package oracle.sample.jcr; /* ListEntNode.java */ import oracle.ocs.jcr.BeehiveRepositoryConfiguration; import java.io.*; import java.util.Hashtable; import javax.servlet.*; import javax.servlet.http.*; import javax.jcr.Node; import javax.jcr.NodeIterator; import javax.jcr.Repository; import javax.jcr.Session; import javax.jcr.SimpleCredentials; import javax.naming.Context; import oracle.ocs.jcr.RepositoryFactory; /** * ListEntNode.java * * This servlet lists the members of the enterprise node. * This is a sample servelet that demonstrates how to initialize the * repository and get the child nodes of the enterprise node. */ public class ListEntNode extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { res.setContentType("text/html"); ServletOutputStream out = res.getOutputStream(); out.println(""); out.println("
Retrieved the repository object from the repository " + "factory
"); SimpleCredentials cred = new SimpleCredentials("beeadmin", "Welcome1".toCharArray()); out.println("Finished setting credentials
"); Session sess = rep.login(cred); out.println("Retrieved session: " + sess + "
"); Node root = sess.getRootNode(); out.println("Retrieved root node of the workpace: " + root.getName() + "
"); out.println("User ID used to acquire the session: " + sess.getUserID() + "
"); Node e = root.getNode("oracle"); out.println("List of nodes in the oracle node:
Exception caught: " + e + "
"); } out.println(""); } public String getServletInfo() { return "Create a page that says Hello World and send it back"; } }