Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DARIAH-DE Aggregator Services
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DARIAH-DE
DARIAH-DE Aggregator Services
Commits
1c81fbef
Commit
1c81fbef
authored
11 years ago
by
Thorsten Vitt
Browse files
Options
Downloads
Patches
Plain Diff
Don't call listAggregations for non-aggregations (workaround)
parent
fec0cdc0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/info/textgrid/services/aggregator/AggregationTreeWalker.java
+16
-9
16 additions, 9 deletions
...o/textgrid/services/aggregator/AggregationTreeWalker.java
with
16 additions
and
9 deletions
src/main/java/info/textgrid/services/aggregator/AggregationTreeWalker.java
+
16
−
9
View file @
1c81fbef
...
...
@@ -29,14 +29,14 @@ public abstract class AggregationTreeWalker {
* metadata. The specialized walk method's <var>again</var> parameter is
* passed the information whether this object has been already seen before.
* </p>
*
*
* <p>
* The {@link AggregationTreeWalker} implementation calls
* {@link #walkAggregation(ObjectType, boolean)} if the object's format
* contains "aggregation", otherwise, the object is only added to the
* registry. Clients should extend or override.
* </p>
*
*
* @param object
* the metadata of the object to process.
* @param again
...
...
@@ -69,7 +69,7 @@ protected boolean walk(final ObjectType object, final boolean again) {
/**
* Iterates through the given <var>aggregation</var>'s contents unless it is
* visited <var>again</var>.
*
*
* <p>
* This method will issue a
* {@linkplain SearchClient#listAggregation(String) TG-search request to
...
...
@@ -79,11 +79,11 @@ protected boolean walk(final ObjectType object, final boolean again) {
* request does not return object metadata,
* {@link #walkInaccessibleURI(String)} will be called instead.
* </p>
*
*
* <p>
* Clients may extend or override if they need special treatment.
* </p>
*
*
* @param aggregation
* The metadata of the aggregation to list.
* @param again
...
...
@@ -94,11 +94,17 @@ protected void walkAggregation(final ObjectType aggregation,
final
boolean
again
)
{
if
(
again
)
return
;
// FIXME walkAggregation is also called for works, but it shouldn't.
// This is a workaround, we actually shoud factor out the work handling
// in the subclasses ...
if
(!
aggregation
.
getGeneric
().
getProvided
().
getFormat
().
contains
(
"aggregation"
))
return
;
if
(
getRepository
()
==
null
)
throw
new
IllegalStateException
(
"AggregationTreeWalkers must be initialized with a repository before use."
);
final
SearchClient
searchClient
=
getSearchClient
(
isPublic
(
aggregation
));
final
String
id
=
aggregation
.
getGeneric
().
getGenerated
()
.
getTextgridUri
().
getValue
();
...
...
@@ -121,6 +127,7 @@ protected void walkAggregation(final ObjectType aggregation,
}
/** for logging / debugging purposes */
private
static
String
describe
(
final
ObjectType
object
)
{
final
StringBuilder
builder
=
new
StringBuilder
();
try
{
...
...
@@ -161,9 +168,9 @@ protected SearchClient getSearchClient(final boolean isPublic) {
/**
* Called by {@link #walkAggregation(ObjectType, boolean)} when the
* aggregation contains entries for which there is no metadata included.
*
*
* The default implementation does nothing, clients may override.
*
*
* @param textgridUri
* the URI listed in the aggregation.
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment