Package org.palo.viewapi

Examples of org.palo.viewapi.AxisHierarchy


    }
    Axis axis = cv.getAxis(axisId);
    if (axis == null) {
      return null;
    }
    AxisHierarchy axisHierarchy = axis.getAxisHierarchy(axisHierarchyId);
    if (axisHierarchy == null) {
      for (Axis ax: cv.getAxes()) {
        AxisHierarchy ah = ax.getAxisHierarchy(axisHierarchyId);
        if (ah != null) {
          return ah;
        }
      }
    }
View Full Code Here


      parent.forceAddChild(node);
    }
  }
 
  public boolean checkLocalFilter(String sessionId, String axisHierarchyId, String viewId, String axisId, String filterPaths, XElementNode [] visibleElements, boolean displayLeft) throws SessionExpiredException, PaloGwtCoreException {
    AxisHierarchy axisHierarchy = toNative(sessionId, axisHierarchyId, viewId, axisId);
    if (axisHierarchy == null) {
      return false;
    }
    ElementNode [] initialLocalFilter = axisHierarchy.getLocalFilter() == null ? null :
      axisHierarchy.getLocalFilter().getVisibleElements();
    if (visibleElements != null && visibleElements.length > 0) {
//      String path = xAxisHierarchy.getProperty("filterPaths");     
      updateLocalFilter(axisHierarchy, visibleElements);
      if (filterPaths != null) {
        axisHierarchy.addProperty(new Property<String>("filterPaths", filterPaths));
      } else {
        axisHierarchy.removeProperty(new Property<String>("filterPaths", ""));
      }
    }
    if (axisHierarchy.getLocalFilter() == null) {
      updateLocalFilter(axisHierarchy, initialLocalFilter);
      return false;
    }
    ElementNode [] nodes = axisHierarchy.getLocalFilter().getVisibleElements();
    String [] allPaths = null;
    if (axisHierarchy.getProperty("filterPaths") != null) {
      String filterPath = (String) axisHierarchy.getProperty("filterPaths").getValue();
      if (filterPath != null) {
        allPaths = filterPath.split(",");
      }
    }
    if (nodes == null || nodes.length == 0) {
      updateLocalFilter(axisHierarchy, initialLocalFilter);
      return false;
    }
    pathCounter = 0;
    boolean result;
    if (axisHierarchy.getSubset() == null) {
      result = tryToMatch(nodes, nodes, axisHierarchy.getHierarchy().getElementsTree(), axisHierarchy.getHierarchy(), allPaths, displayLeft);
    } else {
      result = tryToMatch(nodes, nodes, axisHierarchy.getSubset().getRootNodes(), axisHierarchy.getHierarchy(), allPaths, displayLeft);
    }
    updateLocalFilter(axisHierarchy, initialLocalFilter);
    return result;
  }
View Full Code Here

    return result;   
  }
 
  public XElementNode[] applyAlias(String sessionId, String axisHierarchyId, String viewId, String axisId,
      XAlias alias, XElementNode[] allNodes) throws SessionExpiredException, PaloGwtCoreException {
    AxisHierarchy axisHierarchy = toNative(sessionId, axisHierarchyId, viewId, axisId);
    if (axisHierarchy == null) {
      return allNodes;
    }
    Property<?> aliasProperty = axisHierarchy.getProperty(AxisHierarchy.USE_ALIAS);   
    updateAlias(axisHierarchy, alias);
    HashMap <String, String> allElems = new HashMap<String, String>();
    traverse(axisHierarchy.getRootNodes(), allElems);
    Property prop = axisHierarchy.getProperty("aliasFormat");
    String aliasFormat = null;
    if (prop != null && prop.getValue() != null) {
      aliasFormat = prop.getValue().toString();
    }
    for (XElementNode node: allNodes) {
      String newName = allElems.get(node.getElement().getId());
      if (newName != null) {
        if (aliasFormat == null) {
          node.setName(newName);
          node.getElement().setName(newName);
        } else {
          String name = getAliasForElement(newName, node.getElement().getName(), aliasFormat);
          node.setName(name);
          node.getElement().setName(name);         
        }
      }
    }
    if (aliasProperty != null) {
      axisHierarchy.addProperty(aliasProperty);
    } else {
      axisHierarchy.removeProperty(new Property(AxisHierarchy.USE_ALIAS, ""));
    }
    return allNodes;
  }
View Full Code Here

  public boolean containsElement(String sessionId, String axisHierarchyId, String viewId, String axisId, XElement element, XSubset subset)
      throws SessionExpiredException, PaloGwtCoreException {
    if (subset == null || element == null) {
      return false;
    }
    AxisHierarchy axisHierarchy = toNative(sessionId, axisHierarchyId, viewId, axisId);
    Hierarchy h = axisHierarchy.getHierarchy();
    Subset2 s = h.getSubsetHandler().getSubset(subset.getId(), Subset2.TYPE_GLOBAL);
    if (s == null) {
      s = h.getSubsetHandler().getSubset(subset.getId(), Subset2.TYPE_LOCAL);
    }
    if (s == null) {
View Full Code Here

    }
  }
 
  public String getElementPath(String sessionId, String axisHierarchyId, String viewId, String axisId, String selectedElementId)
      throws SessionExpiredException, PaloGwtCoreException
    AxisHierarchy hier = toNative(sessionId, axisHierarchyId, viewId, axisId);   
    if (hier != null) {     
      Finder f = new Finder(selectedElementId);
      traverse(hier.getRootNodes(), f);
      return f.getPath();
    }
    return null;
 
View Full Code Here

    }
  }
 
  public int getNumberOfChildren(String sessionId, String axisHierarchyId, String viewId, String axisId, String selectedElementId)
    throws SessionExpiredException, PaloGwtCoreException {
    AxisHierarchy hier = toNative(sessionId, axisHierarchyId, viewId, axisId);   
    if (hier != null) {
      Counter c = new Counter(selectedElementId);     
      ElementNode [] roots = hier.getRootNodes();
      traverse(roots, c);
      return c.getResult() + roots.length;
    }
    return 0;
  }
View Full Code Here

 
  private final List <TreeNode> loadTreeNodes(CubeViewController cvc, String hierarchyId, String viewId, String axisId, int level) {
    List<TreeNode> nodes = new ArrayList<TreeNode>();
   
    Axis axis = cvc.getCubeView().getAxis(axisId);
    AxisHierarchy axisHierarchy = axis.getAxisHierarchy(hierarchyId);
    if(axisHierarchy != null) {
      ElementNode [] rootNodes = axisHierarchy.getRootNodes();
      HashMap<ElementNode, TreeNode> parents = new HashMap<ElementNode, TreeNode>();
      for (ElementNode rootElement: rootNodes) {
        XElementNode xRoot = XElementFactory.createX(rootElement, hierarchyId, viewId);       
        xRoot.setChildCount(rootElement.getChildCount());
        TreeNode n = new TreeNode(null, xRoot, true);
View Full Code Here

TOP

Related Classes of org.palo.viewapi.AxisHierarchy

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.