ICIWorkspace

The ICIWorkspace properties and methods are used to retrieve and to create a Workspace.

HRESULT AddParticipant([in] BSTR bstrName, [out, retval];

EFT v7.1 and later

HRESULT ExpireTime([out, retval] DATE* pVal);

EFT v7.2.1

HRESULT GetParticipantPermissions([in] BSTR bstrName, [out, retval] IDispatch** ppdisplPermissions);

EFT v7.1 and later

HRESULT Name([out, retval] BSTR *pVal);

EFT v7.1 and later

HRESULT Owner([out, retval] BSTR *pVal);

EFT v7.1 and later

HRESULT ParticipantList([out, retval] VARIANT* pVal);

EFT v7.1 and later

HRESULT Path([out, retval] BSTR *pVal);

EFT v7.1 and later

HRESULT RemoveParticipant([in] BSTR bstrName, [out, retval]  

EFT v7.1 and later

HRESULT SetParticipantPermissions([in] BSTR bstrName, [in] IDispatch* ppdisplPermissions);

EFT v7.1 and later

HRESULT TimeCreated([out, retval] BSTR *pVal);

EFT v7.1 and later

Workspace Examples, VBScript script fragments:

1) Getting a Workspace object and printing its information:

guid = site.GetWorkspaceGUID("/Usr/testuser/share")

Set ws = site.GetWorkspace(guid)

WScript.Echo vbCrLf

WScript.Echo "Workspace name: " & ws.Name & vbCrLf

WScript.Echo "Workspace path: " & ws.Path & vbCrLf

WScript.Echo "Workspace Owner: " & ws.Owner & vbCrLf

WScript.Echo "Workspace TimeCreated: " & ws.TimeCreated & vbCrLf

WScript.Echo "Workspace ParticipantList: "

Dim arList : arList = ws.ParticipantList

for i = LBound(arList) to UBound(arList)

WScript.Echo CStr(i) & " - " & arList(i)

next

2) A function that removes all participants from a workspace (make sure to call SetWorkspace after calling this function):

Function RemoveParticipants (ws)

     Dim arList : arList = ws.ParticipantList

 

     for i = LBound(arList) to UBound(arList)

           WScript.Echo CStr(i) & " - Deleting " & arList(i)

           ws.RemoveParticipant(arList(i))

     next

End Function

3) Changing a user’s permissions:

Set perm = ws.GetParticipantPermissions("user")

 

WScript.Echo "Permissions for user" & vbCrLf

WScript.Echo "DownloadFile: " & perm.DownloadFile & vbCrLf

WScript.Echo "UploadFile: " & perm.UploadFile & vbCrLf

WScript.Echo "DeleteFile: " & perm.DeleteFile & vbCrLf

WScript.Echo "RenameFileFolder: " & perm.RenameFileFolder & vbCrLf

WScript.Echo "CreateFolder: " & perm.CreateFolder & vbCrLf

WScript.Echo "DeleteFolder: " & perm.DeleteFolder & vbCrLf

 

' Change permissions

perm.DownloadFile = true

perm.UploadFile = true

perm.DeleteFile = true

perm.RenameFileFolder = true

perm.CreateFolder = true

perm.DeleteFolder = true

 

' Set permissions

ws.SetParticipantPermissions "user", perm

' Set workspace

site.SetWorkspace guid, ws