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