001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.dynamicdatamapping.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.ReferenceRegistry;
019    
020    /**
021     * The utility for the d d m template local service. This utility wraps {@link com.liferay.portlet.dynamicdatamapping.service.impl.DDMTemplateLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
022     *
023     * <p>
024     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
025     * </p>
026     *
027     * @author Brian Wing Shun Chan
028     * @see DDMTemplateLocalService
029     * @see com.liferay.portlet.dynamicdatamapping.service.base.DDMTemplateLocalServiceBaseImpl
030     * @see com.liferay.portlet.dynamicdatamapping.service.impl.DDMTemplateLocalServiceImpl
031     * @generated
032     */
033    public class DDMTemplateLocalServiceUtil {
034            /*
035             * NOTE FOR DEVELOPERS:
036             *
037             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.dynamicdatamapping.service.impl.DDMTemplateLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
038             */
039    
040            /**
041            * Adds the d d m template to the database. Also notifies the appropriate model listeners.
042            *
043            * @param ddmTemplate the d d m template
044            * @return the d d m template that was added
045            * @throws SystemException if a system exception occurred
046            */
047            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate addDDMTemplate(
048                    com.liferay.portlet.dynamicdatamapping.model.DDMTemplate ddmTemplate)
049                    throws com.liferay.portal.kernel.exception.SystemException {
050                    return getService().addDDMTemplate(ddmTemplate);
051            }
052    
053            /**
054            * Creates a new d d m template with the primary key. Does not add the d d m template to the database.
055            *
056            * @param templateId the primary key for the new d d m template
057            * @return the new d d m template
058            */
059            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate createDDMTemplate(
060                    long templateId) {
061                    return getService().createDDMTemplate(templateId);
062            }
063    
064            /**
065            * Deletes the d d m template with the primary key from the database. Also notifies the appropriate model listeners.
066            *
067            * @param templateId the primary key of the d d m template
068            * @return the d d m template that was removed
069            * @throws PortalException if a d d m template with the primary key could not be found
070            * @throws SystemException if a system exception occurred
071            */
072            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate deleteDDMTemplate(
073                    long templateId)
074                    throws com.liferay.portal.kernel.exception.PortalException,
075                            com.liferay.portal.kernel.exception.SystemException {
076                    return getService().deleteDDMTemplate(templateId);
077            }
078    
079            /**
080            * Deletes the d d m template from the database. Also notifies the appropriate model listeners.
081            *
082            * @param ddmTemplate the d d m template
083            * @return the d d m template that was removed
084            * @throws SystemException if a system exception occurred
085            */
086            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate deleteDDMTemplate(
087                    com.liferay.portlet.dynamicdatamapping.model.DDMTemplate ddmTemplate)
088                    throws com.liferay.portal.kernel.exception.SystemException {
089                    return getService().deleteDDMTemplate(ddmTemplate);
090            }
091    
092            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
093                    return getService().dynamicQuery();
094            }
095    
096            /**
097            * Performs a dynamic query on the database and returns the matching rows.
098            *
099            * @param dynamicQuery the dynamic query
100            * @return the matching rows
101            * @throws SystemException if a system exception occurred
102            */
103            @SuppressWarnings("rawtypes")
104            public static java.util.List dynamicQuery(
105                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
106                    throws com.liferay.portal.kernel.exception.SystemException {
107                    return getService().dynamicQuery(dynamicQuery);
108            }
109    
110            /**
111            * Performs a dynamic query on the database and returns a range of the matching rows.
112            *
113            * <p>
114            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.dynamicdatamapping.model.impl.DDMTemplateModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
115            * </p>
116            *
117            * @param dynamicQuery the dynamic query
118            * @param start the lower bound of the range of model instances
119            * @param end the upper bound of the range of model instances (not inclusive)
120            * @return the range of matching rows
121            * @throws SystemException if a system exception occurred
122            */
123            @SuppressWarnings("rawtypes")
124            public static java.util.List dynamicQuery(
125                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
126                    int end) throws com.liferay.portal.kernel.exception.SystemException {
127                    return getService().dynamicQuery(dynamicQuery, start, end);
128            }
129    
130            /**
131            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
132            *
133            * <p>
134            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.dynamicdatamapping.model.impl.DDMTemplateModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
135            * </p>
136            *
137            * @param dynamicQuery the dynamic query
138            * @param start the lower bound of the range of model instances
139            * @param end the upper bound of the range of model instances (not inclusive)
140            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
141            * @return the ordered range of matching rows
142            * @throws SystemException if a system exception occurred
143            */
144            @SuppressWarnings("rawtypes")
145            public static java.util.List dynamicQuery(
146                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
147                    int end,
148                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
149                    throws com.liferay.portal.kernel.exception.SystemException {
150                    return getService()
151                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
152            }
153    
154            /**
155            * Returns the number of rows that match the dynamic query.
156            *
157            * @param dynamicQuery the dynamic query
158            * @return the number of rows that match the dynamic query
159            * @throws SystemException if a system exception occurred
160            */
161            public static long dynamicQueryCount(
162                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
163                    throws com.liferay.portal.kernel.exception.SystemException {
164                    return getService().dynamicQueryCount(dynamicQuery);
165            }
166    
167            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate fetchDDMTemplate(
168                    long templateId)
169                    throws com.liferay.portal.kernel.exception.SystemException {
170                    return getService().fetchDDMTemplate(templateId);
171            }
172    
173            /**
174            * Returns the d d m template with the primary key.
175            *
176            * @param templateId the primary key of the d d m template
177            * @return the d d m template
178            * @throws PortalException if a d d m template with the primary key could not be found
179            * @throws SystemException if a system exception occurred
180            */
181            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getDDMTemplate(
182                    long templateId)
183                    throws com.liferay.portal.kernel.exception.PortalException,
184                            com.liferay.portal.kernel.exception.SystemException {
185                    return getService().getDDMTemplate(templateId);
186            }
187    
188            public static com.liferay.portal.model.PersistedModel getPersistedModel(
189                    java.io.Serializable primaryKeyObj)
190                    throws com.liferay.portal.kernel.exception.PortalException,
191                            com.liferay.portal.kernel.exception.SystemException {
192                    return getService().getPersistedModel(primaryKeyObj);
193            }
194    
195            /**
196            * Returns the d d m template matching the UUID and group.
197            *
198            * @param uuid the d d m template's UUID
199            * @param groupId the primary key of the group
200            * @return the matching d d m template
201            * @throws PortalException if a matching d d m template could not be found
202            * @throws SystemException if a system exception occurred
203            */
204            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getDDMTemplateByUuidAndGroupId(
205                    java.lang.String uuid, long groupId)
206                    throws com.liferay.portal.kernel.exception.PortalException,
207                            com.liferay.portal.kernel.exception.SystemException {
208                    return getService().getDDMTemplateByUuidAndGroupId(uuid, groupId);
209            }
210    
211            /**
212            * Returns a range of all the d d m templates.
213            *
214            * <p>
215            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.dynamicdatamapping.model.impl.DDMTemplateModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
216            * </p>
217            *
218            * @param start the lower bound of the range of d d m templates
219            * @param end the upper bound of the range of d d m templates (not inclusive)
220            * @return the range of d d m templates
221            * @throws SystemException if a system exception occurred
222            */
223            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getDDMTemplates(
224                    int start, int end)
225                    throws com.liferay.portal.kernel.exception.SystemException {
226                    return getService().getDDMTemplates(start, end);
227            }
228    
229            /**
230            * Returns the number of d d m templates.
231            *
232            * @return the number of d d m templates
233            * @throws SystemException if a system exception occurred
234            */
235            public static int getDDMTemplatesCount()
236                    throws com.liferay.portal.kernel.exception.SystemException {
237                    return getService().getDDMTemplatesCount();
238            }
239    
240            /**
241            * Updates the d d m template in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
242            *
243            * @param ddmTemplate the d d m template
244            * @return the d d m template that was updated
245            * @throws SystemException if a system exception occurred
246            */
247            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate updateDDMTemplate(
248                    com.liferay.portlet.dynamicdatamapping.model.DDMTemplate ddmTemplate)
249                    throws com.liferay.portal.kernel.exception.SystemException {
250                    return getService().updateDDMTemplate(ddmTemplate);
251            }
252    
253            /**
254            * Returns the Spring bean ID for this bean.
255            *
256            * @return the Spring bean ID for this bean
257            */
258            public static java.lang.String getBeanIdentifier() {
259                    return getService().getBeanIdentifier();
260            }
261    
262            /**
263            * Sets the Spring bean ID for this bean.
264            *
265            * @param beanIdentifier the Spring bean ID for this bean
266            */
267            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
268                    getService().setBeanIdentifier(beanIdentifier);
269            }
270    
271            /**
272            * Adds a template.
273            *
274            * @param userId the primary key of the template's creator/owner
275            * @param groupId the primary key of the group
276            * @param classNameId the primary key of the class name for the template's
277            related model
278            * @param classPK the primary key of the template's related entity
279            * @param nameMap the template's locales and localized names
280            * @param descriptionMap the template's locales and localized descriptions
281            * @param type the template's type. For more information, see {@link
282            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
283            * @param mode the template's mode. For more information, see {@link
284            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
285            * @param language the template's script language. For more information,
286            see {@link
287            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
288            * @param script the template's script
289            * @param serviceContext the service context to be applied. Can set the
290            UUID, creation date, modification date, guest permissions, and
291            group permissions for the template.
292            * @return the template
293            * @throws PortalException if a portal exception occurred
294            * @throws SystemException if a system exception occurred
295            */
296            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate addTemplate(
297                    long userId, long groupId, long classNameId, long classPK,
298                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
299                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
300                    java.lang.String type, java.lang.String mode,
301                    java.lang.String language, java.lang.String script,
302                    com.liferay.portal.service.ServiceContext serviceContext)
303                    throws com.liferay.portal.kernel.exception.PortalException,
304                            com.liferay.portal.kernel.exception.SystemException {
305                    return getService()
306                                       .addTemplate(userId, groupId, classNameId, classPK, nameMap,
307                            descriptionMap, type, mode, language, script, serviceContext);
308            }
309    
310            /**
311            * Adds a template with additional parameters.
312            *
313            * @param userId the primary key of the template's creator/owner
314            * @param groupId the primary key of the group
315            * @param classNameId the primary key of the class name for the template's
316            related model
317            * @param classPK the primary key of the template's related entity
318            * @param templateKey the unique string identifying the template
319            (optionally <code>null</code>)
320            * @param nameMap the template's locales and localized names
321            * @param descriptionMap the template's locales and localized descriptions
322            * @param type the template's type. For more information, see {@link
323            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
324            * @param mode the template's mode. For more information, see {@link
325            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
326            * @param language the template's script language. For more information,
327            see {@link
328            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
329            * @param script the template's script
330            * @param cacheable whether the template is cacheable
331            * @param smallImage whether the template has a small image
332            * @param smallImageURL the template's small image URL (optionally
333            <code>null</code>)
334            * @param smallImageFile the template's small image file (optionally
335            <code>null</code>)
336            * @param serviceContext the service context to be applied. Can set the
337            UUID, creation date, modification date, guest permissions, and
338            group permissions for the template.
339            * @return the template
340            * @throws PortalException if a portal exception occurred
341            * @throws SystemException if a system exception occurred
342            */
343            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate addTemplate(
344                    long userId, long groupId, long classNameId, long classPK,
345                    java.lang.String templateKey,
346                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
347                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
348                    java.lang.String type, java.lang.String mode,
349                    java.lang.String language, java.lang.String script, boolean cacheable,
350                    boolean smallImage, java.lang.String smallImageURL,
351                    java.io.File smallImageFile,
352                    com.liferay.portal.service.ServiceContext serviceContext)
353                    throws com.liferay.portal.kernel.exception.PortalException,
354                            com.liferay.portal.kernel.exception.SystemException {
355                    return getService()
356                                       .addTemplate(userId, groupId, classNameId, classPK,
357                            templateKey, nameMap, descriptionMap, type, mode, language, script,
358                            cacheable, smallImage, smallImageURL, smallImageFile, serviceContext);
359            }
360    
361            /**
362            * Adds the resources to the template.
363            *
364            * @param template the template to add resources to
365            * @param addGroupPermissions whether to add group permissions
366            * @param addGuestPermissions whether to add guest permissions
367            * @throws PortalException if a portal exception occurred
368            * @throws SystemException if a system exception occurred
369            */
370            public static void addTemplateResources(
371                    com.liferay.portlet.dynamicdatamapping.model.DDMTemplate template,
372                    boolean addGroupPermissions, boolean addGuestPermissions)
373                    throws com.liferay.portal.kernel.exception.PortalException,
374                            com.liferay.portal.kernel.exception.SystemException {
375                    getService()
376                            .addTemplateResources(template, addGroupPermissions,
377                            addGuestPermissions);
378            }
379    
380            /**
381            * Adds the model resources with the permissions to the template.
382            *
383            * @param template the template to add resources to
384            * @param groupPermissions the group permissions to be added
385            * @param guestPermissions the guest permissions to be added
386            * @throws PortalException if a portal exception occurred
387            * @throws SystemException if a system exception occurred
388            */
389            public static void addTemplateResources(
390                    com.liferay.portlet.dynamicdatamapping.model.DDMTemplate template,
391                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
392                    throws com.liferay.portal.kernel.exception.PortalException,
393                            com.liferay.portal.kernel.exception.SystemException {
394                    getService()
395                            .addTemplateResources(template, groupPermissions, guestPermissions);
396            }
397    
398            /**
399            * Copies the template, creating a new template with all the values
400            * extracted from the original one. This method supports defining a new name
401            * and description.
402            *
403            * @param userId the primary key of the template's creator/owner
404            * @param templateId the primary key of the template to be copied
405            * @param nameMap the new template's locales and localized names
406            * @param descriptionMap the new template's locales and localized
407            descriptions
408            * @param serviceContext the service context to be applied. Can set the
409            UUID, creation date, modification date, guest permissions, and
410            group permissions for the template.
411            * @return the new template
412            * @throws PortalException if a portal exception occurred
413            * @throws SystemException if a system exception occurred
414            */
415            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate copyTemplate(
416                    long userId, long templateId,
417                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
418                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
419                    com.liferay.portal.service.ServiceContext serviceContext)
420                    throws com.liferay.portal.kernel.exception.PortalException,
421                            com.liferay.portal.kernel.exception.SystemException {
422                    return getService()
423                                       .copyTemplate(userId, templateId, nameMap, descriptionMap,
424                            serviceContext);
425            }
426    
427            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate copyTemplate(
428                    long userId, long templateId,
429                    com.liferay.portal.service.ServiceContext serviceContext)
430                    throws com.liferay.portal.kernel.exception.PortalException,
431                            com.liferay.portal.kernel.exception.SystemException {
432                    return getService().copyTemplate(userId, templateId, serviceContext);
433            }
434    
435            /**
436            * Copies all the templates matching the class name ID, class PK, and type.
437            * This method creates new templates, extracting all the values from the old
438            * ones and updating their class PKs.
439            *
440            * @param userId the primary key of the template's creator/owner
441            * @param classNameId the primary key of the class name for the template's
442            related model
443            * @param oldClassPK the primary key of the old template's related entity
444            * @param newClassPK the primary key of the new template's related entity
445            * @param type the template's type. For more information, see {@link
446            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
447            * @param serviceContext the service context to be applied. Can set the
448            creation date, modification date, guest permissions, and group
449            permissions for the new templates.
450            * @return the new templates
451            * @throws PortalException if a portal exception occurred
452            * @throws SystemException if a system exception occurred
453            */
454            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> copyTemplates(
455                    long userId, long classNameId, long oldClassPK, long newClassPK,
456                    java.lang.String type,
457                    com.liferay.portal.service.ServiceContext serviceContext)
458                    throws com.liferay.portal.kernel.exception.PortalException,
459                            com.liferay.portal.kernel.exception.SystemException {
460                    return getService()
461                                       .copyTemplates(userId, classNameId, oldClassPK, newClassPK,
462                            type, serviceContext);
463            }
464    
465            /**
466            * Deletes the template and its resources.
467            *
468            * @param template the template to be deleted
469            * @throws PortalException if a portal exception occurred
470            * @throws SystemException if a system exception occurred
471            */
472            public static void deleteTemplate(
473                    com.liferay.portlet.dynamicdatamapping.model.DDMTemplate template)
474                    throws com.liferay.portal.kernel.exception.PortalException,
475                            com.liferay.portal.kernel.exception.SystemException {
476                    getService().deleteTemplate(template);
477            }
478    
479            /**
480            * Deletes the template and its resources.
481            *
482            * @param templateId the primary key of the template to be deleted
483            * @throws PortalException if a portal exception occurred
484            * @throws SystemException if a system exception occurred
485            */
486            public static void deleteTemplate(long templateId)
487                    throws com.liferay.portal.kernel.exception.PortalException,
488                            com.liferay.portal.kernel.exception.SystemException {
489                    getService().deleteTemplate(templateId);
490            }
491    
492            /**
493            * Deletes all the templates of the group.
494            *
495            * @param groupId the primary key of the group
496            * @throws PortalException if a portal exception occurred
497            * @throws SystemException if a system exception occurred
498            */
499            public static void deleteTemplates(long groupId)
500                    throws com.liferay.portal.kernel.exception.PortalException,
501                            com.liferay.portal.kernel.exception.SystemException {
502                    getService().deleteTemplates(groupId);
503            }
504    
505            /**
506            * Returns the template matching the group and template key.
507            *
508            * @param groupId the primary key of the group
509            * @param classNameId the primary key of the class name for the template's
510            related model
511            * @param templateKey the unique string identifying the template
512            * @return the matching template, or <code>null</code> if a matching
513            template could not be found
514            * @throws SystemException if a system exception occurred
515            */
516            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate fetchTemplate(
517                    long groupId, long classNameId, java.lang.String templateKey)
518                    throws com.liferay.portal.kernel.exception.SystemException {
519                    return getService().fetchTemplate(groupId, classNameId, templateKey);
520            }
521    
522            /**
523            * Returns the template matching the group and template key, optionally in
524            * the global scope.
525            *
526            * <p>
527            * This method first searches in the given group. If the template is still
528            * not found and <code>includeGlobalTemplates</code> is set to
529            * <code>true</code>, this method searches the global group.
530            * </p>
531            *
532            * @param groupId the primary key of the group
533            * @param classNameId the primary key of the class name for the template's
534            related model
535            * @param templateKey the unique string identifying the template
536            * @param includeGlobalTemplates whether to include the global scope in the
537            search
538            * @return the matching template, or <code>null</code> if a matching
539            template could not be found
540            * @throws PortalException if a portal exception occurred
541            * @throws SystemException if a system exception occurred
542            */
543            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate fetchTemplate(
544                    long groupId, long classNameId, java.lang.String templateKey,
545                    boolean includeGlobalTemplates)
546                    throws com.liferay.portal.kernel.exception.PortalException,
547                            com.liferay.portal.kernel.exception.SystemException {
548                    return getService()
549                                       .fetchTemplate(groupId, classNameId, templateKey,
550                            includeGlobalTemplates);
551            }
552    
553            /**
554            * Returns the template matching the UUID and group.
555            *
556            * @param uuid the unique string identifying the template
557            * @param groupId the primary key of the group
558            * @return the matching template, or <code>null</code> if a matching
559            template could not be found
560            * @throws SystemException if a system exception occurred
561            */
562            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate fetchTemplate(
563                    java.lang.String uuid, long groupId)
564                    throws com.liferay.portal.kernel.exception.SystemException {
565                    return getService().fetchTemplate(uuid, groupId);
566            }
567    
568            /**
569            * Returns the template with the ID.
570            *
571            * @param templateId the primary key of the template
572            * @return the template with the ID
573            * @throws PortalException if a matching template could not be found
574            * @throws SystemException if a system exception occurred
575            */
576            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getTemplate(
577                    long templateId)
578                    throws com.liferay.portal.kernel.exception.PortalException,
579                            com.liferay.portal.kernel.exception.SystemException {
580                    return getService().getTemplate(templateId);
581            }
582    
583            /**
584            * Returns the template matching the group and template key.
585            *
586            * @param groupId the primary key of the group
587            * @param classNameId the primary key of the class name for the template's
588            related model
589            * @param templateKey the unique string identifying the template
590            * @return the matching template
591            * @throws PortalException if a matching template could not be found
592            * @throws SystemException if a system exception occurred
593            */
594            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getTemplate(
595                    long groupId, long classNameId, java.lang.String templateKey)
596                    throws com.liferay.portal.kernel.exception.PortalException,
597                            com.liferay.portal.kernel.exception.SystemException {
598                    return getService().getTemplate(groupId, classNameId, templateKey);
599            }
600    
601            /**
602            * Returns the template matching the group and template key, optionally in
603            * the global scope.
604            *
605            * <p>
606            * This method first searches in the group. If the template is still not
607            * found and <code>includeGlobalTemplates</code> is set to
608            * <code>true</code>, this method searches the global group.
609            * </p>
610            *
611            * @param groupId the primary key of the group
612            * @param classNameId the primary key of the class name for the template's
613            related model
614            * @param templateKey the unique string identifying the template
615            * @param includeGlobalTemplates whether to include the global scope in the
616            search
617            * @return the matching template
618            * @throws PortalException if a matching template could not be found
619            * @throws SystemException if a system exception occurred
620            */
621            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getTemplate(
622                    long groupId, long classNameId, java.lang.String templateKey,
623                    boolean includeGlobalTemplates)
624                    throws com.liferay.portal.kernel.exception.PortalException,
625                            com.liferay.portal.kernel.exception.SystemException {
626                    return getService()
627                                       .getTemplate(groupId, classNameId, templateKey,
628                            includeGlobalTemplates);
629            }
630    
631            /**
632            * Returns all the templates with the class PK.
633            *
634            * @param classPK the primary key of the template's related entity
635            * @return the templates with the class PK
636            * @throws SystemException if a system exception occurred
637            */
638            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates(
639                    long classPK)
640                    throws com.liferay.portal.kernel.exception.SystemException {
641                    return getService().getTemplates(classPK);
642            }
643    
644            /**
645            * Returns all the templates matching the group and class name ID.
646            *
647            * @param groupId the primary key of the group
648            * @param classNameId the primary key of the class name for the template's
649            related model
650            * @return the matching templates
651            * @throws SystemException if a system exception occurred
652            */
653            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates(
654                    long groupId, long classNameId)
655                    throws com.liferay.portal.kernel.exception.SystemException {
656                    return getService().getTemplates(groupId, classNameId);
657            }
658    
659            /**
660            * Returns all the templates matching the group, class name ID, and class
661            * PK.
662            *
663            * @param groupId the primary key of the group
664            * @param classNameId the primary key of the class name for the template's
665            related model
666            * @param classPK the primary key of the template's related entity
667            * @return the matching templates
668            * @throws SystemException if a system exception occurred
669            */
670            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates(
671                    long groupId, long classNameId, long classPK)
672                    throws com.liferay.portal.kernel.exception.SystemException {
673                    return getService().getTemplates(groupId, classNameId, classPK);
674            }
675    
676            /**
677            * Returns all the templates matching the group, class name ID, class PK,
678            * and type.
679            *
680            * @param groupId the primary key of the group
681            * @param classNameId the primary key of the class name for the template's
682            related model
683            * @param classPK the primary key of the template's related entity
684            * @param type the template's type. For more information, see {@link
685            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
686            * @return the matching templates
687            * @throws SystemException if a system exception occurred
688            */
689            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates(
690                    long groupId, long classNameId, long classPK, java.lang.String type)
691                    throws com.liferay.portal.kernel.exception.SystemException {
692                    return getService().getTemplates(groupId, classNameId, classPK, type);
693            }
694    
695            /**
696            * Returns all the templates matching the group, class name ID, class PK,
697            * type, and mode.
698            *
699            * @param groupId the primary key of the group
700            * @param classNameId the primary key of the class name for the template's
701            related model
702            * @param classPK the primary key of the template's related entity
703            * @param type the template's type. For more information, see {@link
704            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
705            * @param mode the template's mode. For more information, see {@link
706            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
707            * @return the matching templates
708            * @throws SystemException if a system exception occurred
709            */
710            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates(
711                    long groupId, long classNameId, long classPK, java.lang.String type,
712                    java.lang.String mode)
713                    throws com.liferay.portal.kernel.exception.SystemException {
714                    return getService()
715                                       .getTemplates(groupId, classNameId, classPK, type, mode);
716            }
717    
718            /**
719            * Returns all the templates matching the group and class PK.
720            *
721            * @param groupId the primary key of the group
722            * @param classPK the primary key of the template's related entity
723            * @return the matching templates
724            * @throws SystemException if a system exception occurred
725            */
726            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplatesByClassPK(
727                    long groupId, long classPK)
728                    throws com.liferay.portal.kernel.exception.SystemException {
729                    return getService().getTemplatesByClassPK(groupId, classPK);
730            }
731    
732            /**
733            * Returns an ordered range of all the templates matching the group and
734            * structure class name ID.
735            *
736            * <p>
737            * Useful when paginating results. Returns a maximum of <code>end -
738            * start</code> instances. <code>start</code> and <code>end</code> are not
739            * primary keys, they are indexes in the result set. Thus, <code>0</code>
740            * refers to the first result in the set. Setting both <code>start</code>
741            * and <code>end</code> to {@link
742            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
743            * result set.
744            * </p>
745            *
746            * @param groupId the primary key of the group
747            * @param structureClassNameId the primary key of the class name for the
748            template's related structure
749            * @param start the lower bound of the range of templates to return
750            * @param end the upper bound of the range of templates to return (not
751            inclusive)
752            * @param orderByComparator the comparator to order the templates
753            (optionally <code>null</code>)
754            * @return the range of matching templates ordered by the comparator
755            * @throws SystemException if a system exception occurred
756            */
757            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplatesByStructureClassNameId(
758                    long groupId, long structureClassNameId, int start, int end,
759                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
760                    throws com.liferay.portal.kernel.exception.SystemException {
761                    return getService()
762                                       .getTemplatesByStructureClassNameId(groupId,
763                            structureClassNameId, start, end, orderByComparator);
764            }
765    
766            /**
767            * Returns the number of templates belonging to the group.
768            *
769            * @param groupId the primary key of the group
770            * @return the number of templates belonging to the group
771            * @throws SystemException if a system exception occurred
772            */
773            public static int getTemplatesCount(long groupId)
774                    throws com.liferay.portal.kernel.exception.SystemException {
775                    return getService().getTemplatesCount(groupId);
776            }
777    
778            /**
779            * Returns the number of templates matching the group and class name ID.
780            *
781            * @param groupId the primary key of the group
782            * @param classNameId the primary key of the class name for the template's
783            related model
784            * @return the number of matching templates
785            * @throws SystemException if a system exception occurred
786            */
787            public static int getTemplatesCount(long groupId, long classNameId)
788                    throws com.liferay.portal.kernel.exception.SystemException {
789                    return getService().getTemplatesCount(groupId, classNameId);
790            }
791    
792            /**
793            * Returns an ordered range of all the templates matching the group, class
794            * name ID, class PK, type, and mode, and matching the keywords in the
795            * template names and descriptions.
796            *
797            * <p>
798            * Useful when paginating results. Returns a maximum of <code>end -
799            * start</code> instances. <code>start</code> and <code>end</code> are not
800            * primary keys, they are indexes in the result set. Thus, <code>0</code>
801            * refers to the first result in the set. Setting both <code>start</code>
802            * and <code>end</code> to {@link
803            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
804            * result set.
805            * </p>
806            *
807            * @param companyId the primary key of the template's company
808            * @param groupId the primary key of the group
809            * @param classNameId the primary key of the class name for the template's
810            related model
811            * @param classPK the primary key of the template's related entity
812            * @param keywords the keywords (space separated), which may occur in the
813            template's name or description (optionally <code>null</code>)
814            * @param type the template's type (optionally <code>null</code>). For more
815            information, see {@link
816            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
817            * @param mode the template's mode (optionally <code>null</code>). For more
818            information, see {@link
819            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
820            * @param start the lower bound of the range of templates to return
821            * @param end the upper bound of the range of templates to return (not
822            inclusive)
823            * @param orderByComparator the comparator to order the templates
824            (optionally <code>null</code>)
825            * @return the range of matching templates ordered by the comparator
826            * @throws SystemException if a system exception occurred
827            */
828            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search(
829                    long companyId, long groupId, long classNameId, long classPK,
830                    java.lang.String keywords, java.lang.String type,
831                    java.lang.String mode, int start, int end,
832                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
833                    throws com.liferay.portal.kernel.exception.SystemException {
834                    return getService()
835                                       .search(companyId, groupId, classNameId, classPK, keywords,
836                            type, mode, start, end, orderByComparator);
837            }
838    
839            /**
840            * Returns an ordered range of all the templates matching the group, class
841            * name ID, class PK, name keyword, description keyword, type, mode, and
842            * language.
843            *
844            * <p>
845            * Useful when paginating results. Returns a maximum of <code>end -
846            * start</code> instances. <code>start</code> and <code>end</code> are not
847            * primary keys, they are indexes in the result set. Thus, <code>0</code>
848            * refers to the first result in the set. Setting both <code>start</code>
849            * and <code>end</code> to {@link
850            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
851            * result set.
852            * </p>
853            *
854            * @param companyId the primary key of the template's company
855            * @param groupId the primary key of the group
856            * @param classNameId the primary key of the class name for the template's
857            related model
858            * @param classPK the primary key of the template's related entity
859            * @param name the name keywords (optionally <code>null</code>)
860            * @param description the description keywords (optionally
861            <code>null</code>)
862            * @param type the template's type (optionally <code>null</code>). For more
863            information, see {@link
864            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
865            * @param mode the template's mode (optionally <code>null</code>). For more
866            information, see {@link
867            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
868            * @param language the template's script language (optionally
869            <code>null</code>). For more information, see {@link
870            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
871            * @param andOperator whether every field must match its keywords, or just
872            one field
873            * @param start the lower bound of the range of templates to return
874            * @param end the upper bound of the range of templates to return (not
875            inclusive)
876            * @param orderByComparator the comparator to order the templates
877            (optionally <code>null</code>)
878            * @return the range of matching templates ordered by the comparator
879            * @throws SystemException if a system exception occurred
880            */
881            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search(
882                    long companyId, long groupId, long classNameId, long classPK,
883                    java.lang.String name, java.lang.String description,
884                    java.lang.String type, java.lang.String mode,
885                    java.lang.String language, boolean andOperator, int start, int end,
886                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
887                    throws com.liferay.portal.kernel.exception.SystemException {
888                    return getService()
889                                       .search(companyId, groupId, classNameId, classPK, name,
890                            description, type, mode, language, andOperator, start, end,
891                            orderByComparator);
892            }
893    
894            /**
895            * Returns an ordered range of all the templates matching the group IDs,
896            * class Name IDs, class PK, type, and mode, and include the keywords on its
897            * names and descriptions.
898            *
899            * <p>
900            * Useful when paginating results. Returns a maximum of <code>end -
901            * start</code> instances. <code>start</code> and <code>end</code> are not
902            * primary keys, they are indexes in the result set. Thus, <code>0</code>
903            * refers to the first result in the set. Setting both <code>start</code>
904            * and <code>end</code> to {@link
905            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
906            * result set.
907            * </p>
908            *
909            * @param companyId the primary key of the template's company
910            * @param groupIds the primary keys of the groups
911            * @param classNameIds the primary keys of the entity's instances the
912            templates are related to
913            * @param classPK the primary key of the template's related entity
914            * @param keywords the keywords (space separated), which may occur in the
915            template's name or description (optionally <code>null</code>)
916            * @param type the template's type (optionally <code>null</code>). For more
917            information, see {@link
918            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
919            * @param mode the template's mode (optionally <code>null</code>). For more
920            information, see {@link
921            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
922            * @param start the lower bound of the range of templates to return
923            * @param end the upper bound of the range of templates to return (not
924            inclusive)
925            * @param orderByComparator the comparator to order the templates
926            (optionally <code>null</code>)
927            * @return the range of matching templates ordered by the comparator
928            * @throws SystemException if a system exception occurred
929            */
930            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search(
931                    long companyId, long[] groupIds, long[] classNameIds, long classPK,
932                    java.lang.String keywords, java.lang.String type,
933                    java.lang.String mode, int start, int end,
934                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
935                    throws com.liferay.portal.kernel.exception.SystemException {
936                    return getService()
937                                       .search(companyId, groupIds, classNameIds, classPK,
938                            keywords, type, mode, start, end, orderByComparator);
939            }
940    
941            /**
942            * Returns an ordered range of all the templates matching the group IDs,
943            * class name IDs, class PK, name keyword, description keyword, type, mode,
944            * and language.
945            *
946            * <p>
947            * Useful when paginating results. Returns a maximum of <code>end -
948            * start</code> instances. <code>start</code> and <code>end</code> are not
949            * primary keys, they are indexes in the result set. Thus, <code>0</code>
950            * refers to the first result in the set. Setting both <code>start</code>
951            * and <code>end</code> to {@link
952            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
953            * result set.
954            * </p>
955            *
956            * @param companyId the primary key of the template's company
957            * @param groupIds the primary keys of the groups
958            * @param classNameIds the primary keys of the entity's instances the
959            templates are related to
960            * @param classPK the primary key of the template's related entity
961            * @param name the name keywords (optionally <code>null</code>)
962            * @param description the description keywords (optionally
963            <code>null</code>)
964            * @param type the template's type (optionally <code>null</code>). For more
965            information, see {@link
966            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
967            * @param mode the template's mode (optionally <code>null</code>). For more
968            information, see {@link
969            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
970            * @param language the template's script language (optionally
971            <code>null</code>). For more information, see {@link
972            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
973            * @param andOperator whether every field must match its keywords, or just
974            one field.
975            * @param start the lower bound of the range of templates to return
976            * @param end the upper bound of the range of templates to return (not
977            inclusive)
978            * @param orderByComparator the comparator to order the templates
979            (optionally <code>null</code>)
980            * @return the range of matching templates ordered by the comparator
981            * @throws SystemException if a system exception occurred
982            */
983            public static java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search(
984                    long companyId, long[] groupIds, long[] classNameIds, long classPK,
985                    java.lang.String name, java.lang.String description,
986                    java.lang.String type, java.lang.String mode,
987                    java.lang.String language, boolean andOperator, int start, int end,
988                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
989                    throws com.liferay.portal.kernel.exception.SystemException {
990                    return getService()
991                                       .search(companyId, groupIds, classNameIds, classPK, name,
992                            description, type, mode, language, andOperator, start, end,
993                            orderByComparator);
994            }
995    
996            /**
997            * Returns the number of templates matching the group, class name ID, class
998            * PK, type, and matching the keywords in the template names and
999            * descriptions.
1000            *
1001            * @param companyId the primary key of the template's company
1002            * @param groupId the primary key of the group
1003            * @param classNameId the primary key of the class name for the template's
1004            related model
1005            * @param classPK the primary key of the template's related entity
1006            * @param keywords the keywords (space separated), which may occur in the
1007            template's name or description (optionally <code>null</code>)
1008            * @param type the template's type (optionally <code>null</code>). For more
1009            information, see {@link
1010            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
1011            * @param mode the template's mode (optionally <code>null</code>). For more
1012            information, see {@link
1013            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
1014            * @return the number of matching templates
1015            * @throws SystemException if a system exception occurred
1016            */
1017            public static int searchCount(long companyId, long groupId,
1018                    long classNameId, long classPK, java.lang.String keywords,
1019                    java.lang.String type, java.lang.String mode)
1020                    throws com.liferay.portal.kernel.exception.SystemException {
1021                    return getService()
1022                                       .searchCount(companyId, groupId, classNameId, classPK,
1023                            keywords, type, mode);
1024            }
1025    
1026            /**
1027            * Returns the number of templates matching the group, class name ID, class
1028            * PK, name keyword, description keyword, type, mode, and language.
1029            *
1030            * @param companyId the primary key of the template's company
1031            * @param groupId the primary key of the group
1032            * @param classNameId the primary key of the class name for the template's
1033            related model
1034            * @param classPK the primary key of the template's related entity
1035            * @param name the name keywords (optionally <code>null</code>)
1036            * @param description the description keywords (optionally
1037            <code>null</code>)
1038            * @param type the template's type (optionally <code>null</code>). For more
1039            information, see {@link
1040            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
1041            * @param mode the template's mode (optionally <code>null</code>). For more
1042            information, see {@link
1043            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
1044            * @param language the template's script language (optionally
1045            <code>null</code>). For more information, see {@link
1046            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
1047            * @param andOperator whether every field must match its keywords, or just
1048            one field.
1049            * @return the number of matching templates
1050            * @throws SystemException if a system exception occurred
1051            */
1052            public static int searchCount(long companyId, long groupId,
1053                    long classNameId, long classPK, java.lang.String name,
1054                    java.lang.String description, java.lang.String type,
1055                    java.lang.String mode, java.lang.String language, boolean andOperator)
1056                    throws com.liferay.portal.kernel.exception.SystemException {
1057                    return getService()
1058                                       .searchCount(companyId, groupId, classNameId, classPK, name,
1059                            description, type, mode, language, andOperator);
1060            }
1061    
1062            /**
1063            * Returns the number of templates matching the group IDs, class name IDs,
1064            * class PK, type, and mode, and matching the keywords in the template names
1065            * and descriptions.
1066            *
1067            * @param companyId the primary key of the template's company
1068            * @param groupIds the primary keys of the groups
1069            * @param classNameIds the primary keys of the entity's instance the
1070            templates are related to
1071            * @param classPK the primary key of the template's related entity
1072            * @param keywords the keywords (space separated), which may occur in the
1073            template's name or description (optionally <code>null</code>)
1074            * @param type the template's type (optionally <code>null</code>). For more
1075            information, see {@link
1076            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
1077            * @param mode the template's mode (optionally <code>null</code>). For more
1078            information, see {@link
1079            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
1080            * @return the number of matching templates
1081            * @throws SystemException if a system exception occurred
1082            */
1083            public static int searchCount(long companyId, long[] groupIds,
1084                    long[] classNameIds, long classPK, java.lang.String keywords,
1085                    java.lang.String type, java.lang.String mode)
1086                    throws com.liferay.portal.kernel.exception.SystemException {
1087                    return getService()
1088                                       .searchCount(companyId, groupIds, classNameIds, classPK,
1089                            keywords, type, mode);
1090            }
1091    
1092            /**
1093            * Returns the number of templates matching the group IDs, class name IDs,
1094            * class PKs, name keyword, description keyword, type, mode, and language.
1095            *
1096            * @param companyId the primary key of the templates company
1097            * @param groupIds the primary keys of the groups
1098            * @param classNameIds the primary keys of the entity's instance the
1099            templates are related to
1100            * @param classPK the primary key of the template's related entity
1101            * @param name the name keywords (optionally <code>null</code>)
1102            * @param description the description keywords (optionally
1103            <code>null</code>)
1104            * @param type the template's type (optionally <code>null</code>). For more
1105            information, see {@link
1106            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
1107            * @param mode the template's mode (optionally <code>null</code>). For more
1108            information, see {@link
1109            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
1110            * @param language the template's script language (optionally
1111            <code>null</code>). For more information, see {@link
1112            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
1113            * @param andOperator whether every field must match its keywords, or just
1114            one field.
1115            * @return the number of matching templates
1116            * @throws SystemException if a system exception occurred
1117            */
1118            public static int searchCount(long companyId, long[] groupIds,
1119                    long[] classNameIds, long classPK, java.lang.String name,
1120                    java.lang.String description, java.lang.String type,
1121                    java.lang.String mode, java.lang.String language, boolean andOperator)
1122                    throws com.liferay.portal.kernel.exception.SystemException {
1123                    return getService()
1124                                       .searchCount(companyId, groupIds, classNameIds, classPK,
1125                            name, description, type, mode, language, andOperator);
1126            }
1127    
1128            /**
1129            * Updates the template matching the ID.
1130            *
1131            * @param templateId the primary key of the template
1132            * @param nameMap the template's new locales and localized names
1133            * @param descriptionMap the template's new locales and localized
1134            description
1135            * @param type the template's type. For more information, see {@link
1136            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
1137            * @param mode the template's mode. For more information, see {@link
1138            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
1139            * @param language the template's script language. For more information,
1140            see {@link
1141            com.liferay.portlet.dynamicdatamapping.model.DDMTemplateConstants}.
1142            * @param script the template's script
1143            * @param cacheable whether the template is cacheable
1144            * @param smallImage whether the template has a small image
1145            * @param smallImageURL the template's small image URL (optionally
1146            <code>null</code>)
1147            * @param smallImageFile the template's small image file (optionally
1148            <code>null</code>)
1149            * @param serviceContext the service context to be applied. Can set the
1150            modification date.
1151            * @return the updated template
1152            * @throws PortalException if a portal exception occurred
1153            * @throws SystemException if a system exception occurred
1154            */
1155            public static com.liferay.portlet.dynamicdatamapping.model.DDMTemplate updateTemplate(
1156                    long templateId,
1157                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
1158                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
1159                    java.lang.String type, java.lang.String mode,
1160                    java.lang.String language, java.lang.String script, boolean cacheable,
1161                    boolean smallImage, java.lang.String smallImageURL,
1162                    java.io.File smallImageFile,
1163                    com.liferay.portal.service.ServiceContext serviceContext)
1164                    throws com.liferay.portal.kernel.exception.PortalException,
1165                            com.liferay.portal.kernel.exception.SystemException {
1166                    return getService()
1167                                       .updateTemplate(templateId, nameMap, descriptionMap, type,
1168                            mode, language, script, cacheable, smallImage, smallImageURL,
1169                            smallImageFile, serviceContext);
1170            }
1171    
1172            public static DDMTemplateLocalService getService() {
1173                    if (_service == null) {
1174                            _service = (DDMTemplateLocalService)PortalBeanLocatorUtil.locate(DDMTemplateLocalService.class.getName());
1175    
1176                            ReferenceRegistry.registerReference(DDMTemplateLocalServiceUtil.class,
1177                                    "_service");
1178                    }
1179    
1180                    return _service;
1181            }
1182    
1183            /**
1184             * @deprecated As of 6.2.0
1185             */
1186            public void setService(DDMTemplateLocalService service) {
1187            }
1188    
1189            private static DDMTemplateLocalService _service;
1190    }