Class PortletTemplateHome
java.lang.Object
fr.paris.lutece.portal.business.portlet.PortletTemplateHome
Static facade of the portlet templates : the FreeMarker templates a portlet of a given type can be rendered with
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe template identifier meaning "no template chosen" : the portlet renders with the default template of its type -
Method Summary
Modifier and TypeMethodDescriptionstatic PortletTemplatecreate(PortletTemplate template) Creates a templatestatic List<PortletTemplate>findAll()Returns every template, ordered by portlet typeReturns the identifiers of every templatestatic List<PortletTemplate>findByPortletType(String strPortletTypeId) Returns the templates registered for a portlet typestatic PortletTemplatefindByPrimaryKey(int nKey) Finds a templatestatic List<PortletTemplate>findByPrimaryKeyList(List<Integer> listIdTemplates) Returns the templates whose identifiers are given.findIdsByPortletType(String strPortletTypeId) Returns the identifiers of the templates registered for a portlet typestatic ReferenceListReturns the templates as a reference list for a select, whatever their portlet typestatic ReferenceListfindReferenceList(String strPortletTypeId) Returns the templates registered for a portlet type as a reference list for a selectstatic StringgetTemplatePath(Portlet portlet, String strDefaultTemplatePath) Returns the path of the template chosen for a portlet, or a default path when the portlet has no valid template.static booleanisTemplateUsed(int nKey) Tells whether at least one portlet uses a templatestatic voidremove(int nKey) Removes a templatestatic PortletTemplateupdate(PortletTemplate template) Updates a template
-
Field Details
-
NO_TEMPLATE_ID
public static final int NO_TEMPLATE_IDThe template identifier meaning "no template chosen" : the portlet renders with the default template of its type- See Also:
-
-
Method Details
-
create
Creates a template- Parameters:
template- the template- Returns:
- the template, with its identifier
-
update
Updates a template- Parameters:
template- the template- Returns:
- the template
-
remove
public static void remove(int nKey) Removes a template- Parameters:
nKey- the template identifier
-
findByPrimaryKey
Finds a template- Parameters:
nKey- the template identifier- Returns:
- the template, null when it does not exist
-
findAll
Returns every template, ordered by portlet type- Returns:
- the templates
-
findByPortletType
Returns the templates registered for a portlet type- Parameters:
strPortletTypeId- the portlet type identifier- Returns:
- the templates, ordered by identifier
-
findByPrimaryKeyList
Returns the templates whose identifiers are given. It is serializable as a method reference, which lets a session pager load a page of templates from their identifiers.- Parameters:
listIdTemplates- the template identifiers- Returns:
- the templates, ordered by portlet type then identifier
-
findAllIds
Returns the identifiers of every template- Returns:
- the identifiers, ordered by portlet type then identifier
-
findIdsByPortletType
Returns the identifiers of the templates registered for a portlet type- Parameters:
strPortletTypeId- the portlet type identifier- Returns:
- the identifiers, ordered by identifier
-
findReferenceList
Returns the templates registered for a portlet type as a reference list for a select- Parameters:
strPortletTypeId- the portlet type identifier- Returns:
- the reference list (template identifier, description)
-
findReferenceList
Returns the templates as a reference list for a select, whatever their portlet type- Returns:
- the reference list (template identifier, description)
-
getTemplatePath
Returns the path of the template chosen for a portlet, or a default path when the portlet has no valid template.A template is valid when it exists, has a path and applies to the portlet type : a template removed from the back office, or a template of another type, never breaks a page.
- Parameters:
portlet- the portletstrDefaultTemplatePath- the path used when the portlet has no valid template- Returns:
- the template path, relative to the WEB-INF/templates directory
-
isTemplateUsed
public static boolean isTemplateUsed(int nKey) Tells whether at least one portlet uses a template- Parameters:
nKey- the template identifier- Returns:
- true when a portlet uses the template
-