Liferay 6.2-ce-ga5

com.liferay.portlet.dynamicdatamapping.service
Interface DDMTemplateLocalService

All Superinterfaces:
BaseLocalService, PersistedModelLocalService
All Known Implementing Classes:
DDMTemplateLocalServiceWrapper

@ProviderType
@Transactional(isolation=PORTAL,
               rollbackFor={PortalException.class,SystemException.class})
public interface DDMTemplateLocalService
extends BaseLocalService, PersistedModelLocalService

Provides the local service interface for DDMTemplate. 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.

See Also:
DDMTemplateLocalServiceUtil, com.liferay.portlet.dynamicdatamapping.service.base.DDMTemplateLocalServiceBaseImpl, com.liferay.portlet.dynamicdatamapping.service.impl.DDMTemplateLocalServiceImpl

Method Summary
 DDMTemplate addDDMTemplate(DDMTemplate ddmTemplate)
          Adds the d d m template to the database.
 DDMTemplate addTemplate(long userId, long groupId, long classNameId, long classPK, Map<Locale,String> nameMap, Map<Locale,String> descriptionMap, String type, String mode, String language, String script, ServiceContext serviceContext)
          Adds a template.
 DDMTemplate addTemplate(long userId, long groupId, long classNameId, long classPK, String templateKey, Map<Locale,String> nameMap, Map<Locale,String> descriptionMap, String type, String mode, String language, String script, boolean cacheable, boolean smallImage, String smallImageURL, File smallImageFile, ServiceContext serviceContext)
          Adds a template with additional parameters.
 void addTemplateResources(DDMTemplate template, boolean addGroupPermissions, boolean addGuestPermissions)
          Adds the resources to the template.
 void addTemplateResources(DDMTemplate template, String[] groupPermissions, String[] guestPermissions)
          Adds the model resources with the permissions to the template.
 DDMTemplate copyTemplate(long userId, long templateId, Map<Locale,String> nameMap, Map<Locale,String> descriptionMap, ServiceContext serviceContext)
          Copies the template, creating a new template with all the values extracted from the original one.
 DDMTemplate copyTemplate(long userId, long templateId, ServiceContext serviceContext)
           
 List<DDMTemplate> copyTemplates(long userId, long classNameId, long oldClassPK, long newClassPK, String type, ServiceContext serviceContext)
          Copies all the templates matching the class name ID, class PK, and type.
 DDMTemplate createDDMTemplate(long templateId)
          Creates a new d d m template with the primary key.
 DDMTemplate deleteDDMTemplate(DDMTemplate ddmTemplate)
          Deletes the d d m template from the database.
 DDMTemplate deleteDDMTemplate(long templateId)
          Deletes the d d m template with the primary key from the database.
 void deleteTemplate(DDMTemplate template)
          Deletes the template and its resources.
 void deleteTemplate(long templateId)
          Deletes the template and its resources.
 void deleteTemplates(long groupId)
          Deletes all the templates of the group.
 void deleteTemplates(long groupId, long classNameId)
           
 DynamicQuery dynamicQuery()
           
 List dynamicQuery(DynamicQuery dynamicQuery)
          Performs a dynamic query on the database and returns the matching rows.
 List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
          Performs a dynamic query on the database and returns a range of the matching rows.
 List dynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator orderByComparator)
          Performs a dynamic query on the database and returns an ordered range of the matching rows.
 long dynamicQueryCount(DynamicQuery dynamicQuery)
          Returns the number of rows that match the dynamic query.
 long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection)
          Returns the number of rows that match the dynamic query.
 DDMTemplate fetchDDMTemplate(long templateId)
           
 DDMTemplate fetchDDMTemplateByUuidAndCompanyId(String uuid, long companyId)
          Returns the d d m template with the matching UUID and company.
 DDMTemplate fetchDDMTemplateByUuidAndGroupId(String uuid, long groupId)
          Returns the d d m template matching the UUID and group.
 DDMTemplate fetchTemplate(long groupId, long classNameId, String templateKey)
          Returns the template matching the group and template key.
 DDMTemplate fetchTemplate(long groupId, long classNameId, String templateKey, boolean includeGlobalTemplates)
          Returns the template matching the group and template key, optionally in the global scope.
 String getBeanIdentifier()
          Returns the Spring bean ID for this bean.
 DDMTemplate getDDMTemplate(long templateId)
          Returns the d d m template with the primary key.
 DDMTemplate getDDMTemplateByUuidAndCompanyId(String uuid, long companyId)
          Returns the d d m template with the matching UUID and company.
 DDMTemplate getDDMTemplateByUuidAndGroupId(String uuid, long groupId)
          Returns the d d m template matching the UUID and group.
 List<DDMTemplate> getDDMTemplates(int start, int end)
          Returns a range of all the d d m templates.
 int getDDMTemplatesCount()
          Returns the number of d d m templates.
 PersistedModel getPersistedModel(Serializable primaryKeyObj)
           
 DDMTemplate getTemplate(long templateId)
          Returns the template with the ID.
 DDMTemplate getTemplate(long groupId, long classNameId, String templateKey)
          Returns the template matching the group and template key.
 DDMTemplate getTemplate(long groupId, long classNameId, String templateKey, boolean includeGlobalTemplates)
          Returns the template matching the group and template key, optionally in the global scope.
 DDMTemplate getTemplateBySmallImageId(long smallImageId)
           
 List<DDMTemplate> getTemplates(long classPK)
          Returns all the templates with the class PK.
 List<DDMTemplate> getTemplates(long groupId, long classNameId)
          Returns all the templates matching the group and class name ID.
 List<DDMTemplate> getTemplates(long groupId, long classNameId, long classPK)
          Returns all the templates matching the group, class name ID, and class PK.
 List<DDMTemplate> getTemplates(long groupId, long classNameId, long classPK, String type)
          Returns all the templates matching the group, class name ID, class PK, and type.
 List<DDMTemplate> getTemplates(long groupId, long classNameId, long classPK, String type, String mode)
          Returns all the templates matching the group, class name ID, class PK, type, and mode.
 List<DDMTemplate> getTemplatesByClassPK(long[] groupIds, long classPK)
           
 List<DDMTemplate> getTemplatesByClassPK(long groupId, long classPK)
           
 List<DDMTemplate> getTemplatesByClassPK(long groupId, long classPK, int start, int end)
           
 int getTemplatesByClassPKCount(long groupId, long classPK)
          Returns the number of templates matching the group and class PK.
 List<DDMTemplate> getTemplatesByStructureClassNameId(long groupId, long structureClassNameId, int start, int end, OrderByComparator orderByComparator)
          Returns an ordered range of all the templates matching the group and structure class name ID.
 int getTemplatesByStructureClassNameIdCount(long groupId, long structureClassNameId)
          Returns the number of templates matching the group and structure class name ID, including Generic Templates.
 int getTemplatesCount(long groupId)
          Returns the number of templates belonging to the group.
 int getTemplatesCount(long groupId, long classNameId)
          Returns the number of templates matching the group and class name ID.
 int getTemplatesCount(long groupId, long classNameId, long classPK)
          Returns the number of templates matching the group, class name ID, and class PK.
 List<DDMTemplate> search(long companyId, long[] groupIds, long[] classNameIds, long[] classPKs, String keywords, String type, String mode, int start, int end, OrderByComparator orderByComparator)
          Returns an ordered range of all the templates matching the group IDs, class Name IDs, class PK, type, and mode, and include the keywords on its names and descriptions.
 List<DDMTemplate> search(long companyId, long[] groupIds, long[] classNameIds, long[] classPKs, String name, String description, String type, String mode, String language, boolean andOperator, int start, int end, OrderByComparator orderByComparator)
          Returns an ordered range of all the templates matching the group IDs, class name IDs, class PK, name keyword, description keyword, type, mode, and language.
 List<DDMTemplate> search(long companyId, long groupId, long classNameId, long classPK, String keywords, String type, String mode, int start, int end, OrderByComparator orderByComparator)
          Returns an ordered range of all the templates matching the group, class name ID, class PK, type, and mode, and matching the keywords in the template names and descriptions.
 List<DDMTemplate> search(long companyId, long groupId, long classNameId, long classPK, String name, String description, String type, String mode, String language, boolean andOperator, int start, int end, OrderByComparator orderByComparator)
          Returns an ordered range of all the templates matching the group, class name ID, class PK, name keyword, description keyword, type, mode, and language.
 int searchCount(long companyId, long[] groupIds, long[] classNameIds, long[] classPKs, String keywords, String type, String mode)
          Returns the number of templates matching the group IDs, class name IDs, class PK, type, and mode, and matching the keywords in the template names and descriptions.
 int searchCount(long companyId, long[] groupIds, long[] classNameIds, long[] classPKs, String name, String description, String type, String mode, String language, boolean andOperator)
          Returns the number of templates matching the group IDs, class name IDs, class PKs, name keyword, description keyword, type, mode, and language.
 int searchCount(long companyId, long groupId, long classNameId, long classPK, String keywords, String type, String mode)
          Returns the number of templates matching the group, class name ID, class PK, type, and matching the keywords in the template names and descriptions.
 int searchCount(long companyId, long groupId, long classNameId, long classPK, String name, String description, String type, String mode, String language, boolean andOperator)
          Returns the number of templates matching the group, class name ID, class PK, name keyword, description keyword, type, mode, and language.
 void setBeanIdentifier(String beanIdentifier)
          Sets the Spring bean ID for this bean.
 DDMTemplate updateDDMTemplate(DDMTemplate ddmTemplate)
          Updates the d d m template in the database or adds it if it does not yet exist.
 DDMTemplate updateTemplate(long templateId, long classPK, Map<Locale,String> nameMap, Map<Locale,String> descriptionMap, String type, String mode, String language, String script, boolean cacheable, boolean smallImage, String smallImageURL, File smallImageFile, ServiceContext serviceContext)
          Updates the template matching the ID.
 

