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