Skip to content

Commit

Permalink
#24 Add EMLRuleSet rules for publisher
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-podolskiy90 committed Aug 1, 2024
1 parent 613c23f commit f47fc0e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,19 @@ public void setPublishingOrganizationKey(UUID publishingOrganizationKey) {
target.setPublishingOrganizationKey(publishingOrganizationKey);
}

public void setPublishingOrganizationName(String publishingOrganizationName) {
target.setPublishingOrganizationName(publishingOrganizationName);
}

public void setPublisher(String publisherId, String publisherName) {
try {
setPublishingOrganizationKey(UUID.fromString(publisherId));
} catch (IllegalArgumentException e) {
LOG.error("Publishing organization key {} is an invalid UUID - skipping!", publisherId);
}
setPublishingOrganizationName(publisherName);
}

public void setProject(Project project) {
target.setProject(project);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,9 @@ private void verifyV_1_3(Dataset dataset) {

assertEquals("Sample Metadata RLS", dataset.getTitle());
assertEquals("test-1_3", dataset.getShortName());
assertEquals("Publishing Organization 1", dataset.getPublishingOrganizationName());
assertNotNull(dataset.getPublishingOrganizationKey());
assertEquals("619a4b95-1a82-4006-be6a-7dbe3c9b33c5", dataset.getPublishingOrganizationKey().toString());

assertNotNull(dataset.getHomepage());
assertEquals("http://reeflifesurvey.com/", dataset.getHomepage().toString());
Expand Down Expand Up @@ -1252,6 +1255,7 @@ private void verifyV_1_3(Dataset dataset) {
assertEquals("http://www.researcherid.com/rid/Z-1234-2014", contact2.getUserId().get(0));

// Project personnel
assertNotNull(dataset.getProject());
List<Contact> personnelList = dataset.getProject().getContacts();
assertEquals(2, personnelList.size());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,11 @@
<onlineUrl>http://reeflifesurvey.com/</onlineUrl>
<userId directory="http://www.researcherid.com/rid/">Z-1234-2014</userId>
</contact>

<publisher id="619a4b95-1a82-4006-be6a-7dbe3c9b33c5" scope="system" system="http://gbif.org">
<organizationName>Publishing Organization 1</organizationName>
</publisher>

<methods>
<methodStep>
<description>
Expand Down

0 comments on commit f47fc0e

Please sign in to comment.