001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.dynamicdatamapping.util;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.json.JSONArray;
019    import com.liferay.portal.kernel.xml.Document;
020    import com.liferay.portal.kernel.xml.Element;
021    import com.liferay.portlet.dynamicdatamapping.model.DDMStructure;
022    import com.liferay.portlet.dynamicdatamapping.model.DDMTemplate;
023    import com.liferay.portlet.dynamicdatamapping.storage.Field;
024    import com.liferay.portlet.dynamicdatamapping.storage.Fields;
025    
026    import java.util.Locale;
027    
028    import javax.servlet.http.HttpServletRequest;
029    import javax.servlet.http.HttpServletResponse;
030    
031    /**
032     * @author Eduardo Lundgren
033     * @author Brian Wing Shun Chan
034     */
035    public interface DDMXSD {
036    
037            public String getFieldHTML(
038                            HttpServletRequest request, HttpServletResponse response,
039                            Element element, Fields fields, String portletNamespace,
040                            String namespace, String mode, boolean readOnly, Locale locale)
041                    throws Exception;
042    
043            public String getFieldHTMLByName(
044                            HttpServletRequest request, HttpServletResponse response,
045                            long classNameId, long classPK, String fieldName, Fields fields,
046                            String portletNamespace, String namespace, String mode,
047                            boolean readOnly, Locale locale)
048                    throws Exception;
049    
050            public String getHTML(
051                            HttpServletRequest request, HttpServletResponse response,
052                            DDMStructure ddmStructure, Fields fields, String portletNamespace,
053                            String namespace, boolean readOnly, Locale locale)
054                    throws Exception;
055    
056            public String getHTML(
057                            HttpServletRequest request, HttpServletResponse response,
058                            DDMTemplate ddmTemplate, Fields fields, String portletNamespace,
059                            String namespace, boolean readOnly, Locale locale)
060                    throws Exception;
061    
062            public String getHTML(
063                            HttpServletRequest request, HttpServletResponse response,
064                            String xml, Fields fields, String portletNamespace, Locale locale)
065                    throws Exception;
066    
067            public String getHTML(
068                            HttpServletRequest request, HttpServletResponse response,
069                            String xml, Fields fields, String portletNamespace,
070                            String namespace, boolean readOnly, Locale locale)
071                    throws Exception;
072    
073            public String getHTML(
074                            HttpServletRequest request, HttpServletResponse response,
075                            String xml, Fields fields, String portletNamespace,
076                            String namespace, Locale locale)
077                    throws Exception;
078    
079            public String getHTML(
080                            HttpServletRequest request, HttpServletResponse response,
081                            String xml, Fields fields, String portletNamespace,
082                            String namespace, String mode, boolean readOnly, Locale locale)
083                    throws Exception;
084    
085            public String getHTML(
086                            HttpServletRequest request, HttpServletResponse response,
087                            String xml, String portletNamespace, Locale locale)
088                    throws Exception;
089    
090            public JSONArray getJSONArray(DDMStructure structure, String xsd)
091                    throws PortalException;
092    
093            public JSONArray getJSONArray(Document document) throws PortalException;
094    
095            public JSONArray getJSONArray(Element element) throws PortalException;
096    
097            public JSONArray getJSONArray(String xml) throws PortalException;
098    
099            public String getSimpleFieldHTML(
100                            HttpServletRequest request, HttpServletResponse response,
101                            Element element, Field field, String portletNamespace,
102                            String namespace, String mode, boolean readOnly, Locale locale)
103                    throws Exception;
104    
105            public String getSimpleFieldHTMLByName(
106                            HttpServletRequest request, HttpServletResponse response,
107                            long classNameId, long classPK, Field field,
108                            String portletNamespace, String namespace, String mode,
109                            boolean readOnly, Locale locale)
110                    throws Exception;
111    
112            public String getXSD(long classNameId, long classPK) throws PortalException;
113    
114            public String getXSD(String json) throws PortalException;
115    
116    }