Class IntegratedAppSupport


  • public class IntegratedAppSupport
    extends Object
    Support class that processes all the required information for an integrated application to work with CTF.
    • Constructor Detail

      • IntegratedAppSupport

        public IntegratedAppSupport​(String ctfBaseUrl,
                                    String iaBaseUrl,
                                    String iaName)
        Constructor that requires a CTF base URL as an argument.
        Parameters:
        ctfBaseUrl - a CTF base URL
        iaBaseUrl - an integrated application's base URL
        iaName - integrated application's name
    • Method Detail

      • isLoggedIn

        public String isLoggedIn()
        check if the user is logged in to the CTF system
        Returns:
        String true if user is logged in to the System false if the user is a guest user who have not logged in to the system
      • setIsLoggedIn

        public void setIsLoggedIn​(String mIsLoggedIn)
        set if the user is logged into the CTf systen
        Parameters:
        mIsLoggedIn - true if the user is logged into the CTF system, else false
      • getCachedPermissions

        public List getCachedPermissions​(String projId)
        Get the cached permissions for the given project
        Parameters:
        projId - CTF project ID
        Returns:
        return the cached permissions for the given project
      • putCachedPermissions

        public void putCachedPermissions​(String projId,
                                         List permissions)
        Adds the permissions to the cache for the given project
        Parameters:
        projId - CTF project ID
        permissions - a list of permissions
      • getCachedRoles

        public List getCachedRoles​(String projId)
        Get the cached roles for the given project
        Parameters:
        projId - CTF project ID
        Returns:
        return the cached roles for the given project
      • putCachedRoles

        public void putCachedRoles​(String projId,
                                   List roles)
        Adds the roles to the cache for the given project
        Parameters:
        projId - CTF project ID
        roles - a list of roles in the project
      • getProjectId

        public String getProjectId()
        get the project Id
        Returns:
        Project Id
      • setProjectId

        public void setProjectId​(String mProjectId)
        Sets the ProjectId
        Parameters:
        mProjectId -
      • getRequestObject

        public javax.servlet.http.HttpServletRequest getRequestObject()
        Get the Request Object
        Returns:
        the http request object
      • setRequestObject

        public void setRequestObject​(javax.servlet.http.HttpServletRequest requestObject)
        Sets the httpServletRequest object
      • getIntegratedAppName

        public String getIntegratedAppName()
        Returns the IntegratedAppName
        Returns:
        the integratedAppName
      • setIntegratedAppName

        public void setIntegratedAppName​(String integratedAppName)
        Sets the IntegratedAppName
        Parameters:
        integratedAppName - the integratedApp Name
      • getIntegratedAppId

        public String getIntegratedAppId()
        Get the integrated application Id
        Returns:
        the integrated application id.
      • setIntegratedAppId

        public void setIntegratedAppId​(String integratedAppId)
        Set the integrated application Id.
        Parameters:
        integratedAppId - the integrated application Id.
      • getProjectPath

        public String getProjectPath()
        Get the project path
        Returns:
        project path to which the integrated app. belongs
      • setProjectPath

        public void setProjectPath​(String projectPath)
        Set the project path
        Parameters:
        projectPath - the project path to which the integrated app. belongs
      • getCtfBaseUrl

        public String getCtfBaseUrl()
        Get the CTF base URL
        Returns:
        String
      • setCtfBaseUrl

        public void setCtfBaseUrl​(String ctfBaseUrl)
        Set the CTF base URL.
        Parameters:
        ctfBaseUrl -
      • getIntegratedAppBaseUrl

        public String getIntegratedAppBaseUrl()
        Get the integrated apps base URL
        Returns:
        the integrated apps base URL
      • setIntegratedAppBaseUrl

        public void setIntegratedAppBaseUrl​(String iaBaseUrl)
        Set the integrated apps base URL.
        Parameters:
        iaBaseUrl - integrated apps base URL
      • getWebSessionId

        public String getWebSessionId()
        Get the web session id.
        Returns:
        the web session id
      • setWebSessionId

        public void setWebSessionId​(String webSessionId)
        Set the web session id.
        Parameters:
        webSessionId - users web session id
      • getSoapSessionId

        public String getSoapSessionId()
        Get the user's soap session id
        Returns:
        soap session id
      • setSoapSessionId

        public void setSoapSessionId​(String soapSessionId)
        Set the user's soap session id
        Parameters:
        soapSessionId -
      • getIntegratedAppObjectId

        public String getIntegratedAppObjectId()
        Get the id of an object in the integrated application
        Returns:
        id of an object in the integrated application.
      • setIntegratedAppObjectId

        public void setIntegratedAppObjectId​(String iaObjectId)
        Set the id of an object in the integrated application.
        Parameters:
        iaObjectId - object id
      • getPluggableAppSoap

        public IPluggableAppSoap getPluggableAppSoap()
        Get PluggableAppSoap interface.
        Returns:
        PluggableAppSoap interface
      • getCollabNetSoap

        public ICollabNetSoap getCollabNetSoap()
        Get CollabNetSoap interface.
        Returns:
        CollabNetSoap interface
      • getIntegrationDataAppSoap

        public IIntegrationDataAppSoap getIntegrationDataAppSoap()
        Get IntegrationDataAppSoap interface.
        Returns:
        IntegrationDataAppSoap interface
      • createCookie

        public void createCookie​(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response)
                          throws RemoteException
        Set up the cookie.
        Parameters:
        request - HttpServletRequest
        response - HttpServletResponse
        Throws:
        RemoteException
      • getWebSessionId

        public String getWebSessionId​(String soapSessionId)
                               throws RemoteException
        Get the web session id for the given soap session id.
        Parameters:
        soapSessionId - soap session id
        Returns:
        web session id for the given soap session id.
        Throws:
        RemoteException - thrown when the session is invalid
      • getPlugUrlByLinkId

        public String getPlugUrlByLinkId​(String linkId)
                                  throws RemoteException
        This method returns Pluggable application base Url by passing Link Id
        Parameters:
        linkId -
        Returns:
        Throws:
        RemoteException
      • getProjectPathByIntAppId

        public String getProjectPathByIntAppId​(String integratedAppId)
                                        throws RemoteException
        Get the project path for the given integrated application id
        Parameters:
        integratedAppId - integrated application id
        Returns:
        project path for the given integrated application
        Throws:
        RemoteException - thrown something goes wrong
      • processRequest

        public void processRequest​(javax.servlet.http.HttpServletRequest request,
                                   javax.servlet.http.HttpServletResponse response)
                            throws RemoteException
        Process the request to initialize the session and project information.
        Parameters:
        request - HttpServletRequest
        response - HttpServletResponse
        Throws:
        RemoteException - thrown when the session is invalid
      • getProjectId

        public String getProjectId​(String projectPath)
                            throws RemoteException
        Get the project id for a given soap session id and project path
        Parameters:
        projectPath - the project path
        Returns:
        project id for a given project path
        Throws:
        RemoteException
      • isGoUrl

        public boolean isGoUrl()
        Identify if the current request is a gourl or not.
        Returns:
        true if the request is a gourl, otherwise false.
      • isSuperUser

        public boolean isSuperUser()
                            throws RemoteException
        Whether the current logged in user is a super user or not.
        Returns:
        true if the user is a super user, otherwise false.
        Throws:
        RemoteException
      • processSoapRequest

        public void processSoapRequest()
                                throws RemoteException
        Process the request to initialize the session and project information.
        Throws:
        RemoteException - thrown when the session is invalid
      • getOneTimeToken

        public String getOneTimeToken()
      • setOneTimeToken

        public void setOneTimeToken​(String mOneTimeToken)
      • getExtSysId

        public String getExtSysId()
      • setExtSysId

        public void setExtSysId​(String mExtSysId)
      • getRepoPath

        public String getRepoPath()
      • setRepoPath

        public void setRepoPath​(String mRepoPath)
      • isAdminPage

        public boolean isAdminPage()
        Whether the current request is for an admin page or not.
        Returns:
        true if the requested page is for an admin page, otherwise false.
      • setAdminPage

        public void setAdminPage​(boolean isAdminPage)
        Set true if the current request is for an admin page, otherwise false.
        Parameters:
        isAdminPage - true if the current request is for an admin page, otherwise false
      • redirectToCTF

        public void redirectToCTF​(javax.servlet.http.HttpServletRequest request,
                                  javax.servlet.http.HttpServletResponse response)
                           throws RemoteException
        Redirect to CTF when the session is invalid/expired
        Parameters:
        request - HttpServletResponse
        response - HttpServletResponse
        Throws:
        RemoteException - thrown when there is problem during redirect.
      • getIntegratedAppPrefix

        public String getIntegratedAppPrefix()
        Get the Integrated Application prefix.
        Returns:
        the Integrated Application prefix.
      • setIntegratedAppPrefix

        public void setIntegratedAppPrefix​(String prefix)
        Set the Integrated Application prefix.
        Parameters:
        prefix - the integrated application prefix.
      • updateRecentRead

        public void updateRecentRead​(javax.servlet.http.HttpServletRequest request,
                                     String objectId,
                                     String title)
        Update the recently read/viewed objects
        Parameters:
        request - HttpServletRequest
        objectId - object that was viewed
        title - object title
      • updateRecentWrite

        public void updateRecentWrite​(javax.servlet.http.HttpServletRequest request,
                                      String objectId,
                                      String title)
        Update the recently edited or newly created objects
        Parameters:
        request - HttpServletRequest
        objectId - object that was recently edited/created
        title - object title