001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
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.Hits;
022    import com.liferay.portal.service.ServiceContext;
023    import com.liferay.portal.theme.ThemeDisplay;
024    import com.liferay.portlet.dynamicdatalists.model.DDLRecord;
025    import com.liferay.portlet.dynamicdatalists.model.DDLRecordSet;
026    
027    import java.util.List;
028    
029    import javax.portlet.PortletPreferences;
030    import javax.portlet.RenderRequest;
031    import javax.portlet.RenderResponse;
032    
033    import javax.servlet.http.HttpServletRequest;
034    
035    /**
036     * @author Eduardo Lundgren
037     * @author Marcellus Tavares
038     */
039    @ProviderType
040    public interface DDL {
041    
042            public JSONObject getRecordJSONObject(DDLRecord record) throws Exception;
043    
044            public JSONObject getRecordJSONObject(
045                            DDLRecord record, boolean latestRecordVersion)
046                    throws Exception;
047    
048            public List<DDLRecord> getRecords(Hits hits) 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            /**
070             * @deprecated As of 7.0.0, with no direct replacement
071             */
072            @Deprecated
073            public boolean isEditable(
074                            HttpServletRequest request, String portletId, long groupId)
075                    throws Exception;
076    
077            /**
078             * @deprecated As of 7.0.0, with no direct replacement
079             */
080            @Deprecated
081            public boolean isEditable(
082                            PortletPreferences preferences, String portletId, long groupId)
083                    throws Exception;
084    
085            public DDLRecord updateRecord(
086                            long recordId, long recordSetId, boolean mergeFields,
087                            boolean checkPermission, ServiceContext serviceContext)
088                    throws Exception;
089    
090            public DDLRecord updateRecord(
091                            long recordId, long recordSetId, boolean mergeFields,
092                            ServiceContext serviceContext)
093                    throws Exception;
094    
095    }