001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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.model.BaseModel;
020    import com.liferay.portal.service.ServiceContext;
021    import com.liferay.portlet.dynamicdatamapping.storage.Field;
022    import com.liferay.portlet.dynamicdatamapping.storage.Fields;
023    
024    import javax.servlet.http.HttpServletRequest;
025    import javax.servlet.http.HttpServletResponse;
026    
027    /**
028     * @author Eduardo Lundgren
029     */
030    public interface DDM {
031    
032            public Fields getFields(
033                            long ddmStructureId, long ddmTemplateId,
034                            ServiceContext serviceContext)
035                    throws PortalException, SystemException;
036    
037            public Fields getFields(
038                            long ddmStructureId, long ddmTemplateId, String fieldNamespace,
039                            ServiceContext serviceContext)
040                    throws PortalException, SystemException;
041    
042            public Fields getFields(long ddmStructureId, ServiceContext serviceContext)
043                    throws PortalException, SystemException;
044    
045            public Fields getFields(
046                            long ddmStructureId, String fieldNamespace,
047                            ServiceContext serviceContext)
048                    throws PortalException, SystemException;
049    
050            public String getFileUploadPath(BaseModel<?> baseModel);
051    
052            public void sendFieldFile(
053                            HttpServletRequest request, HttpServletResponse response,
054                            Field field)
055                    throws Exception;
056    
057            public String uploadFieldFile(
058                            long structureId, long storageId, BaseModel<?> baseModel,
059                            String fieldName, ServiceContext serviceContext)
060                    throws Exception;
061    
062            public String uploadFieldFile(
063                            long structureId, long storageId, BaseModel<?> baseModel,
064                            String fieldName, String fieldNamespace,
065                            ServiceContext serviceContext)
066                    throws Exception;
067    
068    }