001
014
015 package com.liferay.portlet.asset.lar;
016
017 import com.liferay.portal.kernel.lar.BaseStagedModelDataHandler;
018 import com.liferay.portal.kernel.lar.PortletDataContext;
019 import com.liferay.portlet.asset.model.AssetVocabulary;
020 import com.liferay.portlet.asset.service.AssetVocabularyLocalServiceUtil;
021
022
025 public class AssetVocabularyStagedModelDataHandler
026 extends BaseStagedModelDataHandler<AssetVocabulary> {
027
028 public static final String[] CLASS_NAMES =
029 {AssetVocabulary.class.getName()};
030
031 @Override
032 public void deleteStagedModel(
033 String uuid, long groupId, String className, String extraData) {
034 }
035
036 @Override
037 public String[] getClassNames() {
038 return CLASS_NAMES;
039 }
040
041 @Override
042 public String getDisplayName(AssetVocabulary vocabulary) {
043 return vocabulary.getTitleCurrentValue();
044 }
045
046 @Override
047 protected void doExportStagedModel(
048 PortletDataContext portletDataContext, AssetVocabulary vocabulary)
049 throws Exception {
050 }
051
052 @Override
053 protected void doImportStagedModel(
054 PortletDataContext portletDataContext, AssetVocabulary vocabulary)
055 throws Exception {
056 }
057
058 @Override
059 protected boolean validateMissingReference(
060 String uuid, long companyId, long groupId)
061 throws Exception {
062
063 AssetVocabulary vocabulary =
064 AssetVocabularyLocalServiceUtil.
065 fetchAssetVocabularyByUuidAndGroupId(uuid, groupId);
066
067 if (vocabulary == null) {
068 return false;
069 }
070
071 return true;
072 }
073
074 }