Package com.dotmarketing.portlets.categories.business

Examples of com.dotmarketing.portlets.categories.business.CategoryAPI


          idsToClear.addAll(dc.loadResults());
      }

    } else if(isCategory) {

      CategoryAPI catAPI = APILocator.getCategoryAPI();
      Category cat = (Category) permissionable;
      UserAPI userAPI = APILocator.getUserAPI();
      List<Category> children;
      try {
        children = catAPI.getCategoryTreeDown(cat, cat, userAPI.getSystemUser(), false);
      } catch (DotSecurityException e) {
        Logger.error(PermissionBitFactoryImpl.class, e.getMessage(), e);
        throw new DotRuntimeException(e.getMessage(), e);
      }
      for(Category child : children) {
View Full Code Here


    UserWebAPI uWebAPI = WebAPILocator.getUserWebAPI();
    WebContext ctx = WebContextFactory.get();
    HttpServletRequest request = ctx.getHttpServletRequest();
    UserProxyAPI userProxyAPI = APILocator.getUserProxyAPI();

    CategoryAPI catAPI = APILocator.getCategoryAPI();
    UserProxy uProxy = userProxyAPI.getUserProxy(userId, uWebAPI.getLoggedInUser(request), uWebAPI.isLoggedToBackend(request));
    List<Category> children = catAPI.getChildren(uProxy, uWebAPI.getLoggedInUser(request), uWebAPI.isLoggedToBackend(request));

    List<Map<String, Object>> toReturn = new ArrayList<Map<String,Object>>();
    for(Category child: children) {
      toReturn.add(child.getMap());
    }
View Full Code Here

    UserProxyAPI userProxyAPI = APILocator.getUserProxyAPI();

    User user = uWebAPI.getLoggedInUser(request);
    boolean respectFrontend = uWebAPI.isLoggedToBackend(request);

    CategoryAPI catAPI = APILocator.getCategoryAPI();
    UserProxy userProxy = userProxyAPI.getUserProxy(userId, uWebAPI.getLoggedInUser(request), uWebAPI.isLoggedToBackend(request));

    HibernateUtil.startTransaction();
    List<Category> myUserCategories = catAPI.getChildren(userProxy, user, respectFrontend);
    for (Object o : myUserCategories) {
      if(o instanceof Category && catAPI.canUseCategory((Category)o, user, respectFrontend)){
        catAPI.removeChild(userProxy, (Category)o, user, respectFrontend);
      }
    }
    for(int i = 0;i < categories.length;i++)
    {
      Category category = catAPI.find(categories[i], user, respectFrontend);
      if(InodeUtils.isSet(category.getInode()))
      {
        catAPI.addChild(userProxy, category, user, respectFrontend);
      }
    }
    HibernateUtil.commitTransaction();
  }
View Full Code Here

      }
      if(f.getFieldContentlet().startsWith("float")){
        decimalFields.put(st.getVelocityVarName()+"."+f.getVelocityVarName(), f);
      }
    }
    CategoryAPI catAPI = APILocator.getCategoryAPI();
    Category category=null;
    String categoriesvalues="";
    boolean first = true;
    for (String cat : categories) {
       try {
         category=catAPI.find(cat, currentUser, false);
      } catch (DotDataException e) {
        Logger.error(this, "Error trying to obtain the categories", e);
      } catch (DotSecurityException e) {
        Logger.error(this, " Permission error trying to obtain the categories", e);
      }
View Full Code Here

TOP

Related Classes of com.dotmarketing.portlets.categories.business.CategoryAPI

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.