001    /**
002     * Copyright (c) 2000-2012 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 namespace, String mode, boolean readOnly, Locale locale)
039                    throws Exception;
040    
041            public String getFieldHTMLByName(
042                            PageContext pageContext, long classNameId, long classPK,
043                            String fieldName, int repeatableIndex, Fields fields,
044                            String namespace, String mode, boolean readOnly, Locale locale)
045                    throws Exception;
046    
047            public String getHTML(
048                            PageContext pageContext, DDMStructure ddmStructure, Fields fields,
049                            String namespace, boolean readOnly, Locale locale)
050                    throws Exception;
051    
052            public String getHTML(
053                            PageContext pageContext, DDMTemplate ddmTemplate, Fields fields,
054                            String namespace, boolean readOnly, Locale locale)
055                    throws Exception;
056    
057            public String getHTML(
058                            PageContext pageContext, String xml, Fields fields, Locale locale)
059                    throws Exception;
060    
061            public String getHTML(
062                            PageContext pageContext, String xml, Fields fields,
063                            String namespace, boolean readOnly, Locale locale)
064                    throws Exception;
065    
066            public String getHTML(
067                            PageContext pageContext, String xml, Fields fields,
068                            String namespace, Locale locale)
069                    throws Exception;
070    
071            public String getHTML(PageContext pageContext, String xml, Locale locale)
072                    throws Exception;
073    
074            public JSONArray getJSONArray(DDMStructure structure, String xsd)
075                    throws PortalException, SystemException;
076    
077            public JSONArray getJSONArray(Document document) throws PortalException;
078    
079            public JSONArray getJSONArray(Element element) throws PortalException;
080    
081            public JSONArray getJSONArray(String xml)
082                    throws PortalException, SystemException;
083    
084            public String getXSD(long classNameId, long classPK)
085                    throws PortalException, SystemException;
086    
087    }