Database :: openWorkspace - Open Workspace
The function creates or opens the workspace with the name passed in sWorkspaceName. A user or group name has to be passed in addition in sUserName in order to verify access rights to the workspace.
After opening the workspace, updated instances and collections are stored in the opened workspace. When the workspace is used the first time, it will be created and initialized. Otherwise the existing workspace is opened. In order to provide a location for a new workspace, a file path can be provided in sWorkspacePath. The file path will be ignored, when the workspace does already exist.
In order to access the workspace exclusively, true should be passed in bExclusive.
You might check before opening whether the workspace exists or not by calling locateWorkspace(), which returns true when the workspace has already been created.
Usually the workspace file is created in the same folder as the database. You may, however, pass an explicit location for the workspace via the ws_path parameter.
Implementation details
- sWorkspaceName
- Workspace name
The workspace name is the extension of the current workspace or database. The database can be considered as the root for all workspaces. The workspace name may address a workspace on top of the current one (simple workspace name) or a workspace on any higher level by passing a sequence of workspace names separated by '.'.
In order to pass no dictionary path, an empty string ( String() ) has to be passed.
- sUserName
- User name
The user name is the user's login name. In order not to pass any user name, an empty string ( String() )may be passed.
- bExclusive
- Exclusive use of resource
When this option is set to true, the opened resource is accessed exclusively.
- sWorkspacePath
- File path to the workspace database location
Usually new workspace files are created in the same folder as the database. You may, however, pass an explicit location for the workspace via this parameter.
group1_ws.my_ws // my work space in a group work space