Class ProjectXsltHelper
java.lang.Object
org.ametys.plugins.workspaces.project.helper.ProjectXsltHelper
- All Implemented Interfaces:
Contextualizable
,LogEnabled
,Serviceable
Helper component to be used from XSL stylesheets to get info related to projects.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Returns true if current user can access to the back-officestatic boolean
Returns true if current user can leave the projectstatic MapElement
categoryColor
(String categoryId) Return the color associated to the categorystatic MapElement
categoryColor
(Category category) Return the color associated to the categorystatic String
computeDefaultLanguage
(String language) Get the language that will be the default value of the available values.void
contextualize
(Context context) void
enableLogging
(Logger logger) static String
Get the id of alerts root's pagestatic String
getLanguageLabel
(String code, String language) Get the translated label associated to the codestatic String
getModulePage
(String moduleId) Get the module page.static String
Get the id of news root's pagestatic boolean
hasRightOnModule
(String rightId, String moduleId) Returns true if the current user has the specified right on the specified workspace modulestatic boolean
Determines if the current user is a manager of current projectstatic boolean
Determines if the current user is a manager for the projectstatic boolean
Determines if a user is a managerstatic boolean
Determines if the given user is a manager for the projectstatic boolean
isResourceFromWorkspace
(String resourceId) True if the resource comes from workspacesstatic String
project()
Returns the current projectstatic MapElement
Return the color associated to the first category associated to the current projectstatic MapElement
projectCategoryColor
(String projectName) Return the color associated to the first category associated to the given projectstatic String
Return the color associated to the first category associated to the current projectstatic String
projectCategoryLabel
(String projectName) Return the color associated to the first category associated to the given projectstatic String
Returns the creation date of the current projectstatic String
projectCreationDate
(String projectName) Returns the creation date of the given projectstatic String
Returns the description of the current projectstatic String
projectDescription
(String projectName) Returns the description of the given projectstatic MapElement
Returns the information of current projectstatic MapElement
projectInfo
(String projectName) Returns the project informationstatic NodeList
Returns the keywords of the current projectstatic NodeList
projectKeywords
(String projectName) Returns the project keywordsstatic String
Get the date of last activity for current projectstatic String
projectLastActivityDate
(String projectName) Get the date of last activity for a given projectstatic String
Returns the title of the current projectstatic String
projectTitle
(String projectName) Returns the title of the given projectstatic Node
resourceSite
(String projectResourceId) Get the site of a project's resourcevoid
service
(ServiceManager manager)
-
Constructor Details
-
ProjectXsltHelper
public ProjectXsltHelper()
-
-
Method Details
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
enableLogging
- Specified by:
enableLogging
in interfaceLogEnabled
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
project
Returns the current project- Returns:
- the current project
-
projectInfo
Returns the information of current project- Returns:
- the information of current project
-
projectInfo
Returns the project information- Parameters:
projectName
- The project name- Returns:
- the project information
-
projectTitle
Returns the title of the current project- Returns:
- the title of the current project
-
projectTitle
Returns the title of the given project- Parameters:
projectName
- The project to consider- Returns:
- the title of the given project or empty otherwise
-
projectDescription
Returns the description of the current project- Returns:
- the description of the current project
-
projectDescription
Returns the description of the given project- Parameters:
projectName
- The project to consider- Returns:
- the description of the given project or empty otherwise
-
projectKeywords
Returns the keywords of the current project- Returns:
- keywords of the current project
-
projectKeywords
Returns the project keywords- Parameters:
projectName
- the project name- Returns:
- the project keywords
-
projectCreationDate
Returns the creation date of the current project- Returns:
- the creation date of the current project at the ISO format or empty otherwise
-
projectCreationDate
Returns the creation date of the given project- Parameters:
projectName
- The project to consider- Returns:
- the creation date of the given project at the ISO format or empty otherwise
-
projectCategoryColor
Return the color associated to the first category associated to the current project- Returns:
- the hexa code color or the default color if no color is associated to the first category or if not category is associated. <color> <main>#FFFFFF</main> <text>#000000</text> </color>
-
projectCategoryColor
Return the color associated to the first category associated to the given project- Parameters:
projectName
- The project to consider- Returns:
- the hexa code color or the default color if no color is associated to the first category or if not category is associated <color> <main>#FFFFFF</main> <text>#000000</text> </color>
-
categoryColor
Return the color associated to the category- Parameters:
categoryId
- category id- Returns:
- the hexa code color or the default color if no color is associated to the category or if null <color> <main>#FFFFFF</main> <text>#000000</text> </color>
-
categoryColor
Return the color associated to the category- Parameters:
category
- category- Returns:
- the hexa code color or the default color if no color is associated to the category or if null <color> <main>#FFFFFF</main> <text>#000000</text> </color>
-
projectCategoryLabel
Return the color associated to the first category associated to the current project- Returns:
- the hexa code color or the default color if no color is associated to the first category or if not category is associated
-
projectCategoryLabel
Return the color associated to the first category associated to the given project- Parameters:
projectName
- The project to consider- Returns:
- the label or empty if no category
-
projectLastActivityDate
Get the date of last activity for current project- Returns:
- the formatted date of last activity or creation date if there is no activity yet
-
projectLastActivityDate
Get the date of last activity for a given project- Parameters:
projectName
- the project's name- Returns:
- the formatted date of last activity or creation date if there is no activity yet
-
isResourceFromWorkspace
True if the resource comes from workspaces- Parameters:
resourceId
- the resource id- Returns:
- true if the resource comes from workspaces
-
resourceSite
Get the site of a project's resource- Parameters:
projectResourceId
- The resource id- Returns:
- The site <site id="site://xxx" name="siteName"><title>Site's titleX</title><url>http://...</url>/site>
-
getNewsRootPageId
Get the id of news root's page- Returns:
- the id of news root's page or null if not exists
-
getAlertsRootPageId
Get the id of alerts root's page- Returns:
- the id of alerts root's page or null if not exists
-
getModulePage
Get the module page. Be careful, the read access is not check !- Parameters:
moduleId
- the module id- Returns:
- the module page
-
getLanguageLabel
Get the translated label associated to the code- Parameters:
code
- The language codelanguage
- The language in which translate the label- Returns:
- The label associated to the code
-
computeDefaultLanguage
Get the language that will be the default value of the available values. First choice will be the page language, 'en' otherwise, first available language otherwise.- Parameters:
language
- The current page language- Returns:
- A language code
-
isManager
Determines if the current user is a manager of current project- Returns:
- true if the current user is manager
-
isManager
Determines if a user is a manager- Parameters:
login
- the user's loginpopulationId
- the user's population- Returns:
- true if the user is manager
-
isManager
Determines if the current user is a manager for the project- Parameters:
projectName
- the project's name- Returns:
- true if the current user is manager
-
isManager
Determines if the given user is a manager for the project- Parameters:
projectName
- the project's namelogin
- the user's loginpopulationId
- the user's population- Returns:
- true if the user is manager
-
hasRightOnModule
Returns true if the current user has the specified right on the specified workspace module- Parameters:
rightId
- Right IdmoduleId
- Module Id- Returns:
- true if the current user has the specified right on the specified module
-
canAccessBO
Returns true if current user can access to the back-office- Returns:
- true if current user can access to the back-office
-
canLeaveProject
Returns true if current user can leave the project- Returns:
- true if current user can leave the project
-