on 02-18-2006 10:11 AM
HI,
can you provide me with code sample or links to any examples which deal with Adding and removing pages to folder programmatically.
Any documents on how to add a page to a workset programmatically will also be helpful.
Message was edited by: Kirupanand Venkatapathi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
Sorry for the bad link (I left off the htm at the end):
http://help.sap.com/saphelp_nw04/helpdata/en/fd/ea5c42da4de92ce10000000a1550b0/frameset.htm
-
Quick code sample (without try/catch):
import java.util.Hashtable;
import javax.naming.Context;
import com.sapportals.portal.pcd.gl.IPcdContext;
import com.sapportals.portal.prt.jndisupport.InitialContext;
import com.sap.portal.pcm.page.IPage;
import com.sap.portal.pcm.iview.IiViews;
import com.sap.portal.pcm.INewObjectDescriptor;
import com.sapportals.portal.prt.runtime.PortalRuntime;
//********* Set up environment for PCD/JNDI call
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, IPcdContext.PCD_INITIAL_CONTEXT_FACTORY);
env.put(Context.SECURITY_PRINCIPAL, request.getUser());
//********* Create initial context
InitialContext iCtx = null;
iCtx = new InitialContext(env);
//********* Lookup page (or folder)
IPage myPage =(IPage)iCtx.lookup("pcd:portal_content/DanielContent/myPage");
//********* Create descriptor for new iView
IiViews iViewSrv = (IiViews)PortalRuntime.getRuntimeResources().getService(IiViews.KEY);
INewObjectDescriptor IVtoAdd = (INewObjectDescriptor)iViewSrv.instantiateDescriptor(CreateMethod.DELTA_LINK,"pcd:portal_content/DanielContent/myParent",request.getUser());
//********* Add iView to page
myPage.addiView(IVtoAdd,"testParent");
If you want to add something to a folder, you would look up the folder and cast the return value into a Context object, and then call the bind method to add the object to the folder.
Hope this helps.
Daniel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Adding and removing pages (and other semantic objects) is described in the Portal Developer Guide in the section called Managing iViews and Other PCD Objects at http://help.sap.com/saphelp_nw04/helpdata/en/fd/ea5c42da4de92ce10000000a1550b0/frameset.
The above includes simple yet detailed information on adding pages to folders (PCD folders, not role folders).
As for worksets, these semantic objects are technically not public and not described in the guide.
Hope this helps.
Daniel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.