Method Detail

addDDMTemplate

@Indexable(type=REINDEX)
DDMTemplate addDDMTemplate(DDMTemplate ddmTemplate)
                           throws SystemException
Adds the d d m template to the database. Also notifies the appropriate model listeners.

Parameters:
ddmTemplate - the d d m template
Returns:
the d d m template that was added
Throws:
SystemException - if a system exception occurred

createDDMTemplate

DDMTemplate createDDMTemplate(long templateId)
Creates a new d d m template with the primary key. Does not add the d d m template to the database.

Parameters:
templateId - the primary key for the new d d m template
Returns:
the new d d m template

deleteDDMTemplate

@Indexable(type=DELETE)
DDMTemplate deleteDDMTemplate(long templateId)
                              throws PortalException,
                                     SystemException
Deletes the d d m template with the primary key from the database. Also notifies the appropriate model listeners.

Parameters:
templateId - the primary key of the d d m template
Returns:
the d d m template that was removed
Throws:
PortalException - if a d d m template with the primary key could not be found
SystemException - if a system exception occurred

deleteDDMTemplate

@Indexable(type=DELETE)
DDMTemplate deleteDDMTemplate(DDMTemplate ddmTemplate)
                              throws SystemException
Deletes the d d m template from the database. Also notifies the appropriate model listeners.

