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.AssetCategory;
020 import com.liferay.portlet.asset.service.AssetCategoryLocalServiceUtil;
021
022
025 public class AssetCategoryStagedModelDataHandler
026 extends BaseStagedModelDataHandler<AssetCategory> {
027
028 public static final String[] CLASS_NAMES = {AssetCategory.class.getName()};
029
030 @Override
031 public void deleteStagedModel(
032 String uuid, long groupId, String className, String extraData) {
033 }
034
035 @Override
036 public String[] getClassNames() {
037 return CLASS_NAMES;
038 }
039
040 @Override
041 public String getDisplayName(AssetCategory category) {
042 return category.getTitleCurrentValue();
043 }
044
045 @Override
046 protected void doExportStagedModel(
047 PortletDataContext portletDataContext, AssetCategory category)
048 throws Exception {
049 }
050
051 @Override
052 protected void doImportStagedModel(
053 PortletDataContext portletDataContext, AssetCategory category)
054 throws Exception {
055 }
056
057 @Override
058 protected boolean validateMissingReference(
059 String uuid, long companyId, long groupId)
060 throws Exception {
061
062 AssetCategory category =
063 AssetCategoryLocalServiceUtil.fetchAssetCategoryByUuidAndGroupId(
064 uuid, groupId);
065
066 if (category == null) {
067 return false;
068 }
069
070 return true;
071 }
072
073 }