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