Parameters:
ddmTemplate - the d d m template
Returns:
the d d m template that was removed
Throws:
SystemException - if a system exception occurred

dynamicQuery

DynamicQuery dynamicQuery()

dynamicQuery

List dynamicQuery(DynamicQuery dynamicQuery)
                  throws SystemException
Performs a dynamic query on the database and returns the matching rows.

Parameters:
dynamicQuery - the dynamic query
Returns:
the matching rows
Throws:
SystemException - if a system exception occurred

dynamicQuery

List dynamicQuery(DynamicQuery dynamicQuery,
                  int start,
                  int end)
                  throws SystemException
Performs a dynamic query on the database and returns a range of the matching rows.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil.ALL_POS), then the query will include the default ORDER BY logic from DDMTemplateModelImpl. If both orderByComparator 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.

Parameters:
dynamicQuery - the dynamic query
start - the lower bound of the range of model instances
end - the upper bound of the range of model instances (not inclusive)
Returns:
the range of matching rows
Throws:
SystemException - if a system exception occurred

dynamicQuery

List dynamicQuery(DynamicQuery dynamicQuery,
                  int start,
                  int end,
                  OrderByComparator orderByComparator)
                  throws SystemException
Performs a dynamic query on the database and returns an ordered range of the matching rows.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil.ALL_POS), then the query will include the default ORDER BY logic from DDMTemplateModelImpl. If both orderByComparator 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.

Parameters:
dynamicQuery - the dynamic query
start - the lower bound of the range of model instances
end - the upper bound of the range of model instances (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of matching rows
Throws:
SystemException - if a system exception occurred

dynamicQueryCount

long dynamicQueryCount(DynamicQuery dynamicQuery)
                       throws SystemException
Returns the number of rows that match the dynamic query.

Parameters:
dynamicQuery - the dynamic query
Returns:
the number of rows that match the dynamic query
Throws:
SystemException - if a system exception occurred

dynamicQueryCount

long dynamicQueryCount(DynamicQuery dynamicQuery,
                       Projection projection)
                       throws SystemException
Returns the number of rows that match the dynamic query.

Parameters:
dynamicQuery - the dynamic query
projection - the projection to apply to the query
Returns:
the number of rows that match the dynamic query
Throws:
SystemException - if a system exception occurred

fetchDDMTemplate

@Transactional(propagation=SUPPORTS,
               readOnly=true)
DDMTemplate fetchDDMTemplate(long templateId)
                             throws SystemException
Throws:
SystemException

fetchDDMTemplateByUuidAndCompanyId

@Transactional(propagation=SUPPORTS,
               readOnly=true)
DDMTemplate fetchDDMTemplateByUuidAndCompanyId(String uuid,
                                                                                        long companyId)
                                               throws SystemException
Returns the d d m template with the matching UUID and company.

Parameters:
uuid - the d d m template's UUID
companyId - the primary key of the company
Returns:
the matching d d m template, or null if a matching d d m template could not be found
Throws:
SystemException - if a system exception occurred

fetchDDMTemplateByUuidAndGroupId

@Transactional(propagation=SUPPORTS,
               readOnly=true)
DDMTemplate fetchDDMTemplateByUuidAndGroupId(String uuid,
                                                                                      long groupId)
                                             throws SystemException
Returns the d d m template matching the UUID and group.

Parameters:
uuid - the d d m template's UUID
groupId - the primary key of the group
Returns:
the matching d d m template, or null if a matching d d m template could not be found
Throws:
SystemException - if a system exception occurred

getDDMTemplate

@Transactional(propagation=SUPPORTS,
               readOnly=true)
DDMTemplate getDDMTemplate(long templateId)
                           throws PortalException,
                                  SystemException
Returns the d d m template with the primary key.

Parameters:
templateId - the primary key of the d d m template
Returns:
the d d m template
Throws:
PortalException - if a d d m template with the primary key could not be found
SystemException - if a system exception occurred

getPersistedModel

@Transactional(propagation=SUPPORTS,
               readOnly=true)
PersistedModel getPersistedModel(Serializable primaryKeyObj)
                                 throws PortalException,
                                        SystemException
Specified by:
getPersistedModel in interface PersistedModelLocalService
Throws:
PortalException
SystemException

getDDMTemplateByUuidAndCompanyId

@Transactional(propagation=SUPPORTS,
               readOnly=true)
DDMTemplate getDDMTemplateByUuidAndCompanyId(String uuid,
                                                                                      long companyId)
                                             throws PortalException,
                                                    SystemException
Returns the d d m template with the matching UUID and company.

Parameters:
uuid - the d d m template's UUID
companyId - the primary key of the company
Returns:
the matching d d m template
Throws:
PortalException - if a matching d d m template could not be found
SystemException - if a system exception occurred

getDDMTemplateByUuidAndGroupId

@Transactional(propagation=SUPPORTS,
               readOnly=true)
DDMTemplate getDDMTemplateByUuidAndGroupId(String uuid,
                                                                                    long groupId)
                                           throws PortalException,
                                                  SystemException
Returns the d d m template matching the UUID and group.

Parameters:
uuid - the d d m template's UUID
groupId - the primary key of the group
Returns:
the matching d d m template
Throws:
PortalException - if a matching d d m template could not be found
SystemException - if a system exception occurred

getDDMTemplates

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<DDMTemplate> getDDMTemplates(int start,
                                                                           int end)
                                  throws SystemException
Returns a range of all the d d m templates.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil.ALL_POS), then the query will include the default ORDER BY logic from DDMTemplateModelImpl. If both orderByComparator 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.

