Search in sources :

Example 1 with DefaultProcessing

use of org.apache.sis.metadata.iso.lineage.DefaultProcessing in project sis by apache.

the class TreeTableFormatTest method testProcessing.

/**
 * Tests the formatting of a {@link DefaultProcessing} object.
 */
@Test
public void testProcessing() {
    final DefaultCitation titled = new DefaultCitation("Some specification");
    final DefaultCitation coded = new DefaultCitation();
    final DefaultCitation untitled = new DefaultCitation();
    titled.setPresentationForms(singleton(PresentationForm.DOCUMENT_HARDCOPY));
    coded.setPresentationForms(singleton(PresentationForm.IMAGE_HARDCOPY));
    untitled.setCitedResponsibleParties(singleton(new DefaultResponsibleParty(Role.AUTHOR)));
    final DefaultProcessing processing = new DefaultProcessing();
    processing.setDocumentations(asList(titled, coded, untitled));
    final String text = format.format(processing.asTreeTable());
    assertMultilinesEquals("Processing\n" + "  ├─Documentation (1 of 3)…………… Some specification\n" + "  │   └─Presentation form……………… Document hardcopy\n" + "  ├─Documentation (2 of 3)\n" + "  │   └─Presentation form……………… Image hardcopy\n" + "  └─Documentation (3 of 3)\n" + "      └─Cited responsible party\n" + "          └─Role……………………………………… Author\n", text);
}
Also used : DefaultResponsibleParty(org.apache.sis.metadata.iso.citation.DefaultResponsibleParty) DefaultCitation(org.apache.sis.metadata.iso.citation.DefaultCitation) DefaultProcessing(org.apache.sis.metadata.iso.lineage.DefaultProcessing) SimpleInternationalString(org.apache.sis.util.iso.SimpleInternationalString) Test(org.junit.Test) DefaultCitationTest(org.apache.sis.metadata.iso.citation.DefaultCitationTest)

Example 2 with DefaultProcessing

use of org.apache.sis.metadata.iso.lineage.DefaultProcessing in project sis by apache.

the class MetadataBuilder method addHostComputer.

/**
 * Adds information about the computer and/or operating system in use at the processing time.
 * This is added to the processing identified by last call to {@link #addProcessing(CharSequence, String)}.
 * Storage location is:
 *
 * <ul>
 *   <li>{@code metadata/resourceLineage/processStep/processingInformation/procedureDescription}</li>
 * </ul>
 *
 * @param  platform  name of the system on which the processing has been executed, or {@code null} for no-operation.
 */
public final void addHostComputer(final CharSequence platform) {
    InternationalString i18n = trim(platform);
    if (i18n != null) {
        i18n = Resources.formatInternational(Resources.Keys.ProcessingExecutedOn_1, i18n);
        final DefaultProcessing p = processing();
        p.setProcedureDescription(append(p.getProcedureDescription(), i18n));
    }
}
Also used : InternationalString(org.opengis.util.InternationalString) DefaultProcessing(org.apache.sis.metadata.iso.lineage.DefaultProcessing)

Aggregations

DefaultProcessing (org.apache.sis.metadata.iso.lineage.DefaultProcessing)2 DefaultCitation (org.apache.sis.metadata.iso.citation.DefaultCitation)1 DefaultCitationTest (org.apache.sis.metadata.iso.citation.DefaultCitationTest)1 DefaultResponsibleParty (org.apache.sis.metadata.iso.citation.DefaultResponsibleParty)1 SimpleInternationalString (org.apache.sis.util.iso.SimpleInternationalString)1 Test (org.junit.Test)1 InternationalString (org.opengis.util.InternationalString)1