Package com.agiletec.aps.system.common.tree

Examples of com.agiletec.aps.system.common.tree.ITreeNode


   * @param facetManager The manager nodes facet.
   */
  public FacetBreadCrumbs(String requiredFacet, String facetRoot, ITreeNodeManager facetManager) {
    this.setFacetRoot(facetRoot);
    this.setRequiredFacet(requiredFacet);
    ITreeNode requiredNode = facetManager.getNode(requiredFacet);
    this.addBreadCrumbsNode(requiredNode);
  }
View Full Code Here


   * @param node
   */
  private void addBreadCrumbsNode(ITreeNode node) {
    this.getBreadCrumbs().add(0, node.getCode());
    if (node.getCode().equals(this.getFacetRoot())) return;
    ITreeNode parentNode = node.getParent();
    if (null != parentNode && !parentNode.getCode().equals(node.getCode())) {
      this.addBreadCrumbsNode(parentNode);
    }
  }
View Full Code Here

    ServletRequest request =  this.pageContext.getRequest();
    RequestContext reqCtx = (RequestContext) request.getAttribute(RequestContext.REQCTX);
    try {
      IFacetNavHelper facetNavHelper = (IFacetNavHelper) ApsWebApplicationUtils.getBean(JpFacetNavSystemConstants.CONTENT_FACET_NAV_HELPER, this.pageContext);
      ITreeNodeManager facetManager =  facetNavHelper.getTreeNodeManager();
      ITreeNode facetNode = facetManager.getNode(this.getFacetNodeCode());
      String separator = (this.getSeparator() == null) ? " / " : this.getSeparator();
      if (null != facetNode) {
        Lang currentLang = (Lang) reqCtx.getExtraParam(SystemConstants.EXTRAPAR_CURRENT_LANG);
        String title = facetNode.getTitles().getProperty(currentLang.getCode());
        if (this.isFullTitle()) {
          title = facetNode.getFullTitle(currentLang.getCode(), separator);
        }
        if (null == title || title.trim().length() == 0) {
          ILangManager langManager = (ILangManager) ApsWebApplicationUtils.getBean(SystemConstants.LANGUAGE_MANAGER, this.pageContext);
          Lang defaultLang = langManager.getDefaultLang();
          title = facetNode.getTitles().getProperty(defaultLang.getCode());
          if (this.isFullTitle()) {
            title = facetNode.getFullTitle(defaultLang.getCode(), separator);
          }
        }
        if (null == title || title.trim().length() == 0) {
          title = this.getFacetNodeCode();
        }
View Full Code Here

  private boolean isSelectedOneChild() {
    ITreeNodeManager facetManager = this.getFacetManager();
    List<String> requiredFacets = this.getRequiredFacets();
    for (int i=0; i<requiredFacets.size(); i++) {
      String requiredFacet = requiredFacets.get(i);
      ITreeNode facet = facetManager.getNode(requiredFacet);
      if (null != facet) {
        boolean check = this.checkSelectChild(facet, this.getFacetNodeCode());
        if (check) return true;
      }
    }
View Full Code Here

   */
  private boolean checkSelectChild(ITreeNode facet, String codeForCheck) {
    if (facet.getCode().equals(codeForCheck)) {
      return true;
    }
    ITreeNode parentFacet = facet.getParent();
    if (null != parentFacet && !parentFacet.getCode().equals(parentFacet.getParent().getCode())) {
      return this.checkSelectChild(parentFacet, codeForCheck);
    }
    return false;
  }
View Full Code Here

   * Returns true if there are children occurrences.
   * @return true if there are children occurrences
   */
  private boolean hasChildrenOccurrences() {
    ITreeNodeManager facetManager = this.getFacetManager();
    ITreeNode facet = facetManager.getNode(this.getFacetNodeCode());
    for (int i=0; i<facet.getChildren().length; i++) {
      ITreeNode child = facet.getChildren()[i];
      Integer occurrence = this.getOccurrences().get(child.getCode());
      if (null != occurrence && occurrence.intValue()>0) {
        return true;
      }
    }
    return false;
View Full Code Here

    try {
      this.createValuedShowlet();
      if (this.isValidFacet()) {
        String facetCode = this.getFacetCode();
        List<String> facetCodes = this.getFacetRootCodes();
        ITreeNode facet = this.getTreeNodeManager().getNode(this.getFacetCode());
        if (facet != null && !facet.getCode().equals(facet.getParent().getCode()) && !facetCodes.contains(facetCode)) {//se esiste, non è la Home e non è
          facetCodes.add(facetCode);
          String facetsFilter = FacetNavWidgetHelper.concatStrings(facetCodes, ",");
          String configParamName = JpFacetNavSystemConstants.FACET_ROOTS_SHOWLET_PARAM_NAME;
          this.getWidget().getConfig().setProperty(configParamName, facetsFilter);
          this.setFacetRootNodes(facetsFilter);
View Full Code Here

    return SUCCESS;
  }
 
  @Override
  public ITreeNode getShowableTree() {
    ITreeNode node = null;
    try {
      ITreeNode allowedTree = this.getAllowedTreeRootNode();
      node = this.getTreeHelper().getShowableTree(this.getTreeNodesToOpen(), allowedTree, this.getNodeGroupCodes());
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "getShowableTree");
    }
    return node;
View Full Code Here

    return node;
  }
 
  @Override
  public ITreeNode getAllowedTreeRootNode() {
    ITreeNode node = null;
    try {
      node = this.getTreeHelper().getAllowedTreeRoot(this.getNodeGroupCodes());
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "getAllowedTreeRootNode");
    }
View Full Code Here

      int[] minMax = this.extractMinMax(occurrences);
      int interval = (minMax[1] - minMax[0]);
      double delta = ((double)interval)/9d;
      Iterator<ITreeNode> iter = occurrences.keySet().iterator();
      while (iter.hasNext()) {
        ITreeNode treeNode = iter.next();
        int occurrence = occurrences.get(treeNode).intValue();
        double position = ((double) (occurrence-minMax[0]))/delta;
        long positionInt = Math.round(position);
        String classId = String.valueOf(((int)positionInt+1));
        CloudInfoBean bean = new CloudInfoBean(treeNode, occurrence, classId, currentLang);
View Full Code Here

TOP

Related Classes of com.agiletec.aps.system.common.tree.ITreeNode

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.