Class DDMTemplateServiceUtil
com.liferay.dynamic.data.mapping.service.impl.DDMTemplateServiceImpl
and is an
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.- See Also:
- Generated:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DDMTemplate
addTemplate
(String externalReferenceCode, long groupId, long classNameId, long classPK, long resourceClassNameId, 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, com.liferay.portal.kernel.service.ServiceContext serviceContext) Adds a template with additional parameters.static DDMTemplate
addTemplate
(String externalReferenceCode, long groupId, long classNameId, long classPK, long resourceClassNameId, Map<Locale, String> nameMap, Map<Locale, String> descriptionMap, String type, String mode, String language, String script, com.liferay.portal.kernel.service.ServiceContext serviceContext) Adds a template.static DDMTemplate
copyTemplate
(long sourceTemplateId, com.liferay.portal.kernel.service.ServiceContext serviceContext) static DDMTemplate
copyTemplate
(long sourceTemplateId, Map<Locale, String> nameMap, Map<Locale, String> descriptionMap, com.liferay.portal.kernel.service.ServiceContext serviceContext) Copies the template, creating a new template with all the values extracted from the original one.static List<DDMTemplate>
copyTemplates
(long classNameId, long sourceClassPK, long resourceClassNameId, long targetClassPK, String type, com.liferay.portal.kernel.service.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
deleteTemplate
(String externalReferenceCode, long groupId) static DDMTemplate
fetchTemplate
(long groupId, long classNameId, String templateKey) Returns the template matching the group and template key.static String
Returns the OSGi service identifier.static DDMTemplateService
static DDMTemplate
getTemplate
(long templateId) Returns the template with the ID.static DDMTemplate
getTemplate
(long groupId, long classNameId, String templateKey) Returns the template matching the group and template key.static DDMTemplate
getTemplate
(long groupId, long classNameId, String templateKey, boolean includeAncestorTemplates) Returns the template matching the group and template key, optionally searching ancestor sites (that have sharing enabled) and global scoped sites.static DDMTemplate
getTemplateByExternalReferenceCode
(String externalReferenceCode, long groupId) static List<DDMTemplate>
getTemplates
(long companyId, long[] groupIds, long[] classNameIds, long[] classPKs, long resourceClassNameId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<DDMTemplate> orderByComparator) static List<DDMTemplate>
getTemplates
(long companyId, long groupId, long classNameId, long resourceClassNameId, int status) static List<DDMTemplate>
getTemplates
(long companyId, long groupId, long classNameId, long classPK, long resourceClassNameId, boolean includeAncestorTemplates, int status) static List<DDMTemplate>
getTemplates
(long companyId, long groupId, long classNameId, long classPK, long resourceClassNameId, int status) static List<DDMTemplate>
getTemplates
(long companyId, long groupId, long classNameId, long classPK, long resourceClassNameId, String type, int status) Returns all the templates matching the group, class name ID, class PK, resource class name ID, and type.static List<DDMTemplate>
getTemplates
(long companyId, long groupId, long classNameId, long classPK, long resourceClassNameId, String type, String mode, int status) static List<DDMTemplate>
getTemplatesByClassPK
(long companyId, long groupId, long classPK, long resourceClassNameId, int status) Returns all the templates matching the group, class PK, and resource class name ID.static List<DDMTemplate>
getTemplatesByStructureClassNameId
(long groupId, long structureClassNameId, int status, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<DDMTemplate> 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, int status) Returns the number of templates matching the group and structure class name ID plus the number of generic templates matching the group.static int
getTemplatesCount
(long companyId, long[] groupIds, long[] classNameIds, long[] classPKs, long resourceClassNameId) static void
revertTemplate
(long templateId, String version, com.liferay.portal.kernel.service.ServiceContext serviceContext) static List<DDMTemplate>
search
(long companyId, long[] groupIds, long[] classNameIds, long[] classPKs, long resourceClassNameId, String keywords, String type, String mode, int status, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<DDMTemplate> 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 List<DDMTemplate>
search
(long companyId, long[] groupIds, long[] classNameIds, long[] classPKs, long resourceClassNameId, String name, String description, String type, String mode, String language, int status, boolean andOperator, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<DDMTemplate> 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 List<DDMTemplate>
search
(long companyId, long groupId, long classNameId, long classPK, long resourceClassNameId, String keywords, String type, String mode, int status, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<DDMTemplate> 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 List<DDMTemplate>
search
(long companyId, long groupId, long classNameId, long classPK, long resourceClassNameId, String name, String description, String type, String mode, String language, int status, boolean andOperator, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<DDMTemplate> 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, long resourceClassNameId, String keywords, String type, String mode, int status) 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, long resourceClassNameId, String name, String description, String type, String mode, String language, int status, 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, long resourceClassNameId, String keywords, String type, String mode, int status) 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, long resourceClassNameId, String name, String description, String type, String mode, String language, int status, boolean andOperator) Returns the number of templates matching the group, class name ID, class PK, name keyword, description keyword, type, mode, and language.static 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, com.liferay.portal.kernel.service.ServiceContext serviceContext) Updates the template matching the ID.static DDMTemplate
updateTemplate
(long templateId, long classPK, Map<Locale, String> nameMap, Map<Locale, String> descriptionMap, String type, String mode, String language, String script, boolean cacheable, com.liferay.portal.kernel.service.ServiceContext serviceContext) Updates the template matching the ID.
-
Constructor Details
-
DDMTemplateServiceUtil
public DDMTemplateServiceUtil()
-
-
Method Details
-
addTemplate
public static DDMTemplate addTemplate(String externalReferenceCode, long groupId, long classNameId, long classPK, long resourceClassNameId, Map<Locale, String> nameMap, Map<Locale, throws com.liferay.portal.kernel.exception.PortalExceptionString> descriptionMap, String type, String mode, String language, String script, com.liferay.portal.kernel.service.ServiceContext serviceContext) Adds a template.- Parameters:
externalReferenceCode
- the template's external reference codegroupId
- 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 entityresourceClassNameId
- the primary key of the class name for template's resource modelnameMap
- the template's locales and localized namesdescriptionMap
- the template's locales and localized descriptionstype
- the template's type. For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.mode
- the template's mode. For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.language
- the template's script language. For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.script
- the template's scriptserviceContext
- the service context to be applied. Must have theddmResource
attribute to check permissions. Can set the UUID, creation date, modification date, guest permissions, and group permissions for the template.- Returns:
- the template
- Throws:
com.liferay.portal.kernel.exception.PortalException
-
addTemplate
public static DDMTemplate addTemplate(String externalReferenceCode, long groupId, long classNameId, long classPK, long resourceClassNameId, String templateKey, Map<Locale, String> nameMap, Map<Locale, throws com.liferay.portal.kernel.exception.PortalExceptionString> descriptionMap, String type, String mode, String language, String script, boolean cacheable, boolean smallImage, String smallImageURL, File smallImageFile, com.liferay.portal.kernel.service.ServiceContext serviceContext) Adds a template with additional parameters.- Parameters:
externalReferenceCode
- the template's external reference codegroupId
- 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 entityresourceClassNameId
- the primary key of the class name for template's resource modeltemplateKey
- the unique string identifying the template (optionallynull
)nameMap
- the template's locales and localized namesdescriptionMap
- the template's locales and localized descriptionstype
- the template's type. For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.mode
- the template's mode. For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.language
- the template's script language. For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.script
- the template's scriptcacheable
- whether the template is cacheablesmallImage
- whether the template has a small imagesmallImageURL
- the template's small image URL (optionallynull
)smallImageFile
- the template's small image file (optionallynull
)serviceContext
- the service context to be applied. Must have theddmResource
attribute to check permissions. Can set the UUID, creation date, modification date, guest permissions, and group permissions for the template.- Returns:
- the template
- Throws:
com.liferay.portal.kernel.exception.PortalException
-
copyTemplate
public static DDMTemplate copyTemplate(long sourceTemplateId, Map<Locale, String> nameMap, Map<Locale, throws com.liferay.portal.kernel.exception.PortalExceptionString> descriptionMap, com.liferay.portal.kernel.service.ServiceContext serviceContext) 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:
sourceTemplateId
- 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 theddmResource
attribute to check permissions. Can set the UUID, creation date, modification date, guest permissions, and group permissions for the template.- Returns:
- the new template
- Throws:
com.liferay.portal.kernel.exception.PortalException
-
copyTemplate
public static DDMTemplate copyTemplate(long sourceTemplateId, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
copyTemplates
public static List<DDMTemplate> copyTemplates(long classNameId, long sourceClassPK, long resourceClassNameId, long targetClassPK, String type, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException 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:
classNameId
- the primary key of the class name for template's related modelsourceClassPK
- the primary key of the old template's related entityresourceClassNameId
- the primary key of the class name for template's resource modeltargetClassPK
- the primary key of the new template's related entitytype
- the template's type. For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.serviceContext
- the service context to be applied. Must have theddmResource
attribute to check permissions. Can set the UUID, creation date, modification date, guest permissions, and group permissions for the template.- Returns:
- the new template
- Throws:
com.liferay.portal.kernel.exception.PortalException
-
deleteTemplate
public static void deleteTemplate(long templateId) throws com.liferay.portal.kernel.exception.PortalException Deletes the template and its resources.- Parameters:
templateId
- the primary key of the template to be deleted- Throws:
com.liferay.portal.kernel.exception.PortalException
-
deleteTemplate
public static DDMTemplate deleteTemplate(String externalReferenceCode, long groupId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
fetchTemplate
public static DDMTemplate fetchTemplate(long groupId, long classNameId, String templateKey) throws com.liferay.portal.kernel.exception.PortalException Returns the template matching the group and template key.- Parameters:
groupId
- the primary key of the groupclassNameId
- the primary key of the class name for template's related modeltemplateKey
- the unique string identifying the template- Returns:
- the matching template, or
null
if a matching template could not be found - Throws:
com.liferay.portal.kernel.exception.PortalException
-
getOSGiServiceIdentifier
Returns the OSGi service identifier.- Returns:
- the OSGi service identifier
-
getTemplate
public static DDMTemplate getTemplate(long templateId) throws com.liferay.portal.kernel.exception.PortalException Returns the template with the ID.- Parameters:
templateId
- the primary key of the template- Returns:
- the template with the ID
- Throws:
com.liferay.portal.kernel.exception.PortalException
-
getTemplate
public static DDMTemplate getTemplate(long groupId, long classNameId, String templateKey) throws com.liferay.portal.kernel.exception.PortalException Returns the template matching the group and template key.- Parameters:
groupId
- the primary key of the groupclassNameId
- the primary key of the class name for template's related modeltemplateKey
- the unique string identifying the template- Returns:
- the matching template
- Throws:
com.liferay.portal.kernel.exception.PortalException
-
getTemplate
public static DDMTemplate getTemplate(long groupId, long classNameId, String templateKey, boolean includeAncestorTemplates) throws com.liferay.portal.kernel.exception.PortalException Returns the template matching the group and template key, optionally searching ancestor sites (that have sharing enabled) and global scoped sites.This method first searches in the group. If the template is still not found and
includeAncestorTemplates
is set totrue
, this method searches the group's ancestor sites (that have sharing enabled) and lastly searches global scoped sites.- Parameters:
groupId
- the primary key of the groupclassNameId
- the primary key of the class name for template's related modeltemplateKey
- the unique string identifying the templateincludeAncestorTemplates
- whether to include ancestor sites (that have sharing enabled) and include global scoped sites in the search- Returns:
- the matching template
- Throws:
com.liferay.portal.kernel.exception.PortalException
-
getTemplateByExternalReferenceCode
public static DDMTemplate getTemplateByExternalReferenceCode(String externalReferenceCode, long groupId) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
getTemplates
public static List<DDMTemplate> getTemplates(long companyId, long groupId, long classNameId, long resourceClassNameId, int status) -
getTemplates
public static List<DDMTemplate> getTemplates(long companyId, long groupId, long classNameId, long classPK, long resourceClassNameId, boolean includeAncestorTemplates, int status) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
getTemplates
public static List<DDMTemplate> getTemplates(long companyId, long groupId, long classNameId, long classPK, long resourceClassNameId, int status) -
getTemplates
public static List<DDMTemplate> getTemplates(long companyId, long groupId, long classNameId, long classPK, long resourceClassNameId, String type, int status) Returns all the templates matching the group, class name ID, class PK, resource class name ID, and type.- Parameters:
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 entityresourceClassNameId
- the primary key of the class name for the template's resource modeltype
- the template's type. For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.- Returns:
- the matching templates
-
getTemplates
public static List<DDMTemplate> getTemplates(long companyId, long groupId, long classNameId, long classPK, long resourceClassNameId, String type, String mode, int status) -
getTemplates
public static List<DDMTemplate> getTemplates(long companyId, long[] groupIds, long[] classNameIds, long[] classPKs, long resourceClassNameId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<DDMTemplate> orderByComparator) -
getTemplatesByClassPK
public static List<DDMTemplate> getTemplatesByClassPK(long companyId, long groupId, long classPK, long resourceClassNameId, int status) Returns all the templates matching the group, class PK, and resource class name ID.- Parameters:
companyId
- the primary key of the template's companygroupId
- the primary key of the groupclassPK
- the primary key of the template's related entityresourceClassNameId
- the primary key of the class name for the template's resource model- Returns:
- the matching templates
-
getTemplatesByStructureClassNameId
public static List<DDMTemplate> getTemplatesByStructureClassNameId(long groupId, long structureClassNameId, int status, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<DDMTemplate> 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.Useful when paginating results. Returns a maximum of
end - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
toQueryUtil#ALL_POS
will return the full result set.- Parameters:
groupId
- the primary key of the groupstructureClassNameId
- the primary key of the class name for the template's related structure (optionally0
). Specify0
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 (optionallynull
)- Returns:
- the range of matching templates ordered by the comparator
-
getTemplatesByStructureClassNameIdCount
public static int getTemplatesByStructureClassNameIdCount(long groupId, long structureClassNameId, int status) Returns the number of templates matching the group and structure class name ID plus the number of generic templates matching the group.- Parameters:
groupId
- the primary key of the groupstructureClassNameId
- the primary key of the class name for the template's related structure (optionally0
). Specify0
to count generic templates only.- Returns:
- the number of matching templates plus the number of matching generic templates
-
getTemplatesCount
public static int getTemplatesCount(long companyId, long[] groupIds, long[] classNameIds, long[] classPKs, long resourceClassNameId) -
revertTemplate
public static void revertTemplate(long templateId, String version, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws com.liferay.portal.kernel.exception.PortalException - Throws:
com.liferay.portal.kernel.exception.PortalException
-
search
public static List<DDMTemplate> search(long companyId, long groupId, long classNameId, long classPK, long resourceClassNameId, String keywords, String type, String mode, int status, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<DDMTemplate> 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.Useful when paginating results. Returns a maximum of
end - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
toQueryUtil#ALL_POS
will return the full result set.- Parameters:
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 entityresourceClassNameId
- the primary key of the class name for template's resource modelkeywords
- the keywords (space separated), which may occur in the template's name or description (optionallynull
)type
- the template's type (optionallynull
). For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.mode
- the template's mode (optionallynull
). For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.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 (optionallynull
)- Returns:
- the matching templates ordered by the comparator
-
search
public static List<DDMTemplate> search(long companyId, long groupId, long classNameId, long classPK, long resourceClassNameId, String name, String description, String type, String mode, String language, int status, boolean andOperator, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<DDMTemplate> 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.Useful when paginating results. Returns a maximum of
end - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
toQueryUtil#ALL_POS
will return the full result set.- Parameters:
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 entityresourceClassNameId
- the primary key of the class name for template's resource modelname
- the name keywords (optionallynull
)description
- the description keywords (optionallynull
)type
- the template's type (optionallynull
). For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.mode
- the template's mode (optionallynull
). For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.language
- the template's script language (optionallynull
). For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.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 (optionallynull
)- Returns:
- the matching templates ordered by the comparator
-
search
public static List<DDMTemplate> search(long companyId, long[] groupIds, long[] classNameIds, long[] classPKs, long resourceClassNameId, String keywords, String type, String mode, int status, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<DDMTemplate> 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.Useful when paginating results. Returns a maximum of
end - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
toQueryUtil#ALL_POS
will return the full result set.- Parameters:
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 entitiesresourceClassNameId
- the primary key of the class name for template's resource modelkeywords
- the keywords (space separated), which may occur in the template's name or description (optionallynull
)type
- the template's type (optionallynull
). For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.mode
- the template's mode (optionallynull
). For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.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 (optionallynull
)- Returns:
- the matching templates ordered by the comparator
-
search
public static List<DDMTemplate> search(long companyId, long[] groupIds, long[] classNameIds, long[] classPKs, long resourceClassNameId, String name, String description, String type, String mode, String language, int status, boolean andOperator, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<DDMTemplate> 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.Useful when paginating results. Returns a maximum of
end - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
toQueryUtil#ALL_POS
will return the full result set.- Parameters:
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 entitiesresourceClassNameId
- the primary key of the class name for template's resource modelname
- the name keywords (optionallynull
)description
- the description keywords (optionallynull
)type
- the template's type (optionallynull
). For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.mode
- the template's mode (optionallynull
). For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.language
- the template's script language (optionallynull
). For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.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 (optionallynull
)- Returns:
- the matching templates ordered by the comparator
-
searchCount
public static int searchCount(long companyId, long groupId, long classNameId, long classPK, long resourceClassNameId, String keywords, String type, String mode, int status) 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.- Parameters:
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 entityresourceClassNameId
- the primary key of the class name for template's resource modelkeywords
- the keywords (space separated), which may occur in the template's name or description (optionallynull
)type
- the template's type (optionallynull
). For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.mode
- the template's mode (optionallynull
). For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.- Returns:
- the number of matching templates
-
searchCount
public static int searchCount(long companyId, long groupId, long classNameId, long classPK, long resourceClassNameId, String name, String description, String type, String mode, String language, int status, boolean andOperator) 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 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 entityresourceClassNameId
- the primary key of the class name for template's resource modelname
- the name keywords (optionallynull
)description
- the description keywords (optionallynull
)type
- the template's type (optionallynull
). For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.mode
- the template's mode (optionallynull
). For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.language
- the template's script language (optionallynull
). For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.andOperator
- whether every field must match its keywords, or just one field.- Returns:
- the number of matching templates
-
searchCount
public static int searchCount(long companyId, long[] groupIds, long[] classNameIds, long[] classPKs, long resourceClassNameId, String keywords, String type, String mode, int status) 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 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 entitiesresourceClassNameId
- the primary key of the class name for template's resource modelkeywords
- the keywords (space separated), which may occur in the template's name or description (optionallynull
)type
- the template's type (optionallynull
). For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.mode
- the template's mode (optionallynull
). For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.- Returns:
- the number of matching templates
-
searchCount
public static int searchCount(long companyId, long[] groupIds, long[] classNameIds, long[] classPKs, long resourceClassNameId, String name, String description, String type, String mode, String language, int status, boolean andOperator) Returns the number of templates matching the group IDs, class name IDs, class PK, name keyword, description keyword, type, mode, and language.- Parameters:
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 entitiesresourceClassNameId
- the primary key of the class name for template's resource modelname
- the name keywords (optionallynull
)description
- the description keywords (optionallynull
)type
- the template's type (optionallynull
). For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.mode
- the template's mode (optionallynull
). For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.language
- the template's script language (optionallynull
). For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.andOperator
- whether every field must match its keywords, or just one field.- Returns:
- the number of matching templates
-
updateTemplate
public static DDMTemplate updateTemplate(long templateId, long classPK, Map<Locale, String> nameMap, Map<Locale, throws com.liferay.portal.kernel.exception.PortalExceptionString> descriptionMap, String type, String mode, String language, String script, boolean cacheable, boolean smallImage, String smallImageURL, File smallImageFile, com.liferay.portal.kernel.service.ServiceContext serviceContext) Updates the template matching the ID.- Parameters:
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 in the dynamic-data-mapping-api module.mode
- the template's mode. For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.language
- the template's script language. For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.script
- the template's scriptcacheable
- whether the template is cacheablesmallImage
- whether the template has a small imagesmallImageURL
- the template's small image URL (optionallynull
)smallImageFile
- the template's small image file (optionallynull
)serviceContext
- the service context to be applied. Can set the modification date.- Returns:
- the updated template
- Throws:
com.liferay.portal.kernel.exception.PortalException
-
updateTemplate
public static DDMTemplate updateTemplate(long templateId, long classPK, Map<Locale, String> nameMap, Map<Locale, throws com.liferay.portal.kernel.exception.PortalExceptionString> descriptionMap, String type, String mode, String language, String script, boolean cacheable, com.liferay.portal.kernel.service.ServiceContext serviceContext) Updates the template matching the ID.- Parameters:
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 in the dynamic-data-mapping-api module.mode
- the template's mode. For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.language
- the template's script language. For more information, see DDMTemplateConstants in the dynamic-data-mapping-api module.script
- the template's scriptcacheable
- whether the template is cacheableserviceContext
- the service context to be applied. Can set the modification date.- Returns:
- the updated template
- Throws:
com.liferay.portal.kernel.exception.PortalException
-
getService
-