本文整理匯總了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();
}