AquaLogic User Interaction Development Guide

     Previous Next  Open TOC in new window   View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Editing Collaboration Folder and Document Properties Using IDK Remote APIs

To query and modify Collaboration folder and document properties from a remote application, use the IDocumentFolder and IDocument interfaces in the IDK.

The IDocumentFolder and IDocument interfaces allow you to update metadata and manipulate security settings. These interfaces provide access to the following metadata:
Property Name Description API Access
ID The object ID for the current folder or document. Read Only
Name The name of the current folder or document. Read/Write
Description The description for the current folder or document. Read/Write
Details The URL to the details page for the current folder or document. Read Only
Content Type Documents only. The Content Type of the current document. Read/Write
Content URL The URL at which the document content can be downloaded. Read Only
Path The path to the document (as a string). Read Only
Author Documents only. The user ID of the author of the current document. Read Only
Created Date The date the current folder or document was created (this information might not be available). Read Only
Last-Modified Date The date the current folder or document was last updated (this information might not be available). Read Only
Checked-Out Date The date the document was last checked out. (Returns null if the document is not checked out.) Read Only
Owner The user ID of the folder or document owner. Read Only
Access Level The permissions for the defined roles on the current folder or document (edit, delete, edit security). You can only change permissions for the folder if the default project security is set to false. Read/Write
Permissions Documents only. The permissions for the current user on the current document (check out, attach links, copy, edit, edit security, delete). Read Only
Parent Folder The parent folder that contains the current folder or document. Read Only
Project The parent project that contains the current folder or document. Read Only
Default Project Security Whether or not default project security should be applied to the folder or document. If default project security is enabled, you cannot change the security for the folder. Read/Write
To modify folder or document properties, follow the steps below.
  1. Initiate a PRC session. This example retrieves a login token using the IPortletContext; you can also use IRemoteSession. (For details, see Initiating a PRC Session to Use IDK Remote APIs.)
  2. Get the Document Manager.
  3. Get the folder or document and modify properties as shown in the code samples below.
    Note: You must call store after making any changes or they will not be persisted.

Java

...

IRemoteSession remoteSession = portletContext.getRemotePortalSession();
IDocumentManager documentManager = remoteSession.getCollaborationFactory().getDocumentManager();

//get the document
IDocument document = documentManager.getDocument(documentID);

//set properties
document.setName() = "Updated Name";
document.setDescription() = "Updated Description ";

//update security
document.setAccessLevel(RoleType.MEMBER, AccessLevel.WRITE);

//call store to persist your changes
document.store();

...

.NET (C#)

...

remoteSession = portletContext.GetRemotePortalSession();
documentManager = remoteSession.GetCollaborationFactory().GetDocumentManager();

//get the document
IDocument document = documentManager.GetDocument(documentID);

//set properties
document.Name = "Updated Name";
document.Description = "Updated Description";

//update security
document.SetAccessLevel(RoleTypes.Member, AccessLevels.Write);

//call store to persist your changes
document.Store();

...

.NET (VB)

...

dim documentManager As IDocumentManager
dim remoteSession As Plumtree.Remote.PRC.IRemoteSession
remoteSession = portletContext.GetRemotePortalSession()
documentManager = remoteSession.GetCollaborationFactory().GetDocumentManager()

'get the document
dim document As IDocument = documentManager.GetDocument(documentID)

'set properties 
document.Name = "Updated Name"
document.Description = "Updated Description"

'update security
document.SetAccessLevel(RoleTypes.Member, AccessLevels.Write)

//call store to persist your changes
document.Store()

...

  Back to Top      Previous Next