Search in sources :

Example 1 with DefaultIndividual

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;
}
Also used : AbstractParty(org.apache.sis.metadata.iso.citation.AbstractParty) DefaultAddress(org.apache.sis.metadata.iso.citation.DefaultAddress) DefaultOrganisation(org.apache.sis.metadata.iso.citation.DefaultOrganisation) DefaultResponsibleParty(org.apache.sis.metadata.iso.citation.DefaultResponsibleParty) DefaultCitation(org.apache.sis.metadata.iso.citation.DefaultCitation) DefaultContact(org.apache.sis.metadata.iso.citation.DefaultContact) DefaultIndividual(org.apache.sis.metadata.iso.citation.DefaultIndividual)

Example 2 with DefaultIndividual

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);
}
Also used : DefaultResponsibleParty(org.apache.sis.metadata.iso.citation.DefaultResponsibleParty) SimpleInternationalString(org.apache.sis.util.iso.SimpleInternationalString) DefaultCitation(org.apache.sis.metadata.iso.citation.DefaultCitation) InternationalString(org.opengis.util.InternationalString) SimpleInternationalString(org.apache.sis.util.iso.SimpleInternationalString) DefaultIndividual(org.apache.sis.metadata.iso.citation.DefaultIndividual)

Aggregations

DefaultCitation (org.apache.sis.metadata.iso.citation.DefaultCitation)2 DefaultIndividual (org.apache.sis.metadata.iso.citation.DefaultIndividual)2 DefaultResponsibleParty (org.apache.sis.metadata.iso.citation.DefaultResponsibleParty)2 AbstractParty (org.apache.sis.metadata.iso.citation.AbstractParty)1 DefaultAddress (org.apache.sis.metadata.iso.citation.DefaultAddress)1 DefaultContact (org.apache.sis.metadata.iso.citation.DefaultContact)1 DefaultOrganisation (org.apache.sis.metadata.iso.citation.DefaultOrganisation)1 SimpleInternationalString (org.apache.sis.util.iso.SimpleInternationalString)1 InternationalString (org.opengis.util.InternationalString)1