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