Search in sources :

Example 51 with DefaultCitation

use of org.apache.sis.metadata.iso.citation.DefaultCitation in project sis by apache.

the class DefaultServiceIdentificationTest method create.

/**
 * Creates the service identification to use for testing purpose.
 */
private static DefaultServiceIdentification create() {
    final NameFactory factory = DefaultFactories.forBuildin(NameFactory.class);
    final DefaultCoupledResource resource = DefaultCoupledResourceTest.create(factory);
    resource.setResourceReferences(singleton(new DefaultCitation("WMS specification")));
    final DefaultServiceIdentification id = new DefaultServiceIdentification(// serviceType
    factory.createGenericName(null, "Web Map Server"), // citation
    NilReason.MISSING.createNilObject(Citation.class), // abstract
    "A dummy service for testing purpose.");
    id.setServiceTypeVersions(singleton("1.0"));
    id.setCoupledResources(singleton(resource));
    id.setCouplingType(UnsupportedCodeList.valueOf("LOOSE"));
    id.setContainsOperations(singleton(resource.getOperation()));
    return id;
}
Also used : DefaultCitation(org.apache.sis.metadata.iso.citation.DefaultCitation) Citation(org.opengis.metadata.citation.Citation) DefaultCitation(org.apache.sis.metadata.iso.citation.DefaultCitation) NameFactory(org.opengis.util.NameFactory)

Example 52 with DefaultCitation

use of org.apache.sis.metadata.iso.citation.DefaultCitation in project sis by apache.

the class MergerTest method createSample2.

/**
 * Creates a metadata sample with content information of different kind in a different order
 * than the one created by {@link #createSample1()}.
 */
private static DefaultMetadata createSample2() {
    final DefaultFeatureCatalogueDescription features = new DefaultFeatureCatalogueDescription();
    final DefaultImageDescription image = new DefaultImageDescription();
    final DefaultMetadata metadata = new DefaultMetadata();
    image.setProcessingLevelCode(new DefaultIdentifier("Level 2"));
    metadata.getContentInfo().add(image);
    features.setFeatureCatalogueCitations(Collections.singleton(new DefaultCitation("GPX file")));
    features.setIncludedWithDataset(Boolean.TRUE);
    metadata.getContentInfo().add(features);
    metadata.getLanguages().add(Locale.FRENCH);
    return metadata;
}
Also used : DefaultImageDescription(org.apache.sis.metadata.iso.content.DefaultImageDescription) DefaultFeatureCatalogueDescription(org.apache.sis.metadata.iso.content.DefaultFeatureCatalogueDescription) DefaultCitation(org.apache.sis.metadata.iso.citation.DefaultCitation) DefaultMetadata(org.apache.sis.metadata.iso.DefaultMetadata) DefaultIdentifier(org.apache.sis.metadata.iso.DefaultIdentifier)

Example 53 with DefaultCitation

use of org.apache.sis.metadata.iso.citation.DefaultCitation in project sis by apache.

the class MergerTest method createSample1.

/**
 * Creates a metadata sample with 3 content information of different kind.
 */
private static DefaultMetadata createSample1() {
    final DefaultFeatureCatalogueDescription features = new DefaultFeatureCatalogueDescription();
    final DefaultCoverageDescription coverage = new DefaultCoverageDescription();
    final DefaultImageDescription image = new DefaultImageDescription();
    final DefaultMetadata metadata = new DefaultMetadata();
    features.setFeatureCatalogueCitations(Collections.singleton(new DefaultCitation("Shapefile")));
    features.setIncludedWithDataset(Boolean.TRUE);
    metadata.getContentInfo().add(features);
    coverage.setProcessingLevelCode(new DefaultIdentifier("Level 1"));
    metadata.getContentInfo().add(coverage);
    image.setImagingCondition(ImagingCondition.CLOUD);
    image.setCloudCoverPercentage(0.8);
    metadata.getContentInfo().add(image);
    metadata.getLanguages().add(Locale.JAPANESE);
    metadata.getCharacterSets().add(StandardCharsets.UTF_16);
    return metadata;
}
Also used : DefaultImageDescription(org.apache.sis.metadata.iso.content.DefaultImageDescription) DefaultFeatureCatalogueDescription(org.apache.sis.metadata.iso.content.DefaultFeatureCatalogueDescription) DefaultCitation(org.apache.sis.metadata.iso.citation.DefaultCitation) DefaultMetadata(org.apache.sis.metadata.iso.DefaultMetadata) DefaultCoverageDescription(org.apache.sis.metadata.iso.content.DefaultCoverageDescription) DefaultIdentifier(org.apache.sis.metadata.iso.DefaultIdentifier)

