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.xml.Element;
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 import java.util.Map;
027
028 import javax.portlet.PortletPreferences;
029 import javax.portlet.RenderRequest;
030 import javax.portlet.RenderResponse;
031
032 import javax.servlet.http.HttpServletRequest;
033 import javax.servlet.http.HttpServletResponse;
034
035
038 public interface DDL {
039
040 public void addAllReservedEls(
041 Element rootElement, Map<String, String> tokens,
042 DDLRecordSet recordSet);
043
044 public JSONObject getRecordJSONObject(DDLRecord record) throws Exception;
045
046 public JSONObject getRecordJSONObject(
047 DDLRecord record, boolean latestRecordVersion)
048 throws Exception;
049
050 public JSONArray getRecordSetJSONArray(DDLRecordSet recordSet)
051 throws Exception;
052
053 public JSONArray getRecordsJSONArray(DDLRecordSet recordSet)
054 throws Exception;
055
056 public JSONArray getRecordsJSONArray(List<DDLRecord> records)
057 throws Exception;
058
059 public JSONArray getRecordsJSONArray(
060 List<DDLRecord> records, boolean latestRecordVersion)
061 throws Exception;
062
063 public String getTemplateContent(
064 long ddmTemplateId, DDLRecordSet recordSet,
065 ThemeDisplay themeDisplay, RenderRequest renderRequest,
066 RenderResponse renderResponse)
067 throws Exception;
068
069 public boolean isEditable(
070 HttpServletRequest request, String portletId, long groupId)
071 throws Exception;
072
073 public boolean isEditable(
074 PortletPreferences preferences, String portletId, long groupId)
075 throws Exception;
076
077 public void sendRecordFileUpload(
078 HttpServletRequest request, HttpServletResponse response,
079 DDLRecord record, String fieldName)
080 throws Exception;
081
082 public void sendRecordFileUpload(
083 HttpServletRequest request, HttpServletResponse response,
084 long recordId, String fieldName)
085 throws Exception;
086
087 public DDLRecord updateRecord(
088 long recordId, long recordSetId, boolean mergeFields,
089 boolean checkPermission, ServiceContext serviceContext)
090 throws Exception;
091
092 public DDLRecord updateRecord(
093 long recordId, long recordSetId, boolean mergeFields,
094 ServiceContext serviceContext)
095 throws Exception;
096
097 public String uploadRecordFieldFile(
098 DDLRecord record, String fieldName, ServiceContext serviceContext)
099 throws Exception;
100
101 }