// Get the workspaceWorkspace workspace = Repository.getWorkspace("admin user id", "admin user id Password");// set current working library
workspace.setCurrentDocumentLibrary(workspace.getDocumentLibrary("name of the library where you have your components"));
// retrieve library component
DocumentIdIterator docIds=workspace.findByName(DocumentTypes.LibraryComponent,"component name");
if (docIds.hasNext()){
DocumentId did = (DocumentId)docIds.next();
LibraryComponent libComp = (LibraryComponent)workspace.getById(did);
if (docIds.hasNext()){
DocumentId did = (DocumentId)docIds.next();
LibraryComponent libComp = (LibraryComponent)workspace.getById(did);
// Create the rendering contextRenderingContext context = workspace.createRenderingContext(portletRequest, portletResponse, new HashMap(), "connect");
// Set the path to the content to be renderedcontext.setRenderedContent("/Library1/SiteA/SiteArea1/SiteArea1-1/myContent(refer some default content)");// Get the rendered stringString renderedContent = workspace.render(context,libComp );
No comments:
Post a Comment