001    /**
002     * Copyright (c) 2000-2011 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.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.MethodCache;
019    import com.liferay.portal.kernel.util.ReferenceRegistry;
020    
021    /**
022     * The utility for the d d m template remote service. This utility wraps {@link com.liferay.portlet.dynamicdatamapping.service.impl.DDMTemplateServiceImpl} and is the primary access point for service operations in application layer code running on a remote server.
023     *
024     * <p>
025     * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see DDMTemplateService
030     * @see com.liferay.portlet.dynamicdatamapping.service.base.DDMTemplateServiceBaseImpl
031     * @see com.liferay.portlet.dynamicdatamapping.service.impl.DDMTemplateServiceImpl
032     * @generated
033     */
034    public class DDMTemplateServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.dynamicdatamapping.service.impl.DDMTemplateServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate addTemplate(
041                    long groupId, long structureId,
042                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
043                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
044                    java.lang.String type, java.lang.String mode,
045                    java.lang.String language, java.lang.String script,
046                    com.liferay.portal.service.ServiceContext serviceContext)
047                    throws com.liferay.portal.kernel.exception.PortalException,
048                            com.liferay.portal.kernel.exception.SystemException {
049                    return getService()
050                                       .addTemplate(groupId, structureId, nameMap, descriptionMap,
051                            type, mode, language, script, serviceContext);
052            }
053    
054            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> copyTemplates(
055                    long structureId, long newStructureId, java.lang.String type,
056                    com.liferay.portal.service.ServiceContext serviceContext)
057                    throws com.liferay.portal.kernel.exception.PortalException,
058                            com.liferay.portal.kernel.exception.SystemException {
059                    return getService()
060                                       .copyTemplates(structureId, newStructureId, type,
061                            serviceContext);
062            }
063    
064            public static void deleteTemplate(long templateId)
065                    throws com.liferay.portal.kernel.exception.PortalException,
066                            com.liferay.portal.kernel.exception.SystemException {
067                    getService().deleteTemplate(templateId);
068            }
069    
070            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getTemplate(
071                    long templateId)
072                    throws com.liferay.portal.kernel.exception.PortalException,
073                            com.liferay.portal.kernel.exception.SystemException {
074                    return getService().getTemplate(templateId);
075            }
076    
077            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates(
078                    long structureId, java.lang.String type, java.lang.String mode)
079                    throws com.liferay.portal.kernel.exception.SystemException {
080                    return getService().getTemplates(structureId, type, mode);
081            }
082    
083            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate updateTemplate(
084                    long templateId,
085                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
086                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
087                    java.lang.String type, java.lang.String mode,
088                    java.lang.String language, java.lang.String script,
089                    com.liferay.portal.service.ServiceContext serviceContext)
090                    throws com.liferay.portal.kernel.exception.PortalException,
091                            com.liferay.portal.kernel.exception.SystemException {
092                    return getService()
093                                       .updateTemplate(templateId, nameMap, descriptionMap, type,
094                            mode, language, script, serviceContext);
095            }
096    
097            public static DDMTemplateService getService() {
098                    if (_service == null) {
099                            _service = (DDMTemplateService)PortalBeanLocatorUtil.locate(DDMTemplateService.class.getName());
100    
101                            ReferenceRegistry.registerReference(DDMTemplateServiceUtil.class,
102                                    "_service");
103                            MethodCache.remove(DDMTemplateService.class);
104                    }
105    
106                    return _service;
107            }
108    
109            public void setService(DDMTemplateService service) {
110                    MethodCache.remove(DDMTemplateService.class);
111    
112                    _service = service;
113    
114                    ReferenceRegistry.registerReference(DDMTemplateServiceUtil.class,
115                            "_service");
116                    MethodCache.remove(DDMTemplateService.class);
117            }
118    
119            private static DDMTemplateService _service;
120    }