Examples of eXistXMLCatalogResolver


Examples of org.exist.validation.resolver.eXistXMLCatalogResolver

        final VALIDATION_SETTING validation = convertValidationMode(option);

        final GrammarPool grammarPool =
                (GrammarPool) config.getProperty(XMLReaderObjectFactory.GRAMMER_POOL);
       
        final eXistXMLCatalogResolver resolver =
                (eXistXMLCatalogResolver) config.getProperty(CATALOG_RESOLVER);

        final XMLReader xmlReader = createXmlReader(validation, grammarPool, resolver);

        setReaderValidationMode(validation, xmlReader);
View Full Code Here

Examples of org.exist.validation.resolver.eXistXMLCatalogResolver

            } else if(grammarUrl.endsWith(".xml")){

                // Scenario 2 : path to catalog (xml)
                logger.debug("Validation using user specified catalog '" + grammarUrl + "'.");
                final eXistXMLCatalogResolver resolver = new eXistXMLCatalogResolver();
                resolver.setCatalogList(new String[]{grammarUrl});
                xmlReader.setProperty(XMLReaderObjectFactory.APACHE_PROPERTIES_ENTITYRESOLVER, resolver);

            } else if(grammarUrl.endsWith("/")){

                // Scenario 3 : path to collection ("/"): search.
View Full Code Here

Examples of org.exist.validation.resolver.eXistXMLCatalogResolver

        }


        // Extract catalogs
        LOG.debug( "Creating eXist catalog resolver" );
        final eXistXMLCatalogResolver resolver       = new eXistXMLCatalogResolver();

        final NodeList                entityResolver = validation.getElementsByTagName( XMLReaderObjectFactory.CONFIGURATION_ENTITY_RESOLVER_ELEMENT_NAME );

        if( entityResolver.getLength() > 0 ) {
            final Element  r        = (Element)entityResolver.item( 0 );
            final NodeList catalogs = r.getElementsByTagName( XMLReaderObjectFactory.CONFIGURATION_CATALOG_ELEMENT_NAME );

            LOG.debug( "Found " + catalogs.getLength() + " catalog uri entries." );
            LOG.debug( "Using dbHome=" + dbHome );

            // Determine webapps directory. SingleInstanceConfiguration cannot
            // be used at this phase. Trick is to check wether dbHOME is
            // pointing to a WEB-INF directory, meaning inside war file)
            File webappHome = null;

            if( dbHome == null ) { /// DWES Why? let's make jUnit happy
                webappHome = new File( "webapp" ).getAbsoluteFile();

            } else if( dbHome.endsWith( "WEB-INF" ) ) {
                webappHome = new File( dbHome ).getParentFile().getAbsoluteFile();

            } else {
                webappHome = new File( dbHome, "webapp" ).getAbsoluteFile();
            }
            LOG.debug( "using webappHome=" + webappHome.toURI().toString() );

            // Get and store all URIs
            final List<String> allURIs = new ArrayList<String>();

            for( int i = 0; i < catalogs.getLength(); i++ ) {
                String uri = ( (Element)catalogs.item( i ) ).getAttribute( "uri" );

                if( uri != null ) { // when uri attribute is filled in

                    // Substitute string, creating an uri from a local file
                    if( uri.indexOf( "${WEBAPP_HOME}" ) != -1 ) {
                        uri = uri.replaceAll( "\\$\\{WEBAPP_HOME\\}", webappHome.toURI().toString() );
                    }
                    if( uri.indexOf( "${EXIST_HOME}" ) != -1 ) {
                        uri = uri.replaceAll( "\\$\\{EXIST_HOME\\}", dbHome );
                    }

                    // Add uri to confiuration
                    LOG.info( "Add catalog uri " + uri + "" );
                    allURIs.add( uri );
                }

            }
            resolver.setCatalogs( allURIs );

            // Store all configured URIs
            config.put( XMLReaderObjectFactory.CATALOG_URIS, allURIs );

        }
View Full Code Here

Examples of org.exist.validation.resolver.eXistXMLCatalogResolver

                    entityResolver = new SearchResourceResolver(catalogUrls[0], brokerPool);
                    setXmlReaderEnitityResolver(xmlReader, entityResolver);

                } else if (singleUrl.endsWith(".xml")) {
                    LOG.debug("Using catalogs " + getStrings(catalogUrls));
                    entityResolver = new eXistXMLCatalogResolver();
                    ((eXistXMLCatalogResolver) entityResolver).setCatalogList(catalogUrls);
                    setXmlReaderEnitityResolver(xmlReader, entityResolver);

                } else {
                    LOG.error("Catalog URLs should end on / or .xml");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.