Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Dynamic Creation of workspaces on Worksite Server
yuvpurush
How to create workspaces on the Worksite server dynamically?
The workspace will contain documents which will be uploaded by a J2EE application which resides on a filesystem other than the worksite is running on.
We have to create the workspace dynamically as and when we upload documents on the file system.
Is there any Java API's available?
Immediate help is much appreciated.
Find more posts tagged with
Comments
JTNeville
The WOM can do this, though it would have to be in steps, create the workspace (admin), set the security (admin), create the document folder, upload the document folder. The first three steps could be made into one by making a template ahead of time and calling create with that.
The WOM/SDK is included in your documentation and zip files you got when you purchased the MP system and is available for download via your support login.
JTNeville
1) Create the session (pge of the WOM SDK pdf)
Example 4.1 illustrates the creation of a simple session.
try {
// Obtain a handle to a SessionManager object
SessionManager manager = SesssionManager.getInstance ();
// Create a Simple Session
// myApplicationname is an arbitrary application name
// myServer is the name of a WorkSite MP server cluster
SimpleSession session = manager.createSimpleSession
(“myApplicationname”, “myServer”)
} catch (WorkteamException we) { we.printStackTrace ();}
2) Create the workspace (pge 47, 51... of the WOM pdf)
Example 4.5.
// Create a workspace in an existing facility
// To create a catalog, use createCatalog instead of
// createWorkspace
Workspace workspace = facility.createWorkspace ();
workspace.setName ("My First Workspace");
workspace.setDescription ("A Workspace");
workspace.update ();
workspace.refresh (); // Optional; generally unnecessary
// Delete an existing workspace
Workspace workspace = facility.deleteWorkspace ();
3) Create the document (pge 63 of the WOM pdf):
Example 5.1 illustrates the creation of a new document.
// myFolder is a reference to a folder
// From the current folder, create a document
Document myDocument = myFolder.createDocument ();
myDocument.setName("myPdfDoc");
myDocument.setDescription ("Example PDF document");
// Get the file to be associated with the Document version
File file = new File ("myPdfFile.pdf");
// Set an initial version (stream) for the document
Version version = myDocument.setInitialVersion (file);
// Get the ApplicationFormat associated with 'PDF'.
// Note this may throw a WorkteamException
// if not present within Library
Collection appFormatCollection =
library.getApplicationFormat ("PDF");
Iterator iter = appFormatCollection.iterator ();
ApplicationFormat appFormat =
(ApplicationFormat) iter.next ();
// Set the ApplicationFormat
version.setApplicationFormat (appFormat);
// Set the Security Policy to that of the containing folder
SecurityPolicy policy = myFolder.getSecurityPolicy ();
myDocument.setSecurityPolicy (policy);
// Make the document persistent, including the
// version file stream
myDocument.update ();
Chapter 5 goes into document management via the WOM and Chapter 10 covers guidelines for working with the WOM.
Should be enough to get you going.
yuvpurush
Thanks a lot.
But, i cant create the session itself.. im getting the class format error when i import the packages from iMapMP.zip.At runtime only im getting this error. I think the classes in this zip file is compiled with a older version. Is anyone having the new version of iMapMP.zip