Class WebService
- java.lang.Object
-
- com.collabnet.ce.soap60.webservices.WebService
-
- Direct Known Subclasses:
CategorizationAppSoap,CollabNetSoap,DiscussionAppSoap,DocumentAppSoap,FileStorageAppSoap,FrsAppSoap,IntegrationDataAppSoap,MonitoringAppSoap,NewsAppSoap,PageAppSoap,PlanningAppSoap,PluggableAppSoap,RbacAppSoap,ScmAppSoap,SimpleFileStorageAppSoap,TagAppSoap,TeamAppSoap,TrackerAppSoap,WikiAppSoap
public abstract class WebService extends Object
Base class for all web services.
-
-
Constructor Summary
Constructors Constructor Description WebService()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidassertNormalProject(String objectId, String loggedInUser)Validates the given object id and throws an Exception if it does not represent a normal project.protected voidassertProjectGroup(String objectId, String loggedInUser)Validates the given object id and throws an Exception if it does not represent a project group.protected booleancanGiveFullUserDetails(String username, String loggedInUser)Overloaded form to process `UserSoapRow'protected voidcheckGeneralPermission(com.vasoftware.sf.server.types.Path path, com.vasoftware.sf.common.access.rbac.Operation operation, String loggedInUser)Check to see if the user has the specified permission, without doing any resource checking.protected voidcheckPermission(com.vasoftware.sf.server.types.ObjectKey objectId, com.vasoftware.sf.common.access.rbac.Operation operation, com.vasoftware.sf.server.types.ProjectPath projectPath, String loggedInUser)Checks RBAC permission and throws an exception if permission is denied.protected voidcheckPermission(com.vasoftware.sf.server.types.Path path, com.vasoftware.sf.common.access.rbac.Operation operation, String loggedInUser)Checks RBAC permission and throws an exception if permission is denied.protected voidcheckSiteWidePermission(com.vasoftware.sf.common.access.rbac.Operation operation, String loggedInUser)Checks if the current user has the given site wide permission to perform the operationprotected com.vasoftware.sf.server.types.UserSessionKeycreateUserSessionKey(String username)Creates and returns user session key.protected javax.activation.DataHandlerdownloadFile(com.vasoftware.sf.server.types.GuidKey fileKey, String loggedInUser)Downloads a file stored within the file storage.protected List<String>filterInvalidProjMembers(String projectId, List<String> userNames, String loggedInUser)Filter Invalid Project Members from List of Given Users.protected StringgenerateFolderName(com.vasoftware.sf.server.types.FolderPath folderPath, String title, String loggedInUser)Generates unique folder name from title.protected static com.collabnet.ctf.access.service.AccessControlServicegetAccessControlService()Returns the Access Control Serviceprotected com.collabnet.ctf.applicationregistry.service.ApplicationRegistryServicegetApplicationRegistryService()Gets the application registry service handleprotected com.collabnet.ctf.attachment.service.AttachmentServicegetAttachment()Returns Attachment API handle.protected com.collabnet.ctf.authentication.service.AuthenticationServicegetAuthenticationService()Returns the Authentication Serviceprotected com.collabnet.ctf.categorization.service.CategorizationServicegetCategorization()Returns the categorization API handle.protected com.collabnet.ctf.core.service.CoreServicegetCoreService()Returns the Core Serviceprotected com.collabnet.ctf.discussion.service.DiscussionServicegetDiscussion()Returns the discussion API handle.protected com.collabnet.ctf.document.service.DocumentServicegetDocMan()Returns the DocumentService handle.protected com.vasoftware.sf.server.types.FolderPathgetDocumentRootFolder(String projectId, String loggedInUser)Returns the root document folder path.protected com.collabnet.ctf.filestorage.service.FileStorageServicegetFileStorageService()Returns theFileStorageServiceAPI handle.protected com.vasoftware.sf.server.types.FolderKeygetFolderKey(String folderId, String loggedInUser)Returns the folder key for the specified string.protected com.vasoftware.sf.server.types.FolderPathgetFolderPath(String folderId, com.vasoftware.sf.server.types.FolderType folderType, com.vasoftware.sf.server.types.FolderType appFolderType, String loggedInUser)Returns the path of the specified folder and verifies it to be of the specified type.protected com.vasoftware.sf.server.types.FolderPathgetFolderPath(String folderId, com.vasoftware.sf.server.types.FolderType folderType, String loggedInUser)Returns the path of the specified folder and verifies it to be of the specified type.protected com.vasoftware.sf.server.types.FolderPathgetFolderPath(String folderId, String loggedInUser)Returns the path of the specified folder.protected com.collabnet.ctf.frs.service.FrsServicegetFrs()Returns the frs API handle.protected com.collabnet.ctf.integrationdata.service.IntegrationDataServicegetIntegrationData()Returns the integration data API handle.protected com.vasoftware.sf.server.types.ItemPathgetItemPath(String itemId, com.vasoftware.sf.server.types.ItemType itemType, String loggedInUser)Returns the path of the specified item and verifies it to be of the specified type.protected com.vasoftware.sf.server.types.ItemPathgetItemPath(String itemId, String loggedInUser)Returns the path of the specified item.protected LocalegetLocale(String locale)Returns locale object from string specification.protected com.collabnet.ctf.monitoring.service.MonitoringServicegetMonitoring()Gets the monitoring service API handleprotected com.collabnet.ctf.news.service.NewsServicegetNews()Returns the news API handle.protected DategetNulledMinSoapDate(Date date)Return the date, but return null if it's the magic soap value that .net usesprotected com.vasoftware.sf.server.types.ObjectKeygetObjectKey(String objectId, String loggedInUser)Returns an object's key object from the string id.protected com.vasoftware.sf.server.types.PathgetObjectPath(String objectId, String loggedInUser)Returns an object's path by its ID.protected com.vasoftware.sf.common.access.rbac.OperationgetOperation(String operationString, String idForPluggable, com.vasoftware.sf.server.types.UserSessionKey sessionKey)Gets Operation object from operation string.protected com.collabnet.ctf.page.service.PageServicegetPages()Returns the Pages API handleprotected com.collabnet.ctf.planning.service.PlanningFolderServicegetPlanning()Returns the planning API handle.protected com.collabnet.ctf.pluggable.service.PluggableServicegetPluggableComponent()Returns the Pluggable data API handle.protected com.vasoftware.sf.server.types.ProjectKeygetProjectId(com.vasoftware.sf.server.types.ItemKey itemKey, String loggedInUser)Returns the project ID of an item for marshaling purposes.protected com.vasoftware.sf.server.types.ProjectPathgetProjectPath(com.vasoftware.sf.server.types.Path path)Obtains the project path from the given path.protected com.vasoftware.sf.server.types.ProjectPathgetProjectPath(String projectId, String loggedInUser)Returns the path of the specified project.protected com.collabnet.ctf.rbac.service.RBACServicegetRbac()Returns the integration data API handle.protected com.collabnet.ctf.search.service.SearchServicegetSearch()Returns the search API handleprotected longgetStoredFileSize(com.vasoftware.sf.server.types.GuidKey fileKey, String loggedInUser)Returns the size of a stored file.protected StringgetStoredFileText(com.vasoftware.sf.server.types.GuidKey fileKey, String loggedInUser)Returns the text content of a stored file.protected com.collabnet.ctf.tag.service.TagServicegetTagService()Gets the tag service API handleprotected com.collabnet.ctf.team.service.TeamServicegetTeam()Returns the team API handle.protected com.collabnet.ctf.template.service.TemplateServicegetTemplate()Returns Template API handle.protected com.collabnet.ctf.tracker.service.TrackerServicegetTracker()Returns the tracker API handle.protected com.collabnet.ctf.common.services.user.UserServicegetUser()Returns the user API handle.protected com.vasoftware.sf.server.services.user.UserDOgetUserData(String username)Returns user data.protected StringgetUsername(String oAuthToken)Gets username from OAuth tokenprotected static com.collabnet.ctf.user.service.UserServicegetUserService()Returns the User Serviceprotected com.collabnet.ctf.wiki.service.WikiServicegetWiki()Returns the wiki API handle.protected booleanhasPermission(com.vasoftware.sf.server.types.ObjectKey objectId, com.vasoftware.sf.common.access.rbac.Operation operation, com.vasoftware.sf.server.types.ProjectPath projectPath, String loggedInUser)Checks RBAC permission.protected booleanhasSiteWidePermission(com.vasoftware.sf.common.access.rbac.Operation operation, String loggedInUser)Checks if the current user has the given site wide permission to perform the operationprotected static booleanisFolderResource(String resourceName)Check if a resource is a folder resourceprotected booleanisProjectGroup(String objectId, String loggedInUser)Checks if the specified object id is a project group id.protected booleanisProjectId(String objectId)Checks if the specified object id is a project id.protected booleanisStrEmpty(String s)Checks if the specified string is null or zero length.protected booleanisSuperUser(String username)Checks if current user is a super-user.protected booleanisValidEmail(String value)validates Emailprotected com.vasoftware.sf.server.services.filestorage.StoredFileDO[]makeStoredFileDO(String fileName, String mimeType, String fileId, String loggedInUser)Prepare StoredFileDO objectprotected com.vasoftware.sf.server.services.filestorage.StoredFileDO[]makeStoredFileDOs(AttachmentSoapDO[] attachmentFiles, String loggedInUser)Makes StoredFileDo's from Attachment List.protected voidrequireProjectAdminPermission(String projectId, String loggedInUser)Checks to see if the currently logged in user is a user with project administrator edit permission.protected voidsetPartialOrFullUserData(UserSoapList userSoapList, String loggedInUser)Overloaded form for processing `UserSoapList'protected voidsetUserNameToResponse(String userName)Sets username to response header to get it recorded in access logprotected com.vasoftware.sf.server.types.GuidKeystoreFile(String fileId, String loggedInUser)Stores uploaded file in the file storage.protected com.vasoftware.sf.server.types.GuidKeystoreTextFile(String text, String loggedInUser)Stores text as a file.protected voidvalidateChoice(String name, int[] choices, int value)Validates integer value to be one of the possible choices.protected voidvalidateChoice(String name, String[] choices, String value)Validates string to be one of the possible choices.protected voidvalidateIconFile(String iconFileName, String iconMimeType)Validates the icon fileName and mime type.protected voidvalidateString(String name, String value)Validates string to be non-null and non-empty.protected voidvalidateStringArray(String name, String[] values)Validates values in the string array to be non-null and non-empty.protected voidvalidateStringWithTrim(String name, String value)Validates string to be non-null and non-empty with ignoring white spaces at starting and ending of the stringprotected StringvalidateTokenAndExactUsername(String oAuthToken)Validates input OAuth token and returns usernameprotected com.nimbusds.jwt.ReadOnlyJWTClaimsSetvalidateTokenAndExactUsername(String oAuthToken, boolean triggerLicenseCheck)Validates input OAuth token and returnsReadOnlyJWTClaimsSetprotected voidvalidateWikiPageName(String name, String value)Validates wiki page name to be conformant.protected voidverifyLicense(String oAuthToken)Make sure the license hasn't expired on the app server.
-
-
-
Method Detail
-
checkPermission
protected void checkPermission(com.vasoftware.sf.server.types.Path path, com.vasoftware.sf.common.access.rbac.Operation operation, String loggedInUser) throws InvalidSessionFault, PermissionDeniedFault, SystemFaultChecks RBAC permission and throws an exception if permission is denied.- Parameters:
path- Path of the object.operation- Permission to check.loggedInUser- the logged in user- Throws:
InvalidSessionFault- when the sessionId is invalid.PermissionDeniedFault- when permission is denied for the specified operation.SystemFault- when an unexpected system error occurs.
-
checkPermission
protected void checkPermission(com.vasoftware.sf.server.types.ObjectKey objectId, com.vasoftware.sf.common.access.rbac.Operation operation, com.vasoftware.sf.server.types.ProjectPath projectPath, String loggedInUser) throws InvalidSessionFault, PermissionDeniedFault, SystemFaultChecks RBAC permission and throws an exception if permission is denied.- Parameters:
objectId- Path of the object.operation- Permission to check.projectPath- the path of the project that objectId is underloggedInUser- the logged in user- Throws:
InvalidSessionFault- when the sessionId is invalid.PermissionDeniedFault- when permission is denied for the specified operation.SystemFault- when an unexpected system error occurs.
-
checkGeneralPermission
protected void checkGeneralPermission(com.vasoftware.sf.server.types.Path path, com.vasoftware.sf.common.access.rbac.Operation operation, String loggedInUser) throws InvalidSessionFault, PermissionDeniedFault, SystemFaultCheck to see if the user has the specified permission, without doing any resource checking. This checks to see if the user has the specified operation in any of the roles in this project, without applying the context of an object with a resource- Parameters:
path- Path of the object.operation- Permission to check.loggedInUser- the logged in user- Throws:
InvalidSessionFault- when the sessionId is invalid.PermissionDeniedFault- when permission is denied for the specified operation.SystemFault- when an unexpected system error occurs.
-
hasPermission
protected boolean hasPermission(com.vasoftware.sf.server.types.ObjectKey objectId, com.vasoftware.sf.common.access.rbac.Operation operation, com.vasoftware.sf.server.types.ProjectPath projectPath, String loggedInUser) throws InvalidSessionFault, SystemFaultChecks RBAC permission.- Parameters:
objectId- Path of the object.operation- Permission to check.projectPath- the path of the project that objectId is underloggedInUser- the logged in user- Returns:
- true if the user has permission
- Throws:
InvalidSessionFault- when the sessionId is invalid.SystemFault- when an unexpected system error occurs.
-
hasSiteWidePermission
protected boolean hasSiteWidePermission(com.vasoftware.sf.common.access.rbac.Operation operation, String loggedInUser) throws InvalidSessionFault, SystemFaultChecks if the current user has the given site wide permission to perform the operation- Parameters:
operation-loggedInUser- the logged in user- Returns:
- true if the user has the permission for the operation at Site-Wide scope false otherwise
- Throws:
InvalidSessionFault- when the sessionId is invalidSystemFault- when an unexpected system error occurs
-
checkSiteWidePermission
protected void checkSiteWidePermission(com.vasoftware.sf.common.access.rbac.Operation operation, String loggedInUser) throws InvalidSessionFault, SystemFault, PermissionDeniedFaultChecks if the current user has the given site wide permission to perform the operation- Parameters:
operation-loggedInUser- the logged in user- Throws:
InvalidSessionFault- when the sessionId is invalidSystemFault- when an unexpected system error occursPermissionDeniedFault
-
validateTokenAndExactUsername
protected String validateTokenAndExactUsername(String oAuthToken) throws InvalidSessionFault
Validates input OAuth token and returns username- Parameters:
oAuthToken- the OAuth token- Returns:
- the username
- Throws:
InvalidSessionFault- when oauth token is invalid
-
validateTokenAndExactUsername
protected com.nimbusds.jwt.ReadOnlyJWTClaimsSet validateTokenAndExactUsername(String oAuthToken, boolean triggerLicenseCheck) throws InvalidSessionFault
Validates input OAuth token and returnsReadOnlyJWTClaimsSet- Parameters:
oAuthToken- the OAuth tokentriggerLicenseCheck- if true license check will be triggered- Returns:
- Throws:
InvalidSessionFault- when oauth token is invalid
-
verifyLicense
protected void verifyLicense(String oAuthToken) throws InvalidSessionFault
Make sure the license hasn't expired on the app server. If so, throw InvalidSessionFault- Parameters:
oAuthToken- Input OAuth Token- Throws:
InvalidSessionFault- if the license has expired on the appserver
-
getUsername
protected String getUsername(String oAuthToken) throws InvalidSessionFault
Gets username from OAuth token- Parameters:
oAuthToken- the OAuth token- Returns:
- username
- Throws:
InvalidSessionFault- when oauth token is invalid
-
setUserNameToResponse
protected void setUserNameToResponse(String userName)
Sets username to response header to get it recorded in access log- Parameters:
userName- session username
-
createUserSessionKey
protected com.vasoftware.sf.server.types.UserSessionKey createUserSessionKey(String username) throws InvalidSessionFault
Creates and returns user session key.- Returns:
- User session key.
- Throws:
InvalidSessionFault- when the username is invalid.
-
getUserData
protected com.vasoftware.sf.server.services.user.UserDO getUserData(String username)
Returns user data.- Parameters:
username- the username- Returns:
- user data
- Throws:
com.collabnet.ctf.base.SfSystemException- when username cannot be found.
-
isSuperUser
protected boolean isSuperUser(String username)
Checks if current user is a super-user.- Parameters:
username- the username- Returns:
- true if user is a super-user, false otherwise.
- Throws:
com.collabnet.ctf.base.SfSystemException- when username cannot be found.
-
requireProjectAdminPermission
protected void requireProjectAdminPermission(String projectId, String loggedInUser) throws PermissionDeniedFault, InvalidSessionFault, SystemFault, NoSuchObjectFault
Checks to see if the currently logged in user is a user with project administrator edit permission.- Parameters:
projectId- project IdloggedInUser- the logged in user- Throws:
PermissionDeniedFault- thrown if user is not logged in or is not a project administrator.NoSuchObjectFault- when the specified objectId is invalid.SystemFault- when an unexpected system error occurs.InvalidSessionFault- when the user session is invalid.
-
getObjectKey
protected com.vasoftware.sf.server.types.ObjectKey getObjectKey(String objectId, String loggedInUser) throws InvalidSessionFault, NoSuchObjectFault
Returns an object's key object from the string id.- Parameters:
objectId- String ID.loggedInUser- the logged in user- Returns:
- Key instance.
- Throws:
InvalidSessionFault- when the user session is invalid.NoSuchObjectFault- when the specified objectId is invalid.
-
getProjectPath
protected com.vasoftware.sf.server.types.ProjectPath getProjectPath(String projectId, String loggedInUser) throws InvalidSessionFault, NoSuchObjectFault
Returns the path of the specified project.- Parameters:
projectId- Project id.loggedInUser- the logged in user- Returns:
- Project path.
- Throws:
InvalidSessionFault- when session is invalid (or not active).NoSuchObjectFault- when specified object id is invalid.
-
getProjectPath
protected com.vasoftware.sf.server.types.ProjectPath getProjectPath(com.vasoftware.sf.server.types.Path path)
Obtains the project path from the given path.- Parameters:
path- the path for which the project path is to be obtained- Returns:
- project path
-
getFolderPath
protected com.vasoftware.sf.server.types.FolderPath getFolderPath(String folderId, String loggedInUser) throws InvalidSessionFault, NoSuchObjectFault
Returns the path of the specified folder.- Parameters:
folderId- Folder id.loggedInUser- the logged in user- Returns:
- Folder path.
- Throws:
InvalidSessionFault- when session is invalid (or not active).NoSuchObjectFault- when specified object id is invalid.
-
getFolderPath
protected com.vasoftware.sf.server.types.FolderPath getFolderPath(String folderId, com.vasoftware.sf.server.types.FolderType folderType, String loggedInUser) throws InvalidSessionFault, NoSuchObjectFault
Returns the path of the specified folder and verifies it to be of the specified type.- Parameters:
folderId- Folder id.folderType- Folder type.loggedInUser- the logged in user- Returns:
- Folder path.
- Throws:
InvalidSessionFault- when session is invalid (or not active).NoSuchObjectFault- when specified object id is invalid.
-
getFolderPath
protected com.vasoftware.sf.server.types.FolderPath getFolderPath(String folderId, com.vasoftware.sf.server.types.FolderType folderType, com.vasoftware.sf.server.types.FolderType appFolderType, String loggedInUser) throws InvalidSessionFault, NoSuchObjectFault
Returns the path of the specified folder and verifies it to be of the specified type.- Parameters:
folderId- Folder id.folderType- Folder type.appFolderType- Alternative application folder type.loggedInUser- the logged in user- Returns:
- Folder path.
- Throws:
InvalidSessionFault- when session is invalid (or not active).NoSuchObjectFault- when specified object id is invalid.
-
getFolderKey
protected com.vasoftware.sf.server.types.FolderKey getFolderKey(String folderId, String loggedInUser) throws InvalidSessionFault, NoSuchObjectFault
Returns the folder key for the specified string.- Parameters:
folderId- Folder id.loggedInUser- the logged in user.- Returns:
- Folder key object.
- Throws:
InvalidSessionFault- when session is invalid (or not active).NoSuchObjectFault- when specified object id is invalid.
-
getItemPath
protected com.vasoftware.sf.server.types.ItemPath getItemPath(String itemId, String loggedInUser) throws InvalidSessionFault, NoSuchObjectFault
Returns the path of the specified item.- Parameters:
itemId- Item id.loggedInUser- the logged in user- Returns:
- Item path.
- Throws:
InvalidSessionFault- when session is invalid (or not active).NoSuchObjectFault- when specified object id is invalid.
-
getItemPath
protected com.vasoftware.sf.server.types.ItemPath getItemPath(String itemId, com.vasoftware.sf.server.types.ItemType itemType, String loggedInUser) throws InvalidSessionFault, NoSuchObjectFault
Returns the path of the specified item and verifies it to be of the specified type.- Parameters:
itemId- Item id.itemType- Item Type.loggedInUser- the logged in user.- Returns:
- Item path.
- Throws:
InvalidSessionFault- when session is invalid (or not active).NoSuchObjectFault- when specified object id is invalid.
-
getObjectPath
protected com.vasoftware.sf.server.types.Path getObjectPath(String objectId, String loggedInUser) throws InvalidSessionFault, NoSuchObjectFault
Returns an object's path by its ID.- Parameters:
objectId- Id of the object whose path is needed.loggedInUser- the logged in user- Returns:
- Path of the object.
- Throws:
InvalidSessionFault- when session is invalid (or not active).NoSuchObjectFault- when specified object id is invalid.
-
isProjectId
protected boolean isProjectId(String objectId)
Checks if the specified object id is a project id.- Parameters:
objectId- ID of the object to check.- Returns:
- true if specified id is that of a project, false otherwise.
-
generateFolderName
protected String generateFolderName(com.vasoftware.sf.server.types.FolderPath folderPath, String title, String loggedInUser) throws InvalidSessionFault, SystemFault
Generates unique folder name from title. If no unique name can be generated, or if the title contains any characters outside the Unicode "Basic Latin" character set, this method returns null.- Parameters:
folderPath- Parent folder path.title- Title from which to generate unique folder name.loggedInUser- the logged in user- Returns:
- Unique folder name, or null if one cannot be generated.
- Throws:
InvalidSessionFault- when session is invalid (or not active).SystemFault- when a system level error occurs.
-
isStrEmpty
protected boolean isStrEmpty(String s)
Checks if the specified string is null or zero length.- Parameters:
s- String to check.- Returns:
- true if string is null or zero length, false otherwise.
-
storeTextFile
protected com.vasoftware.sf.server.types.GuidKey storeTextFile(String text, String loggedInUser) throws InvalidSessionFault, SystemFault
Stores text as a file.- Parameters:
text- Text to store.loggedInUser- the logged in user- Returns:
- Stored file key.
- Throws:
InvalidSessionFault- when session is invalid (or not active).SystemFault- when a system level error occurs.
-
storeFile
protected com.vasoftware.sf.server.types.GuidKey storeFile(String fileId, String loggedInUser) throws InvalidSessionFault, NoSuchObjectFault, SystemFault
Stores uploaded file in the file storage. Uploaded files are initially in the temporary storage.- Parameters:
fileId- File id from temporary store.loggedInUser- the logged in user- Returns:
- Stored file key.
- Throws:
InvalidSessionFault- when session is invalid (or not active).SystemFault- when a system level error occurs.NoSuchObjectFault- when the specified file id is invalid.
-
getStoredFileSize
protected long getStoredFileSize(com.vasoftware.sf.server.types.GuidKey fileKey, String loggedInUser) throws InvalidSessionFault, SystemFaultReturns the size of a stored file.- Parameters:
fileKey- Key to stored file.loggedInUser- the logged in user- Returns:
- File size in bytes.
- Throws:
InvalidSessionFault- when session is invalid (or not active).SystemFault- when a system level error occurs.
-
getStoredFileText
protected String getStoredFileText(com.vasoftware.sf.server.types.GuidKey fileKey, String loggedInUser) throws InvalidSessionFault, SystemFault
Returns the text content of a stored file.- Parameters:
fileKey- Key to stored file.loggedInUser- the logged in user- Returns:
- File content as text string.
- Throws:
InvalidSessionFault- when session is invalid (or not active).SystemFault- when a system level error occurs.
-
downloadFile
protected javax.activation.DataHandler downloadFile(com.vasoftware.sf.server.types.GuidKey fileKey, String loggedInUser) throws InvalidSessionFault, SystemFaultDownloads a file stored within the file storage.- Parameters:
fileKey- Stored file key.loggedInUser- the logged in user- Returns:
- Data for SOAP download.
- Throws:
InvalidSessionFault- when session is invalid (or not active).SystemFault- when a system level error occurs.
-
getDocumentRootFolder
protected com.vasoftware.sf.server.types.FolderPath getDocumentRootFolder(String projectId, String loggedInUser) throws NoSuchObjectFault, InvalidSessionFault
Returns the root document folder path.- Parameters:
projectId- Project id.loggedInUser- the logged in user.- Returns:
- Root document folder path.
- Throws:
NoSuchObjectFault- when the specified project id is invalid.InvalidSessionFault- when there is no active session.
-
getTemplate
protected com.collabnet.ctf.template.service.TemplateService getTemplate()
Returns Template API handle.- Returns:
- Template API handle.
-
getPages
protected com.collabnet.ctf.page.service.PageService getPages()
Returns the Pages API handle- Returns:
- pages API handle
-
getPlanning
protected com.collabnet.ctf.planning.service.PlanningFolderService getPlanning()
Returns the planning API handle.- Returns:
- PlanningFolderService Planning folder service instance
-
getTracker
protected com.collabnet.ctf.tracker.service.TrackerService getTracker()
Returns the tracker API handle.- Returns:
- Tracker API handle.
-
getAttachment
protected com.collabnet.ctf.attachment.service.AttachmentService getAttachment()
Returns Attachment API handle.- Returns:
- Attachment API handle.
-
getCoreService
protected com.collabnet.ctf.core.service.CoreService getCoreService()
Returns the Core Service- Returns:
- the core service
-
getUserService
protected static com.collabnet.ctf.user.service.UserService getUserService()
Returns the User Service- Returns:
- the user service instance
-
getAuthenticationService
protected com.collabnet.ctf.authentication.service.AuthenticationService getAuthenticationService()
Returns the Authentication Service- Returns:
- the Authentication service
-
getAccessControlService
protected static com.collabnet.ctf.access.service.AccessControlService getAccessControlService()
Returns the Access Control Service- Returns:
- the AccessControlService instance
-
getTeam
protected com.collabnet.ctf.team.service.TeamService getTeam()
Returns the team API handle.- Returns:
- Team API handle.
-
getUser
protected com.collabnet.ctf.common.services.user.UserService getUser()
Returns the user API handle.- Returns:
- User API handle.
-
getDocMan
protected com.collabnet.ctf.document.service.DocumentService getDocMan()
Returns the DocumentService handle.- Returns:
- DocumentService handle.
-
getFileStorageService
protected com.collabnet.ctf.filestorage.service.FileStorageService getFileStorageService()
Returns theFileStorageServiceAPI handle.- Returns:
FileStorageServiceAPI handle.
-
getWiki
protected com.collabnet.ctf.wiki.service.WikiService getWiki()
Returns the wiki API handle.- Returns:
- Wiki API handle.
-
getSearch
protected com.collabnet.ctf.search.service.SearchService getSearch()
Returns the search API handle- Returns:
- Search API handle
-
getDiscussion
protected com.collabnet.ctf.discussion.service.DiscussionService getDiscussion()
Returns the discussion API handle.- Returns:
- Discussion API handle.
-
getNews
protected com.collabnet.ctf.news.service.NewsService getNews()
Returns the news API handle.- Returns:
- News API handle.
-
getFrs
protected com.collabnet.ctf.frs.service.FrsService getFrs()
Returns the frs API handle.- Returns:
- Frs API handle.
-
getCategorization
protected com.collabnet.ctf.categorization.service.CategorizationService getCategorization()
Returns the categorization API handle.- Returns:
- Categorization API handle.
-
getIntegrationData
protected com.collabnet.ctf.integrationdata.service.IntegrationDataService getIntegrationData()
Returns the integration data API handle.- Returns:
- integration data API handle.
-
getRbac
protected com.collabnet.ctf.rbac.service.RBACService getRbac()
Returns the integration data API handle.- Returns:
- integration data API handle.
-
getMonitoring
protected com.collabnet.ctf.monitoring.service.MonitoringService getMonitoring()
Gets the monitoring service API handle- Returns:
- monitoring service implementation
-
getApplicationRegistryService
protected com.collabnet.ctf.applicationregistry.service.ApplicationRegistryService getApplicationRegistryService()
Gets the application registry service handle- Returns:
- monitoring service implementation
-
getTagService
protected com.collabnet.ctf.tag.service.TagService getTagService()
Gets the tag service API handle- Returns:
- tag service implementation
-
validateString
protected void validateString(String name, String value) throws IllegalArgumentFault
Validates string to be non-null and non-empty.- Parameters:
name- Parameter name.value- Parameter value.- Throws:
IllegalArgumentFault- when the specified argument is invalid (empty or null)
-
validateStringWithTrim
protected void validateStringWithTrim(String name, String value) throws IllegalArgumentFault
Validates string to be non-null and non-empty with ignoring white spaces at starting and ending of the string- Parameters:
name- Parameter name.value- Parameter value.- Throws:
IllegalArgumentFault- when the specified argument is invalid (empty or null)
-
validateStringArray
protected void validateStringArray(String name, String[] values) throws IllegalArgumentFault
Validates values in the string array to be non-null and non-empty.- Parameters:
name- Parameter name.values- Parameter array of value.- Throws:
IllegalArgumentFault- when the specified argument is invalid (empty or null)
-
validateWikiPageName
protected void validateWikiPageName(String name, String value) throws IllegalArgumentFault
Validates wiki page name to be conformant.- Parameters:
name- Parameter name.value- Parameter value (wiki page name).- Throws:
IllegalArgumentFault- when the specified argument is invalid.
-
validateChoice
protected void validateChoice(String name, String[] choices, String value) throws IllegalArgumentFault
Validates string to be one of the possible choices.- Parameters:
name- Parameter name.choices- Value choices.value- Parameter value.- Throws:
IllegalArgumentFault- when the specified value is not a valid choice.
-
validateChoice
protected void validateChoice(String name, int[] choices, int value) throws IllegalArgumentFault
Validates integer value to be one of the possible choices.- Parameters:
name- Parameter name.choices- Value choices.value- Parameter value.- Throws:
IllegalArgumentFault- when the specified value is not a valid choice.
-
validateIconFile
protected void validateIconFile(String iconFileName, String iconMimeType) throws IllegalArgumentFault
Validates the icon fileName and mime type.- Parameters:
iconFileName- the name of the icon fileiconMimeType- the mime-type of the icon file- Throws:
IllegalArgumentFault- thrown if given arguements are invalid
-
getLocale
protected Locale getLocale(String locale) throws IllegalArgumentFault
Returns locale object from string specification.- Parameters:
locale- Locale string.- Returns:
- Locale object.
- Throws:
IllegalArgumentFault- when specified locale is invalid.
-
getNulledMinSoapDate
protected Date getNulledMinSoapDate(Date date)
Return the date, but return null if it's the magic soap value that .net uses- Parameters:
date- the date- Returns:
- the date, or null if magic
-
getProjectId
protected com.vasoftware.sf.server.types.ProjectKey getProjectId(com.vasoftware.sf.server.types.ItemKey itemKey, String loggedInUser) throws InvalidSessionFault, com.collabnet.ctf.common.exceptions.NoSuchObjectExceptionReturns the project ID of an item for marshaling purposes.- Parameters:
itemKey- Item key.loggedInUser- the logged in user.- Returns:
- Item's project key.
- Throws:
InvalidSessionFault- when the session is invalid.com.collabnet.ctf.common.exceptions.NoSuchObjectException- when the specified item id is invalid.
-
isFolderResource
protected static boolean isFolderResource(String resourceName)
Check if a resource is a folder resource- Parameters:
resourceName- The name of the resource to check- Returns:
- If the resource is a folder resource TODO: determine if it is a folder resource in a better way, using a service call and the resource type
-
makeStoredFileDO
protected com.vasoftware.sf.server.services.filestorage.StoredFileDO[] makeStoredFileDO(String fileName, String mimeType, String fileId, String loggedInUser) throws InvalidSessionFault, NoSuchObjectFault, SystemFault
Prepare StoredFileDO object- Parameters:
fileName- File namemimeType- Mime typefileId- ID of uploaded fileloggedInUser- the logged in user- Returns:
- StoredFileDO
- Throws:
InvalidSessionFault- InvalidSessionFaultNoSuchObjectFault- NoSuchObjectFaultSystemFault- SystemFault
-
makeStoredFileDOs
protected com.vasoftware.sf.server.services.filestorage.StoredFileDO[] makeStoredFileDOs(AttachmentSoapDO[] attachmentFiles, String loggedInUser) throws InvalidSessionFault, NoSuchObjectFault, SystemFault
Makes StoredFileDo's from Attachment List.- Parameters:
attachmentFiles- list of attachment files.loggedInUser- the logged in user- Returns:
- StoredFileDO[] list of Stored File DO's
- Throws:
InvalidSessionFault- InvalidSessionFaultNoSuchObjectFault- NoSuchObjectFaultSystemFault- SystemFault
-
assertNormalProject
protected void assertNormalProject(String objectId, String loggedInUser) throws InvalidSessionFault, NoSuchObjectFault
Validates the given object id and throws an Exception if it does not represent a normal project.- Parameters:
objectId- ID of the object to check.loggedInUser- the logged in user- Throws:
NoSuchObjectFault- when the specified object id is invalid or does not represent a project.InvalidSessionFault- when there is no active session.
-
isProjectGroup
protected boolean isProjectGroup(String objectId, String loggedInUser) throws InvalidSessionFault, NoSuchObjectFault
Checks if the specified object id is a project group id.- Parameters:
objectId- ID of the object to check.loggedInUser- the logged in user- Returns:
- true if specified id is that of a project group, false otherwise.
- Throws:
NoSuchObjectFault- when the specified object id is invalid.InvalidSessionFault- when there is no active session.
-
assertProjectGroup
protected void assertProjectGroup(String objectId, String loggedInUser) throws InvalidSessionFault, NoSuchObjectFault
Validates the given object id and throws an Exception if it does not represent a project group.- Parameters:
objectId- The id of the object to check.loggedInUser- the logged in user.- Throws:
NoSuchObjectFault- when the specified object id is invalid or does not represent a project group.InvalidSessionFault- when there is no active session.
-
isValidEmail
protected boolean isValidEmail(String value)
validates Email- Parameters:
value- email value- Returns:
- boolean true or false
-
setPartialOrFullUserData
protected void setPartialOrFullUserData(UserSoapList userSoapList, String loggedInUser) throws InvalidSessionFault, SystemFault
Overloaded form for processing `UserSoapList'- Parameters:
userSoapList- userSoapListloggedInUser- the logged in user- Throws:
InvalidSessionFault- when session is invalidSystemFault- when something wrong happened
-
canGiveFullUserDetails
protected boolean canGiveFullUserDetails(String username, String loggedInUser) throws InvalidSessionFault, SystemFault
Overloaded form to process `UserSoapRow'- Parameters:
username- username to checkloggedInUser- the logged in user- Returns:
- boolean return true if the given user can see full user details, false otherwise.
- Throws:
InvalidSessionFault- when session is invalidSystemFault- when something wrong happened
-
getOperation
protected com.vasoftware.sf.common.access.rbac.Operation getOperation(String operationString, String idForPluggable, com.vasoftware.sf.server.types.UserSessionKey sessionKey) throws IllegalArgumentException, com.vasoftware.sf.server.services.application.NoSuchOperationException
Gets Operation object from operation string.- Parameters:
operationString- The string representation of the operation. This should be in the format objectTypeName.operationCategory.operationName. For a list of operation strings for various object types, see OperationConstants interface. For integrated application, this should be in the format PluggableLink.plugid.permission_name.permission_name or PluggableLink.permission_name.permission_name.idForPluggable- Link id of the pluggable-project link or plug id for pluggable object. Required only when operationString is in the format PluggableLink.permission_name.permission_name.sessionKey- sessionKey of the user. Required only when operationString is in the format PluggableLink.permission_name.permission_name.- Returns:
- Operation object
- Throws:
IllegalArgumentException- If the operationString is in an invalid formatcom.vasoftware.sf.server.services.application.NoSuchOperationException- If specified operation doesn't exist
-
filterInvalidProjMembers
protected List<String> filterInvalidProjMembers(String projectId, List<String> userNames, String loggedInUser) throws InvalidSessionFault, com.collabnet.ctf.common.exceptions.NoSuchObjectException
Filter Invalid Project Members from List of Given Users.- Parameters:
projectId- projectId.userNames- List of user names.loggedInUser- the logged in user- Throws:
InvalidSessionFault- when session is invalidcom.collabnet.ctf.common.exceptions.NoSuchObjectException- when the specified item id is invalid.
-
getPluggableComponent
protected com.collabnet.ctf.pluggable.service.PluggableService getPluggableComponent()
Returns the Pluggable data API handle.- Returns:
- pluggable data API handle.
-
-