Package org.fao.geonet.kernel.schema

Examples of org.fao.geonet.kernel.schema.MetadataSchema


    @Test(expected = AssertionError.class)
    public void testAddAttribute_ValueIsNode2() throws Exception {
        SchemaManager manager = _schemaManager;

        MetadataSchema schema = manager.getSchema("iso19139");

        final Element metadataElement = new Element("MD_Metadata", GMD);
        String newValue = "<service>xml is not allowed here</service>";
        final String xpathProperty = "@codeListValue";
        new EditLib(_schemaManager).addElementOrFragmentFromXpath(metadataElement, schema, xpathProperty, new AddElemValue(newValue),
View Full Code Here



    @Test
    public void multiUpdate() throws JDOMException {
        SchemaManager manager = _schemaManager;
        MetadataSchema schema = manager.getSchema("iso19139");
        final Element metadataElement = new Element("MD_Metadata", GMD);
        HashMap<String, AddElemValue> updates = new HashMap<String, AddElemValue>();
        final String text = "text";
        final String att = "att";
        final String charStringXpath = "gmd:fileIdentifier/gco:CharacterString";
View Full Code Here

    }

    @Test
    public void testAddElementFromXpath_Extent() throws Exception {

        MetadataSchema schema = _schemaManager.getSchema("iso19139");

        final Element metadataElement = new Element("MD_Metadata", GMD);
        String newValue = "newValueFromRootXpath";
        final String xpath = "gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement";
        final String xpathProperty = xpath;
View Full Code Here

    }

    @Test
    public void testAddElementFromXpath_ExtentFromRoot() throws Exception {

        MetadataSchema schema = _schemaManager.getSchema("iso19139");

        final Element metadataElement = new Element("MD_Metadata", GMD);
        String newValue = "newValueFromRootXpath";
        final String xpath = "gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:temporalElement";
        final String xpathProperty = "/gmd:MD_Metadata/"+xpath;
View Full Code Here

    @Test
    public void testStackOverflowFindLongestMatch() throws Exception {
        final Element element = Xml.loadFile(EditLibIntegrationTest.class.getResource("editlib-stackoverflow-findlongestmatch.xml"));
        List<String> xpathParts = Lists.newArrayList("gmd:distributionInfo", "gmd:MD_Distribution", "gmd:transferOptions",
                "gmd:MD_DigitalTransferOptions", "gmd:onLine", "gmd:CI_OnlineResource", "gmd:linkage");
        MetadataSchema schema = _schemaManager.getSchema("iso19139");
        final EditLib editLib = new EditLib(_schemaManager);
        final Pair<Element, String> longestMatch = editLib.findLongestMatch(element, schema, xpathParts);
        assertEquals("gmd:MD_Distribution", longestMatch.one().getQualifiedName());
        assertEquals("gmd:transferOptions/gmd:MD_DigitalTransferOptions/gmd:onLine/gmd:CI_OnlineResource/gmd:linkage", longestMatch.two());
    }
View Full Code Here

                }

                boolean metadataChanged = false;
                EditLib editLib = new EditLib(_schemaManager);

                MetadataSchema metadataSchema = _schemaManager.getSchema(schemaId);
                final String settingId = SettingManager.CSW_TRANSACTION_XPATH_UPDATE_CREATE_NEW_ELEMENTS;
                boolean createXpathNodeIfNotExists = gc.getBean(SettingManager.class).getValueAsBool(settingId);

                // Process properties to update
                for (Element recordProperty : recordProperties) {
View Full Code Here

            }

            if(Log.isDebugEnabled(Geonet.CSW_SEARCH))
                Log.debug(Geonet.CSW_SEARCH, "SearchController dealing with # " + elementNames.size() + " elementNames using strategy " + strategy);

            MetadataSchema mds = schemaManager.getSchema(schema);
            List<Namespace> namespaces = mds.getSchemaNS();

            Element matchingMetadata = (Element)result.clone();
            if(strategy.equals("context") || strategy.equals("geonetwork26")) {
            // these strategies do not return complete metadata
            matchingMetadata.removeContent();
View Full Code Here

TOP

Related Classes of org.fao.geonet.kernel.schema.MetadataSchema

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.