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