Final Lab - Gadget Development Advanced: Development of a LDAP Browsing Gadget The following is what should be accomplished in this lab:
In this exercise you will use all the concepts and skills acquired during the course to complete a partially written gadget. This gadget will provide some simple browsing capabilities for the directory allowing the user to browse the objects in the tree and examine the attributes and their values for each object. Although the gadget is quite crude, by the end of the exercise you should have a better understanding of the processes involved in gadget development. Figures 54 and 55 demonstrate what your final gadget should look like.
Figure 54: Browsing the o=novell Context.
Figure 55: Browsing the Admin user. Completing the Gadget The data that will output to the browser and how this data is represented with XML.
Testing the Gadget Remember:
Getting Started To get you going you will need to download the gadget.zip file. This .zip file contains the following files:
XML Output Help Below are some sample XML output the gadget might output, notice the currentDN and parentDN and state attributes and when no currentDN exists (i.e. we are at the root) the conventional up level indicator/symbol is present (ie. the ".."). Keep this XML output in mind when completing both the code and the XSL. XML output while browsing the objects: <LDAPBROWSE CURRENT_DN="" PARENT_DN=""> XML output while browsing the attributes present on a given object: <LDAPBROWSE CURRENT_DN="cn=Admin,o=novell" PARENT_DN="o=novell" state="AttrList"> In the Java code you may wish to use the com.novell.nps.gadgetManager.XmlUtil convenience object (see the exteNd Director Gadget Developer Kit documentation at: http://www.developer.novell.com/ndk/downloadaz.htm). The data is pulled from the directory via the com.novell.nps.authentication.AuthenticationManager object. This portion of the code has been provided, however be sure to examine it carefully to fully understand what functionality it provides. So, go ahead and look at the LDAPBrowse.java code, from the gadget zip file and fill in the 10 TODOs. When you have completed the TODOs, check your answers with Solution-LDAPBrowse.java. If you would like to see the complete source code for LDAPBrowse.java, see LDAPBrowse_Solution.java in the downloads section. Next, work on the main.xsl skeleton. When you have completed this, check your solutions with Solution-main.xsl.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||||