001
014
015 package com.liferay.portlet.dynamicdatalists.util;
016
017 import com.liferay.portal.kernel.json.JSONArray;
018 import com.liferay.portal.kernel.json.JSONObject;
019 import com.liferay.portal.kernel.search.Hits;
020 import com.liferay.portal.service.ServiceContext;
021 import com.liferay.portal.theme.ThemeDisplay;
022 import com.liferay.portlet.dynamicdatalists.model.DDLRecord;
023 import com.liferay.portlet.dynamicdatalists.model.DDLRecordSet;
024
025 import java.util.List;
026
027 import javax.portlet.PortletPreferences;
028 import javax.portlet.RenderRequest;
029 import javax.portlet.RenderResponse;
030
031 import javax.servlet.http.HttpServletRequest;
032
033
037 public interface DDL {
038
039 public JSONObject getRecordJSONObject(DDLRecord record) throws Exception;
040
041 public JSONObject getRecordJSONObject(
042 DDLRecord record, boolean latestRecordVersion)
043 throws Exception;
044
045 public List<DDLRecord> getRecords(Hits hits) throws Exception;
046
047 public JSONArray getRecordSetJSONArray(DDLRecordSet recordSet)
048 throws Exception;
049
050 public JSONArray getRecordsJSONArray(DDLRecordSet recordSet)
051 throws Exception;
052
053 public JSONArray getRecordsJSONArray(List<DDLRecord> records)
054 throws Exception;
055
056 public JSONArray getRecordsJSONArray(
057 List<DDLRecord> records, boolean latestRecordVersion)
058 throws Exception;
059
060 public String getTemplateContent(
061 long ddmTemplateId, DDLRecordSet recordSet,
062 ThemeDisplay themeDisplay, RenderRequest renderRequest,
063 RenderResponse renderResponse)
064 throws Exception;
065
066 public boolean isEditable(
067 HttpServletRequest request, String portletId, long groupId)
068 throws Exception;
069
070 public boolean isEditable(
071 PortletPreferences preferences, String portletId, long groupId)
072 throws Exception;
073
074 public DDLRecord updateRecord(
075 long recordId, long recordSetId, boolean mergeFields,
076 boolean checkPermission, ServiceContext serviceContext)
077 throws Exception;
078
079 public DDLRecord updateRecord(
080 long recordId, long recordSetId, boolean mergeFields,
081 ServiceContext serviceContext)
082 throws Exception;
083
084 }