本文整理汇总了Java中com.liferay.portlet.asset.model.AssetVocabulary类的典型用法代码示例。如果您正苦于以下问题:Java AssetVocabulary类的具体用法?Java AssetVocabulary怎么用?Java AssetVocabulary使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AssetVocabulary类属于com.liferay.portlet.asset.model包,在下文中一共展示了AssetVocabulary类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: load
import com.liferay.portlet.asset.model.AssetVocabulary; //导入依赖的package包/类
@Override
public AssetVocabulary load(final PortletPreferences preferences, final String key, final String defaultValue) {
final String uuid = preferences.getValue(key, "");
if (StringUtils.isEmpty(uuid)) {
return null;
}
final long companyId = ServiceContextThreadLocal.getServiceContext().getCompanyId();
try {
return AssetVocabularyLocalServiceUtil.fetchAssetVocabularyByUuidAndCompanyId(uuid, companyId);
} catch (final SystemException e) {
log.error("Could not load vocabulary {}", uuid, e);
return null;
}
}
示例2: generateAssetVocabularyElement
import com.liferay.portlet.asset.model.AssetVocabulary; //导入依赖的package包/类
private Element generateAssetVocabularyElement(AssetVocabulary vocab) {
Element vocabElem = SAXReaderUtil.createElement(vocab.getName());
vocabElem.addAttribute("id", String.valueOf(vocab.getVocabularyId()));
vocabElem.addAttribute("companyId", String.valueOf(vocab.getCompanyId()));
vocabElem.addAttribute("groupId", String.valueOf(vocab.getGroupId()));
return vocabElem;
}
示例3: store
import com.liferay.portlet.asset.model.AssetVocabulary; //导入依赖的package包/类
@Override
public void store(final PortletPreferences preferences, final String key, final AssetVocabulary vocabulary)
throws ReadOnlyException {
preferences.setValue(key, vocabulary == null ? null : vocabulary.getUuid());
}