Package com.dotmarketing.portlets.categories.model

Examples of com.dotmarketing.portlets.categories.model.Category


    List<Map<String, Object>> retList = new ArrayList<Map<String,Object>>();
    List<Category> categories = new ArrayList<Category>();
    if(categoriesInodes != null) {
      for (String categoryInode : categoriesInodes) {
        Category cat = categoryAPI.find(categoryInode, user, respectFrontendRoles);
        if(cat != null)
          categories.add(cat);
      }
    }
    List<Event> events = eventAPI.find(hostId, fromDate, toDate, tags, keywords, categories, live, includeArchived, offset, limit, user, respectFrontendRoles);
    for(Event ev : events) {
      Map<String, Object> eventMap = ev.getMap();

      //Loading categories
      List<Map<String, Object>> categoryMaps = new ArrayList<Map<String,Object>>();
      List<Category> eventCategories =  categoryAPI.getParents(ev, user, respectFrontendRoles);
      for(Category cat : eventCategories) {
        categoryMaps.add(cat.getMap());
      }
     
      // http://jira.dotmarketing.net/browse/DOTCMS-6904
      // we're missing [working, live, deleted] info
     
View Full Code Here


    ArrayList<Category> cats = new ArrayList<Category>();
    // Getting categories that come from the entity
    String[] arr = req.getParameterValues("categories") == null?new String[0]:req.getParameterValues("categories");
    if (arr != null && arr.length > 0) {
      for (int i = 0; i < arr.length; i++) {
        Category category = catAPI.find(arr[i], user, false);
        if(!cats.contains(category))
        {
          cats.add(category);
        }
View Full Code Here

        if(field.getFieldType().equals(FieldType.CATEGORY.toString())) {
          String catValue=contentlet.getStringProperty(field.getVelocityVarName());
          if(UtilMethods.isSet(catValue)) {
            for(String cat : catValue.split("\\s*,\\s*")) {
              // take it as catId
              Category category=APILocator.getCategoryAPI().find(cat, init.getUser(), false);
              if(category!=null && InodeUtils.isSet(category.getCategoryId())) {
                cats.add(category);
              }
              else {
                // try it as catKey
                category=APILocator.getCategoryAPI().findByKey(cat, init.getUser(), false);
                if(category!=null && InodeUtils.isSet(category.getCategoryId())) {
                  cats.add(category);
                }
                else {
                  // try it as variable
                  // FIXME: https://github.com/dotCMS/dotCMS/issues/2847
                  HibernateUtil hu=new HibernateUtil(Category.class);
                  hu.setQuery("from "+Category.class.getCanonicalName()+" WHERE category_velocity_var_name=?");
                  hu.setParam(cat);
                  category=(Category)hu.load();
                  if(category!=null && InodeUtils.isSet(category.getCategoryId())) {
                    cats.add(category);
                  }
                }
              }

View Full Code Here

TOP

Related Classes of com.dotmarketing.portlets.categories.model.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.