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.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.json.JSONArray;
020    import com.liferay.portal.kernel.xml.Document;
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 getFieldHTML(
037                            PageContext pageContext, Element element, Fields fields,
038                            String portletNamespace, String namespace, String mode,
039                            boolean readOnly, Locale locale)
040                    throws Exception;
041    
042            public String getFieldHTML(
043                            PageContext pageContext, Element element, String portletNamespace,
044                            String namespace, String mode, boolean readOnly, Locale locale)
045                    throws Exception;
046    
047            public String getFieldHTMLByName(
048                            PageContext pageContext, long classNameId, long classPK,
049                            String fieldName, Fields fields, String portletNamespace,
050                            String namespace, String mode, boolean readOnly, Locale locale)
051                    throws Exception;
052    
053            public String getFieldHTMLByName(
054                            PageContext pageContext, long classNameId, long classPK,
055                            String fieldName, String portletNamespace, String namespace,
056                            String mode, boolean readOnly, Locale locale)
057                    throws Exception;
058    
059            public String getHTML(
060                            PageContext pageContext, DDMStructure ddmStructure, Fields fields,
061                            String portletNamespace, String namespace, boolean readOnly,
062                            Locale locale)
063                    throws Exception;
064    
065            public String getHTML(
066                            PageContext pageContext, DDMTemplate ddmTemplate, Fields fields,
067                            String portletNamespace, String namespace, boolean readOnly,
068                            Locale locale)
069                    throws Exception;
070    
071            public String getHTML(
072                            PageContext pageContext, String xml, Fields fields,
073                            String portletNamespace, Locale locale)
074                    throws Exception;
075    
076            public String getHTML(
077                            PageContext pageContext, String xml, Fields fields,
078                            String portletNamespace, String namespace, boolean readOnly,
079                            Locale locale)
080                    throws Exception;
081    
082            public String getHTML(
083                            PageContext pageContext, String xml, Fields fields,
084                            String portletNamespace, String namespace, Locale locale)
085                    throws Exception;
086    
087            public String getHTML(
088                            PageContext pageContext, String xml, String portletNamespace,
089                            Locale locale)
090                    throws Exception;
091    
092            public JSONArray getJSONArray(DDMStructure structure, String xsd)
093                    throws PortalException, SystemException;
094    
095            public JSONArray getJSONArray(Document document) throws PortalException;
096    
097            public JSONArray getJSONArray(Element element) throws PortalException;
098    
099            public JSONArray getJSONArray(String xml)
100                    throws PortalException, SystemException;
101    
102            public String getXSD(long classNameId, long classPK)
103                    throws PortalException, SystemException;
104    
105    }