Class DocumentSpacesService
java.lang.Object
fr.paris.lutece.plugins.document.service.spaces.DocumentSpacesService
@ApplicationScoped
@Named("document.DocumentSpacesService")
public class DocumentSpacesService
extends Object
Document Spaces management Service.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DocumentSpacesServiceDeprecated, for removal: This API element is subject to removal in a future version.getLabelSpacePath(int nIdDocumentSpace, fr.paris.lutece.portal.business.user.AdminUser user) the path of the document spacegetSpacesBrowser(jakarta.servlet.http.HttpServletRequest request, fr.paris.lutece.portal.business.user.AdminUser user, Locale locale, boolean bFilterViewRollUser, boolean bFilterWorkspaceUser) get the HTML code to display a space browser.getSpacesBrowser(jakarta.servlet.http.HttpServletRequest request, fr.paris.lutece.portal.business.user.AdminUser user, Locale locale, boolean bFilterViewRollUser, boolean bFilterWorkspaceUser, boolean bSelectFilesMode) get the HTML code to display a space browser.getSpacesBrowser(jakarta.servlet.http.HttpServletRequest request, fr.paris.lutece.portal.business.user.AdminUser user, Locale locale, boolean bFilterViewRollUser, boolean bFilterWorkspaceUser, boolean bSelectFilesMode, String idSpaceOverwrite, String actionUrl) get the HTML code to display a space browser.Gets the XSL to display user spaces treegetUserAllowedSpaces(fr.paris.lutece.portal.business.user.AdminUser user) Get the list of spaces allowed for a given userintgetUserDefaultSpace(fr.paris.lutece.portal.business.user.AdminUser user) Gets user default spacegetXmlSpacesList(fr.paris.lutece.portal.business.user.AdminUser user) Gets allowed Spaces for a given user as an XML documentgetXmlSpacesList(fr.paris.lutece.portal.business.user.AdminUser user, String strCodeType) Gets allowed Spaces for a given user and a type of document as an XML documentvoidinitializedService(jakarta.servlet.ServletContext context) This method observes the initialization of theApplicationScopedcontext.booleanisAuthorizedViewByRole(int nIdSpace, fr.paris.lutece.portal.business.user.AdminUser user) Check if the user can view a space according its rolebooleanisAuthorizedViewByWorkgroup(int nIdSpace, fr.paris.lutece.portal.business.user.AdminUser user) Check if a space should be visible to the user according its workgroup
-
Field Details
-
PARAMETER_BROWSER_SELECTED_SPACE_ID
- See Also:
-
PARAMETER_BROWSER_SPACE_ID
- See Also:
-
-
Constructor Details
-
DocumentSpacesService
public DocumentSpacesService()Creates a new instance of DocumentSpacesService
-
-
Method Details
-
getInstance
Deprecated, for removal: This API element is subject to removal in a future version.Use@Injectto obtain theDocumentSpacesServiceinstance. This method will be removed in future versions.Returns the unique instance of theDocumentSpacesServiceservice.This method is deprecated and is provided for backward compatibility only. For new code, use dependency injection with
@Injectto obtain theDocumentSpacesServiceinstance instead.- Returns:
- The unique instance of
DocumentSpacesService.
-
getXmlSpacesList
Gets allowed Spaces for a given user as an XML document- Parameters:
user- The current user- Returns:
- An XML document containing allowed spaces
-
getXmlSpacesList
public String getXmlSpacesList(fr.paris.lutece.portal.business.user.AdminUser user, String strCodeType) Gets allowed Spaces for a given user and a type of document as an XML document- Parameters:
user- The current userstrCodeType- The code for the document type- Returns:
- An XML document containing allowed spaces
-
getUserDefaultSpace
public int getUserDefaultSpace(fr.paris.lutece.portal.business.user.AdminUser user) Gets user default space- Parameters:
user- The current user- Returns:
- The user default space
-
getTreeXsl
Gets the XSL to display user spaces tree- Returns:
- The XSL to display user spaces tree
- Throws:
fr.paris.lutece.plugins.resource.loader.ResourceNotFoundException
-
isAuthorizedViewByRole
public boolean isAuthorizedViewByRole(int nIdSpace, fr.paris.lutece.portal.business.user.AdminUser user) Check if the user can view a space according its role- Parameters:
nIdSpace- The Space Iduser- The current user- Returns:
- True if the user has the permission to view document Space.
-
isAuthorizedViewByWorkgroup
public boolean isAuthorizedViewByWorkgroup(int nIdSpace, fr.paris.lutece.portal.business.user.AdminUser user) Check if a space should be visible to the user according its workgroup- Parameters:
nIdSpace- the id of the space to checkuser- The current user- Returns:
- true if authorized, otherwise false
-
getUserAllowedSpaces
public List<DocumentSpace> getUserAllowedSpaces(fr.paris.lutece.portal.business.user.AdminUser user) Get the list of spaces allowed for a given user- Parameters:
user- The admin user- Returns:
- The list of spaces allowed for the given user
-
getSpacesBrowser
public String getSpacesBrowser(jakarta.servlet.http.HttpServletRequest request, fr.paris.lutece.portal.business.user.AdminUser user, Locale locale, boolean bFilterViewRollUser, boolean bFilterWorkspaceUser) get the HTML code to display a space browser.- Parameters:
request- The HTTP requestuser- The current userbFilterViewRollUser- true if the list of childs space must be filter by RBAC view permissionbFilterWorkspaceUser- true if the list of childs space must be filter by workgrouplocale- The Locale- Returns:
- The HTML form
-
getSpacesBrowser
public String getSpacesBrowser(jakarta.servlet.http.HttpServletRequest request, fr.paris.lutece.portal.business.user.AdminUser user, Locale locale, boolean bFilterViewRollUser, boolean bFilterWorkspaceUser, boolean bSelectFilesMode) get the HTML code to display a space browser.- Parameters:
request- The HTTP requestuser- The current userbFilterViewRollUser- true if the list of childs space must be filter by RBAC view permissionbFilterWorkspaceUser- true if the list of childs space must be filter by workgroupbSelectFilesMode- true if the list spaces is used to select files onlylocale- The Locale- Returns:
- The HTML form
-
getSpacesBrowser
public String getSpacesBrowser(jakarta.servlet.http.HttpServletRequest request, fr.paris.lutece.portal.business.user.AdminUser user, Locale locale, boolean bFilterViewRollUser, boolean bFilterWorkspaceUser, boolean bSelectFilesMode, String idSpaceOverwrite, String actionUrl) get the HTML code to display a space browser.- Parameters:
request- The HTTP requestuser- The current userbFilterViewRollUser- true if the list of childs space must be filter by RBAC view permissionbFilterWorkspaceUser- true if the list of childs space must be filter by workgroupbSelectFilesMode- true if the list spaces is used to select files onlylocale- The LocaleidSpaceOverwrite- idSpace to browseactionUrl- base url to use on action- Returns:
- The HTML form
-
getLabelSpacePath
public String getLabelSpacePath(int nIdDocumentSpace, fr.paris.lutece.portal.business.user.AdminUser user) the path of the document space- Parameters:
nIdDocumentSpace- the id of the document spaceuser- the user- Returns:
- the path of the document space
-
initializedService
public void initializedService(@Observes @Initialized(jakarta.enterprise.context.ApplicationScoped.class) jakarta.servlet.ServletContext context) This method observes the initialization of theApplicationScopedcontext. It ensures that this CDI beans are instantiated at the application startup.This method is triggered automatically by CDI when the
ApplicationScopedcontext is initialized, which typically occurs during the startup of the application server.- Parameters:
context- theServletContextthat is initialized. This parameter is observed and injected automatically by CDI when theApplicationScopedcontext is initialized.
-
@Injectto obtain theDocumentSpacesServiceinstance.