001    /**
002     * Copyright (c) 2000-2011 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.json.JSONArray;
018    import com.liferay.portal.kernel.json.JSONException;
019    import com.liferay.portal.kernel.xml.Document;
020    import com.liferay.portal.kernel.xml.DocumentException;
021    import com.liferay.portal.kernel.xml.Element;
022    import com.liferay.portlet.dynamicdatamapping.model.DDMTemplate;
023    import com.liferay.portlet.dynamicdatamapping.storage.Fields;
024    
025    import java.util.Locale;
026    
027    import javax.servlet.jsp.PageContext;
028    
029    /**
030     * @author Eduardo Lundgren
031     * @author Brian Wing Shun Chan
032     */
033    public interface DDMXSD {
034    
035            public String getHTML(
036                            PageContext pageContext, DDMTemplate ddmTemplate, Fields fields,
037                            Locale locale)
038                    throws Exception;
039    
040            public String getHTML(
041                            PageContext pageContext, Document document, Fields fields,
042                            Locale locale)
043                    throws Exception;
044    
045            public String getHTML(
046                            PageContext pageContext, Document document, Fields fields,
047                            String namespace, boolean readOnly, Locale locale)
048                    throws Exception;
049    
050            public String getHTML(
051                            PageContext pageContext, Document document, Fields fields,
052                            String namespace, String mode, boolean readOnly, Locale locale)
053                    throws Exception;
054    
055            public String getHTML(
056                            PageContext pageContext, Document document, Locale locale)
057                    throws Exception;
058    
059            public String getHTML(
060                            PageContext pageContext, Element element, Locale locale)
061                    throws Exception;
062    
063            public String getHTML(
064                            PageContext pageContext, String xml, Fields fields, Locale locale)
065                    throws Exception;
066    
067            public String getHTML(
068                            PageContext pageContext, String xml, Fields fields,
069                            String namespace, boolean readOnly, Locale locale)
070                    throws Exception;
071    
072            public String getHTML(
073                            PageContext pageContext, String xml, Fields fields,
074                            String namespace, Locale locale)
075                    throws Exception;
076    
077            public String getHTML(PageContext pageContext, String xml, Locale locale)
078                    throws Exception;
079    
080            public JSONArray getJSONArray(Document document) throws JSONException;
081    
082            public JSONArray getJSONArray(Element element) throws JSONException;
083    
084            public JSONArray getJSONArray(String xml)
085                    throws DocumentException, JSONException;
086    
087    }