Parameters:
start - the lower bound of the range of d d m templates
end - the upper bound of the range of d d m templates (not inclusive)
Returns:
the range of d d m templates
Throws:
SystemException - if a system exception occurred

getDDMTemplatesCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int getDDMTemplatesCount()
                         throws SystemException
Returns the number of d d m templates.

Returns:
the number of d d m templates
Throws:
SystemException - if a system exception occurred

updateDDMTemplate

@Indexable(type=REINDEX)
DDMTemplate updateDDMTemplate(DDMTemplate ddmTemplate)
                              throws SystemException
Updates the d d m template in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.

Parameters:
ddmTemplate - the d d m template
Returns:
the d d m template that was updated
Throws:
SystemException - if a system exception occurred

getBeanIdentifier

String getBeanIdentifier()
Returns the Spring bean ID for this bean.

Returns:
the Spring bean ID for this bean

setBeanIdentifier

void setBeanIdentifier(String beanIdentifier)
Sets the Spring bean ID for this bean.

Parameters:
beanIdentifier - the Spring bean ID for this bean

addTemplate

DDMTemplate addTemplate(long userId,
                        long groupId,
                        long classNameId,
                        long classPK,
                        Map<Locale,String> nameMap,
                        Map<Locale,String> descriptionMap,
                        String type,
                        String mode,
                        String language,
                        String script,
                        ServiceContext serviceContext)
                        throws PortalException,
                               SystemException
Adds a template.

Parameters:
userId - the primary key of the template's creator/owner
groupId - the primary key of the group
classNameId - the primary key of the class name for the template's related model
classPK - the primary key of the template's related entity
nameMap - the template's locales and localized names
descriptionMap - the template's locales and localized descriptions
type - the template's type. For more information, see DDMTemplateConstants.
mode - the template's mode. For more information, see DDMTemplateConstants.
language - the template's script language. For more information, see DDMTemplateConstants.
script - the template's script
serviceContext - the service context to be applied. Can set the UUID, creation date, modification date, guest permissions, and group permissions for the template.
Returns:
the template
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

addTemplate

DDMTemplate addTemplate(long userId,
                        long groupId,
                        long classNameId,
                        long classPK,
                        String templateKey,
                        Map<Locale,String> nameMap,
                        Map<Locale,String> descriptionMap,
                        String type,
                        String mode,
                        String language,
                        String script,
                        boolean cacheable,
                        boolean smallImage,
                        String smallImageURL,
                        File smallImageFile,
                        ServiceContext serviceContext)
                        throws PortalException,
                               SystemException
Adds a template with additional parameters.

Parameters:
userId - the primary key of the template's creator/owner
groupId - the primary key of the group
classNameId - the primary key of the class name for the template's related model
classPK - the primary key of the template's related entity
templateKey - the unique string identifying the template (optionally null)
nameMap - the template's locales and localized names
descriptionMap - the template's locales and localized descriptions
type - the template's type. For more information, see DDMTemplateConstants.
mode - the template's mode. For more information, see DDMTemplateConstants.
language - the template's script language. For more information, see DDMTemplateConstants.
script - the template's script
cacheable - whether the template is cacheable
smallImage - whether the template has a small image
smallImageURL - the template's small image URL (optionally null)
smallImageFile - the template's small image file (optionally null)
serviceContext - the service context to be applied. Can set the UUID, creation date, modification date, guest permissions, and group permissions for the template.
Returns:
the template
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

addTemplateResources

void addTemplateResources(DDMTemplate template,
                          boolean addGroupPermissions,
                          boolean addGuestPermissions)
                          throws PortalException,
                                 SystemException
Adds the resources to the template.

Parameters:
template - the template to add resources to
addGroupPermissions - whether to add group permissions
addGuestPermissions - whether to add guest permissions
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

addTemplateResources

