 |
|
|
 |
| Novell Portal Services Overview and Gadget Development |
 |
| April 2003 |
 |
| DeveloperNet University Course |
 |
 |
| Reader Rating |
 |
|
 |
from ratings |
 |
|
 |
|
|
Solution-LDAPBrowse.java
Solution - LDAPBrowse.java
The changes required are as follows:
- Code fill:
/* ------------------------------------------------------- TODO(1): provide some constants (static final) for: * the LDAP browse tag * the LDAP object tag * the LDAP attrbiute tag --------------------------------------------------------------- */
Solution:
private static final String LDAPBROWSE_TAG = "LDAPBROWSE"; private static final String LDAP_OBJECT_TAG = "LDAP_OBJECT"; private static final String LDAP_ATTRIBUTE_TAG = "LDAP_ATTRIBUTE";
- Code fill:
/* --------------------------------------------------------- TODO(2): initialize the following to the empty string ("") * base * parentDN * currentDN * selectedCN --------------------------------------------------------------- */
Solution:
base = ""; parentDN = ""; currentDN = ""; selectedCN = "";
- Code fill:
/* ---------------------------------------------------- TODO(3): set CURRENT_DN and PARENT_DN properties on ldapBrowseAttrbiutes. Hint: try the setProperty() method! ------------------------------------------------------------ */
Solution:
ldapBrowseAttributes.setProperty("CURRENT_DN", currentDN); ldapBrowseAttributes.setProperty("PARENT_DN", parentDN);
- Code fill:
/* ------------------------------------------------------ TODO(4): write out the start tag for <LDAPBROWSE someAttrbiutes> ensuring you specify the attributes (ldaoBrowseAttribtues) you created above. Hint: try the XmlUtil.writeStartTag() method ------------------------------------------------------------ */
Solution:
XmlUtil.writeStartTag(LDAPBROWSE_TAG, ldapBrowseAttributes, out);
- Code fill:
/* ------------------------------------------------------- TODO(5): write out the full tag for <LDAPOBJECT > which will contain the current object in the loop. -------------------------------------------------------------- */
Solution:
XmlUtil.writeTag(LDAP_OBJECT_TAG, dn2Cn((String)ldapResults.elementAt(i)), out);
- Code fill:
/* ---------------------------------------------------- TODO(6): write out the end tag for </LDAPBROWSE> ---------------------------------------------------------- */
Solution:
XmlUtil.writeEndTag(LDAPBROWSE_TAG, out);
- Code fill:
/* ------------------------------------------------------ TODO(7): get the following from the HttpServletRequest * CURRENT_DN * SELECTED_CN Hint: use the getParameter() method. ------------------------------------------------------------- */
Solution:
String currentDN = req.getParameter( "CURRENT_DN" ); String selectedCN = req.getParameter( "SELECTED_CN" );
- Code fill:
/* -------------------------------------------------------- TODO(8): set CURRENT_DN and PARENT_DN properties on ldapBrowseAttrbiutes. Hint: try the setProperty() method! -------------------------------------------------------------- */
Solution:
ldapBrowseAttributes.setProperty("CURRENT_DN", currentDN); ldapBrowseAttributes.setProperty("PARENT_DN", parentDN);
- Code fill:
/* --------------------------------------------------------- TODO(9): write out the start tag for <LDAPBROWSE someAttrbiutes> ensuring you specify the attributes (ldaoBrowseAttribtues) you created above. --------------------------------------------------------------- */
Solution:
XmlUtil.writeStartTag(LDAPBROWSE_TAG, ldapBrowseAttributes, out);
- Code fill:
/* ---------------------------------------------------------- TODO(10): write out the end tag for </LDAPBROWSE> --------------------------------------------------------------- */
Solution:
XmlUtil.writeEndTag(LDAPBROWSE_TAG, out);
|