Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Searching for workspace names which have commas.
WhitehillTech
Is it possible to retrieve a workspace which contains a comma in it's name without having to rely on wildcard searches?
Given the following code (VBA):
'********************************************************************************************************
Dim iDMS As New ManDMS
Dim iSess As IManSession
Dim iDB As IManDatabase
Dim strServername As String
Dim strUserName As String
Dim strPassword As String
Dim strDatabaseName As String
Dim strWorkspace As String
Dim imaWorkspaces As IManFolders
Dim imaCurrentContainer As IManFolder
'*************Fill in the following info*************
strServername = "" 'server to connect to
strUserName = "" 'Username to connect with
strPassword = "" 'Password for the user specified
strDatabaseName = "" 'The name of the Database used
strWorkspace = "" 'The name of the workspace to search for.
'****************************************************
'Create Session
Set iSess = iDMS.Sessions.Add(strServername)
'Login to the session
iSess.Login strUserName, strPassword
'Get the Database
Set iDB = iSess.Databases.ItemByName(strDatabaseName)
Dim workspaceSearchParams As IManWorkspaceSearchParameters
Set workspaceSearchParams = iDMS.CreateWorkspaceSearchParameters()
Call workspaceSearchParams.Add(imFolderAttributeID.imFolderName, strWorkspace)
Dim profileSearchParams As IManProfileSearchParameters
Set profileSearchParams = iDMS.CreateProfileSearchParameters()
Set imaWorkspaces = iDB.SearchWorkspaces _
(profileSearchParams, workspaceSearchParams)
Set imaCurrentContainer = imaWorkspaces.ItemByIndex(imaWorkspaces.Count).Workspace
'********************************************************************************************************
if strWorkspace is "workspace,name" which is a valid workspace located in the database,
The search would fail as it is looking for workspace or name specifically. Which neither are actual workspaces in the database
One way I have found to retrieve the workspace in question is to replace the comma with an asterisk to do a wildcard search which would retrieve all workspaces that match the pattern "workspace*name".
The problem with that is that the results need to be looped through and compared to ensure that "workspace,name" is actually there and that the results are not only other workspaces such as "workspaceSomethingname"
Is there a way to escape the comma character? or some other means to retrieve the workspace directly.
Find more posts tagged with
Comments
There are no comments yet