Package org.fao.geonet.repository

Examples of org.fao.geonet.repository.SchematronRepository


        }
    }

    private void addSchematron(String schemaName) {
        final SchemaManager schemaManager = _applicationContext.getBean(SchemaManager.class);
        final SchematronRepository repo = _applicationContext.getBean(SchematronRepository.class);
        Schematron schematron = new Schematron();
        schematron.setSchemaName(schemaName);
        schematron.setFile(schemaManager.getSchemaDir(schemaName) + File.separator + "schematron" + File.separator
                           + "schematron-rules-geonetwork.sch");
        repo.save(schematron);
    }
View Full Code Here


            }
            System.setProperty(Constants.XML_CATALOG_FILES, catalogProp);
            Xml.resetResolver();
        }

        SchematronRepository schemaRepo = applicationContext.getBean(SchematronRepository.class);
        SchematronCriteriaGroupRepository criteriaGroupRepository = applicationContext.getBean(SchematronCriteriaGroupRepository.class);
        MetadataSchema mds = new SchemaLoader().load(xmlSchemaFile, xmlSubstitutionsFile, schemaRepo, criteriaGroupRepository);

        mds.setName(name);
        mds.setSchemaDir(path);
View Full Code Here

    static final String PARAM_DISPLAY_PRIORITY = "displaypriority";

    @Override
    protected Element list(Element params, ServiceContext context) throws Exception {
        String id = Util.getParam(params, Params.ID, null);
        final SchematronRepository repository = context.getBean(SchematronRepository.class);

        Element result;
        if (id == null) {
            result = repository.findAllAsXml();
        } else {
            final Schematron one = repository.findOne(Integer.parseInt(id));
            if (one == null) {
                throw new BadParameterEx(Params.ID, id);
            }
            result = new Element("schematron").addContent(one.asXml());
        }
View Full Code Here

        elResp.addContent(new Element(Geonet.Elem.ID).setText(id));
        elResp.addContent(new Element("schema").setText(dataMan.getMetadataSchema(id)));
        elResp.addContent(errorReport);
        Element schematronTranslations = new Element("schematronTranslations");

        final SchematronRepository schematronRepository = context.getBean(SchematronRepository.class);
        // --- add translations for schematrons
        final List<Schematron> schematrons = schematronRepository.findAllBySchemaName(schemaName);

        MetadataSchema metadataSchema = dataMan.getSchema(schemaName);
        String schemaDir = metadataSchema.getSchemaDir();
        SAXBuilder builder = new SAXBuilder();
View Full Code Here

        MetadataSchema metadataSchema = getSchema(schema);
        final String schemaDir = this.schemaMan.getSchemaDir(schema);

        Element schemaTronXmlOut = new Element("schematronerrors", Edit.NAMESPACE);
        try {
            final SchematronRepository schematronRepository = _applicationContext.getBean(SchematronRepository.class);
            final SchematronCriteriaGroupRepository criteriaGroupRepository = _applicationContext.getBean(SchematronCriteriaGroupRepository.class);

            final List<Schematron> schematronList = schematronRepository.findAllBySchemaName(metadataSchema.getName());

            //Loop through all xsl files
            for (Schematron schematron : schematronList) {

                int id = schematron.getId();
View Full Code Here

TOP

Related Classes of org.fao.geonet.repository.SchematronRepository

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.