Package org.fao.geonet.kernel.schema

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


  }

    private int _mdId;

    public void setSchemaFilters(boolean withHeld, boolean keepMarkedElement) {
        MetadataSchema mds = _dataManager.getSchema(metadata.getDataInfo().getSchemaId());
        Map<String, Pair<String, Element>> filters = new HashMap<String, Pair<String, Element>>();
        if (withHeld) {
            if (keepMarkedElement) {
                Element mark = new Element("keepMarkedElement");
                mark.setAttribute("nilReason", "withheld", Geonet.Namespaces.GCO);
                filters.put("editing",
                        Pair.read(XPATH_WITHHELD, mark));
            } else {
                filters.put("editing",
                        Pair.<String, Element>read(XPATH_WITHHELD, null));
            }
        }

        filters.put("download",
                Pair.<String, Element>read(XPATH_DOWNLOAD, null));
        filters.put("dynamic",
                Pair.<String, Element>read(XPATH_DYNAMIC, null));

        mds.setOperationFilters(filters);
    }
View Full Code Here


    private SchemaManager _schemaManager;

    @Test
    public void testAddElementFromXpath_NoAttributes() throws Exception {

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

        final Element metadataElement = new Element("MD_Metadata", GMD);
        String newValue = "newValue";
        final String xpathProperty = "gmd:fileIdentifier/gco:CharacterString";
        boolean updated = new EditLib(_schemaManager).addElementOrFragmentFromXpath(metadataElement, schema, xpathProperty,
View Full Code Here


    @Test
    public void testAddElementFromXpath_HasPositionalIdentifier() throws Exception {

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

        final Element metadataElement = new Element("MD_Metadata", GMD).addContent(
                new Element("fileIdentifier", GMD).addContent(
                        new Element("CharacterString", GCO).setText("OldValue")
                )
View Full Code Here

    }

    @Test
    public void testEditElementFromXpath_NoAttributes() throws Exception {

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

        final Element metadataElement = new Element("MD_Metadata", GMD).addContent(
                new Element("fileIdentifier", GMD).addContent(
                        new Element("CharacterString", GCO).setText("OldValue")
                )
View Full Code Here

    }

    @Test
    public void testEditExistingAttribute() throws Exception {

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

        final Element metadataElement = new Element("MD_Metadata", GMD).addContent(
                new Element("fileIdentifier", GMD).setAttribute("nilReason", "missing", GCO).addContent(
                        new Element("CharacterString", GCO).setText("OldValue")
                )
View Full Code Here

    }

    @Test
    public void testReplaceFragmentFromXpath_NewXmlHasDifferentName() throws Exception {

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

        String code1 = "code1";
        String code2 = "code2";
        String code3 = "code3";
        final Element metadataElement = new Element("MD_Metadata", GMD).addContent(Arrays.asList(
View Full Code Here

    }

    @Test
    public void testRelativePathUpdateWithBrackets() throws Exception {

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

        String code1 = "code1";
        String code2 = "code2";
        String code3 = "code3";
View Full Code Here

    }
    @Test
    public void testRelativePathUpdateNoBrackets() throws Exception {

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

        String code1 = "code1";
        String code2 = "code2";
        String code3 = "code3";
View Full Code Here

    }

    @Test
    public void testRelativePathUpdateNoChildFound() throws Exception {

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

        final Element metadataElement = new Element("MD_Metadata", GMD);

        String newValue = "newValue";
        final String refSysElemName = "*//gmd:RS_Identifier/gmd:code/gco:CharacterString";
 
View Full Code Here

    }

    @Test
    public void testReplaceFragmentFromXpath_NewXmlRootHasSameNameAsSelectedElement() throws Exception {

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

        String code1 = "code1";
        String code2 = "code2";
        String code3 = "code3";
        final Element metadataElement = new Element("MD_Metadata", GMD).addContent(Arrays.asList(
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.