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