Skip to content

Commit

Permalink
Introduce BriefObjectMetadata#getLabel, which returns the label of an…
Browse files Browse the repository at this point in the history
… object

- Update ExportController to use getLabel
  • Loading branch information
daines committed Mar 16, 2015
1 parent 74447c4 commit 977340e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Expand Up @@ -101,10 +101,10 @@ private void printObject(CSVPrinter printer, BriefObjectMetadata object) throws
printer.print(object.getTitle());
printer.print(object.getAncestorNames());

List<String> labelRelations = object.getRelation("label");
String label = object.getLabel();

if (labelRelations.size() > 0) {
printer.print(labelRelations.get(0));
if (label != null) {
printer.print(label);
} else {
printer.print("");
}
Expand Down
Expand Up @@ -102,6 +102,8 @@ public interface BriefObjectMetadata {

public List<String> getIdentifier();

public String getLabel();

public String getTitle();

public List<String> getOtherTitle();
Expand Down
Expand Up @@ -230,6 +230,16 @@ public List<String> getRelation(String relationName) {
return this.relationsMap.get(relationName);
}

@Override
public String getLabel() {
List<String> labelRelations = this.getRelation("label");
if (labelRelations == null || labelRelations.size() == 0) {
return null;
} else {
return labelRelations.get(0);
}
}

@Override
public Datastream getDefaultWebData() {
if (this.relationsMap == null)
Expand Down

0 comments on commit 977340e

Please sign in to comment.