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.util.StringPool;
020 import com.liferay.portal.util.PropsValues;
021
022 import javax.portlet.PortletPreferences;
023
024
027 public class DLDisplayPortletDataHandler extends DLPortletDataHandler {
028
029 public DLDisplayPortletDataHandler() {
030 setDataLevel(DataLevel.PORTLET_INSTANCE);
031 setDataPortletPreferences("rootFolderId");
032 setPublishToLiveByDefault(PropsValues.DL_PUBLISH_TO_LIVE_BY_DEFAULT);
033 }
034
035 @Override
036 protected PortletPreferences doDeleteData(
037 PortletDataContext portletDataContext, String portletId,
038 PortletPreferences portletPreferences)
039 throws Exception {
040
041 if (portletPreferences == null) {
042 return portletPreferences;
043 }
044
045 portletPreferences.setValue("enable-comment-ratings", StringPool.BLANK);
046 portletPreferences.setValue("fileEntriesPerPage", StringPool.BLANK);
047 portletPreferences.setValue("fileEntryColumns", StringPool.BLANK);
048 portletPreferences.setValue("folderColumns", StringPool.BLANK);
049 portletPreferences.setValue("foldersPerPage", StringPool.BLANK);
050 portletPreferences.setValue("rootFolderId", StringPool.BLANK);
051 portletPreferences.setValue("showFoldersSearch", StringPool.BLANK);
052 portletPreferences.setValue("showSubfolders", StringPool.BLANK);
053
054 return portletPreferences;
055 }
056
057 }