Class IntegratedAppSupport
java.lang.Object
com.collabnet.ce.soap60.integratedapps.util.IntegratedAppSupport
Support class that processes all the required information for an integrated
application to work with CTF.
-
Constructor Summary
ConstructorsConstructorDescriptionIntegratedAppSupport
(String ctfBaseUrl, String iaBaseUrl, String iaName) Constructor that requires a CTF base URL as an argument. -
Method Summary
Modifier and TypeMethodDescriptionvoid
createCookie
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Set up the cookie.getCachedPermissions
(String projId) Get the cached permissions for the given projectgetCachedRoles
(String projId) Get the cached roles for the given projectGet CollabNetSoap interface.Get the CTF base URLGet the integrated apps base URLGet the integrated application IdReturns the IntegratedAppNameGet the id of an object in the integrated applicationGet the Integrated Application prefix.Get IntegrationDataAppSoap interface.Get PluggableAppSoap interface.getPlugIdByBaseUrl
(String plugId) This method returns the PlugId by passing the BaseUrlgetPlugUrlByLinkId
(String linkId) This method returns Pluggable application base Url by passing Link Idget the project IdgetProjectId
(String projectPath) Get the project id for a given soap session id and project pathGet the project pathgetProjectPathByIntAppId
(String integratedAppId) Get the project path for the given integrated application idjavax.servlet.http.HttpServletRequest
Get the Request ObjectGet the user's soap session idGet the userId for a given soap session idGet the web session id.getWebSessionId
(String soapSessionId) Get the web session id for the given soap session id.boolean
Whether the current request is for an admin page or not.boolean
isGoUrl()
Identify if the current request is a gourl or not.check if the user is logged in to the CTF systemboolean
Whether the current logged in user is a super user or not.void
processRequest
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Process the request to initialize the session and project information.void
Process the request to initialize the session and project information.void
putCachedPermissions
(String projId, List permissions) Adds the permissions to the cache for the given projectvoid
putCachedRoles
(String projId, List roles) Adds the roles to the cache for the given projectvoid
redirectToCTF
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Redirect to CTF when the session is invalid/expiredvoid
setAdminPage
(boolean isAdminPage) Set true if the current request is for an admin page, otherwise false.void
setCtfBaseUrl
(String ctfBaseUrl) Set the CTF base URL.void
setExtSysId
(String mExtSysId) void
setIntegratedAppBaseUrl
(String iaBaseUrl) Set the integrated apps base URL.void
setIntegratedAppId
(String integratedAppId) Set the integrated application Id.void
setIntegratedAppName
(String integratedAppName) Sets the IntegratedAppNamevoid
setIntegratedAppObjectId
(String iaObjectId) Set the id of an object in the integrated application.void
setIntegratedAppPrefix
(String prefix) Set the Integrated Application prefix.void
setIsLoggedIn
(String mIsLoggedIn) set if the user is logged into the CTf systenvoid
setOneTimeToken
(String mOneTimeToken) void
setProjectId
(String mProjectId) Sets the ProjectIdvoid
setProjectPath
(String projectPath) Set the project pathvoid
setRepoPath
(String mRepoPath) void
setRequestObject
(javax.servlet.http.HttpServletRequest requestObject) Sets the httpServletRequest objectvoid
setSoapSessionId
(String soapSessionId) Set the user's soap session idvoid
setWebSessionId
(String webSessionId) Set the web session id.void
updateRecentRead
(javax.servlet.http.HttpServletRequest request, String objectId, String title) Update the recently read/viewed objectsvoid
updateRecentWrite
(javax.servlet.http.HttpServletRequest request, String objectId, String title) Update the recently edited or newly created objects
-
Constructor Details
-
IntegratedAppSupport
Constructor that requires a CTF base URL as an argument.- Parameters:
ctfBaseUrl
- a CTF base URLiaBaseUrl
- an integrated application's base URLiaName
- integrated application's name
-
-
Method Details
-
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
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
Get the cached permissions for the given project- Parameters:
projId
- CTF project ID- Returns:
- return the cached permissions for the given project
-
putCachedPermissions
Adds the permissions to the cache for the given project- Parameters:
projId
- CTF project IDpermissions
- a list of permissions
-
getCachedRoles
Get the cached roles for the given project- Parameters:
projId
- CTF project ID- Returns:
- return the cached roles for the given project
-
putCachedRoles
Adds the roles to the cache for the given project- Parameters:
projId
- CTF project IDroles
- a list of roles in the project
-
getProjectId
get the project Id- Returns:
- Project Id
-
setProjectId
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
Returns the IntegratedAppName- Returns:
- the integratedAppName
-
setIntegratedAppName
Sets the IntegratedAppName- Parameters:
integratedAppName
- the integratedApp Name
-
getIntegratedAppId
Get the integrated application Id- Returns:
- the integrated application id.
-
setIntegratedAppId
Set the integrated application Id.- Parameters:
integratedAppId
- the integrated application Id.
-
getProjectPath
Get the project path- Returns:
- project path to which the integrated app. belongs
-
setProjectPath
Set the project path- Parameters:
projectPath
- the project path to which the integrated app. belongs
-
getCtfBaseUrl
Get the CTF base URL- Returns:
- String
-
setCtfBaseUrl
Set the CTF base URL.- Parameters:
ctfBaseUrl
-
-
getIntegratedAppBaseUrl
Get the integrated apps base URL- Returns:
- the integrated apps base URL
-
setIntegratedAppBaseUrl
Set the integrated apps base URL.- Parameters:
iaBaseUrl
- integrated apps base URL
-
getWebSessionId
Get the web session id.- Returns:
- the web session id
-
setWebSessionId
Set the web session id.- Parameters:
webSessionId
- users web session id
-
getSoapSessionId
Get the user's soap session id- Returns:
- soap session id
-
setSoapSessionId
Set the user's soap session id- Parameters:
soapSessionId
-
-
getIntegratedAppObjectId
Get the id of an object in the integrated application- Returns:
- id of an object in the integrated application.
-
setIntegratedAppObjectId
Set the id of an object in the integrated application.- Parameters:
iaObjectId
- object id
-
getPluggableAppSoap
Get PluggableAppSoap interface.- Returns:
- PluggableAppSoap interface
-
getCollabNetSoap
Get CollabNetSoap interface.- Returns:
- CollabNetSoap interface
-
getRbacAppSoap
-
getScmAppSoap
-
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
- HttpServletRequestresponse
- HttpServletResponse- Throws:
RemoteException
-
getWebSessionId
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
This method returns Pluggable application base Url by passing Link Id- Parameters:
linkId
-- Returns:
- Throws:
RemoteException
-
getProjectPathByIntAppId
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
-
getPlugIdByBaseUrl
This method returns the PlugId by passing the BaseUrl- Parameters:
plugId
-- Returns:
- Throws:
RemoteException
-
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
- HttpServletRequestresponse
- HttpServletResponse- Throws:
RemoteException
- thrown when the session is invalid
-
getUserId
Get the userId for a given soap session id- Returns:
- the user id for a given session id
- Throws:
RemoteException
-
getProjectId
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
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
Process the request to initialize the session and project information.- Throws:
RemoteException
- thrown when the session is invalid
-
getOneTimeToken
-
setOneTimeToken
-
getExtSysId
-
setExtSysId
-
getRepoPath
-
setRepoPath
-
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
- HttpServletResponseresponse
- HttpServletResponse- Throws:
RemoteException
- thrown when there is problem during redirect.
-
getIntegratedAppPrefix
Get the Integrated Application prefix.- Returns:
- the Integrated Application prefix.
-
setIntegratedAppPrefix
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
- HttpServletRequestobjectId
- object that was viewedtitle
- 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
- HttpServletRequestobjectId
- object that was recently edited/createdtitle
- object title
-