Package org.glassfish.admingui.connector

Examples of org.glassfish.admingui.connector.Index


  // The parent UIComponent
  UIComponent parent = getParentUIComponent();

  // Get the Index
        Index index = (Index) desc.getEvaluatedOption(ctx, "index", parent);

  // The following method should set the "key" to the node containing all
  // the children... the children will also have keys which must be
  // retrievable by the next method (getChildTreeNodeObjects)... these
  // "keys" will be used by the rest of the methods in this file for
View Full Code Here


     */
    public synchronized Index getHelpIndex(String locale) {
  if (locale == null) {
      locale = "en"; // Use this as the default...
  }
  Index mergedIndex = helpSetIndexMap.get(locale);
  if (mergedIndex != null) {
      // Already calculated...
      return mergedIndex;
  }

  // TOC
  Map<String, List<URL>> mapUrls = getResources(locale + "/help/index.xml");

  // Get our parser...
  ConfigParser parser = new ConfigParser(habitat);

  // Setup a new "merged" TOC...
  mergedIndex = new Index();
  mergedIndex.setIndexItems(new ArrayList<IndexItem>());
  mergedIndex.setVersion("2.0");

  // Loop through the urls and add them all
  String id = null; // module id
  String prefix = "/" + locale + "/help/"// prefix (minus module id)
  List<URL> urls = null; // URLs to TOC files w/i each plugin module
  for (Map.Entry<String, List<URL>> entry : mapUrls.entrySet()) {
      id = entry.getKey();
      urls = entry.getValue();
      for (URL url : urls) {
    DomDocument doc = parser.parse(url);

    // Merge all the TOC's...
    Index index = (Index) doc.getRoot().get();
    for (IndexItem item : index.getIndexItems()) {
        insertIndexItem(mergedIndex.getIndexItems(), item, id + prefix);
    }
      }
  }

View Full Code Here

TOP

Related Classes of org.glassfish.admingui.connector.Index

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.