本文整理汇总了Java中com.liferay.asset.kernel.model.AssetCategory类的典型用法代码示例。如果您正苦于以下问题:Java AssetCategory类的具体用法?Java AssetCategory怎么用?Java AssetCategory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AssetCategory类属于com.liferay.asset.kernel.model包,在下文中一共展示了AssetCategory类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: displayTerm
import com.liferay.asset.kernel.model.AssetCategory; //导入依赖的package包/类
@Override
public String displayTerm(HttpServletRequest request, FacetConfiguration facetConfiguration, String queryTerm) {
ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
Locale locale = themeDisplay.getLocale();
try {
AssetCategory assetCategory = assetCategoryService.getCategory(Long.parseLong(queryTerm));
return assetCategory.getTitle(locale);
} catch (PortalException e) {
LOG.warn("Could not retrieve AssetCategory from id [" + queryTerm + "]", e);
return queryTerm;
}
}
开发者ID:savoirfairelinux,项目名称:flashlight-search,代码行数:13,代码来源:AssetCategoriesSearchFacetDisplayHandler.java
示例2: getCategoryList
import com.liferay.asset.kernel.model.AssetCategory; //导入依赖的package包/类
/**
* Get Category list
*
* @param resourceRequest
* @param resourceResponse
* @return
* @throws PortalException
*/
private String getCategoryList(ResourceRequest resourceRequest, ResourceResponse resourceResponse)
throws PortalException {
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
long vocabularyId = ParamUtil.getLong(resourceRequest, "vocabularyId",0);
if (_log.isDebugEnabled()) {
_log.debug("Vocabulary Id <" + String.valueOf(vocabularyId) + ">");
}
List<AssetCategory> categories =
_assetCategoryLocalService.getVocabularyCategories(
vocabularyId,
QueryUtil.ALL_POS,
QueryUtil.ALL_POS,
null
);
for (AssetCategory category : categories) {
JSONObject curUserJSONObject = JSONFactoryUtil.createJSONObject();
if (_log.isDebugEnabled()) {
_log.debug("Category name <" + category.getName() + ">");
_log.debug(category.toString());
_log.debug("----------");
}
curUserJSONObject.put("categoryId", category.getCategoryId());
curUserJSONObject.put("categoryName", category.getName());
jsonArray.put(curUserJSONObject);
}
return jsonArray.toJSONString();
}