001
014
015 package com.liferay.portlet.dynamicdatalists.util;
016
017 import aQute.bnd.annotation.ProviderType;
018
019 import com.liferay.portal.kernel.json.JSONArray;
020 import com.liferay.portal.kernel.json.JSONObject;
021 import com.liferay.portal.kernel.search.Field;
022 import com.liferay.portal.kernel.search.Hits;
023 import com.liferay.portal.service.ServiceContext;
024 import com.liferay.portal.theme.ThemeDisplay;
025 import com.liferay.portlet.dynamicdatalists.model.DDLRecord;
026 import com.liferay.portlet.dynamicdatalists.model.DDLRecordSet;
027
028 import java.util.List;
029
030 import javax.portlet.PortletPreferences;
031 import javax.portlet.RenderRequest;
032 import javax.portlet.RenderResponse;
033
034 import javax.servlet.http.HttpServletRequest;
035
036
040 @ProviderType
041 public interface DDL {
042
043 public static final String[] SELECTED_FIELD_NAMES =
044 {Field.COMPANY_ID, Field.ENTRY_CLASS_PK, Field.UID};
045
046 public JSONObject getRecordJSONObject(DDLRecord record) throws Exception;
047
048 public JSONObject getRecordJSONObject(
049 DDLRecord record, boolean latestRecordVersion)
050 throws Exception;
051
052 public List<DDLRecord> getRecords(Hits hits) throws Exception;
053
054 public JSONArray getRecordSetJSONArray(DDLRecordSet recordSet)
055 throws Exception;
056
057 public JSONArray getRecordsJSONArray(DDLRecordSet recordSet)
058 throws Exception;
059
060 public JSONArray getRecordsJSONArray(List<DDLRecord> records)
061 throws Exception;
062
063 public JSONArray getRecordsJSONArray(
064 List<DDLRecord> records, boolean latestRecordVersion)
065 throws Exception;
066
067 public String getTemplateContent(
068 long ddmTemplateId, DDLRecordSet recordSet,
069 ThemeDisplay themeDisplay, RenderRequest renderRequest,
070 RenderResponse renderResponse)
071 throws Exception;
072
073
076 @Deprecated
077 public boolean isEditable(
078 HttpServletRequest request, String portletId, long groupId)
079 throws Exception;
080
081
084 @Deprecated
085 public boolean isEditable(
086 PortletPreferences preferences, String portletId, long groupId)
087 throws Exception;
088
089 public DDLRecord updateRecord(
090 long recordId, long recordSetId, boolean mergeFields,
091 boolean checkPermission, ServiceContext serviceContext)
092 throws Exception;
093
094 public DDLRecord updateRecord(
095 long recordId, long recordSetId, boolean mergeFields,
096 ServiceContext serviceContext)
097 throws Exception;
098
099 }