public class DDMTemplateLocalServiceImpl extends DDMTemplateLocalServiceBaseImpl
DDM templates (templates) are used in Liferay to render templated content like applications, forms, dynamic data lists, or web contents.
Templates support a variety of templating languages, like Velocity or FreeMarker. They also support multi-language names and descriptions.
Templates can be related to many models in Liferay, such as those for structures, dynamic data lists, and applications. This relationship can be established via the class name ID and class PK.
counterLocalService, ddmContentLocalService, ddmContentPersistence, ddmStorageLinkLocalService, ddmStorageLinkPersistence, ddmStructureFinder, ddmStructureLinkLocalService, ddmStructureLinkPersistence, ddmStructureLocalService, ddmStructurePersistence, ddmStructureService, ddmTemplateFinder, ddmTemplateLocalService, ddmTemplatePersistence, ddmTemplateService, groupFinder, groupLocalService, groupPersistence, groupService, imageLocalService, imagePersistence, imageService, persistedModelLocalServiceRegistry, resourceLocalService, systemEventLocalService, systemEventPersistence, userFinder, userLocalService, userPersistence, userService| Constructor and Description |
|---|
DDMTemplateLocalServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
com.liferay.portlet.dynamicdatamapping.model.DDMTemplate |
addTemplate(long userId,
long groupId,
long classNameId,
long classPK,
java.util.Map<java.util.Locale,java.lang.String> nameMap,
java.util.Map<java.util.Locale,java.lang.String> descriptionMap,
java.lang.String type,
java.lang.String mode,
java.lang.String language,
java.lang.String script,
com.liferay.portal.service.ServiceContext serviceContext)
Adds a template.
|
com.liferay.portlet.dynamicdatamapping.model.DDMTemplate |
addTemplate(long userId,
long groupId,
long classNameId,
long classPK,
java.lang.String templateKey,
java.util.Map<java.util.Locale,java.lang.String> nameMap,
java.util.Map<java.util.Locale,java.lang.String> descriptionMap,
java.lang.String type,
java.lang.String mode,
java.lang.String language,
java.lang.String script,
boolean cacheable,
boolean smallImage,
java.lang.String smallImageURL,
java.io.File smallImageFile,
com.liferay.portal.service.ServiceContext serviceContext)
Adds a template with additional parameters.
|
void |
addTemplateResources(com.liferay.portlet.dynamicdatamapping.model.DDMTemplate template,
boolean addGroupPermissions,
boolean addGuestPermissions)
Adds the resources to the template.
|
void |
addTemplateResources(com.liferay.portlet.dynamicdatamapping.model.DDMTemplate template,
java.lang.String[] groupPermissions,
java.lang.String[] guestPermissions)
Adds the model resources with the permissions to the template.
|
protected java.io.File |
copySmallImage(com.liferay.portlet.dynamicdatamapping.model.DDMTemplate template) |
protected com.liferay.portlet.dynamicdatamapping.model.DDMTemplate |
copyTemplate(long userId,
com.liferay.portlet.dynamicdatamapping.model.DDMTemplate template,
long classPK,
java.util.Map<java.util.Locale,java.lang.String> nameMap,
java.util.Map<java.util.Locale,java.lang.String> descriptionMap,
com.liferay.portal.service.ServiceContext serviceContext) |
com.liferay.portlet.dynamicdatamapping.model.DDMTemplate |
copyTemplate(long userId,
long templateId,
java.util.Map<java.util.Locale,java.lang.String> nameMap,
java.util.Map<java.util.Locale,java.lang.String> descriptionMap,
com.liferay.portal.service.ServiceContext serviceContext)
Copies the template, creating a new template with all the values
extracted from the original one.
|
com.liferay.portlet.dynamicdatamapping.model.DDMTemplate |
copyTemplate(long userId,
long templateId,
com.liferay.portal.service.ServiceContext serviceContext) |
java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> |
copyTemplates(long userId,
long classNameId,
long oldClassPK,
long newClassPK,
java.lang.String type,
com.liferay.portal.service.ServiceContext serviceContext)
Copies all the templates matching the class name ID, class PK, and type.
|
void |
deleteTemplate(com.liferay.portlet.dynamicdatamapping.model.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) |
com.liferay.portlet.dynamicdatamapping.model.DDMTemplate |
fetchTemplate(long groupId,
long classNameId,
java.lang.String templateKey)
Returns the template matching the group and template key.
|
com.liferay.portlet.dynamicdatamapping.model.DDMTemplate |
fetchTemplate(long groupId,
long classNameId,
java.lang.String templateKey,
boolean includeGlobalTemplates)
Returns the template matching the group and template key, optionally in
the global scope.
|
protected java.lang.String |
formatScript(java.lang.String type,
java.lang.String language,
java.lang.String script) |
com.liferay.portlet.dynamicdatamapping.model.DDMTemplate |
getTemplate(long templateId)
Returns the template with the ID.
|
com.liferay.portlet.dynamicdatamapping.model.DDMTemplate |
getTemplate(long groupId,
long classNameId,
java.lang.String templateKey)
Returns the template matching the group and template key.
|
com.liferay.portlet.dynamicdatamapping.model.DDMTemplate |
getTemplate(long groupId,
long classNameId,
java.lang.String templateKey,
boolean includeGlobalTemplates)
Returns the template matching the group and template key, optionally in
the global scope.
|
com.liferay.portlet.dynamicdatamapping.model.DDMTemplate |
getTemplateBySmallImageId(long smallImageId) |
java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> |
getTemplates(long classPK)
Returns all the templates with the class PK.
|
java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> |
getTemplates(long groupId,
long classNameId)
Returns all the templates matching the group and class name ID.
|
java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> |
getTemplates(long groupId,
long classNameId,
long classPK)
Returns all the templates matching the group, class name ID, and class
PK.
|
java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> |
getTemplates(long groupId,
long classNameId,
long classPK,
java.lang.String type)
Returns all the templates matching the group, class name ID, class PK,
and type.
|
java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> |
getTemplates(long groupId,
long classNameId,
long classPK,
java.lang.String type,
java.lang.String mode)
Returns all the templates matching the group, class name ID, class PK,
type, and mode.
|
java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> |
getTemplatesByClassPK(long[] groupIds,
long classPK) |
java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> |
getTemplatesByClassPK(long groupId,
long classPK) |
java.util.List<com.liferay.portlet.dynamicdatamapping.model.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.
|
java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> |
getTemplatesByStructureClassNameId(long groupId,
long structureClassNameId,
int start,
int end,
com.liferay.portal.kernel.util.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.
|
protected void |
saveImages(boolean smallImage,
long smallImageId,
java.io.File smallImageFile,
byte[] smallImageBytes) |
java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> |
search(long companyId,
long[] groupIds,
long[] classNameIds,
long[] classPKs,
java.lang.String keywords,
java.lang.String type,
java.lang.String mode,
int start,
int end,
com.liferay.portal.kernel.util.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.
|
java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> |
search(long companyId,
long[] groupIds,
long[] classNameIds,
long[] classPKs,
java.lang.String name,
java.lang.String description,
java.lang.String type,
java.lang.String mode,
java.lang.String language,
boolean andOperator,
int start,
int end,
com.liferay.portal.kernel.util.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.
|
java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> |
search(long companyId,
long groupId,
long classNameId,
long classPK,
java.lang.String keywords,
java.lang.String type,
java.lang.String mode,
int start,
int end,
com.liferay.portal.kernel.util.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.
|
java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> |
search(long companyId,
long groupId,
long classNameId,
long classPK,
java.lang.String name,
java.lang.String description,
java.lang.String type,
java.lang.String mode,
java.lang.String language,
boolean andOperator,
int start,
int end,
com.liferay.portal.kernel.util.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,
java.lang.String keywords,
java.lang.String type,
java.lang.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,
java.lang.String name,
java.lang.String description,
java.lang.String type,
java.lang.String mode,
java.lang.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,
java.lang.String keywords,
java.lang.String type,
java.lang.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,
java.lang.String name,
java.lang.String description,
java.lang.String type,
java.lang.String mode,
java.lang.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.
|
com.liferay.portlet.dynamicdatamapping.model.DDMTemplate |
updateTemplate(long templateId,
long classPK,
java.util.Map<java.util.Locale,java.lang.String> nameMap,
java.util.Map<java.util.Locale,java.lang.String> descriptionMap,
java.lang.String type,
java.lang.String mode,
java.lang.String language,
java.lang.String script,
boolean cacheable,
boolean smallImage,
java.lang.String smallImageURL,
java.io.File smallImageFile,
com.liferay.portal.service.ServiceContext serviceContext)
Updates the template matching the ID.
|
protected void |
validate(long groupId,
long classNameId,
java.lang.String templateKey,
java.util.Map<java.util.Locale,java.lang.String> nameMap,
java.lang.String script,
boolean smallImage,
java.lang.String smallImageURL,
java.io.File smallImageFile,
byte[] smallImageBytes) |
protected void |
validate(java.util.Map<java.util.Locale,java.lang.String> nameMap,
java.lang.String script,
boolean smallImage,
java.lang.String smallImageURL,
java.io.File smallImageFile,
byte[] smallImageBytes) |
protected void |
validateName(java.util.Map<java.util.Locale,java.lang.String> nameMap) |
addDDMTemplate, afterPropertiesSet, createDDMTemplate, deleteDDMTemplate, deleteDDMTemplate, destroy, dynamicQuery, dynamicQuery, dynamicQuery, dynamicQuery, dynamicQueryCount, dynamicQueryCount, fetchDDMTemplate, fetchDDMTemplateByUuidAndCompanyId, fetchDDMTemplateByUuidAndGroupId, getBeanIdentifier, getCounterLocalService, getDDMContentLocalService, getDDMContentPersistence, getDDMStorageLinkLocalService, getDDMStorageLinkPersistence, getDDMStructureFinder, getDDMStructureLinkLocalService, getDDMStructureLinkPersistence, getDDMStructureLocalService, getDDMStructurePersistence, getDDMStructureService, getDDMTemplate, getDDMTemplateByUuidAndCompanyId, getDDMTemplateByUuidAndGroupId, getDDMTemplateFinder, getDDMTemplateLocalService, getDDMTemplatePersistence, getDDMTemplates, getDDMTemplatesCount, getDDMTemplateService, getGroupFinder, getGroupLocalService, getGroupPersistence, getGroupService, getImageLocalService, getImagePersistence, getImageService, getModelClass, getModelClassName, getPersistedModel, getResourceLocalService, getSystemEventLocalService, getSystemEventPersistence, getUserFinder, getUserLocalService, getUserPersistence, getUserService, runSQL, setBeanIdentifier, setCounterLocalService, setDDMContentLocalService, setDDMContentPersistence, setDDMStorageLinkLocalService, setDDMStorageLinkPersistence, setDDMStructureFinder, setDDMStructureLinkLocalService, setDDMStructureLinkPersistence, setDDMStructureLocalService, setDDMStructurePersistence, setDDMStructureService, setDDMTemplateFinder, setDDMTemplateLocalService, setDDMTemplatePersistence, setDDMTemplateService, setGroupFinder, setGroupLocalService, setGroupPersistence, setGroupService, setImageLocalService, setImagePersistence, setImageService, setResourceLocalService, setSystemEventLocalService, setSystemEventPersistence, setUserFinder, setUserLocalService, setUserPersistence, setUserService, updateDDMTemplatepublic com.liferay.portlet.dynamicdatamapping.model.DDMTemplate addTemplate(long userId,
long groupId,
long classNameId,
long classPK,
java.util.Map<java.util.Locale,java.lang.String> nameMap,
java.util.Map<java.util.Locale,java.lang.String> descriptionMap,
java.lang.String type,
java.lang.String mode,
java.lang.String language,
java.lang.String script,
com.liferay.portal.service.ServiceContext serviceContext)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
userId - the primary key of the template's creator/ownergroupId - the primary key of the groupclassNameId - the primary key of the class name for the template's
related modelclassPK - the primary key of the template's related entitynameMap - the template's locales and localized namesdescriptionMap - the template's locales and localized descriptionstype - 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 scriptserviceContext - the service context to be applied. Can set the
UUID, creation date, modification date, guest permissions, and
group permissions for the template.com.liferay.portal.kernel.exception.PortalException - if a portal exception occurredcom.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic com.liferay.portlet.dynamicdatamapping.model.DDMTemplate addTemplate(long userId,
long groupId,
long classNameId,
long classPK,
java.lang.String templateKey,
java.util.Map<java.util.Locale,java.lang.String> nameMap,
java.util.Map<java.util.Locale,java.lang.String> descriptionMap,
java.lang.String type,
java.lang.String mode,
java.lang.String language,
java.lang.String script,
boolean cacheable,
boolean smallImage,
java.lang.String smallImageURL,
java.io.File smallImageFile,
com.liferay.portal.service.ServiceContext serviceContext)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
userId - the primary key of the template's creator/ownergroupId - the primary key of the groupclassNameId - the primary key of the class name for the template's
related modelclassPK - the primary key of the template's related entitytemplateKey - the unique string identifying the template
(optionally null)nameMap - the template's locales and localized namesdescriptionMap - the template's locales and localized descriptionstype - 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 scriptcacheable - whether the template is cacheablesmallImage - whether the template has a small imagesmallImageURL - 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.com.liferay.portal.kernel.exception.PortalException - if a portal exception occurredcom.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic void addTemplateResources(com.liferay.portlet.dynamicdatamapping.model.DDMTemplate template,
boolean addGroupPermissions,
boolean addGuestPermissions)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
template - the template to add resources toaddGroupPermissions - whether to add group permissionsaddGuestPermissions - whether to add guest permissionscom.liferay.portal.kernel.exception.PortalException - if a portal exception occurredcom.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic void addTemplateResources(com.liferay.portlet.dynamicdatamapping.model.DDMTemplate template,
java.lang.String[] groupPermissions,
java.lang.String[] guestPermissions)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
template - the template to add resources togroupPermissions - the group permissions to be addedguestPermissions - the guest permissions to be addedcom.liferay.portal.kernel.exception.PortalException - if a portal exception occurredcom.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic com.liferay.portlet.dynamicdatamapping.model.DDMTemplate copyTemplate(long userId,
long templateId,
java.util.Map<java.util.Locale,java.lang.String> nameMap,
java.util.Map<java.util.Locale,java.lang.String> descriptionMap,
com.liferay.portal.service.ServiceContext serviceContext)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
userId - the primary key of the template's creator/ownertemplateId - the primary key of the template to be copiednameMap - the new template's locales and localized namesdescriptionMap - the new template's locales and localized
descriptionsserviceContext - the service context to be applied. Can set the
UUID, creation date, modification date, guest permissions, and
group permissions for the template.com.liferay.portal.kernel.exception.PortalException - if a portal exception occurredcom.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic com.liferay.portlet.dynamicdatamapping.model.DDMTemplate copyTemplate(long userId,
long templateId,
com.liferay.portal.service.ServiceContext serviceContext)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
com.liferay.portal.kernel.exception.PortalExceptioncom.liferay.portal.kernel.exception.SystemExceptionpublic java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> copyTemplates(long userId,
long classNameId,
long oldClassPK,
long newClassPK,
java.lang.String type,
com.liferay.portal.service.ServiceContext serviceContext)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
userId - the primary key of the template's creator/ownerclassNameId - the primary key of the class name for the template's
related modeloldClassPK - the primary key of the old template's related entitynewClassPK - the primary key of the new template's related entitytype - 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.com.liferay.portal.kernel.exception.PortalException - if a portal exception occurredcom.liferay.portal.kernel.exception.SystemException - if a system exception occurred@SystemEvent(type=1)
public void deleteTemplate(com.liferay.portlet.dynamicdatamapping.model.DDMTemplate template)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
template - the template to be deletedcom.liferay.portal.kernel.exception.PortalException - if a portal exception occurredcom.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic void deleteTemplate(long templateId)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
templateId - the primary key of the template to be deletedcom.liferay.portal.kernel.exception.PortalException - if a portal exception occurredcom.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic void deleteTemplates(long groupId)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
groupId - the primary key of the groupcom.liferay.portal.kernel.exception.PortalException - if a portal exception occurredcom.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic void deleteTemplates(long groupId,
long classNameId)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
com.liferay.portal.kernel.exception.PortalExceptioncom.liferay.portal.kernel.exception.SystemExceptionpublic com.liferay.portlet.dynamicdatamapping.model.DDMTemplate fetchTemplate(long groupId,
long classNameId,
java.lang.String templateKey)
throws com.liferay.portal.kernel.exception.SystemException
groupId - the primary key of the groupclassNameId - the primary key of the class name for the template's
related modeltemplateKey - the unique string identifying the templatenull if a matching
template could not be foundcom.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic com.liferay.portlet.dynamicdatamapping.model.DDMTemplate fetchTemplate(long groupId,
long classNameId,
java.lang.String templateKey,
boolean includeGlobalTemplates)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
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.
groupId - the primary key of the groupclassNameId - the primary key of the class name for the template's
related modeltemplateKey - the unique string identifying the templateincludeGlobalTemplates - whether to include the global scope in the
searchnull if a matching
template could not be foundcom.liferay.portal.kernel.exception.PortalException - if a portal exception occurredcom.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getTemplate(long templateId)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
templateId - the primary key of the templatecom.liferay.portal.kernel.exception.PortalException - if a matching template could not be foundcom.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getTemplate(long groupId,
long classNameId,
java.lang.String templateKey)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
groupId - the primary key of the groupclassNameId - the primary key of the class name for the template's
related modeltemplateKey - the unique string identifying the templatecom.liferay.portal.kernel.exception.PortalException - if a matching template could not be foundcom.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getTemplate(long groupId,
long classNameId,
java.lang.String templateKey,
boolean includeGlobalTemplates)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
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.
groupId - the primary key of the groupclassNameId - the primary key of the class name for the template's
related modeltemplateKey - the unique string identifying the templateincludeGlobalTemplates - whether to include the global scope in the
searchcom.liferay.portal.kernel.exception.PortalException - if a matching template could not be foundcom.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic com.liferay.portlet.dynamicdatamapping.model.DDMTemplate getTemplateBySmallImageId(long smallImageId)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
com.liferay.portal.kernel.exception.PortalExceptioncom.liferay.portal.kernel.exception.SystemExceptionpublic java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates(long classPK)
throws com.liferay.portal.kernel.exception.SystemException
classPK - the primary key of the template's related entitycom.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates(long groupId,
long classNameId)
throws com.liferay.portal.kernel.exception.SystemException
groupId - the primary key of the groupclassNameId - the primary key of the class name for the template's
related modelcom.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates(long groupId,
long classNameId,
long classPK)
throws com.liferay.portal.kernel.exception.SystemException
groupId - the primary key of the groupclassNameId - the primary key of the class name for the template's
related modelclassPK - the primary key of the template's related entitycom.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates(long groupId,
long classNameId,
long classPK,
java.lang.String type)
throws com.liferay.portal.kernel.exception.SystemException
groupId - the primary key of the groupclassNameId - the primary key of the class name for the template's
related modelclassPK - the primary key of the template's related entitytype - the template's type. For more information, see DDMTemplateConstants.com.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplates(long groupId,
long classNameId,
long classPK,
java.lang.String type,
java.lang.String mode)
throws com.liferay.portal.kernel.exception.SystemException
groupId - the primary key of the groupclassNameId - the primary key of the class name for the template's
related modelclassPK - the primary key of the template's related entitytype - the template's type. For more information, see DDMTemplateConstants.mode - the template's mode. For more information, see DDMTemplateConstants.com.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplatesByClassPK(long groupId,
long classPK)
throws com.liferay.portal.kernel.exception.SystemException
com.liferay.portal.kernel.exception.SystemExceptionpublic java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplatesByClassPK(long groupId,
long classPK,
int start,
int end)
throws com.liferay.portal.kernel.exception.SystemException
com.liferay.portal.kernel.exception.SystemExceptionpublic java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplatesByClassPK(long[] groupIds,
long classPK)
throws com.liferay.portal.kernel.exception.SystemException
com.liferay.portal.kernel.exception.SystemExceptionpublic int getTemplatesByClassPKCount(long groupId,
long classPK)
throws com.liferay.portal.kernel.exception.SystemException
groupId - the primary key of the groupclassPK - the primary key of the template's related entitycom.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> getTemplatesByStructureClassNameId(long groupId,
long structureClassNameId,
int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException
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.
groupId - the primary key of the groupstructureClassNameId - the primary key of the class name for the
template's related structurestart - the lower bound of the range of templates to returnend - the upper bound of the range of templates to return (not
inclusive)orderByComparator - the comparator to order the templates
(optionally null)com.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic int getTemplatesByStructureClassNameIdCount(long groupId,
long structureClassNameId)
throws com.liferay.portal.kernel.exception.SystemException
groupId - the primary key of the groupstructureClassNameId - the primary key of the class name for the
template's related structurecom.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic int getTemplatesCount(long groupId)
throws com.liferay.portal.kernel.exception.SystemException
groupId - the primary key of the groupcom.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic int getTemplatesCount(long groupId,
long classNameId)
throws com.liferay.portal.kernel.exception.SystemException
groupId - the primary key of the groupclassNameId - the primary key of the class name for the template's
related modelcom.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic int getTemplatesCount(long groupId,
long classNameId,
long classPK)
throws com.liferay.portal.kernel.exception.SystemException
groupId - the primary key of the groupclassNameId - the primary key of the class name for the template's
related modelclassPK - the primary key of the template's related entitycom.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search(long companyId,
long groupId,
long classNameId,
long classPK,
java.lang.String keywords,
java.lang.String type,
java.lang.String mode,
int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException
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.
companyId - the primary key of the template's companygroupId - the primary key of the groupclassNameId - the primary key of the class name for the template's
related modelclassPK - the primary key of the template's related entitykeywords - 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 returnend - the upper bound of the range of templates to return (not
inclusive)orderByComparator - the comparator to order the templates
(optionally null)com.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search(long companyId,
long groupId,
long classNameId,
long classPK,
java.lang.String name,
java.lang.String description,
java.lang.String type,
java.lang.String mode,
java.lang.String language,
boolean andOperator,
int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException
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.
companyId - the primary key of the template's companygroupId - the primary key of the groupclassNameId - the primary key of the class name for the template's
related modelclassPK - the primary key of the template's related entityname - 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 fieldstart - the lower bound of the range of templates to returnend - the upper bound of the range of templates to return (not
inclusive)orderByComparator - the comparator to order the templates
(optionally null)com.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search(long companyId,
long[] groupIds,
long[] classNameIds,
long[] classPKs,
java.lang.String keywords,
java.lang.String type,
java.lang.String mode,
int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException
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.
companyId - the primary key of the template's companygroupIds - the primary keys of the groupsclassNameIds - the primary keys of the entity's instances the
templates are related toclassPKs - the primary keys of the template's related entitieskeywords - 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 returnend - the upper bound of the range of templates to return (not
inclusive)orderByComparator - the comparator to order the templates
(optionally null)com.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic java.util.List<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> search(long companyId,
long[] groupIds,
long[] classNameIds,
long[] classPKs,
java.lang.String name,
java.lang.String description,
java.lang.String type,
java.lang.String mode,
java.lang.String language,
boolean andOperator,
int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
throws com.liferay.portal.kernel.exception.SystemException
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.
companyId - the primary key of the template's companygroupIds - the primary keys of the groupsclassNameIds - the primary keys of the entity's instances the
templates are related toclassPKs - the primary keys of the template's related entitiesname - 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 returnend - the upper bound of the range of templates to return (not
inclusive)orderByComparator - the comparator to order the templates
(optionally null)com.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic int searchCount(long companyId,
long groupId,
long classNameId,
long classPK,
java.lang.String keywords,
java.lang.String type,
java.lang.String mode)
throws com.liferay.portal.kernel.exception.SystemException
companyId - the primary key of the template's companygroupId - the primary key of the groupclassNameId - the primary key of the class name for the template's
related modelclassPK - the primary key of the template's related entitykeywords - 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.com.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic int searchCount(long companyId,
long groupId,
long classNameId,
long classPK,
java.lang.String name,
java.lang.String description,
java.lang.String type,
java.lang.String mode,
java.lang.String language,
boolean andOperator)
throws com.liferay.portal.kernel.exception.SystemException
companyId - the primary key of the template's companygroupId - the primary key of the groupclassNameId - the primary key of the class name for the template's
related modelclassPK - the primary key of the template's related entityname - 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.com.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic int searchCount(long companyId,
long[] groupIds,
long[] classNameIds,
long[] classPKs,
java.lang.String keywords,
java.lang.String type,
java.lang.String mode)
throws com.liferay.portal.kernel.exception.SystemException
companyId - the primary key of the template's companygroupIds - the primary keys of the groupsclassNameIds - the primary keys of the entity's instance the
templates are related toclassPKs - the primary keys of the template's related entitieskeywords - 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.com.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic int searchCount(long companyId,
long[] groupIds,
long[] classNameIds,
long[] classPKs,
java.lang.String name,
java.lang.String description,
java.lang.String type,
java.lang.String mode,
java.lang.String language,
boolean andOperator)
throws com.liferay.portal.kernel.exception.SystemException
companyId - the primary key of the templates companygroupIds - the primary keys of the groupsclassNameIds - the primary keys of the entity's instance the
templates are related toclassPKs - the primary keys of the template's related entitiesname - 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.com.liferay.portal.kernel.exception.SystemException - if a system exception occurredpublic com.liferay.portlet.dynamicdatamapping.model.DDMTemplate updateTemplate(long templateId,
long classPK,
java.util.Map<java.util.Locale,java.lang.String> nameMap,
java.util.Map<java.util.Locale,java.lang.String> descriptionMap,
java.lang.String type,
java.lang.String mode,
java.lang.String language,
java.lang.String script,
boolean cacheable,
boolean smallImage,
java.lang.String smallImageURL,
java.io.File smallImageFile,
com.liferay.portal.service.ServiceContext serviceContext)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
templateId - the primary key of the templateclassPK - the primary key of the template's related entitynameMap - the template's new locales and localized namesdescriptionMap - the template's new locales and localized
descriptiontype - 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 scriptcacheable - whether the template is cacheablesmallImage - whether the template has a small imagesmallImageURL - 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.com.liferay.portal.kernel.exception.PortalException - if a portal exception occurredcom.liferay.portal.kernel.exception.SystemException - if a system exception occurredprotected java.io.File copySmallImage(com.liferay.portlet.dynamicdatamapping.model.DDMTemplate template)
throws com.liferay.portal.kernel.exception.SystemException
com.liferay.portal.kernel.exception.SystemExceptionprotected com.liferay.portlet.dynamicdatamapping.model.DDMTemplate copyTemplate(long userId,
com.liferay.portlet.dynamicdatamapping.model.DDMTemplate template,
long classPK,
java.util.Map<java.util.Locale,java.lang.String> nameMap,
java.util.Map<java.util.Locale,java.lang.String> descriptionMap,
com.liferay.portal.service.ServiceContext serviceContext)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
com.liferay.portal.kernel.exception.PortalExceptioncom.liferay.portal.kernel.exception.SystemExceptionprotected java.lang.String formatScript(java.lang.String type,
java.lang.String language,
java.lang.String script)
throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalExceptionprotected void saveImages(boolean smallImage,
long smallImageId,
java.io.File smallImageFile,
byte[] smallImageBytes)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
com.liferay.portal.kernel.exception.PortalExceptioncom.liferay.portal.kernel.exception.SystemExceptionprotected void validate(long groupId,
long classNameId,
java.lang.String templateKey,
java.util.Map<java.util.Locale,java.lang.String> nameMap,
java.lang.String script,
boolean smallImage,
java.lang.String smallImageURL,
java.io.File smallImageFile,
byte[] smallImageBytes)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
com.liferay.portal.kernel.exception.PortalExceptioncom.liferay.portal.kernel.exception.SystemExceptionprotected void validate(java.util.Map<java.util.Locale,java.lang.String> nameMap,
java.lang.String script,
boolean smallImage,
java.lang.String smallImageURL,
java.io.File smallImageFile,
byte[] smallImageBytes)
throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException
com.liferay.portal.kernel.exception.PortalExceptioncom.liferay.portal.kernel.exception.SystemExceptionprotected void validateName(java.util.Map<java.util.Locale,java.lang.String> nameMap)
throws com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.PortalException