Package com.agiletec.aps.system.services.category

Examples of com.agiletec.aps.system.services.category.Category


        if (null == this.getElaborationDate() || !this.getElaborationDate().equals(DateConverter.getFormattedDate(new Date(), "yyyyMMdd"))) {
            this.release();
            this.setElaborationDate(DateConverter.getFormattedDate(new Date(), "yyyyMMdd"));
        }
        try {
            Category root = this.getCategoryManager().getCategory(this.getTagCloudCategoryRoot());
            if (root == null || root.getChildren() == null || root.getChildren().length == 0) {
                ApsSystemUtils.getLogger().error("Category Root '" + this.getTagCloudCategoryRoot() + "' null or dosn't has children");
                return new HashMap<ITreeNode, Integer>();
            }
            Set<String> userGroupCodes = this.getGroupsForSearch(currentUser);
            String key = this.createGroupMappingKey(userGroupCodes);
            Map<String, Integer> cloudInfosSmall = this.getGlobalCloudInfos().get(key);
            if (null == cloudInfosSmall) {
                cloudInfosSmall = new HashMap<String, Integer>();
                this.getGlobalCloudInfos().put(key, cloudInfosSmall);
                EntitySearchFilter[] filters = (null != this.getDelayDays() && this.getDelayDays().intValue() > 0) ? new EntitySearchFilter[]{this.getStartDateFilter()} : null;
                Category[] children = root.getChildren();
                for (int i = 0; i < children.length; i++) {
                    Category child = children[i];
                    List<String> contentsId = this.getTagCloudDAO().loadPublicContentsId(new String[]{child.getCode()}, filters, userGroupCodes);
                    cloudInfosSmall.put(child.getCode(), new Integer(contentsId.size()));
                }
            }
            cloudInfos = new HashMap<ITreeNode, Integer>(cloudInfosSmall.size());
            Iterator<String> iterCodes = cloudInfosSmall.keySet().iterator();
            while (iterCodes.hasNext()) {
View Full Code Here


    bean.setResourceType(resourceType);
    bean.setMimeType("image/jpeg");
    List<Category> categories = new ArrayList<Category>();
    ICategoryManager catManager =
      (ICategoryManager) this.getService(SystemConstants.CATEGORY_MANAGER);
    Category cat = catManager.getCategory(categoryCodeToAdd);
    categories.add(cat);
    bean.setCategories(categories);
    return bean;
    }
View Full Code Here

      List<WorkflowSearchFilter> workflowFilters = ((IContentWorkFlowActionHelper) this.getContentActionHelper()).getWorkflowSearchFilters(user);
      if (workflowFilters.size() > 0) {
        List<String> allowedGroups = this.getContentGroupCodes();
        EntitySearchFilter[] filters = this.createFilters();
        String[] categories = null;
        Category category = this.getCategoryManager().getCategory(this.getCategoryCode());
        if (null != category && !category.isRoot()) {
          categories = new String[]{this.getCategoryCode().trim()};
        }
        result = this.getContentSearcherManager().loadContentsId(workflowFilters, categories, filters, allowedGroups);
      } else {
        result = new ArrayList<String>();
View Full Code Here

  public List<Category> getCategories() {
    List<Category> categories = new ArrayList<Category>(this.getCategoryCodes().size());
    Iterator<String> iter = this.getCategoryCodes().iterator();
    while (iter.hasNext()) {
      String categoryCode = iter.next();
      Category category = this.getCategoryManager().getCategory(categoryCode);
      if (null != category) categories.add(category);
    }
    return categories;
  }
View Full Code Here

    return categories;
  }

  private String joinRemoveCategory(boolean isJoin, String categoryCode) {
    try {
      Category category = this.getCategory(categoryCode);
      if (category == null) return SUCCESS;
      List<String> categories = this.getCategoryCodes();
      if (isJoin) {
        if (!categories.contains(categoryCode)) {
          categories.add(categoryCode);
View Full Code Here

  private void setContentCategories(Content content, ApsAggregatorItem apsAggregatorItem) {
    ApsProperties categories = apsAggregatorItem.getCategories();
    if (null != categories && categories.size() > 0) {
      for (Enumeration e = categories.keys() ; e.hasMoreElements() ;) {
        String categoryCode = (String) e.nextElement();
        Category category = this.getCategoryManager().getCategory(categoryCode);
        if (null != category && !content.getCategories().contains(category)) {
          content.addCategory(category);
        }
      }
    }
View Full Code Here

  }
 
  public String joinCategory() {
    try {
      String categoryCode = this.getCategoryCode();
      Category category = this.getCategoryManager().getCategory(categoryCode);
      if (null != category && !category.getCode().equals(category.getParentCode())) {
        ApsProperties currentCats = this.getCategories();
        currentCats.put(category.getCode(), category.getFullTitle());
        this.setXmlCategories(currentCats.toXml());
      }
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "joinCategory");
      return FAILURE;
View Full Code Here

  }

  public String removeCategory() {
    try {
      String categoryCode = this.getCategoryCode();
      Category category = this.getCategoryManager().getCategory(categoryCode);
      if (null != category) {
        ApsProperties currentCats = this.getCategories();
        currentCats.remove(categoryCode);
        this.setXmlCategories(currentCats.toXml());
      }
View Full Code Here

   * @param properties
   */
  private void purgeCategories(ApsProperties properties) {
    for (Enumeration e = properties.keys() ; e.hasMoreElements() ;) {
      String categoryCode = (String) e.nextElement();
      Category category = this.getCategoryManager().getCategory(categoryCode);
      if (null == category) {
        properties.remove(categoryCode);
      }
    }
  }
View Full Code Here

    this._contentDao.insertOnLineContent(content1);

    Content content2 = this._contentManager.loadContent("ART120", true);
    content2.setId("ART120b");
    for (int i = 0; i < masterContent.getCategories().size(); i++) {
      Category category = masterContent.getCategories().get(i);
      content2.addCategory(category);
    }
    this._contentDao.addEntity(content2);
    this._contentDao.insertOnLineContent(content2);
  }
View Full Code Here

TOP

Related Classes of com.agiletec.aps.system.services.category.Category

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.