void addTemplateResources(DDMTemplate template,
                          String[] groupPermissions,
                          String[] guestPermissions)
                          throws PortalException,
                                 SystemException
Adds the model resources with the permissions to the template.

Parameters:
template - the template to add resources to
groupPermissions - the group permissions to be added
guestPermissions - the guest permissions to be added
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

copyTemplate

DDMTemplate copyTemplate(long userId,
                         long templateId,
                         Map<Locale,String> nameMap,
                         Map<Locale,String> descriptionMap,
                         ServiceContext serviceContext)
                         throws PortalException,
                                SystemException
Copies the template, creating a new template with all the values extracted from the original one. This method supports defining a new name and description.

Parameters:
userId - the primary key of the template's creator/owner
templateId - the primary key of the template to be copied
nameMap - the new template's locales and localized names
descriptionMap - the new template's locales and localized descriptions
serviceContext - the service context to be applied. Can set the UUID, creation date, modification date, guest permissions, and group permissions for the template.
Returns:
the new template
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

copyTemplate

DDMTemplate copyTemplate(long userId,
                         long templateId,
                         ServiceContext serviceContext)
                         throws PortalException,
                                SystemException
Throws:
PortalException
SystemException

copyTemplates

List<DDMTemplate> copyTemplates(long userId,
                                long classNameId,
                                long oldClassPK,
                                long newClassPK,
                                String type,
                                ServiceContext serviceContext)
                                throws PortalException,
                                       SystemException
Copies all the templates matching the class name ID, class PK, and type. This method creates new templates, extracting all the values from the old ones and updating their class PKs.

Parameters:
userId - the primary key of the template's creator/owner
classNameId - the primary key of the class name for the template's related model
oldClassPK - the primary key of the old template's related entity
newClassPK - the primary key of the new template's related entity
type - the template's type. For more information, see DDMTemplateConstants.
serviceContext - the service context to be applied. Can set the creation date, modification date, guest permissions, and group permissions for the new templates.
Returns:
the new templates
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

deleteTemplate

@SystemEvent(type=1)
void deleteTemplate(DDMTemplate template)
                    throws PortalException,
                           SystemException
Deletes the template and its resources.

Parameters:
template - the template to be deleted
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

deleteTemplate

void deleteTemplate(long templateId)
                    throws PortalException,
                           SystemException
Deletes the template and its resources.

Parameters:
templateId - the primary key of the template to be deleted
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

deleteTemplates

void deleteTemplates(long groupId)
                     throws PortalException,
                            SystemException
Deletes all the templates of the group.

Parameters:
groupId - the primary key of the group
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

deleteTemplates

void deleteTemplates(long groupId,
                     long classNameId)
                     throws PortalException,
                            SystemException
Throws:
PortalException
SystemException

fetchTemplate

@Transactional(propagation=SUPPORTS,
               readOnly=true)
DDMTemplate fetchTemplate(long groupId,
                                                                   long classNameId,
                                                                   String templateKey)
                          throws SystemException
Returns the template matching the group and template key.

Parameters:
groupId - the primary key of the group
classNameId - the primary key of the class name for the template's related model
templateKey - the unique string identifying the template
Returns:
the matching template, or null if a matching template could not be found
Throws:
SystemException - if a system exception occurred

fetchTemplate

@Transactional(propagation=SUPPORTS,
               readOnly=true)
DDMTemplate fetchTemplate(long groupId,
                                                                   long classNameId,
                                                                   String templateKey,
                                                                   boolean includeGlobalTemplates)
                          throws PortalException,
                                 SystemException
Returns the template matching the group and template key, optionally in the global scope.

This method first searches in the given group. If the template is still not found and includeGlobalTemplates is set to true, this method searches the global group.

Parameters:
groupId - the primary key of the group
classNameId - the primary key of the class name for the template's related model
templateKey - the unique string identifying the template
includeGlobalTemplates - whether to include the global scope in the search
Returns:
the matching template, or null if a matching template could not be found
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

getTemplate

@Transactional(propagation=SUPPORTS,
               readOnly=true)
DDMTemplate getTemplate(long templateId)
                        throws PortalException,
                               SystemException
Returns the template with the ID.

Parameters:
templateId - the primary key of the template
Returns:
the template with the ID
Throws:
PortalException - if a matching template could not be found
SystemException - if a system exception occurred

getTemplate

@Transactional(propagation=SUPPORTS,
               readOnly=true)
DDMTemplate getTemplate(long groupId,
                                                                 long classNameId,
                                                                 String templateKey)
                        throws PortalException,
                               SystemException
Returns the template matching the group and template key.

Parameters:
groupId - the primary key of the group
classNameId - the primary key of the class name for the template's related model
templateKey - the unique string identifying the template
Returns:
the matching template
Throws:
PortalException - if a matching template could not be found
SystemException - if a system exception occurred

getTemplate

@Transactional(propagation=SUPPORTS,
               readOnly=true)
DDMTemplate getTemplate(long groupId,
                                                                 long classNameId,
                                                                 String templateKey,
                                                                 boolean includeGlobalTemplates)
                        throws PortalException,
                               SystemException
Returns the template matching the group and template key, optionally in the global scope.

