001    /**
002     * Copyright (c) 2000-2012 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 java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search(
084                    long companyId, long groupId, long structureId,
085                    java.lang.String keywords, java.lang.String type,
086                    java.lang.String mode, int start, int end,
087                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
088                    throws com.liferay.portal.kernel.exception.SystemException {
089                    return getService()
090                                       .search(companyId, groupId, structureId, keywords, type,
091                            mode, start, end, orderByComparator);
092            }
093    
094            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search(
095                    long companyId, long groupId, long structureId, java.lang.String name,
096                    java.lang.String description, java.lang.String type,
097                    java.lang.String mode, java.lang.String language, boolean andOperator,
098                    int start, int end,
099                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
100                    throws com.liferay.portal.kernel.exception.SystemException {
101                    return getService()
102                                       .search(companyId, groupId, structureId, name, description,
103                            type, mode, language, andOperator, start, end, orderByComparator);
104            }
105    
106            public static int searchCount(long companyId, long groupId,
107                    long structureId, java.lang.String keywords, java.lang.String type,
108                    java.lang.String mode)
109                    throws com.liferay.portal.kernel.exception.SystemException {
110                    return getService()
111                                       .searchCount(companyId, groupId, structureId, keywords,
112                            type, mode);
113            }
114    
115            public static int searchCount(long companyId, long groupId,
116                    long structureId, java.lang.String name, java.lang.String description,
117                    java.lang.String type, java.lang.String mode,
118                    java.lang.String language, boolean andOperator)
119                    throws com.liferay.portal.kernel.exception.SystemException {
120                    return getService()
121                                       .searchCount(companyId, groupId, structureId, name,
122                            description, type, mode, language, andOperator);
123            }
124    
125            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate updateTemplate(
126                    long templateId,
127                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
128                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
129                    java.lang.String type, java.lang.String mode,
130                    java.lang.String language, java.lang.String script,
131                    com.liferay.portal.service.ServiceContext serviceContext)
132                    throws com.liferay.portal.kernel.exception.PortalException,
133                            com.liferay.portal.kernel.exception.SystemException {
134                    return getService()
135                                       .updateTemplate(templateId, nameMap, descriptionMap, type,
136                            mode, language, script, serviceContext);
137            }
138    
139            public static DDMTemplateService getService() {
140                    if (_service == null) {
141                            _service = (DDMTemplateService)PortalBeanLocatorUtil.locate(DDMTemplateService.class.getName());
142    
143                            ReferenceRegistry.registerReference(DDMTemplateServiceUtil.class,
144                                    "_service");
145                            MethodCache.remove(DDMTemplateService.class);
146                    }
147    
148                    return _service;
149            }
150    
151            public void setService(DDMTemplateService service) {
152                    MethodCache.remove(DDMTemplateService.class);
153    
154                    _service = service;
155    
156                    ReferenceRegistry.registerReference(DDMTemplateServiceUtil.class,
157                            "_service");
158                    MethodCache.remove(DDMTemplateService.class);
159            }
160    
161            private static DDMTemplateService _service;
162    }