コード例 #1
0
 protected String getTagPredicate(Map<String, String> filter) {
   if (filter.containsKey(PARAM_TAG)) {
     final ContentMap contentMap =
         templatingFunctions.contentByPath(filter.get(PARAM_TAG), NewsWorkspaceUtil.COLLABORATION);
     if (contentMap != null) {
       final String tagId = (String) contentMap.get("@id");
       if (StringUtils.isNotEmpty(tagId)) {
         return "AND p.tags like '%" + tagId + "%' ";
       }
     } else {
       log.debug("Tag [{}] not found", filter.get(PARAM_TAG));
     }
   }
   return StringUtils.EMPTY;
 }
コード例 #2
0
 protected String getCategoryPredicate(Map<String, String> filter) {
   if (filter.containsKey(PARAM_CATEGORY)) {
     final ContentMap contentMap =
         templatingFunctions.contentByPath(
             filter.get(PARAM_CATEGORY), NewsWorkspaceUtil.CATEGORIES);
     if (contentMap != null) {
       final String categoryId = (String) contentMap.get("@id");
       if (StringUtils.isNotEmpty(categoryId)) {
         return "AND p.categories like '%" + categoryId + "%' ";
       }
     } else {
       log.debug("Category [{}] not found", filter.get(PARAM_CATEGORY));
     }
   }
   return StringUtils.EMPTY;
 }
コード例 #3
0
 /**
  * Get tags for given news node
  *
  * @param news
  * @return List of tag nodes
  */
 public List<ContentMap> getNewsTags(ContentMap news) {
   return getItems(
       news.getJCRNode(), NewsNodeTypes.News.PROPERTY_TAGS, NewsWorkspaceUtil.COLLABORATION);
 }
コード例 #4
0
 /**
  * Get categories for given news node
  *
  * @param news
  * @return List of category nodes
  */
 public List<ContentMap> getNewsCategories(ContentMap news) {
   return getItems(
       news.getJCRNode(), NewsNodeTypes.News.PROPERTY_CATEGORIES, NewsWorkspaceUtil.CATEGORIES);
 }