This method first searches in the group. If the template is still not found and includeGlobalTemplates is set to true, this method searches the global group.

Parameters:
groupId - the primary key of the group
classNameId - the primary key of the class name for the template's related model
templateKey - the unique string identifying the template
includeGlobalTemplates - whether to include the global scope in the search
Returns:
the matching template
Throws:
PortalException - if a matching template could not be found
SystemException - if a system exception occurred

getTemplateBySmallImageId

@Transactional(propagation=SUPPORTS,
               readOnly=true)
DDMTemplate getTemplateBySmallImageId(long smallImageId)
                                      throws PortalException,
                                             SystemException
Throws:
PortalException
SystemException

getTemplates

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<DDMTemplate> getTemplates(long classPK)
                               throws SystemException
Returns all the templates with the class PK.

Parameters:
classPK - the primary key of the template's related entity
Returns:
the templates with the class PK
Throws:
SystemException - if a system exception occurred

getTemplates

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<DDMTemplate> getTemplates(long groupId,
                                                                        long classNameId)
                               throws SystemException
Returns all the templates matching the group and class name ID.

Parameters:
groupId - the primary key of the group
classNameId - the primary key of the class name for the template's related model
Returns:
the matching templates
Throws:
SystemException - if a system exception occurred

getTemplates

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<DDMTemplate> getTemplates(long groupId,
                                                                        long classNameId,
                                                                        long classPK)
                               throws SystemException
Returns all the templates matching the group, class name ID, and class PK.

Parameters:
groupId - the primary key of the group
classNameId - the primary key of the class name for the template's related model
classPK - the primary key of the template's related entity
Returns:
the matching templates
Throws:
SystemException - if a system exception occurred

getTemplates

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<DDMTemplate> getTemplates(long groupId,
                                                                        long classNameId,
                                                                        long classPK,
                                                                        String type)
                               throws SystemException
Returns all the templates matching the group, class name ID, class PK, and type.

Parameters:
groupId - the primary key of the group
classNameId - the primary key of the class name for the template's related model
classPK - the primary key of the template's related entity
type - the template's type. For more information, see DDMTemplateConstants.
Returns:
the matching templates
Throws:
SystemException - if a system exception occurred

getTemplates

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<DDMTemplate> getTemplates(long groupId,
                                                                        long classNameId,
                                                                        long classPK,
                                                                        String type,
                                                                        String mode)
                               throws SystemException
Returns all the templates matching the group, class name ID, class PK, type, and mode.

Parameters:
groupId - the primary key of the group
classNameId - the primary key of the class name for the template's related model
classPK - the primary key of the template's related entity
type - the template's type. For more information, see DDMTemplateConstants.
mode - the template's mode. For more information, see DDMTemplateConstants.
Returns:
the matching templates
Throws:
SystemException - if a system exception occurred

getTemplatesByClassPK

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<DDMTemplate> getTemplatesByClassPK(long groupId,
                                                                                 long classPK)
                                        throws SystemException
Throws:
SystemException

getTemplatesByClassPK

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<DDMTemplate> getTemplatesByClassPK(long groupId,
                                                                                 long classPK,
                                                                                 int start,
                                                                                 int end)
                                        throws SystemException
Throws:
SystemException

getTemplatesByClassPK

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<DDMTemplate> getTemplatesByClassPK(long[] groupIds,
                                                                                 long classPK)
                                        throws SystemException
Throws:
SystemException

getTemplatesByClassPKCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int getTemplatesByClassPKCount(long groupId,
                                                                        long classPK)
                               throws SystemException
Returns the number of templates matching the group and class PK.

Parameters:
groupId - the primary key of the group
classPK - the primary key of the template's related entity
Returns:
the number of templates belonging to the group and class PK
Throws:
SystemException - if a system exception occurred

getTemplatesByStructureClassNameId

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<DDMTemplate> getTemplatesByStructureClassNameId(long groupId,
                                                                                              long structureClassNameId,
                                                                                              int start,
                                                                                              int end,
                                                                                              OrderByComparator orderByComparator)
                                                     throws SystemException
Returns an ordered range of all the templates matching the group and structure class name ID.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
groupId - the primary key of the group
structureClassNameId - the primary key of the class name for the template's related structure
start - the lower bound of the range of templates to return
end - the upper bound of the range of templates to return (not inclusive)
orderByComparator - the comparator to order the templates (optionally null)
Returns:
the range of matching templates ordered by the comparator
Throws:
SystemException - if a system exception occurred

getTemplatesByStructureClassNameIdCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int getTemplatesByStructureClassNameIdCount(long groupId,
                                                                                     long structureClassNameId)
                                            throws SystemException
Returns the number of templates matching the group and structure class name ID, including Generic Templates.

Parameters:
groupId - the primary key of the group
structureClassNameId - the primary key of the class name for the template's related structure
Returns:
the number of matching templates
Throws:
SystemException - if a system exception occurred

getTemplatesCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int getTemplatesCount(long groupId)
                      throws SystemException
Returns the number of templates belonging to the group.

Parameters:
groupId - the primary key of the group
Returns:
the number of templates belonging to the group
Throws:
SystemException - if a system exception occurred

getTemplatesCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int getTemplatesCount(long groupId,
                                                               long classNameId)
                      throws SystemException
