@ProviderType
public class DDMTemplateServiceUtil
extends java.lang.Object
com.liferay.portlet.dynamicdatamapping.service.impl.DDMTemplateServiceImpl and is the
primary access point for service operations in application layer code running
on a remote server. Methods of this service are expected to have security
checks based on the propagated JAAS credentials because this service can be
accessed remotely.DDMTemplateService,
com.liferay.portlet.dynamicdatamapping.service.base.DDMTemplateServiceBaseImpl,
com.liferay.portlet.dynamicdatamapping.service.impl.DDMTemplateServiceImpl| Constructor and Description |
|---|
DDMTemplateServiceUtil() |
| Modifier and Type | Method and Description |
|---|---|
static DDMTemplate |
addTemplate(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,
ServiceContext serviceContext)
Adds a template.
|
static DDMTemplate |
addTemplate(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,
ServiceContext serviceContext)
Adds a template with additional parameters.
|
static DDMTemplate |
copyTemplate(long templateId,
java.util.Map<java.util.Locale,java.lang.String> nameMap,
java.util.Map<java.util.Locale,java.lang.String> descriptionMap,
ServiceContext serviceContext)
Copies the template, creating a new template with all the values
extracted from the original one.
|
static DDMTemplate |
copyTemplate(long templateId,
ServiceContext serviceContext) |
static java.util.List<DDMTemplate> |
copyTemplates(long classNameId,
long classPK,
long newClassPK,
java.lang.String type,
ServiceContext serviceContext)
Copies all the templates matching the class name ID, class PK, and type.
|
static void |
deleteTemplate(long templateId)
Deletes the template and its resources.
|
static DDMTemplate |
fetchTemplate(long groupId,
long classNameId,
java.lang.String templateKey)
Returns the template matching the group and template key.
|
static java.lang.String |
getBeanIdentifier()
Returns the Spring bean ID for this bean.
|
static DDMTemplateService |
getService() |
static DDMTemplate |
getTemplate(long templateId)
Returns the template with the ID.
|
static DDMTemplate |
getTemplate(long groupId,
long classNameId,
java.lang.String templateKey)
Returns the template matching the group and template key.
|
static 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.
|
static java.util.List<DDMTemplate> |
getTemplates(long groupId,
long classNameId)
Returns all the templates matching the group and class name ID.
|
static java.util.List<DDMTemplate> |
getTemplates(long groupId,
long classNameId,
long classPK)
Returns all the templates matching the group, class name ID, and class
PK.
|
static java.util.List<DDMTemplate> |
getTemplates(long groupId,
long classNameId,
long classPK,
java.lang.String type)
Returns all the templates matching the class name ID, class PK, type, and
mode.
|
static java.util.List<DDMTemplate> |
getTemplates(long groupId,
long classNameId,
long classPK,
java.lang.String type,
java.lang.String mode) |
static java.util.List<DDMTemplate> |
getTemplatesByClassPK(long groupId,
long classPK)
Returns all the templates matching the group and class PK.
|
static java.util.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 and all the generic templates matching the group.
|
static int |
getTemplatesByStructureClassNameIdCount(long groupId,
long structureClassNameId)
Returns the number of templates matching the group and structure class
name ID plus the number of generic templates matching the group.
|
static java.util.List<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,
OrderByComparator orderByComparator)
Returns an ordered range of all the templates matching the group IDs,
class name IDs, class PK, type, and mode, and matching the keywords in
the template names and descriptions.
|
static java.util.List<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,
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.
|
static java.util.List<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,
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.
|
static java.util.List<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,
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.
|
static 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.
|
static 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 PK, name keyword, description keyword, type, mode, and language.
|
static 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 mode, and matching the keywords in the template names and
descriptions.
|
static 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.
|
static void |
setBeanIdentifier(java.lang.String beanIdentifier)
Sets the Spring bean ID for this bean.
|
void |
setService(DDMTemplateService service)
Deprecated.
As of 6.2.0
|
static 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,
ServiceContext serviceContext)
Updates the template matching the ID.
|
public static java.lang.String getBeanIdentifier()
public static void setBeanIdentifier(java.lang.String beanIdentifier)
beanIdentifier - the Spring bean ID for this beanpublic static DDMTemplate addTemplate(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, ServiceContext serviceContext) throws PortalException, SystemException
groupId - the primary key of the groupclassNameId - the primary key of the class name for 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. Must have the
ddmResource attribute to check permissions. Can set
the UUID, creation date, modification date, guest permissions,
and group permissions for the template.PortalException - if the user did not have permission to add the
template or if a portal exception occurredSystemException - if a system exception occurredpublic static DDMTemplate addTemplate(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, ServiceContext serviceContext) throws PortalException, SystemException
groupId - the primary key of the groupclassNameId - the primary key of the class name for 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. Must have the
ddmResource attribute to check permissions. Can set
the UUID, creation date, modification date, guest permissions,
and group permissions for the template.PortalException - if the user did not have permission to add the
template or if a portal exception occurredSystemException - if a system exception occurredpublic static DDMTemplate copyTemplate(long templateId, java.util.Map<java.util.Locale,java.lang.String> nameMap, java.util.Map<java.util.Locale,java.lang.String> descriptionMap, ServiceContext serviceContext) throws PortalException, SystemException
templateId - 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. Must have the
ddmResource attribute to check permissions. Can set
the UUID, creation date, modification date, guest permissions,
and group permissions for the template.PortalException - if the user did not have permission to add the
template or if a portal exception occurredSystemException - if a system exception occurredpublic static DDMTemplate copyTemplate(long templateId, ServiceContext serviceContext) throws PortalException, SystemException
PortalExceptionSystemExceptionpublic static java.util.List<DDMTemplate> copyTemplates(long classNameId, long classPK, long newClassPK, java.lang.String type, ServiceContext serviceContext) throws PortalException, SystemException
classNameId - the primary key of the class name for template's
related modelclassPK - the primary key of the original 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. Must have the
ddmResource attribute to check permissions. Can set
the UUID, creation date, modification date, guest permissions,
and group permissions for the template.PortalException - if the user did not have permission to add the
template or if a portal exception occurredSystemException - if a system exception occurredpublic static void deleteTemplate(long templateId)
throws PortalException,
SystemException
templateId - the primary key of the template to be deletedPortalException - if the user did not have permission to delete the
template or if a portal exception occurredSystemException - if a system exception occurredpublic static DDMTemplate fetchTemplate(long groupId, long classNameId, java.lang.String templateKey) throws PortalException, SystemException
groupId - the primary key of the groupclassNameId - the primary key of the class name for template's
related modeltemplateKey - the unique string identifying the templatenull if a matching
template could not be foundPortalException - if the user did not have permission to view the
templateSystemException - if a system exception occurredpublic static DDMTemplate getTemplate(long templateId) throws PortalException, SystemException
templateId - the primary key of the templatePortalException - if the user did not have permission to view the
template or if a matching template could not be foundSystemException - if a system exception occurredpublic static DDMTemplate getTemplate(long groupId, long classNameId, java.lang.String templateKey) throws PortalException, SystemException
groupId - the primary key of the groupclassNameId - the primary key of the class name for template's
related modeltemplateKey - the unique string identifying the templatePortalException - if a matching template could not be foundSystemException - if a system exception occurredpublic static DDMTemplate getTemplate(long groupId, long classNameId, java.lang.String templateKey, boolean includeGlobalTemplates) throws PortalException, 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 template's
related modeltemplateKey - the unique string identifying the templateincludeGlobalTemplates - whether to include the global scope in the
searchPortalException - if a matching template could not be foundSystemException - if a system exception occurredpublic static java.util.List<DDMTemplate> getTemplates(long groupId, long classNameId) throws SystemException
groupId - the primary key of the groupclassNameId - the primary key of the class name for template's
related modelSystemException - if a system exception occurredpublic static java.util.List<DDMTemplate> getTemplates(long groupId, long classNameId, long classPK) throws SystemException
groupId - the primary key of the groupclassNameId - the primary key of the class name for template's
related modelclassPK - the primary key of the template's related entitySystemException - if a system exception occurredpublic static java.util.List<DDMTemplate> getTemplates(long groupId, long classNameId, long classPK, java.lang.String type) throws SystemException
groupId - the primary key of the groupclassNameId - the primary key of the class name for template's
related modelclassPK - the primary key of the template's related entitytype - the template's type. For more information, see DDMTemplateConstants.SystemException - if a system exception occurredpublic static java.util.List<DDMTemplate> getTemplates(long groupId, long classNameId, long classPK, java.lang.String type, java.lang.String mode) throws SystemException
SystemExceptionpublic static java.util.List<DDMTemplate> getTemplatesByClassPK(long groupId, long classPK) throws SystemException
groupId - the primary key of the groupclassPK - the primary key of the template's related entitySystemException - if a system exception occurredpublic static java.util.List<DDMTemplate> getTemplatesByStructureClassNameId(long groupId, long structureClassNameId, int start, int end, OrderByComparator orderByComparator) throws 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 structure (optionally 0). Specify
0 to return generic templates only.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)SystemException - if a system exception occurredpublic static int getTemplatesByStructureClassNameIdCount(long groupId,
long structureClassNameId)
throws SystemException
groupId - the primary key of the groupstructureClassNameId - the primary key of the class name for the
template's related structure (optionally 0). Specify
0 to count generic templates only.SystemException - if a system exception occurredpublic static java.util.List<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, OrderByComparator orderByComparator) throws 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 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)SystemException - if a system exception occurredpublic static java.util.List<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, OrderByComparator orderByComparator) throws 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 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.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)SystemException - if a system exception occurredpublic static java.util.List<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, OrderByComparator orderByComparator) throws 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)SystemException - if a system exception occurredpublic static java.util.List<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, OrderByComparator orderByComparator) throws 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)SystemException - if a system exception occurredpublic static int searchCount(long companyId,
long groupId,
long classNameId,
long classPK,
java.lang.String keywords,
java.lang.String type,
java.lang.String mode)
throws SystemException
companyId - the primary key of the template's companygroupId - the primary key of the groupclassNameId - the primary key of the class name for 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.SystemException - if a system exception occurredpublic static 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 SystemException
companyId - the primary key of the template's companygroupId - the primary key of the groupclassNameId - the primary key of the class name for 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.SystemException - if a system exception occurredpublic static int searchCount(long companyId,
long[] groupIds,
long[] classNameIds,
long[] classPKs,
java.lang.String keywords,
java.lang.String type,
java.lang.String mode)
throws SystemException
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.SystemException - if a system exception occurredpublic static 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 SystemException
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.SystemException - if a system exception occurredpublic static 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, ServiceContext serviceContext) throws PortalException, 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.PortalException - if the user did not have permission to update the
template or if a portal exception occurredSystemException - if a system exception occurredpublic static DDMTemplateService getService()
public void setService(DDMTemplateService service)