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