Search in sources :

Example 1 with SimpleAttrs

use of org.n52.shetland.w3c.xlink.SimpleAttrs in project arctic-sea by 52North.

the class Iso19139GmdEncoderTest method checkMDMetadataEncoding.

// @Test
// public void checkMDMetadataReferenceEncoding() throws EncodingException {
// MDMetadata mdMmetadata = new MDMetadata(new SimpleAttrs().setHref("href").setTitle("title"));
// XmlObject xmlObject = encoder.encode(mdMmetadata);
// xmlObject.validate();
// errors.checkThat(xmlObject, instanceOf(MDMetadataPropertyType.class));
// }
@Test
public void checkMDMetadataEncoding() throws EncodingException {
    MDDataIdentification identificationInfo = new MDDataIdentification(new GmdCitation("title", new GmdCitationDate(GmdDateType.publication(), "2018-10-11")), "abstrakt", "ger");
    MDMetadata mdMmetadata = new MDMetadata(new CiResponsibleParty(new org.n52.shetland.iso.gco.Role(CodeList.CiRoleCodes.CI_RoleCode_author.name())), DateTime.now(), identificationInfo);
    XmlObject xmlObject = encoder.encode(mdMmetadata, EncodingContext.of(XmlBeansEncodingFlags.PROPERTY_TYPE));
    xmlObject.validate();
    errors.checkThat(xmlObject, instanceOf(MDMetadataPropertyType.class));
}
Also used : CiResponsibleParty(org.n52.shetland.iso.gmd.CiResponsibleParty) Role(org.n52.shetland.iso.gco.Role) MDDataIdentification(org.n52.shetland.iso.gmd.MDDataIdentification) GmdCitationDate(org.n52.shetland.iso.gmd.GmdCitationDate) MDMetadata(org.n52.shetland.iso.gmd.MDMetadata) XmlObject(org.apache.xmlbeans.XmlObject) MDMetadataPropertyType(org.isotc211.x2005.gmd.MDMetadataPropertyType) GmdCitation(org.n52.shetland.iso.gmd.GmdCitation) Test(org.junit.Test)

Example 2 with SimpleAttrs

use of org.n52.shetland.w3c.xlink.SimpleAttrs in project arctic-sea by 52North.

the class AbstractMonitoringObjectEncoder method setLegalBackground.

private void setLegalBackground(AbstractMonitoringObjectType amot, AbstractMonitoringObject abstractMonitoringObject) throws EncodingException {
    if (abstractMonitoringObject.isSetLegalBackground()) {
        for (LegislationCitation legislationCitation : abstractMonitoringObject.getLegalBackground()) {
            if (legislationCitation.isSetSimpleAttrs()) {
                SimpleAttrs simpleAttrs = legislationCitation.getSimpleAttrs();
                if (simpleAttrs.isSetHref()) {
                    LegalBackground lb = amot.addNewLegalBackground();
                    lb.setHref(simpleAttrs.getHref());
                    if (simpleAttrs.isSetTitle()) {
                        lb.setTitle(simpleAttrs.getTitle());
                    }
                }
            } else {
                amot.addNewLegalBackground().addNewLegislationCitation().set(encodeEF(legislationCitation));
            }
        }
    }
}
Also used : SimpleAttrs(org.n52.shetland.w3c.xlink.SimpleAttrs) LegislationCitation(org.n52.shetland.inspire.base2.LegislationCitation) LegalBackground(eu.europa.ec.inspire.schemas.ef.x40.AbstractMonitoringObjectType.LegalBackground)

Aggregations

LegalBackground (eu.europa.ec.inspire.schemas.ef.x40.AbstractMonitoringObjectType.LegalBackground)1 XmlObject (org.apache.xmlbeans.XmlObject)1 MDMetadataPropertyType (org.isotc211.x2005.gmd.MDMetadataPropertyType)1 Test (org.junit.Test)1 LegislationCitation (org.n52.shetland.inspire.base2.LegislationCitation)1 Role (org.n52.shetland.iso.gco.Role)1 CiResponsibleParty (org.n52.shetland.iso.gmd.CiResponsibleParty)1 GmdCitation (org.n52.shetland.iso.gmd.GmdCitation)1 GmdCitationDate (org.n52.shetland.iso.gmd.GmdCitationDate)1 MDDataIdentification (org.n52.shetland.iso.gmd.MDDataIdentification)1 MDMetadata (org.n52.shetland.iso.gmd.MDMetadata)1 SimpleAttrs (org.n52.shetland.w3c.xlink.SimpleAttrs)1