001    /**
002     * Copyright (c) 2000-present 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;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.service.ServiceContext;
019    
020    import java.io.File;
021    
022    import java.util.Locale;
023    import java.util.Map;
024    
025    /**
026     * @author Marcellus Tavares
027     */
028    public interface DDMTemplateManager {
029    
030            public static final String TEMPLATE_MODE_CREATE = "create";
031    
032            public static final String TEMPLATE_TYPE_DISPLAY = "display";
033    
034            public static final String TEMPLATE_TYPE_MACRO = "macro";
035    
036            public static final String TEMPLATE_VERSION_DEFAULT = "1.0";
037    
038            public DDMTemplate addTemplate(
039                            long userId, long groupId, long classNameId, long classPK,
040                            long resourceClassNameId, String templateKey,
041                            Map<Locale, String> nameMap, Map<Locale, String> descriptionMap,
042                            String type, String mode, String language, String script,
043                            boolean cacheable, boolean smallImage, String smallImageURL,
044                            File smallImageFile, ServiceContext serviceContext)
045                    throws PortalException;
046    
047            public DDMTemplate fetchTemplate(
048                    long groupId, long classNameId, String templateKey);
049    
050            public DDMTemplate getTemplate(long templateId) throws PortalException;
051    
052    }