use of org.apache.sis.metadata.iso.citation.DefaultIndividual in project sis by apache.
the class TreeNodeTest method metadataWithHierarchy.
/**
* Creates a metadata hierarchy to be used for the tests.
* This method creates the following metadata:
*
* {@preformat text
* Citation
* ├─Title…………………………………………………………………………………………… Some title
* ├─Alternate title (1 of 2)………………………………………… First alternate title
* ├─Alternate title (2 of 2)………………………………………… Second alternate title
* ├─Edition……………………………………………………………………………………… Some edition
* ├─Cited responsible party (1 of 2)
* │ └─Organisation
* │ ├─Name…………………………………………………………………………… Some organisation
* │ └─Role…………………………………………………………………………… Distributor
* ├─Cited responsible party (2 of 2)
* │ └─Individual
* │ ├─Name…………………………………………………………………………… Some person of contact
* │ ├─Contact info
* │ │ └─Address
* │ │ └─Electronic mail address…… Some email
* │ └─Role…………………………………………………………………………… Point of contact
* ├─Presentation form (1 of 2)…………………………………… Map digital
* ├─Presentation form (2 of 2)…………………………………… map hardcopy
* └─Other citation details……………………………………………… Some other details
* }
*/
static DefaultCitation metadataWithHierarchy() {
final DefaultCitation citation = TreeNodeChildrenTest.metadataWithMultiOccurrences();
AbstractParty party = new DefaultOrganisation("Some organisation", null, null, null);
DefaultResponsibleParty responsibility = new DefaultResponsibleParty(Role.DISTRIBUTOR);
responsibility.setParties(singleton(party));
assertTrue(citation.getCitedResponsibleParties().add(responsibility));
// Add a second responsible party with deeper hierarchy.
final DefaultContact contact = new DefaultContact();
final DefaultAddress address = new DefaultAddress();
address.setElectronicMailAddresses(singleton("Some email"));
contact.setAddresses(singleton(address));
party = new DefaultIndividual("Some person of contact", null, contact);
responsibility = new DefaultResponsibleParty(Role.POINT_OF_CONTACT);
responsibility.setParties(singleton(party));
assertTrue(citation.getCitedResponsibleParties().add(responsibility));
return citation;
}
use of org.apache.sis.metadata.iso.citation.DefaultIndividual in project sis by apache.
the class ValueMapTest method createCitation.
/**
* Creates the metadata instance to be used for testing purpose.
* This method creates the following metadata
* (ignoring identifiers, which will be inferred from the ISBN value):
*
* {@preformat text
* Citation
* ├─Title…………………………………………………… Undercurrent
* ├─Edition……………………………………………… <nil:unknown>
* ├─Cited Responsible Parties
* │ └─Individual Name……………… Testsuya Toyoda
* └─ISBN……………………………………………………… 9782505004509
* }
*
* The citation instance is stored in the {@link #citation} field.
* The title and author instances are stored in the {@link #title} and {@link #author} fields.
*
* @return the map view of the citation create by this method.
*/
private Map<String, Object> createCitation() {
title = new SimpleInternationalString("Undercurrent");
author = new DefaultResponsibleParty();
citation = new DefaultCitation(title);
author.setParties(singleton(new DefaultIndividual("Testsuya Toyoda", null, null)));
citation.setCitedResponsibleParties(singleton(author));
citation.setISBN("9782505004509");
citation.setEdition(NilReason.UNKNOWN.createNilObject(InternationalString.class));
return MetadataStandard.ISO_19115.asValueMap(citation, null, KeyNamePolicy.JAVABEANS_PROPERTY, ValueExistencePolicy.NON_EMPTY);
}
Aggregations