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.ReferenceRegistry;
019    
020    /**
021     * 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.
022     *
023     * <p>
024     * 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.
025     * </p>
026     *
027     * @author Brian Wing Shun Chan
028     * @see DDMTemplateService
029     * @see com.liferay.portlet.dynamicdatamapping.service.base.DDMTemplateServiceBaseImpl
030     * @see com.liferay.portlet.dynamicdatamapping.service.impl.DDMTemplateServiceImpl
031     * @generated
032     */
033    public class DDMTemplateServiceUtil {
034            /*
035             * NOTE FOR DEVELOPERS:
036             *
037             * 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.
038             */
039    
040            /**
041            * Returns the Spring bean ID for this bean.
042            *
043            * @return the Spring bean ID for this bean
044            */
045            public static java.lang.String getBeanIdentifier() {
046                    return getService().getBeanIdentifier();
047            }
048    
049            /**
050            * Sets the Spring bean ID for this bean.
051            *
052            * @param beanIdentifier the Spring bean ID for this bean
053            */
054            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
055                    getService().setBeanIdentifier(beanIdentifier);
056            }
057    
058            /**
059            * Adds a template.
060            *
061            * @param groupId the primary key of the group
062            * @param classNameId the primary key of the class name for template's
063            related model
064            * @param classPK the primary key of the template's related entity
065            * @param nameMap the template's locales and localized names
066            * @param descriptionMap the template's locales and localized descriptions
067            * @param type the template's type. For more information, see {@link
068            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
069            * @param mode the template's mode. For more information, see {@link
070            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
071            * @param language the template's script language. For more information,
072            see {@link
073            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
074            * @param script the template's script
075            * @param serviceContext the template's service context. Must have the
076            <code>ddmResource</code> attribute to check permissions. Can set
077            the UUID, creation date, modification date, guest permissions,
078            and group permissions for the template.
079            * @return the template
080            * @throws PortalException if the user did not have permission to add the
081            template or if a portal exception occurred
082            * @throws SystemException if a system exception occurred
083            */
084            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate addTemplate(
085                    long groupId, long classNameId, long classPK,
086                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
087                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
088                    java.lang.String type, java.lang.String mode,
089                    java.lang.String language, java.lang.String script,
090                    com.liferay.portal.service.ServiceContext serviceContext)
091                    throws com.liferay.portal.kernel.exception.PortalException,
092                            com.liferay.portal.kernel.exception.SystemException {
093                    return getService()
094                                       .addTemplate(groupId, classNameId, classPK, nameMap,
095                            descriptionMap, type, mode, language, script, serviceContext);
096            }
097    
098            /**
099            * Adds a template with additional parameters.
100            *
101            * @param groupId the primary key of the group
102            * @param classNameId the primary key of the class name for template's
103            related model
104            * @param classPK the primary key of the template's related entity
105            * @param templateKey the unique string identifying the template
106            (optionally <code>null</code>)
107            * @param nameMap the template's locales and localized names
108            * @param descriptionMap the template's locales and localized descriptions
109            * @param type the template's type. For more information, see {@link
110            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
111            * @param mode the template's mode. For more information, see {@link
112            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
113            * @param language the template's script language. For more information,
114            see {@link
115            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
116            * @param script the template's script
117            * @param cacheable whether the template is cacheable
118            * @param smallImage whether the template has a small image
119            * @param smallImageURL the template's small image URL (optionally
120            <code>null</code>)
121            * @param smallImageFile the template's small image file (optionally
122            <code>null</code>)
123            * @param serviceContext the template's service context. Must have the
124            <code>ddmResource</code> attribute to check permissions. Can set
125            the UUID, creation date, modification date, guest permissions,
126            and group permissions for the template.
127            * @return the template
128            * @throws PortalException if the user did not have permission to add the
129            template or if a portal exception occurred
130            * @throws SystemException if a system exception occurred
131            */
132            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate addTemplate(
133                    long groupId, long classNameId, long classPK,
134                    java.lang.String templateKey,
135                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
136                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
137                    java.lang.String type, java.lang.String mode,
138                    java.lang.String language, java.lang.String script, boolean cacheable,
139                    boolean smallImage, java.lang.String smallImageURL,
140                    java.io.File smallImageFile,
141                    com.liferay.portal.service.ServiceContext serviceContext)
142                    throws com.liferay.portal.kernel.exception.PortalException,
143                            com.liferay.portal.kernel.exception.SystemException {
144                    return getService()
145                                       .addTemplate(groupId, classNameId, classPK, templateKey,
146                            nameMap, descriptionMap, type, mode, language, script, cacheable,
147                            smallImage, smallImageURL, smallImageFile, serviceContext);
148            }
149    
150            /**
151            * Copies the template, creating a new template with all the values
152            * extracted from the original one. This method supports defining a new name
153            * and description.
154            *
155            * @param templateId the primary key of the template to be copied
156            * @param nameMap the new template's locales and localized names
157            * @param descriptionMap the new template's locales and localized
158            descriptions
159            * @param serviceContext the service context to be applied. Must have the
160            <code>ddmResource</code> attribute to check permissions. Can set
161            the UUID, creation date, modification date, guest permissions,
162            and group permissions for the template.
163            * @return the new template
164            * @throws PortalException if the user did not have permission to add the
165            template or if a portal exception occurred
166            * @throws SystemException if a system exception occurred
167            */
168            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate copyTemplate(
169                    long templateId,
170                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
171                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
172                    com.liferay.portal.service.ServiceContext serviceContext)
173                    throws com.liferay.portal.kernel.exception.PortalException,
174                            com.liferay.portal.kernel.exception.SystemException {
175                    return getService()
176                                       .copyTemplate(templateId, nameMap, descriptionMap,
177                            serviceContext);
178            }
179    
180            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate copyTemplate(
181                    long templateId,
182                    com.liferay.portal.service.ServiceContext serviceContext)
183                    throws com.liferay.portal.kernel.exception.PortalException,
184                            com.liferay.portal.kernel.exception.SystemException {
185                    return getService().copyTemplate(templateId, serviceContext);
186            }
187    
188            /**
189            * Copies all the templates matching the class name ID, class PK, and type.
190            * This method creates new templates, extracting all the values from the old
191            * ones and updating their class PKs.
192            *
193            * @param classNameId the primary key of the class name for template's
194            related model
195            * @param classPK the primary key of the original template's related entity
196            * @param newClassPK the primary key of the new template's related entity
197            * @param type the template's type. For more information, see {@link
198            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
199            * @param serviceContext the service context to be applied. Must have the
200            <code>ddmResource</code> attribute to check permissions. Can set
201            the UUID, creation date, modification date, guest permissions,
202            and group permissions for the template.
203            * @return the new template
204            * @throws PortalException if the user did not have permission to add the
205            template or if a portal exception occurred
206            * @throws SystemException if a system exception occurred
207            */
208            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> copyTemplates(
209                    long classNameId, long classPK, long newClassPK, java.lang.String type,
210                    com.liferay.portal.service.ServiceContext serviceContext)
211                    throws com.liferay.portal.kernel.exception.PortalException,
212                            com.liferay.portal.kernel.exception.SystemException {
213                    return getService()
214                                       .copyTemplates(classNameId, classPK, newClassPK, type,
215                            serviceContext);
216            }
217    
218            /**
219            * Deletes the template and its resources.
220            *
221            * @param templateId the primary key of the template to be deleted
222            * @throws PortalException if the user did not have permission to delete the
223            template or if a portal exception occurred
224            * @throws SystemException if a system exception occurred
225            */
226            public static void deleteTemplate(long templateId)
227                    throws com.liferay.portal.kernel.exception.PortalException,
228                            com.liferay.portal.kernel.exception.SystemException {
229                    getService().deleteTemplate(templateId);
230            }
231    
232            /**
233            * Returns the template matching the group and template key.
234            *
235            * @param groupId the primary key of the group
236            * @param classNameId the primary key of the class name for template's
237            related model
238            * @param templateKey the unique string identifying the template
239            * @return the matching template, or <code>null</code> if a matching
240            template could not be found
241            * @throws PortalException if the user did not have permission to delete the
242            template
243            * @throws SystemException if a system exception occurred
244            */
245            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate fetchTemplate(
246                    long groupId, long classNameId, java.lang.String templateKey)
247                    throws com.liferay.portal.kernel.exception.PortalException,
248                            com.liferay.portal.kernel.exception.SystemException {
249                    return getService().fetchTemplate(groupId, classNameId, templateKey);
250            }
251    
252            /**
253            * Returns the template with the ID.
254            *
255            * @param templateId the primary key of the template
256            * @return the template with the ID
257            * @throws PortalException if the user did not have permission to view the
258            template or if a matching template could not be found
259            * @throws SystemException if a system exception occurred
260            */
261            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getTemplate(
262                    long templateId)
263                    throws com.liferay.portal.kernel.exception.PortalException,
264                            com.liferay.portal.kernel.exception.SystemException {
265                    return getService().getTemplate(templateId);
266            }
267    
268            /**
269            * Returns the template matching the group and template key.
270            *
271            * @param groupId the primary key of the group
272            * @param classNameId the primary key of the class name for template's
273            related model
274            * @param templateKey the unique string identifying the template
275            * @return the matching template
276            * @throws PortalException if a matching template could not be found
277            * @throws SystemException if a system exception occurred
278            */
279            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getTemplate(
280                    long groupId, long classNameId, java.lang.String templateKey)
281                    throws com.liferay.portal.kernel.exception.PortalException,
282                            com.liferay.portal.kernel.exception.SystemException {
283                    return getService().getTemplate(groupId, classNameId, templateKey);
284            }
285    
286            /**
287            * Returns the template matching the group and template key, optionally in
288            * the global scope.
289            *
290            * <p>
291            * This method first searches in the group. If the template is still not
292            * found and <code>includeGlobalTemplates</code> is set to
293            * <code>true</code>, this method searches the global group.
294            * </p>
295            *
296            * @param groupId the primary key of the group
297            * @param classNameId the primary key of the class name for template's
298            related model
299            * @param templateKey the unique string identifying the template
300            * @param includeGlobalTemplates whether to include the global scope in the
301            search
302            * @return the matching template
303            * @throws PortalException if a matching template could not be found
304            * @throws SystemException if a system exception occurred
305            */
306            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getTemplate(
307                    long groupId, long classNameId, java.lang.String templateKey,
308                    boolean includeGlobalTemplates)
309                    throws com.liferay.portal.kernel.exception.PortalException,
310                            com.liferay.portal.kernel.exception.SystemException {
311                    return getService()
312                                       .getTemplate(groupId, classNameId, templateKey,
313                            includeGlobalTemplates);
314            }
315    
316            /**
317            * Returns all the templates matching the group and class name ID.
318            *
319            * @param groupId the primary key of the group
320            * @param classNameId the primary key of the class name for template's
321            related model
322            * @return the matching templates
323            * @throws SystemException if a system exception occurred
324            */
325            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates(
326                    long groupId, long classNameId)
327                    throws com.liferay.portal.kernel.exception.SystemException {
328                    return getService().getTemplates(groupId, classNameId);
329            }
330    
331            /**
332            * Returns all the templates matching the group, class name ID, and class
333            * PK.
334            *
335            * @param groupId the primary key of the group
336            * @param classNameId the primary key of the class name for template's
337            related model
338            * @param classPK the primary key of the template's related entity
339            * @return the matching templates
340            * @throws SystemException if a system exception occurred
341            */
342            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates(
343                    long groupId, long classNameId, long classPK)
344                    throws com.liferay.portal.kernel.exception.SystemException {
345                    return getService().getTemplates(groupId, classNameId, classPK);
346            }
347    
348            /**
349            * Returns all the templates matching the class name ID, class PK, type, and
350            * mode.
351            *
352            * @param groupId the primary key of the group
353            * @param classNameId the primary key of the class name for template's
354            related model
355            * @param classPK the primary key of the template's related entity
356            * @param type the template's type. For more information, see {@link
357            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
358            * @return the matching templates
359            * @throws SystemException if a system exception occurred
360            */
361            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates(
362                    long groupId, long classNameId, long classPK, java.lang.String type)
363                    throws com.liferay.portal.kernel.exception.SystemException {
364                    return getService().getTemplates(groupId, classNameId, classPK, type);
365            }
366    
367            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates(
368                    long groupId, long classNameId, long classPK, java.lang.String type,
369                    java.lang.String mode)
370                    throws com.liferay.portal.kernel.exception.SystemException {
371                    return getService()
372                                       .getTemplates(groupId, classNameId, classPK, type, mode);
373            }
374    
375            /**
376            * Returns an ordered range of all the templates matching the group, class
377            * name ID, class PK, type, and mode, and matching the keywords in the
378            * template names and descriptions.
379            *
380            * <p>
381            * Useful when paginating results. Returns a maximum of <code>end -
382            * start</code> instances. <code>start</code> and <code>end</code> are not
383            * primary keys, they are indexes in the result set. Thus, <code>0</code>
384            * refers to the first result in the set. Setting both <code>start</code>
385            * and <code>end</code> to {@link
386            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
387            * result set.
388            * </p>
389            *
390            * @param companyId the primary key of the template's company
391            * @param groupId the primary key of the group
392            * @param classNameId the primary key of the class name for template's
393            related model
394            * @param classPK the primary key of the template's related entity
395            * @param keywords the keywords (space separated), which may occur in the
396            template's name or description (optionally <code>null</code>)
397            * @param type the template's type (optionally <code>null</code>). For more
398            information, see {@link
399            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
400            * @param mode the template's mode (optionally <code>null</code>) For more
401            information, see {@link
402            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
403            * @param start the lower bound of the range of templates to return
404            * @param end the upper bound of the range of templates to return (not
405            inclusive)
406            * @param orderByComparator the comparator to order the templates
407            (optionally <code>null</code>)
408            * @return the matching templates ordered by the comparator
409            * @throws SystemException if a system exception occurred
410            */
411            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search(
412                    long companyId, long groupId, long classNameId, long classPK,
413                    java.lang.String keywords, java.lang.String type,
414                    java.lang.String mode, int start, int end,
415                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
416                    throws com.liferay.portal.kernel.exception.SystemException {
417                    return getService()
418                                       .search(companyId, groupId, classNameId, classPK, keywords,
419                            type, mode, start, end, orderByComparator);
420            }
421    
422            /**
423            * Returns an ordered range of all the templates matching the group, class
424            * name ID, class PK, name keyword, description keyword, type, mode, and
425            * language.
426            *
427            * <p>
428            * Useful when paginating results. Returns a maximum of <code>end -
429            * start</code> instances. <code>start</code> and <code>end</code> are not
430            * primary keys, they are indexes in the result set. Thus, <code>0</code>
431            * refers to the first result in the set. Setting both <code>start</code>
432            * and <code>end</code> to {@link
433            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
434            * result set.
435            * </p>
436            *
437            * @param companyId the primary key of the template's company
438            * @param groupId the primary key of the group
439            * @param classNameId the primary key of the class name for template's
440            related model
441            * @param classPK the primary key of the template's related entity
442            * @param name the name keywords (optionally <code>null</code>)
443            * @param description the description keywords (optionally
444            <code>null</code>)
445            * @param type the template's type (optionally <code>null</code>). For more
446            information, see {@link
447            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
448            * @param mode the template's mode (optionally <code>null</code>). For more
449            information, see {@link
450            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
451            * @param language the template's script language (optionally
452            <code>null</code>). For more information, see {@link
453            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
454            * @param andOperator whether every field must match its keywords, or just
455            one field.
456            * @param start the lower bound of the range of templates to return
457            * @param end the upper bound of the range of templates to return (not
458            inclusive)
459            * @param orderByComparator the comparator to order the templates
460            (optionally <code>null</code>)
461            * @return the matching templates ordered by the comparator
462            * @throws SystemException if a system exception occurred
463            */
464            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search(
465                    long companyId, long groupId, long classNameId, long classPK,
466                    java.lang.String name, java.lang.String description,
467                    java.lang.String type, java.lang.String mode,
468                    java.lang.String language, boolean andOperator, int start, int end,
469                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
470                    throws com.liferay.portal.kernel.exception.SystemException {
471                    return getService()
472                                       .search(companyId, groupId, classNameId, classPK, name,
473                            description, type, mode, language, andOperator, start, end,
474                            orderByComparator);
475            }
476    
477            /**
478            * Returns an ordered range of all the templates matching the group IDs,
479            * class name IDs, class PK, type, and mode, and matching the keywords in
480            * the template names and descriptions.
481            *
482            * <p>
483            * Useful when paginating results. Returns a maximum of <code>end -
484            * start</code> instances. <code>start</code> and <code>end</code> are not
485            * primary keys, they are indexes in the result set. Thus, <code>0</code>
486            * refers to the first result in the set. Setting both <code>start</code>
487            * and <code>end</code> to {@link
488            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
489            * result set.
490            * </p>
491            *
492            * @param companyId the primary key of the template's company
493            * @param groupIds the primary keys of the groups
494            * @param classNameIds the primary keys of the entity's instances the
495            templates are related to
496            * @param classPK the primary key of the template's related entity
497            * @param keywords the keywords (space separated), which may occur in the
498            template's name or description (optionally <code>null</code>)
499            * @param type the template's type (optionally <code>null</code>). For more
500            information, see {@link
501            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
502            * @param mode the template's mode (optionally <code>null</code>). For more
503            information, see {@link
504            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
505            * @param start the lower bound of the range of templates to return
506            * @param end the upper bound of the range of templates to return (not
507            inclusive)
508            * @param orderByComparator the comparator to order the templates
509            (optionally <code>null</code>)
510            * @return the matching templates ordered by the comparator
511            * @throws SystemException if a system exception occurred
512            */
513            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search(
514                    long companyId, long[] groupIds, long[] classNameIds, long classPK,
515                    java.lang.String keywords, java.lang.String type,
516                    java.lang.String mode, int start, int end,
517                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
518                    throws com.liferay.portal.kernel.exception.SystemException {
519                    return getService()
520                                       .search(companyId, groupIds, classNameIds, classPK,
521                            keywords, type, mode, start, end, orderByComparator);
522            }
523    
524            /**
525            * Returns an ordered range of all the templates matching the group IDs,
526            * class name IDs, class PK, name keyword, description keyword, type, mode,
527            * and language.
528            *
529            * <p>
530            * Useful when paginating results. Returns a maximum of <code>end -
531            * start</code> instances. <code>start</code> and <code>end</code> are not
532            * primary keys, they are indexes in the result set. Thus, <code>0</code>
533            * refers to the first result in the set. Setting both <code>start</code>
534            * and <code>end</code> to {@link
535            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
536            * result set.
537            * </p>
538            *
539            * @param companyId the primary key of the template's company
540            * @param groupIds the primary keys of the groups
541            * @param classNameIds the primary keys of the entity's instances the
542            templates are related to
543            * @param classPK the primary key of the template's related entity
544            * @param name the name keywords (optionally <code>null</code>)
545            * @param description the description keywords (optionally
546            <code>null</code>)
547            * @param type the template's type (optionally <code>null</code>). For more
548            information, see {@link
549            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
550            * @param mode the template's mode (optionally <code>null</code>). For more
551            information, see {@link
552            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
553            * @param language the template's script language (optionally
554            <code>null</code>). For more information, see {@link
555            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
556            * @param andOperator whether every field must match its keywords, or just
557            one field.
558            * @param start the lower bound of the range of templates to return
559            * @param end the upper bound of the range of templates to return (not
560            inclusive)
561            * @param orderByComparator the comparator to order the templates
562            (optionally <code>null</code>)
563            * @return the matching templates ordered by the comparator
564            * @throws SystemException if a system exception occurred
565            */
566            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search(
567                    long companyId, long[] groupIds, long[] classNameIds, long classPK,
568                    java.lang.String name, java.lang.String description,
569                    java.lang.String type, java.lang.String mode,
570                    java.lang.String language, boolean andOperator, int start, int end,
571                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
572                    throws com.liferay.portal.kernel.exception.SystemException {
573                    return getService()
574                                       .search(companyId, groupIds, classNameIds, classPK, name,
575                            description, type, mode, language, andOperator, start, end,
576                            orderByComparator);
577            }
578    
579            /**
580            * Returns the number of templates matching the group, class name ID, class
581            * PK, type, and mode, and matching the keywords in the template names and
582            * descriptions.
583            *
584            * @param companyId the primary key of the template's company
585            * @param groupId the primary key of the group
586            * @param classNameId the primary key of the class name for template's
587            related model
588            * @param classPK the primary key of the template's related entity
589            * @param keywords the keywords (space separated), which may occur in the
590            template's name or description (optionally <code>null</code>)
591            * @param type the template's type (optionally <code>null</code>). For more
592            information, see {@link
593            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
594            * @param mode the template's mode (optionally <code>null</code>). For more
595            information, see {@link
596            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
597            * @return the number of matching templates
598            * @throws SystemException if a system exception occurred
599            */
600            public static int searchCount(long companyId, long groupId,
601                    long classNameId, long classPK, java.lang.String keywords,
602                    java.lang.String type, java.lang.String mode)
603                    throws com.liferay.portal.kernel.exception.SystemException {
604                    return getService()
605                                       .searchCount(companyId, groupId, classNameId, classPK,
606                            keywords, type, mode);
607            }
608    
609            /**
610            * Returns the number of templates matching the group, class name ID, class
611            * PK, name keyword, description keyword, type, mode, and language.
612            *
613            * @param companyId the primary key of the template's company
614            * @param groupId the primary key of the group
615            * @param classNameId the primary key of the class name for template's
616            related model
617            * @param classPK the primary key of the template's related entity
618            * @param name the name keywords (optionally <code>null</code>)
619            * @param description the description keywords (optionally
620            <code>null</code>)
621            * @param type the template's type (optionally <code>null</code>). For more
622            information, see {@link
623            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
624            * @param mode the template's mode (optionally <code>null</code>). For more
625            information, see {@link
626            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
627            * @param language the template's script language (optionally
628            <code>null</code>). For more information, see {@link
629            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
630            * @param andOperator whether every field must match its keywords, or just
631            one field.
632            * @return the number of matching templates
633            * @throws SystemException if a system exception occurred
634            */
635            public static int searchCount(long companyId, long groupId,
636                    long classNameId, long classPK, java.lang.String name,
637                    java.lang.String description, java.lang.String type,
638                    java.lang.String mode, java.lang.String language, boolean andOperator)
639                    throws com.liferay.portal.kernel.exception.SystemException {
640                    return getService()
641                                       .searchCount(companyId, groupId, classNameId, classPK, name,
642                            description, type, mode, language, andOperator);
643            }
644    
645            /**
646            * Returns the number of templates matching the group IDs, class name IDs,
647            * class PK, type, and mode, and matching the keywords in the template names
648            * and descriptions.
649            *
650            * @param companyId the primary key of the template's company
651            * @param groupIds the primary keys of the groups
652            * @param classNameIds the primary keys of the entity's instances the
653            templates are related to
654            * @param classPK the primary key of the template's related entity
655            * @param keywords the keywords (space separated), which may occur in the
656            template's name or description (optionally <code>null</code>)
657            * @param type the template's type (optionally <code>null</code>). For more
658            information, see {@link
659            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
660            * @param mode the template's mode (optionally <code>null</code>). For more
661            information, see {@link
662            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
663            * @return the number of matching templates
664            * @throws SystemException if a system exception occurred
665            */
666            public static int searchCount(long companyId, long[] groupIds,
667                    long[] classNameIds, long classPK, java.lang.String keywords,
668                    java.lang.String type, java.lang.String mode)
669                    throws com.liferay.portal.kernel.exception.SystemException {
670                    return getService()
671                                       .searchCount(companyId, groupIds, classNameIds, classPK,
672                            keywords, type, mode);
673            }
674    
675            /**
676            * Returns the number of templates matching the group IDs, class name IDs,
677            * class PK, name keyword, description keyword, type, mode, and language.
678            *
679            * @param companyId the primary key of the template's company
680            * @param groupIds the primary keys of the groups
681            * @param classNameIds the primary keys of the entity's instances the
682            templates are related to
683            * @param classPK the primary key of the template's related entity
684            * @param name the name keywords (optionally <code>null</code>)
685            * @param description the description keywords (optionally
686            <code>null</code>)
687            * @param type the template's type (optionally <code>null</code>). For more
688            information, see {@link
689            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
690            * @param mode the template's mode (optionally <code>null</code>). For more
691            information, see {@link
692            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
693            * @param language the template's script language (optionally
694            <code>null</code>). For more information, see {@link
695            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
696            * @param andOperator whether every field must match its keywords, or just
697            one field.
698            * @return the number of matching templates
699            * @throws SystemException if a system exception occurred
700            */
701            public static int searchCount(long companyId, long[] groupIds,
702                    long[] classNameIds, long classPK, java.lang.String name,
703                    java.lang.String description, java.lang.String type,
704                    java.lang.String mode, java.lang.String language, boolean andOperator)
705                    throws com.liferay.portal.kernel.exception.SystemException {
706                    return getService()
707                                       .searchCount(companyId, groupIds, classNameIds, classPK,
708                            name, description, type, mode, language, andOperator);
709            }
710    
711            /**
712            * Updates the template matching the ID.
713            *
714            * @param templateId the primary key of the template
715            * @param nameMap the template's new locales and localized names
716            * @param descriptionMap the template's new locales and localized
717            description
718            * @param type the template's type. For more information, see {@link
719            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
720            * @param mode the template's mode. For more information, see {@link
721            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
722            * @param language the template's script language. For more information,
723            see {@link
724            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
725            * @param script the template's script
726            * @param cacheable whether the template is cacheable
727            * @param smallImage whether the template has a small image
728            * @param smallImageURL the template's small image URL (optionally
729            <code>null</code>)
730            * @param smallImageFile the template's small image file (optionally
731            <code>null</code>)
732            * @param serviceContext the service context to be applied. Can set the
733            modification date.
734            * @return the updated template
735            * @throws PortalException if the user did not have permission to update the
736            template or if a portal exception occurred
737            * @throws SystemException if a system exception occurred
738            */
739            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate updateTemplate(
740                    long templateId,
741                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
742                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
743                    java.lang.String type, java.lang.String mode,
744                    java.lang.String language, java.lang.String script, boolean cacheable,
745                    boolean smallImage, java.lang.String smallImageURL,
746                    java.io.File smallImageFile,
747                    com.liferay.portal.service.ServiceContext serviceContext)
748                    throws com.liferay.portal.kernel.exception.PortalException,
749                            com.liferay.portal.kernel.exception.SystemException {
750                    return getService()
751                                       .updateTemplate(templateId, nameMap, descriptionMap, type,
752                            mode, language, script, cacheable, smallImage, smallImageURL,
753                            smallImageFile, serviceContext);
754            }
755    
756            public static DDMTemplateService getService() {
757                    if (_service == null) {
758                            _service = (DDMTemplateService)PortalBeanLocatorUtil.locate(DDMTemplateService.class.getName());
759    
760                            ReferenceRegistry.registerReference(DDMTemplateServiceUtil.class,
761                                    "_service");
762                    }
763    
764                    return _service;
765            }
766    
767            /**
768             * @deprecated
769             */
770            public void setService(DDMTemplateService service) {
771            }
772    
773            private static DDMTemplateService _service;
774    }