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.storage.Fields;
023    
024    import java.util.Locale;
025    
026    import javax.servlet.jsp.PageContext;
027    
028    /**
029     * @author Eduardo Lundgren
030     * @author Brian Wing Shun Chan
031     */
032    public interface DDMXSD {
033    
034            public String getHTML(
035                            PageContext pageContext, Document document, Locale locale)
036                    throws Exception;
037    
038            public String getHTML(
039                            PageContext pageContext, Document document, Fields fields,
040                            Locale locale)
041                    throws Exception;
042    
043            public String getHTML(
044                            PageContext pageContext, Document document, Fields fields,
045                            String namespace, boolean readOnly, Locale locale)
046                    throws Exception;
047    
048            public String getHTML(
049                            PageContext pageContext, Element element, Locale locale)
050                    throws Exception;
051    
052            public String getHTML(PageContext pageContext, String xml, Locale locale)
053                    throws Exception;
054    
055            public String getHTML(
056                            PageContext pageContext, String xml, Fields fields, Locale locale)
057                    throws Exception;
058    
059            public String getHTML(
060                            PageContext pageContext, String xml, Fields fields,
061                            String namespace, Locale locale)
062                    throws Exception;
063    
064            public String getHTML(
065                            PageContext pageContext, String xml, Fields fields,
066                            String namespace, boolean readOnly, Locale locale)
067                    throws Exception;
068    
069            public JSONArray getJSONArray(Document document) throws JSONException;
070    
071            public JSONArray getJSONArray(Element element) throws JSONException;
072    
073            public JSONArray getJSONArray(String xml)
074                    throws DocumentException, JSONException;
075    
076    }