001
014
015 package com.liferay.portal.kernel.lar;
016
017 import javax.portlet.PortletPreferences;
018
019
022 public abstract class BasePortletDataHandler implements PortletDataHandler {
023
024 public PortletPreferences deleteData(
025 PortletDataContext context, String portletId,
026 PortletPreferences preferences)
027 throws PortletDataException {
028
029 try {
030 return doDeleteData(context, portletId, preferences);
031 }
032 catch (Exception e) {
033 throw new PortletDataException(e);
034 }
035 }
036
037 public String exportData(
038 PortletDataContext context, String portletId,
039 PortletPreferences preferences)
040 throws PortletDataException {
041
042 try {
043 return doExportData(context, portletId, preferences);
044 }
045 catch (Exception e) {
046 throw new PortletDataException(e);
047 }
048 }
049
050 public boolean isAlwaysExportable() {
051 return _ALWAYS_EXPORTABLE;
052 }
053
054 public boolean isPublishToLiveByDefault() {
055 return _PUBLISH_TO_LIVE_BY_DEFAULT;
056 }
057
058 public PortletPreferences importData(
059 PortletDataContext context, String portletId,
060 PortletPreferences preferences, String data)
061 throws PortletDataException {
062
063 try {
064 return doImportData(context, portletId, preferences, data);
065 }
066 catch (Exception e) {
067 throw new PortletDataException(e);
068 }
069 }
070
071 protected PortletPreferences doDeleteData(
072 PortletDataContext context, String portletId,
073 PortletPreferences preferences)
074 throws Exception {
075
076 return null;
077 }
078
079 protected String doExportData(
080 PortletDataContext context, String portletId,
081 PortletPreferences preferences)
082 throws Exception {
083
084 return null;
085 }
086
087 protected PortletPreferences doImportData(
088 PortletDataContext context, String portletId,
089 PortletPreferences preferences, String data)
090 throws Exception {
091
092 return null;
093 }
094
095 private static final boolean _ALWAYS_EXPORTABLE = false;
096
097 private static final boolean _PUBLISH_TO_LIVE_BY_DEFAULT = false;
098
099 }