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