Returns the number of templates matching the group and class name ID.

Parameters:
groupId - the primary key of the group
classNameId - the primary key of the class name for the template's related model
Returns:
the number of matching templates
Throws:
SystemException - if a system exception occurred

getTemplatesCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int getTemplatesCount(long groupId,
                                                               long classNameId,
                                                               long classPK)
                      throws SystemException
Returns the number of templates matching the group, class name ID, and class PK.

Parameters:
groupId - the primary key of the group
classNameId - the primary key of the class name for the template's related model
classPK - the primary key of the template's related entity
Returns:
the number of matching templates
Throws:
SystemException - if a system exception occurred

search

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<DDMTemplate> search(long companyId,
                                                                  long groupId,
                                                                  long classNameId,
                                                                  long classPK,
                                                                  String keywords,
                                                                  String type,
                                                                  String mode,
                                                                  int start,
                                                                  int end,
                                                                  OrderByComparator orderByComparator)
                         throws SystemException
Returns an ordered range of all the templates matching the group, class name ID, class PK, type, and mode, and matching the keywords in the template names and descriptions.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
companyId - the primary key of the template's company
groupId - the primary key of the group
classNameId - the primary key of the class name for the template's related model
classPK - the primary key of the template's related entity
keywords - the keywords (space separated), which may occur in the template's name or description (optionally null)
type - the template's type (optionally null). For more information, see DDMTemplateConstants.
mode - the template's mode (optionally null). For more information, see DDMTemplateConstants.
start - the lower bound of the range of templates to return
end - the upper bound of the range of templates to return (not inclusive)
orderByComparator - the comparator to order the templates (optionally null)
Returns:
the range of matching templates ordered by the comparator
Throws:
SystemException - if a system exception occurred

search

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<DDMTemplate> search(long companyId,
                                                                  long groupId,
                                                                  long classNameId,
                                                                  long classPK,
                                                                  String name,
                                                                  String description,
                                                                  String type,
                                                                  String mode,
                                                                  String language,
                                                                  boolean andOperator,
                                                                  int start,
                                                                  int end,
                                                                  OrderByComparator orderByComparator)
                         throws SystemException
Returns an ordered range of all the templates matching the group, class name ID, class PK, name keyword, description keyword, type, mode, and language.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
companyId - the primary key of the template's company
groupId - the primary key of the group
classNameId - the primary key of the class name for the template's related model
classPK - the primary key of the template's related entity
name - the name keywords (optionally null)
description - the description keywords (optionally null)
type - the template's type (optionally null). For more information, see DDMTemplateConstants.
mode - the template's mode (optionally null). For more information, see DDMTemplateConstants.
language - the template's script language (optionally null). For more information, see DDMTemplateConstants.
andOperator - whether every field must match its keywords, or just one field
start - the lower bound of the range of templates to return
end - the upper bound of the range of templates to return (not inclusive)
orderByComparator - the comparator to order the templates (optionally null)
Returns:
the range of matching templates ordered by the comparator
Throws:
SystemException - if a system exception occurred

search

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<DDMTemplate> search(long companyId,
                                                                  long[] groupIds,
                                                                  long[] classNameIds,
                                                                  long[] classPKs,
                                                                  String keywords,
                                                                  String type,
                                                                  String mode,
                                                                  int start,
                                                                  int end,
                                                                  OrderByComparator orderByComparator)
                         throws SystemException
Returns an ordered range of all the templates matching the group IDs, class Name IDs, class PK, type, and mode, and include the keywords on its names and descriptions.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
companyId - the primary key of the template's company
groupIds - the primary keys of the groups
classNameIds - the primary keys of the entity's instances the templates are related to
classPKs - the primary keys of the template's related entities
keywords - the keywords (space separated), which may occur in the template's name or description (optionally null)
type - the template's type (optionally null). For more information, see DDMTemplateConstants.
mode - the template's mode (optionally null). For more information, see DDMTemplateConstants.
start - the lower bound of the range of templates to return
end - the upper bound of the range of templates to return (not inclusive)
orderByComparator - the comparator to order the templates (optionally null)
Returns:
the range of matching templates ordered by the comparator
Throws:
SystemException - if a system exception occurred

search

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<DDMTemplate> search(long companyId,
                                                                  long[] groupIds,
                                                                  long[] classNameIds,
                                                                  long[] classPKs,
                                                                  String name,
                                                                  String description,
                                                                  String type,
                                                                  String mode,
                                                                  String language,
                                                                  boolean andOperator,
                                                                  int start,
                                                                  int end,
                                                                  OrderByComparator orderByComparator)
                         throws SystemException
Returns an ordered range of all the templates matching the group IDs, class name IDs, class PK, name keyword, description keyword, type, mode, and language.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
companyId - the primary key of the template's company
groupIds - the primary keys of the groups
classNameIds - the primary keys of the entity's instances the templates are related to
classPKs - the primary keys of the template's related entities
name - the name keywords (optionally null)
description - the description keywords (optionally null)
type - the template's type (optionally null). For more information, see DDMTemplateConstants.
mode - the template's mode (optionally null). For more information, see DDMTemplateConstants.
language - the template's script language (optionally null). For more information, see DDMTemplateConstants.
andOperator - whether every field must match its keywords, or just one field.
start - the lower bound of the range of templates to return
end - the upper bound of the range of templates to return (not inclusive)
orderByComparator - the comparator to order the templates (optionally null)
Returns:
the range of matching templates ordered by the comparator
Throws:
SystemException - if a system exception occurred

searchCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int searchCount(long companyId,
                                                         long groupId,
                                                         long classNameId,
                                                         long classPK,
                                                         String keywords,
                                                         String type,
                                                         String mode)
                throws SystemException
Returns the number of templates matching the group, class name ID, class PK, type, and matching the keywords in the template names and descriptions.

Parameters:
companyId - the primary key of the template's company
groupId - the primary key of the group
classNameId - the primary key of the class name for the template's related model
classPK - the primary key of the template's related entity
keywords - the keywords (space separated), which may occur in the template's name or description (optionally null)
type - the template's type (optionally null). For more information, see DDMTemplateConstants.
mode - the template's mode (optionally null). For more information, see DDMTemplateConstants.
Returns:
the number of matching templates
Throws:
SystemException - if a system exception occurred

searchCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int searchCount(long companyId,
                                                         long groupId,
                                                         long classNameId,
                                                         long classPK,
                                                         String name,
                                                         String description,
                                                         String type,
                                                         String mode,
                                                         String language,
                                                         boolean andOperator)
                throws SystemException
Returns the number of templates matching the group, class name ID, class PK, name keyword, description keyword, type, mode, and language.

Parameters:
companyId - the primary key of the template's company
groupId - the primary key of the group
classNameId - the primary key of the class name for the template's related model
classPK - the primary key of the template's related entity
name - the name keywords (optionally null)
description - the description keywords (optionally null)
type - the template's type (optionally null). For more information, see DDMTemplateConstants.
mode - the template's mode (optionally null). For more information, see DDMTemplateConstants.
language - the template's script language (optionally null). For more information, see DDMTemplateConstants.
andOperator - whether every field must match its keywords, or just one field.
Returns:
the number of matching templates
Throws:
SystemException - if a system exception occurred

searchCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int searchCount(long companyId,
                                                         long[] groupIds,
                                                         long[] classNameIds,
                                                         long[] classPKs,
                                                         String keywords,
                                                         String type,
                                                         String mode)
                throws SystemException
Returns the number of templates matching the group IDs, class name IDs, class PK, type, and mode, and matching the keywords in the template names and descriptions.

Parameters:
companyId - the primary key of the template's company
groupIds - the primary keys of the groups
classNameIds - the primary keys of the entity's instance the templates are related to
classPKs - the primary keys of the template's related entities
keywords - the keywords (space separated), which may occur in the template's name or description (optionally null)
type - the template's type (optionally null). For more information, see DDMTemplateConstants.
mode - the template's mode (optionally null). For more information, see DDMTemplateConstants.
Returns:
the number of matching templates
Throws:
SystemException - if a system exception occurred

searchCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int searchCount(long companyId,
                                                         long[] groupIds,
                                                         long[] classNameIds,
                                                         long[] classPKs,
                                                         String name,
                                                         String description,
                                                         String type,
                                                         String mode,
                                                         String language,
                                                         boolean andOperator)
                throws SystemException
Returns the number of templates matching the group IDs, class name IDs, class PKs, name keyword, description keyword, type, mode, and language.

Parameters:
companyId - the primary key of the templates company
groupIds - the primary keys of the groups
classNameIds - the primary keys of the entity's instance the templates are related to
classPKs - the primary keys of the template's related entities
name - the name keywords (optionally null)
description - the description keywords (optionally null)
type - the template's type (optionally null). For more information, see DDMTemplateConstants.
mode - the template's mode (optionally null). For more information, see DDMTemplateConstants.
language - the template's script language (optionally null). For more information, see DDMTemplateConstants.
andOperator - whether every field must match its keywords, or just one field.
Returns:
the number of matching templates
Throws:
SystemException - if a system exception occurred

updateTemplate

DDMTemplate updateTemplate(long templateId,
                           long classPK,
                           Map<Locale,String> nameMap,
                           Map<Locale,String> descriptionMap,
                           String type,
                           String mode,
                           String language,
                           String script,
                           boolean cacheable,
                           boolean smallImage,
                           String smallImageURL,
                           File smallImageFile,
                           ServiceContext serviceContext)
                           throws PortalException,
                                  SystemException
Updates the template matching the ID.

Parameters:
templateId - the primary key of the template
classPK - the primary key of the template's related entity
nameMap - the template's new locales and localized names
descriptionMap - the template's new locales and localized description
type - the template's type. For more information, see DDMTemplateConstants.
mode - the template's mode. For more information, see DDMTemplateConstants.
language - the template's script language. For more information, see DDMTemplateConstants.
script - the template's script
cacheable - whether the template is cacheable
smallImage - whether the template has a small image
smallImageURL - the template's small image URL (optionally null)
smallImageFile - the template's small image file (optionally null)
serviceContext - the service context to be applied. Can set the modification date.
Returns:
the updated template
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

Liferay 6.2-ce-ga5