Examples of CatalogManager


Examples of org.apache.xml.resolver.CatalogManager

   * Creates a <code>CatalogManager</code>, used to resolve DTDs and other entities.
   *
   * @return A <code>CatalogManager</code> to be used for resolving DTDs and other entities.
   */
  protected CatalogManager createCatalogManager() {
    CatalogManager manager = new CatalogManager();
    manager.setIgnoreMissingProperties(true);
    ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
    StringBuffer builder = new StringBuffer();
    boolean first = true;
    for (int i = 0; i < catalogs.length; i++) {
      final String catalog = catalogs[i];
      try {
        Enumeration enumeration = classLoader.getResources(catalog);
        while (enumeration.hasMoreElements()) {
          if (!first) {
            builder.append(';');
          } else {
            first = false;
          }
          URL resource = (URL) enumeration.nextElement();
          builder.append(resource.toExternalForm());
        }
      } catch (IOException ioe) {
        getLog().warn("Failed to search for catalog files: " + catalog);
        // Let's be a little tolerant here.
      }
    }

    String catalogFiles = builder.toString();
    if (catalogFiles.length() == 0) {
      getLog().warn("Failed to find catalog files.");
    } else {
      if (getLog().isDebugEnabled()) {
        getLog().debug("Catalogs to load: " + catalogFiles);
      }
      manager.setCatalogFiles(catalogFiles);
    }
    return manager;
  }
View Full Code Here

