1
14
15 package com.liferay.portlet.sitemap.lar;
16
17 import com.liferay.portal.kernel.util.StringPool;
18 import com.liferay.portal.lar.BasePortletDataHandler;
19 import com.liferay.portal.lar.PortletDataContext;
20 import com.liferay.portal.lar.PortletDataException;
21 import com.liferay.portal.lar.PortletDataHandlerControl;
22
23 import javax.portlet.PortletPreferences;
24
25
31 public class SitemapPortletDataHandlerImpl extends BasePortletDataHandler {
32
33 public PortletPreferences deleteData(
34 PortletDataContext context, String portletId,
35 PortletPreferences preferences)
36 throws PortletDataException {
37
38 try {
39 preferences.setValue("root-layout-id", StringPool.BLANK);
40 preferences.setValue("display-depth", StringPool.BLANK);
41 preferences.setValue("include-root-in-tree", StringPool.BLANK);
42 preferences.setValue("show-current-page", StringPool.BLANK);
43 preferences.setValue("use-html-title", StringPool.BLANK);
44 preferences.setValue("show-hidden-pages", StringPool.BLANK);
45
46 return preferences;
47 }
48 catch (Exception e) {
49 throw new PortletDataException(e);
50 }
51 }
52
53 public String exportData(
54 PortletDataContext context, String portletId,
55 PortletPreferences preferences) {
56
57 return StringPool.BLANK;
58 }
59
60 public PortletDataHandlerControl[] getExportControls() {
61 return new PortletDataHandlerControl[0];
62 }
63
64 public PortletDataHandlerControl[] getImportControls() {
65 return new PortletDataHandlerControl[0];
66 }
67
68 public PortletPreferences importData(
69 PortletDataContext context, String portletId,
70 PortletPreferences preferences, String data) {
71
72 return preferences;
73 }
74
75 public boolean isPublishToLiveByDefault() {
76 return _PUBLISH_TO_LIVE_BY_DEFAULT;
77 }
78
79 private static final boolean _PUBLISH_TO_LIVE_BY_DEFAULT = true;
80
81 }