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