Example 54 with DefaultCitation

use of org.apache.sis.metadata.iso.citation.DefaultCitation in project sis by apache.

the class MetadataCopierTest method testCopy.

/**
 * Tests {@link MetadataCopier#copy(Object)}.
 */
@Test
public void testCopy() {
    final MetadataCopier copier = new MetadataCopier(MetadataStandard.ISO_19115);
    final DefaultCitation original = HardCodedCitations.EPSG;
    final DefaultCitation copy = (DefaultCitation) copier.copy(original);
    assertNotSame(original, copy);
    assertNotSame(getSingleton(original.getCitedResponsibleParties()), getSingleton(copy.getCitedResponsibleParties()));
    assertEquals(original, copy);
}
Also used : DefaultCitation(org.apache.sis.metadata.iso.citation.DefaultCitation) Test(org.junit.Test)

Example 55 with DefaultCitation

use of org.apache.sis.metadata.iso.citation.DefaultCitation in project sis by apache.

the class MetadataBuilder method addOtherCitationDetails.

/**
 * Adds other information required to complete the citation that is not recorded elsewhere.
 * Storage location is:
 *
 * <ul>
 *   <li>{@code metadata/identificationInfo/citation/otherCitationDetails}</li>
 * </ul>
 *
 * @param  details  other details, or {@code null} for no-operation.
 */
public final void addOtherCitationDetails(final CharSequence details) {
    final InternationalString i18n = trim(details);
    if (i18n != null) {
        final DefaultCitation citation = citation();
        citation.setOtherCitationDetails(append(citation.getOtherCitationDetails(), i18n));
    }
}
Also used : InternationalString(org.opengis.util.InternationalString) DefaultCitation(org.apache.sis.metadata.iso.citation.DefaultCitation)

Aggregations

DefaultCitation (org.apache.sis.metadata.iso.citation.DefaultCitation)65 Test (org.junit.Test)35 SimpleInternationalString (org.apache.sis.util.iso.SimpleInternationalString)32 DependsOnMethod (org.apache.sis.test.DependsOnMethod)21 InternationalString (org.opengis.util.InternationalString)14 Citation (org.opengis.metadata.citation.Citation)10 IdentifiedObject (org.opengis.referencing.IdentifiedObject)9 ImmutableIdentifier (org.apache.sis.metadata.iso.ImmutableIdentifier)5 DefaultResponsibleParty (org.apache.sis.metadata.iso.citation.DefaultResponsibleParty)5 URI (java.net.URI)3 DefaultIdentifier (org.apache.sis.metadata.iso.DefaultIdentifier)3 DefaultMetadata (org.apache.sis.metadata.iso.DefaultMetadata)3 DefaultCitationTest (org.apache.sis.metadata.iso.citation.DefaultCitationTest)3 DefaultOnlineResource (org.apache.sis.metadata.iso.citation.DefaultOnlineResource)3 ArrayList (java.util.ArrayList)2 CI_Citation (org.apache.sis.internal.jaxb.metadata.CI_Citation)2 SimpleIdentifiedObject (org.apache.sis.internal.simple.SimpleIdentifiedObject)2 SimpleIdentifier (org.apache.sis.internal.simple.SimpleIdentifier)2 DefaultCitationDate (org.apache.sis.metadata.iso.citation.DefaultCitationDate)2 DefaultIndividual (org.apache.sis.metadata.iso.citation.DefaultIndividual)2