Examples of org.apache.xml.resolver.CatalogManager

        }
        return null;
    }
    private static EntityResolver getResolver() {
        try {
            CatalogManager catalogManager = new CatalogManager();
            if (DEBUG_LEVEL != null) {
                catalogManager.debug.setDebug(Integer.parseInt(DEBUG_LEVEL));
            }
            catalogManager.setUseStaticCatalog(false);
            catalogManager.setIgnoreMissingProperties(true);
            CatalogResolver catalogResolver = new CatalogResolver(catalogManager) {
                public String getResolvedEntity(String publicId, String systemId) {
                    String s = super.getResolvedEntity(publicId, systemId);
                    if (s != null && s.startsWith("classpath:")) {
                        try {
View Full Code Here

Examples of org.apache.xml.resolver.CatalogManager

    }

    final String[] included = scanIncludedFiles();

    // configure a resolver for catalog files
    final CatalogManager catalogManager = createCatalogManager();
    final CatalogResolver catalogResolver = new CatalogResolver(catalogManager);
    // configure a resolver for urn:dockbx:stylesheet
    final URIResolver uriResolver = createStyleSheetResolver(catalogResolver);
    // configure a resolver for xml entities
    final InjectingEntityResolver injectingResolver = createEntityResolver(catalogResolver);
View Full Code Here

Examples of org.apache.xml.resolver.CatalogManager

   * Creates a <code>CatalogManager</code>, used to resolve DTDs and other entities.
   *
   * @return A <code>CatalogManager</code> to be used for resolving DTDs and other entities.
   */
  protected CatalogManager createCatalogManager() {
    CatalogManager manager = new CatalogManager();
    manager.setIgnoreMissingProperties(true);
    ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
    StringBuffer builder = new StringBuffer();
    boolean first = true;
    for (int i = 0; i < catalogs.length; i++) {
      final String catalog = catalogs[i];
      try {
        Enumeration enumeration = classLoader.getResources(catalog);
        while (enumeration.hasMoreElements()) {
          if (!first) {
            builder.append(';');
          } else {
            first = false;
          }
          URL resource = (URL) enumeration.nextElement();
          builder.append(resource.toExternalForm());
        }
      } catch (IOException ioe) {
        getLog().warn("Failed to search for catalog files: " + catalog);
        // Let's be a little tolerant here.
      }
    }

    String catalogFiles = builder.toString();
    if (catalogFiles.length() == 0) {
      getLog().warn("Failed to find catalog files.");
    } else {
      if (getLog().isDebugEnabled()) {
        getLog().debug("Catalogs to load: " + catalogFiles);
      }
      manager.setCatalogFiles(catalogFiles);
    }
    return manager;
  }
View Full Code Here

Examples of org.apache.xml.resolver.CatalogManager

     *
     * This method returns an instance of the underlying catalog class.
     */
    public Catalog getPrivateCatalog() {
        try {
            final CatalogManager cm = this;
            Catalog catalog =
                (Catalog) AccessController.
                doPrivileged(new PrivilegedExceptionAction() {
                    public Object run() throws Exception {
                        Catalog catalog = staticCatalog;
                        boolean useStatic = cm.getUseStaticCatalog();

                        if (catalog == null || !useStatic) {

                            String catalogClassName = getCatalogClassName();
                            if (catalogClassName == null) {
View Full Code Here

Examples of org.apache.xml.resolver.CatalogManager

     *
     * This method returns an instance of the underlying catalog class.
     */
    public Catalog getPrivateCatalog() {
        try {
            final CatalogManager cm = this;
            Catalog catalog =
                (Catalog) AccessController.
                doPrivileged(new PrivilegedExceptionAction() {
                    public Object run() throws Exception {
                        Catalog catalog = staticCatalog;
                        boolean useStatic = cm.getUseStaticCatalog();

                        if (catalog == null || !useStatic) {

                            String catalogClassName = getCatalogClassName();
                            if (catalogClassName == null) {
View Full Code Here

Examples of org.apache.xml.resolver.CatalogManager

        resolver = getResolver();
    }
   
    private static Object getResolver() {
        try {
            CatalogManager catalogManager = new CatalogManager();
            if (DEBUG_LEVEL != null) {
                catalogManager.debug.setDebug(Integer.parseInt(DEBUG_LEVEL));
            }
            catalogManager.setUseStaticCatalog(false);
            catalogManager.setIgnoreMissingProperties(true);
            CatalogResolver catalogResolver = new CatalogResolver(catalogManager);
            return catalogResolver.getCatalog();
        } catch (Throwable t) {
            //ignore
        }       
View Full Code Here

Examples of org.apache.xml.resolver.CatalogManager

                configs.add(new File(configName));
            }
        }
        EntityResolver entityResolver = null;
        if (catalogLocation != null) {
            CatalogManager catalogManager = CatalogManager.getStaticManager();
            catalogManager.setCatalogFiles(catalogLocation);
            entityResolver = new PassThroughResolver(new CatalogResolver());
        }
        List classPathList = new ArrayList();
        if (classpath != null) {
            for (StringTokenizer st = new StringTokenizer(classpath, ","); st.hasMoreTokens();) {
View Full Code Here

Examples of org.apache.xml.resolver.CatalogManager

        }
        return null;
    }
    private static EntityResolver getResolver() {
        try {
            CatalogManager catalogManager = new CatalogManager();
            if (DEBUG_LEVEL != null) {
                catalogManager.debug.setDebug(Integer.parseInt(DEBUG_LEVEL));
            }
            catalogManager.setUseStaticCatalog(false);
            catalogManager.setIgnoreMissingProperties(true);
            CatalogResolver catalogResolver = new CatalogResolver(catalogManager) {
                public String getResolvedEntity(String publicId, String systemId) {
                    String s = super.getResolvedEntity(publicId, systemId);
                    if (s != null && s.startsWith("classpath:")) {
                        try {
View Full Code Here

Examples of org.olat.catalog.CatalogManager

    // moved, when moving leafs we don't check for ownership of the category
    if (toBeMovedEntry.getType() == CatalogEntry.TYPE_NODE) {
      ownedEntries = getOwnedEntries(ureq);
    }
   
    CatalogManager cm = CatalogManager.getInstance();
    CatalogEntry rootce = (CatalogEntry) cm.getRootCatalogEntries().get(0);
    // Build tree model
    treeModel = new CatalogAjaxTreeModel(rootce, toBeMovedEntry, ownedEntries, false, false);
   
    // Create the ajax tree controller, add it to your main view
    treeCtr = new TreeController(ureq, getWindowControl(), rootce.getName(), treeModel, null);
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.