Show TOC

Background documentationUsing URL Support to Access the UCD Locate this document in the navigation structure

 

To access the UCD JNDI tree, use a URL with the schema prefix ucd:. When using a URL, the user context in the UCD hierarchy is returned.

More information: http://java.sun.com/products/jndi/

The following constant is defined in the class com.sapportals.portal.pcd.gl.IPcdContext:

public final static String UCD_SCHEMA_PREFIX = "ucd:";

Note Note

To access the UCD, you must provide the user principal ID as the SECURITY_PRINCIPAL property in the JNDI environment.

End of the note.

Example

Syntax Syntax

  1. private IPcdContext getUcdContextByUrl() throws NamingException
    {
    	Hashtable <Object, Object> env = new Hashtable();
    	env.put(Context.SECURITY_PRINCIPAL, user);
    	InitialContext ctx = new InitialContext(env);
    	return (IPcdContext) ctx.lookup(IPcdContext.UCD_SCHEMA_PREFIX);
    }
    
End of the code.