001
014
015 package com.liferay.portlet.documentlibrary.lar;
016
017 import com.liferay.portal.kernel.lar.DataLevel;
018 import com.liferay.portal.kernel.lar.PortletDataContext;
019 import com.liferay.portal.kernel.lar.PortletDataHandlerControl;
020 import com.liferay.portal.kernel.util.StringPool;
021 import com.liferay.portal.util.PropsValues;
022
023 import javax.portlet.PortletPreferences;
024
025
028 public class DLDisplayPortletDataHandler extends DLPortletDataHandler {
029
030 public DLDisplayPortletDataHandler() {
031 setDataLevel(DataLevel.PORTLET_INSTANCE);
032 setDataPortletPreferences("rootFolderId");
033 setExportControls(new PortletDataHandlerControl[0]);
034 setPublishToLiveByDefault(PropsValues.DL_PUBLISH_TO_LIVE_BY_DEFAULT);
035 }
036
037 @Override
038 protected PortletPreferences doDeleteData(
039 PortletDataContext portletDataContext, String portletId,
040 PortletPreferences portletPreferences)
041 throws Exception {
042
043 if (portletPreferences == null) {
044 return portletPreferences;
045 }
046
047 portletPreferences.setValue("enable-comment-ratings", StringPool.BLANK);
048 portletPreferences.setValue("fileEntriesPerPage", StringPool.BLANK);
049 portletPreferences.setValue("fileEntryColumns", StringPool.BLANK);
050 portletPreferences.setValue("folderColumns", StringPool.BLANK);
051 portletPreferences.setValue("foldersPerPage", StringPool.BLANK);
052 portletPreferences.setValue("rootFolderId", StringPool.BLANK);
053 portletPreferences.setValue("showFoldersSearch", StringPool.BLANK);
054 portletPreferences.setValue("showSubfolders", StringPool.BLANK);
055
056 return portletPreferences;
057 }
058
059 }