Class DocumentSpacesService


  • public class DocumentSpacesService
    extends java.lang.Object
    Document Spaces management Service.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static DocumentSpacesService getInstance()
      Returns the unique instance of the service
      java.lang.String getLabelSpacePath​(int nIdDocumentSpace, fr.paris.lutece.portal.business.user.AdminUser user)
      the path of the document space
      java.lang.String getSpacesBrowser​(javax.servlet.http.HttpServletRequest request, fr.paris.lutece.portal.business.user.AdminUser user, java.util.Locale locale, boolean bFilterViewRollUser, boolean bFilterWorkspaceUser)
      get the HTML code to display a space browser.
      java.lang.String getSpacesBrowser​(javax.servlet.http.HttpServletRequest request, fr.paris.lutece.portal.business.user.AdminUser user, java.util.Locale locale, boolean bFilterViewRollUser, boolean bFilterWorkspaceUser, boolean bSelectFilesMode)
      get the HTML code to display a space browser.
      java.lang.String getSpacesBrowser​(javax.servlet.http.HttpServletRequest request, fr.paris.lutece.portal.business.user.AdminUser user, java.util.Locale locale, boolean bFilterViewRollUser, boolean bFilterWorkspaceUser, boolean bSelectFilesMode, java.lang.String idSpaceOverwrite, java.lang.String actionUrl)
      get the HTML code to display a space browser.
      javax.xml.transform.Source getTreeXsl()
      Gets the XSL to display user spaces tree
      java.util.List<DocumentSpace> getUserAllowedSpaces​(fr.paris.lutece.portal.business.user.AdminUser user)
      Get the list of spaces allowed for a given user
      int getUserDefaultSpace​(fr.paris.lutece.portal.business.user.AdminUser user)
      Gets user default space
      java.lang.String getXmlSpacesList​(fr.paris.lutece.portal.business.user.AdminUser user)
      Gets allowed Spaces for a given user as an XML document
      java.lang.String getXmlSpacesList​(fr.paris.lutece.portal.business.user.AdminUser user, java.lang.String strCodeType)
      Gets allowed Spaces for a given user and a type of document as an XML document
      boolean isAuthorizedViewByRole​(int nIdSpace, fr.paris.lutece.portal.business.user.AdminUser user)
      Check if the user can view a space according its role
      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
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • PARAMETER_BROWSER_SELECTED_SPACE_ID

        public static final java.lang.String PARAMETER_BROWSER_SELECTED_SPACE_ID
        See Also:
        Constant Field Values
      • PARAMETER_BROWSER_SPACE_ID

        public static final java.lang.String PARAMETER_BROWSER_SPACE_ID
        See Also:
        Constant Field Values
    • Method Detail

      • getInstance

        public static DocumentSpacesService getInstance()
        Returns the unique instance of the service
        Returns:
        the unique instance of the service
      • getXmlSpacesList

        public java.lang.String getXmlSpacesList​(fr.paris.lutece.portal.business.user.AdminUser user)
        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 java.lang.String getXmlSpacesList​(fr.paris.lutece.portal.business.user.AdminUser user,
                                                 java.lang.String strCodeType)
        Gets allowed Spaces for a given user and a type of document as an XML document
        Parameters:
        user - The current user
        strCodeType - 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

        public javax.xml.transform.Source getTreeXsl()
        Gets the XSL to display user spaces tree
        Returns:
        The XSL to display user spaces tree
      • 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 Id
        user - 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 check
        user - The current user
        Returns:
        true if authorized, otherwise false
      • getUserAllowedSpaces

        public java.util.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 java.lang.String getSpacesBrowser​(javax.servlet.http.HttpServletRequest request,
                                                 fr.paris.lutece.portal.business.user.AdminUser user,
                                                 java.util.Locale locale,
                                                 boolean bFilterViewRollUser,
                                                 boolean bFilterWorkspaceUser)
        get the HTML code to display a space browser.
        Parameters:
        request - The HTTP request
        user - The current user
        bFilterViewRollUser - true if the list of childs space must be filter by RBAC view permission
        bFilterWorkspaceUser - true if the list of childs space must be filter by workgroup
        locale - The Locale
        Returns:
        The HTML form
      • getSpacesBrowser

        public java.lang.String getSpacesBrowser​(javax.servlet.http.HttpServletRequest request,
                                                 fr.paris.lutece.portal.business.user.AdminUser user,
                                                 java.util.Locale locale,
                                                 boolean bFilterViewRollUser,
                                                 boolean bFilterWorkspaceUser,
                                                 boolean bSelectFilesMode)
        get the HTML code to display a space browser.
        Parameters:
        request - The HTTP request
        user - The current user
        bFilterViewRollUser - true if the list of childs space must be filter by RBAC view permission
        bFilterWorkspaceUser - true if the list of childs space must be filter by workgroup
        bSelectFilesMode - true if the list spaces is used to select files only
        locale - The Locale
        Returns:
        The HTML form
      • getSpacesBrowser

        public java.lang.String getSpacesBrowser​(javax.servlet.http.HttpServletRequest request,
                                                 fr.paris.lutece.portal.business.user.AdminUser user,
                                                 java.util.Locale locale,
                                                 boolean bFilterViewRollUser,
                                                 boolean bFilterWorkspaceUser,
                                                 boolean bSelectFilesMode,
                                                 java.lang.String idSpaceOverwrite,
                                                 java.lang.String actionUrl)
        get the HTML code to display a space browser.
        Parameters:
        request - The HTTP request
        user - The current user
        bFilterViewRollUser - true if the list of childs space must be filter by RBAC view permission
        bFilterWorkspaceUser - true if the list of childs space must be filter by workgroup
        bSelectFilesMode - true if the list spaces is used to select files only
        locale - The Locale
        idSpaceOverwrite - idSpace to browse
        actionUrl - base url to use on action
        Returns:
        The HTML form
      • getLabelSpacePath

        public java.lang.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 space
        user - the user
        Returns:
        the path of the document space