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.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    }