A Forum reader recently asked:
"I'd like to access the eDirectory object I'm currently modifying in iManager as a com.novell.admin.ns.NSObject from the JSP file. How do I get this object?
NSObject iam = ???
I'm talking about a property book page. I do not want to change any values in eDirectory; I just want to do some
simple parsing on existing values."
And here is the response from Wolfgang Schreiber ...
To get your handle on the selected object(s) in the JSP code of a property book page, you may add code similar to this into your JSP:
// get handles into tree ... please add error handling
TaskContext taskContext =
eMFrameFactory.getTaskContext( request );
AuthenticationBroker authenticationBroker =
ObjectEntry oeTree = (ObjectEntry)
authenticationBroker.getAPIObject( "NDSNamespace" );
NDSNamespace ns = ( NDSNamespace )
// get the selected target(s)
String sTargetsPacked = (String) request.getAttribute(
String saTargets = eMFrameUtils.unpack( sTargetsPacked,
// prepare display
String sDisplay = "Objects selected: " + String.valueOf(
saTargets.length ) + "<br>";
for ( int i=0; i<saTargets.length; i++ )
ObjectEntry oeTarget = oeTree.getNamespace().getObjectEntry(
NSObject nsoTarget = ns.getDetails( oeTarget );
sDisplay += saTargets[i] + " (" + oeTarget.getFullName() +
<TD align=left>Targets (packed):  </TD>
<TD><%= sTargetsPacked %></TD>
<TD align=left>Targets (unpacked): </TD>
<TD><%= sDisplay %></TD>
Do not forget to add the proper import statements to the JSP header. For example:
<%@ page pageEncoding="utf-8" contentType="text/html;charset=utf-8"
Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).
It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.