Modified: xml/xindice/trunk/java/examples/addressbook/src/jsp/index.jsp
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/examples/addressbook/src/jsp/index.jsp?rev=705950&r1=705949&r2=705950&view=diff
==============================================================================
--- xml/xindice/trunk/java/examples/addressbook/src/jsp/index.jsp (original)
+++ xml/xindice/trunk/java/examples/addressbook/src/jsp/index.jsp Sat Oct 18 18:57:36 2008
@@ -19,56 +19,36 @@
*/
%>
-<%@ page import="javax.servlet.*, javax.servlet.http.*" %>
+<p class="introduction">
+ The Address Book sample application serves as a very simple example of
+ the applications that can be constructed using Xindice. All data in the
+ application is stored as XML and the database is queried using XPath.
+</p>
+
+<p class="introduction">
+ This application isn't intended to show what is unique about an XML
+ database, rather it is intended to be familiar and accessible to
+ developers who are used to working with other data storage technologies.
+ You can view the source code for this application as part of the Xindice
+ distribution and it should give you a basic idea of what XML database
+ applications look like.
+</p>
+
+<p>
+ The address book data entries look something like the following.
+</p>
+
+<%-- Setup person bean to show example xml record --%>
+<jsp:useBean id="person" class="addressbook.Person" scope="request">
+ <jsp:setProperty name="person" property="fname" value="Homer"/>
+ <jsp:setProperty name="person" property="lname" value="Simpson"/>
+ <jsp:setProperty name="person" property="workPhone" value="123-456-7890"/>
+ <jsp:setProperty name="person" property="homePhone" value="234-567-8901"/>
+ <jsp:setProperty name="person" property="cellPhone" value="456-789-0123"/>
+ <jsp:setProperty name="person" property="homeEmail" value="[email protected]"/>
+ <jsp:setProperty name="person" property="workEmail" value="[email protected]"/>
+ <jsp:setProperty name="person" property="homeAddress" value="1234 W. Springfield"/>
+ <jsp:setProperty name="person" property="workAddress" value="34 N. Atom Way"/>
+</jsp:useBean>
-
-<%@ include file="header.jsp" %>
-
-<B>
- <FONT SIZE="+2">
- <CENTER>Xindice Sample Address Book Application</CENTER>
- </FONT>
- <BR />
-
- <blockquote>
- <p>
- The Address Book sample application serves as a very simple example of
- the applications that can be constructed using Xindice. All data in the
- application is stored as XML and the database is queried using XPath.
- </p>
-
- <p>
- This application isn't intended to show what is unique about an XML
- database, rather it is intended to be familiar and accessible to
- developers who are used to working with other data storage technologies.
- You can view the source code for this application as part of the Xindice
- distribution and it should give you a basic idea of what XML database
- applications look like.
- </p>
-
- <p>
- The address book data entries look something like the following.
- </p>
- </blockquote>
- <CENTER>
-
- <%
- // Setup person bean to show example xml record
- person.setFname("Homer");
- person.setLname("Simpson");
- person.setWorkPhone("123-456-7890");
- person.setHomePhone("234-567-8901");
- person.setCellPhone("456-789-0123");
- person.setHomeEmail("[email protected]");
- person.setWorkEmail("[email protected]");
- person.setHomeAddress("1234 W. Springfield");
- person.setWorkAddress("34 N. Atom Way");
- %>
-
- <%@ include file="showXMLInfo.jsp" %>
-
- <BR />
- <BR />
-</B>
-
-<%@ include file="footer.jsp" %>
+<%@include file="showXMLInfo.jsp"%>
Added: xml/xindice/trunk/java/examples/addressbook/src/jsp/initialize.jsp
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/examples/addressbook/src/jsp/initialize.jsp?rev=705950&view=auto
==============================================================================
--- xml/xindice/trunk/java/examples/addressbook/src/jsp/initialize.jsp (added)
+++ xml/xindice/trunk/java/examples/addressbook/src/jsp/initialize.jsp Sat Oct 18 18:57:36 2008
@@ -0,0 +1,39 @@
+<%
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Id: addContact.jsp 511428 2007-02-25 03:30:52Z vgritsenko $
+ */
+%>
+<%@ page import="addressbook.DBConnection"%>
+
+<h2>Collection not found</h2>
+
+<p>
+ The application successfully connected to Xindice database, but collection
+ <span class="code"><%=DBConnection.getCollectionURL()%></span>
+ was not found. To create the collection you can either:
+</p>
+<ul>
+ <li>
+ Switch to Xindice installation directory and run the following command:
+ <span class="code">bin<%=java.io.File.separator%>xindice ac -c <%=DBConnection.getParentCollectionURL()%> -n addressbook</span>
+ </li>
+ <li>
+ <a href="Setup?action=initialize">Allow the application to create the collection for you.</a>
+ </li>
+</ul>
+
Propchange: xml/xindice/trunk/java/examples/addressbook/src/jsp/initialize.jsp
------------------------------------------------------------------------------
svn:executable = *
Added: xml/xindice/trunk/java/examples/addressbook/src/jsp/layout.jsp
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/examples/addressbook/src/jsp/layout.jsp?rev=705950&view=auto
==============================================================================
--- xml/xindice/trunk/java/examples/addressbook/src/jsp/layout.jsp (added)
+++ xml/xindice/trunk/java/examples/addressbook/src/jsp/layout.jsp Sat Oct 18 18:57:36 2008
@@ -0,0 +1,66 @@
+<%
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Id: header.jsp 511428 2007-02-25 03:30:52Z vgritsenko $
+ */
+%>
+
+<%@ page contentType="text/html"%>
+
+<jsp:useBean id="content" type="java.lang.String" scope="request"/>
+<jsp:useBean id="msg" class="java.lang.String" scope="request"/>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+ <link href="addressbook.css" rel="stylesheet" type="text/css">
+ <title>Xindice Address Book</title>
+ </head>
+ <body>
+ <h1>Xindice Address Book</h1>
+ <div id="menu">
+ <div class="title">Actions</div>
+ <a href="index.jsp">Home</a>
+ <a href="Task?action=listcontacts">List Contacts</a>
+ <a href="contactForm.jsp">Add a Contact</a>
+ <a href="searchContacts.jsp">Search</a>
+ </div>
+<%
+ if (msg != null && msg.length() > 0) {
+%>
+ <div class="msg">
+ <%=msg%>
+ </div>
+<%
+ }
+%>
+ <div id="content">
+<%
+ try {
+%>
+ <jsp:include page="<%=content%>"/>
+<%
+ } catch (Exception e) {
+ request.setAttribute("error", e);
+%>
+ <jsp:include page="error.jsp"/>
+<%
+ }
+%>
+ </div>
+ </body>
+</html>
Propchange: xml/xindice/trunk/java/examples/addressbook/src/jsp/layout.jsp
------------------------------------------------------------------------------
svn:executable = *
Modified: xml/xindice/trunk/java/examples/addressbook/src/jsp/listContacts.jsp
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/examples/addressbook/src/jsp/listContacts.jsp?rev=705950&r1=705949&r2=705950&view=diff
==============================================================================
--- xml/xindice/trunk/java/examples/addressbook/src/jsp/listContacts.jsp (original)
+++ xml/xindice/trunk/java/examples/addressbook/src/jsp/listContacts.jsp Sat Oct 18 18:57:36 2008
@@ -18,56 +18,6 @@
* $Id$
*/
%>
+<h2>Contacts</h2>
-<%@ include file="header.jsp" %>
-
-<%@ page session="true" %>
-<%@ page import="javax.servlet.http.HttpSession, java.io.* , java.util.*" %>
-
-<FONT SIZE="+2">
- <CENTER>Contacts</CENTER>
-</FONT>
-<BR>
-
-<% // Loop over all entries in session.group, calling showNameLink() on each of them
- if (group.sizeOf() == 0) {
- %> Sorry, No contacts found! <%
- }
- else {
- %>
- <center>
- <table width="80%">
- <tr bgcolor="#C8C8FF"><th>First Name</th><th>Last Name</th><th>Work</th><th>Home</th><th>Cell</th></tr>
- <%
- group.reset();
- int i = 0;
- while ( group.hasMorePersons() ) {
- person = group.getNext();
- %>
- <tr>
- <td align="center">
- <A HREF="/addressbook/Task?action=showcontact&index=<%= group.getIndex() %>"><%= person.getFname() %></A>
- </td>
- <td align="center">
- <A HREF="/addressbook/Task?action=showcontact&index=<%= group.getIndex() %>"><%= person.getLname() %></A>
- </td>
- <td align="center">
- <%= person.getWorkPhone() %>
- </td>
- <td align="center">
- <%= person.getHomePhone() %>
- </td>
- <td align="center">
- <%= person.getCellPhone() %>
- </td>
- </tr>
- <%
- }
- %>
- </table>
- </center>
- <%
- }
-%>
-
-<%@ include file="footer.jsp" %>
+<%@include file="listing.jsp"%>
\ No newline at end of file
Added: xml/xindice/trunk/java/examples/addressbook/src/jsp/listResults.jsp
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/examples/addressbook/src/jsp/listResults.jsp?rev=705950&view=auto
==============================================================================
--- xml/xindice/trunk/java/examples/addressbook/src/jsp/listResults.jsp (added)
+++ xml/xindice/trunk/java/examples/addressbook/src/jsp/listResults.jsp Sat Oct 18 18:57:36 2008
@@ -0,0 +1,27 @@
+<%
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Id: listContacts.jsp 511428 2007-02-25 03:30:52Z vgritsenko $
+ */
+%>
+<jsp:useBean id="xpath" type="java.lang.String" scope="request"/>
+
+<h2>Search Results</h2>
+
+<p>Your XPath query <span class="code"><%=xpath%></span> returned the following results:</p>
+
+<%@include file="listing.jsp"%>
Propchange: xml/xindice/trunk/java/examples/addressbook/src/jsp/listResults.jsp
------------------------------------------------------------------------------
svn:executable = *
Added: xml/xindice/trunk/java/examples/addressbook/src/jsp/listing.jsp
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/examples/addressbook/src/jsp/listing.jsp?rev=705950&view=auto
==============================================================================
--- xml/xindice/trunk/java/examples/addressbook/src/jsp/listing.jsp (added)
+++ xml/xindice/trunk/java/examples/addressbook/src/jsp/listing.jsp Sat Oct 18 18:57:36 2008
@@ -0,0 +1,66 @@
+<%
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Id: listContacts.jsp 511428 2007-02-25 03:30:52Z vgritsenko $
+ */
+%>
+
+<%@ page import="addressbook.Action"%>
+<%@ page import="addressbook.Person"%>
+<%@ page import="java.util.Iterator" %>
+
+<jsp:useBean id="group" type="addressbook.Group" scope="request"/>
+
+<table class="list">
+ <tr>
+ <th>Name</th>
+ <th>Work Phone</th>
+ <th>Home Phone</th>
+ <th>Cell Phone</th>
+ </tr>
+<%
+ if (group.size() == 0) {
+%>
+ <tr>
+ <td colspan="4">
+ <div class="note">No contacts found</div>
+ </td>
+ </tr>
+<%
+ } else {
+ for (Iterator i = group.iterator(); i.hasNext(); ) {
+ Person person = (Person) i.next();
+%>
+ <tr>
+ <td>
+ <a href="Task?action=getcontact&key=<%=person.getDocKey()%>"><%=Action.escapeHtml(person.getFname())%> <%=Action.escapeHtml(person.getLname())%></a>
+ </td>
+ <td>
+ <%=Action.escapeHtml(person.getWorkPhone())%>
+ </td>
+ <td>
+ <%=Action.escapeHtml(person.getHomePhone())%>
+ </td>
+ <td>
+ <%=Action.escapeHtml(person.getCellPhone())%>
+ </td>
+ </tr>
+<%
+ }
+ }
+%>
+</table>
Propchange: xml/xindice/trunk/java/examples/addressbook/src/jsp/listing.jsp
------------------------------------------------------------------------------
svn:executable = *
Modified: xml/xindice/trunk/java/examples/addressbook/src/jsp/searchContacts.jsp
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/examples/addressbook/src/jsp/searchContacts.jsp?rev=705950&r1=705949&r2=705950&view=diff
==============================================================================
--- xml/xindice/trunk/java/examples/addressbook/src/jsp/searchContacts.jsp (original)
+++ xml/xindice/trunk/java/examples/addressbook/src/jsp/searchContacts.jsp Sat Oct 18 18:57:36 2008
@@ -19,110 +19,35 @@
*/
%>
-<%@ include file="header.jsp" %>
+<h2>Search for a Contact</h2>
-<FONT SIZE="+2">
- <CENTER>
- Search for a Contact
- </CENTER>
-</FONT>
+<form action="Task" method="post">
+ <div>
+ <input type="hidden" name="action" value="xpathsearch">
+ <h3>Search by Attribute</h3>
+ <select name="searchtype">
+ <option value="lname">last name</option>
+ <option value="fname">first name</option>
+ <option value="workphone">work phone</option>
+ <option value="homephone">home phone</option>
+ <option value="cellphone">cell phone</option>
+ <option value="homeemail">home email</option>
+ <option value="workemail">work email</option>
+ <option value="homeaddress">home address</option>
+ <option value="workaddress">work address</option>
+ </select>
+ <input type="text" name="searchstring" size="50">
+ <input type="submit" name="submit" value="search">
+ <div class="note">Note: Search is case sensitive and must be exact</div>
+ </div>
+</form>
- <TABLE BORDER="0">
- <FORM NAME="SEARCH" ACTION="/addressbook/Task" METHOD="POST">
- <INPUT TYPE="HIDDEN" NAME="ACTION" VALUE="ATTRIBUTESEARCH">
- <TR>
- <TD COLSPAN="3">
- <FONT SIZE="+1">
- <B>
- Search by attribute
- </B>
- </FONT>
- </TD>
- <TD>
- </TR>
- <TR>
- <TD>
- <SELECT NAME="SEARCHTYPE">
- <OPTION SELECTED VALUE="lname">Last Name
- <OPTION VALUE="fname">First Name
- <OPTION VALUE="workphone">Work Phone
- <OPTION VALUE="homephone">Home Phone
- <OPTION VALUE="cellphone">Cell Phone
- <OPTION VALUE="homeemail">Home Email
- <OPTION VALUE="workemail">Work Email
- <OPTION VALUE="homeaddress">Home Address
- <OPTION VALUE="workaddress">Work Address
- </SELECT>
- </TD>
- <TD>
- <INPUT TYPE="TEXT" NAME="SEARCHSTRING" SIZE="50">
- </TD>
- <TD>
- <INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="SEARCH">
- </TD>
- </TR>
- <TR>
- <TD>
-
- </TD>
- <TD>
- Note: Search is case sensitive and must be exact
- </TD>
- </TR>
- </FORM>
-
- <TR>
- <TD>
-  
- </TD>
- </TR>
- <TR>
- <TD>
-  
- </TD>
- </TR>
- <TR>
- <TD>
-  
- </TD>
- </TR>
- <TR>
- <TD>
-  
- </TD>
- </TR>
-
- <FORM NAME="XPATHSEARCH" ACTION="/addressbook/Task" METHOD="POST">
- <INPUT TYPE="HIDDEN" NAME="ACTION" VALUE="XPATHSEARCH">
- <TR>
- <TD COLSPAN="3">
- <FONT SIZE="+1">
- <B>
- Full Xpath query
- </B>
- </FONT>
- </TD>
- </TR>
- <TR>
- <TD>
- Xpath query
- </TD>
- <TD>
- <INPUT TYPE="TEXT" NAME="SEARCHSTRING" SIZE="50">
- </TD>
- <TD>
- <INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="SEARCH">
- </TD>
- </TR>
- <TR>
- <TD>
-
- </TD>
- <TD>
- Example - /person[lname='Simpson'] ( See <A HREF="/addressbook">Here</A> for sample XML format )
- </TD>
- </TR>
- </FORM>
- </TABLE>
-
-<%@ include file="footer.jsp" %>
+<form action="Task" method="post">
+ <div>
+ <input type="hidden" name="action" value="xpathsearch">
+ <h3>Full XPath Query</h3>
+ <input type="text" name="searchstring" size="50">
+ <input type="submit" name="submit" value="search">
+ <div class="note">Example: /person[lname='simpson'] (see <a href="index.jsp">here</a> for a sample XML record)</div>
+ </div>
+</form>
Added: xml/xindice/trunk/java/examples/addressbook/src/jsp/setup.jsp
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/examples/addressbook/src/jsp/setup.jsp?rev=705950&view=auto
==============================================================================
--- xml/xindice/trunk/java/examples/addressbook/src/jsp/setup.jsp (added)
+++ xml/xindice/trunk/java/examples/addressbook/src/jsp/setup.jsp Sat Oct 18 18:57:36 2008
@@ -0,0 +1,42 @@
+<%
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Id: addContact.jsp 511428 2007-02-25 03:30:52Z vgritsenko $
+ */
+%>
+<h2>Database Connection Failed</h2>
+
+<p>
+ The application failed to connect to database at
+ <span class="code"><%=addressbook.DBConnection.getHostname()%>:<%=addressbook.DBConnection.getPort()%></span>.
+ Please specify host name and port number for Xindice database.
+</p>
+
+<form name="addperson" action="Setup" method="post">
+ <div>
+ <input type="hidden" name="action" value="setup">
+ <div class="property">
+ <label for="hostname">Host Name</label>
+ <span class="value"><input id="hostname" type="text" name="hostname" size="40" value="localhost"></span>
+ </div>
+ <div class="property">
+ <label for="port">Port</label>
+ <span class="value"><input id="port" type="text" name="port" size="40" value="<%=request.getServerPort()%>"></span>
+ </div>
+ <input type="submit" name="action" value="Connect">
+ </div>
+</form>
Propchange: xml/xindice/trunk/java/examples/addressbook/src/jsp/setup.jsp
------------------------------------------------------------------------------
svn:executable = *
Modified: xml/xindice/trunk/java/examples/addressbook/src/jsp/showContact.jsp
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/examples/addressbook/src/jsp/showContact.jsp?rev=705950&r1=705949&r2=705950&view=diff
==============================================================================
--- xml/xindice/trunk/java/examples/addressbook/src/jsp/showContact.jsp (original)
+++ xml/xindice/trunk/java/examples/addressbook/src/jsp/showContact.jsp Sat Oct 18 18:57:36 2008
@@ -18,49 +18,52 @@
* $Id$
*/
%>
+<%@ page import="addressbook.Action" %>
+<h2>Contact Detail</h2>
-<%@ include file="header.jsp" %>
+<jsp:useBean id="person" type="addressbook.Person" scope="request"/>
-<%@ page session="true" %>
-<%@ page import="javax.servlet.http.HttpSession, java.io.* , java.util.*" %>
-
-<FONT SIZE="+2">
- <CENTER>Contact Detail</CENTER>
-</FONT>
-<BR>
-
-<%
- int index = Integer.parseInt((String)request.getParameter("index"));
- person = group.getPersonAt(index);
-%>
-
-<%@ include file="showAllContactInfo.jsp" %>
-
-<BR>
-<TABLE BORDER="0">
- <TR>
- <TD>
- <B>
- <A HREF="/addressbook/Task?action=editcontactform&index=<%= index %>"><FONT COLOR='RED'>Edit</FONT></A>
- </B>
- </TD>
- <TD>
-
- </TD>
- <TD>
- <B>
- <A HREF="/addressbook/Task?action=deletecontact&index=<%= index %>"><FONT COLOR='RED'>Delete</FONT></A>
- </B>
- </TD>
- <TD>
-
- </TD>
- <TD>
- <B>
- <A HREF="/addressbook/Task?action=showxml&index=<%= index %>"><FONT COLOR='RED'>Show XML</FONT></A>
- </B>
- </TD>
- </TR>
-</TABLE>
-
-<%@ include file="footer.jsp" %>
+<div class="contact">
+ <div class="property">
+ <span class="label">First Name</span>
+ <span class="value"><%=Action.escapeHtml(person.getFname())%></span>
+ </div>
+ <div class="property">
+ <span class="label">Last Name</span>
+ <span class="value"><%=Action.escapeHtml(person.getLname())%></span>
+ </div>
+ <div class="property">
+ <span class="label">Work Phone</span>
+ <span class="value"><%=Action.escapeHtml(person.getWorkPhone())%></span>
+ </div>
+ <div class="property">
+ <span class="label">Home Phone</span>
+ <span class="value"><%=Action.escapeHtml(person.getHomePhone())%></span>
+ </div>
+ <div class="property">
+ <span class="label">Cell Phone</span>
+ <span class="value"><%=Action.escapeHtml(person.getCellPhone())%></span>
+ </div>
+ <div class="property">
+ <span class="label">Work Email</span>
+ <span class="value"><%=Action.escapeHtml(person.getWorkEmail())%></span>
+ </div>
+ <div class="property">
+ <span class="label">Home Email</span>
+ <span class="value"><%=Action.escapeHtml(person.getHomeEmail())%></span>
+ </div>
+ <div class="property">
+ <span class="label">Home Address</span>
+ <span class="value"><%=Action.escapeHtml(person.getHomeAddress())%></span>
+ </div>
+ <div class="property">
+ <span class="label">Work Address</span>
+ <span class="value"><%=Action.escapeHtml(person.getWorkAddress())%></span>
+ </div>
+</div>
+
+<div class="actions">
+ <a href="Task?action=editcontact&key=<%=person.getDocKey()%>">Edit</a>
+ <a href="Task?action=deletecontact&key=<%=person.getDocKey()%>">Delete</a>
+ <a href="Task?action=showxml&key=<%=person.getDocKey()%>">Show XML</a>
+</div>
Modified: xml/xindice/trunk/java/examples/addressbook/src/jsp/showXML.jsp
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/examples/addressbook/src/jsp/showXML.jsp?rev=705950&r1=705949&r2=705950&view=diff
==============================================================================
--- xml/xindice/trunk/java/examples/addressbook/src/jsp/showXML.jsp (original)
+++ xml/xindice/trunk/java/examples/addressbook/src/jsp/showXML.jsp Sat Oct 18 18:57:36 2008
@@ -19,49 +19,13 @@
*/
%>
-<%@ include file="header.jsp" %>
+<jsp:useBean id="person" type="addressbook.Person" scope="request"/>
-<%@ page session="true" %>
-<%@ page import="javax.servlet.http.HttpSession, java.io.* , java.util.*" %>
+<h2>Source XML Record</h2>
-<FONT SIZE="+2">
- <CENTER>Source XML Record</CENTER>
-</FONT>
-<BR>
+<%@include file="showXMLInfo.jsp"%>
-<%
- int index = Integer.parseInt((String)request.getParameter("index"));
-
- person = group.getPersonAt(index);
-%>
-
-<%@ include file="showXMLInfo.jsp" %>
-
-<BR>
-<TABLE BORDER="0">
- <TR>
- <TD>
- <B>
- <A HREF="/addressbook/Task?action=editcontactform&index=<%= index %>"><FONT COLOR='RED'>Edit</FONT></A>
- </B>
- </TD>
- <TD>
-
- </TD>
- <TD>
- <B>
- <A HREF="/addressbook/Task?action=deletecontact&index=<%= index %>"><FONT COLOR='RED'>Delete</FONT></A>
- </B>
- </TD>
- <TD>
-
- </TD>
- <TD>
- <B>
- <A HREF="/addressbook/Task?action=showxml&index=<%= index %>"><FONT COLOR='RED'>Show XML</FONT></A>
- </B>
- </TD>
- </TR>
-</TABLE>
-
-<%@ include file="footer.jsp" %>
+<div class="actions">
+ <a href="Task?action=editcontact&key=<%=person.getDocKey()%>">Edit</a>
+ <a href="Task?action=deletecontact&key=<%=person.getDocKey()%>">Delete</a>
+</div>
\ No newline at end of file
Modified: xml/xindice/trunk/java/examples/addressbook/src/jsp/showXMLInfo.jsp
URL: http://svn.apache.org/viewvc/xml/xindice/trunk/java/examples/addressbook/src/jsp/showXMLInfo.jsp?rev=705950&r1=705949&r2=705950&view=diff
==============================================================================
--- xml/xindice/trunk/java/examples/addressbook/src/jsp/showXMLInfo.jsp (original)
+++ xml/xindice/trunk/java/examples/addressbook/src/jsp/showXMLInfo.jsp Sat Oct 18 18:57:36 2008
@@ -18,95 +18,20 @@
* $Id$
*/
%>
-
-<TABLE BORDER="0">
- <TR>
- <TD COLSPAN="2">
- <?xml version="1.0"?>
- </TD>
- <TD>
- </TD>
- </TR>
- <TR>
- <TD COLSPAN="2">
- <person>
- </TD>
- </TR>
- <TR>
- <TD>
-
- </TD>
- <TD>
- <fname><%= person.getFname() %></fname>
- </TD>
- </TR>
- <TR>
- <TD>
-
- </TD>
- <TD>
- <lname><%= person.getLname() %></lname>
- </TD>
- </TR>
- <TR>
- <TD>
-
- </TD>
- <TD>
- <phone type="work" ><%= person.getWorkPhone() %></phone>
- </TD>
- </TR>
- <TR>
- <TD>
-
- </TD>
- <TD>
- <phone type="home" ><%= person.getHomePhone() %></phone>
- </TD>
- </TR>
- <TR>
- <TD>
-
- </TD>
- <TD>
- <phone type="cell" ><%= person.getCellPhone() %></phone>
- </TD>
- </TR>
- <TR>
- <TD>
-
- </TD>
- <TD>
- <email type="home" ><%= person.getHomeEmail() %></email>
- </TD>
- </TR>
- <TR>
- <TD>
-
- </TD>
- <TD>
- <email type="work" ><%= person.getWorkEmail() %></email>
- </TD>
- </TR>
- <TR>
- <TD>
-
- </TD>
- <TD>
- <address type="home"><%= person.getHomeAddress() %></address>
- </TD>
- </TR>
- <TR>
- <TD>
-
- </TD>
- <TD>
- <address type="work" ><%= person.getWorkAddress() %></address>
- </TD>
- </TR>
- <TR>
- <TD>
- </person>
- </TD>
- </TR>
-</TABLE>
+<%@ page import="addressbook.Action" %>
+<%@ page import="org.apache.xindice.util.XMLUtilities" %>
+
+<pre>
+<?xml version="1.0"?>
+<person>
+ <fname><%=Action.escapeHtml(XMLUtilities.escape(person.getFname()))%></fname>
+ <lname><%=Action.escapeHtml(XMLUtilities.escape(person.getLname()))%></lname>
+ <phone type="work"><%=Action.escapeHtml(XMLUtilities.escape(person.getWorkPhone()))%></phone>
+ <phone type="home"><%=Action.escapeHtml(XMLUtilities.escape(person.getHomePhone()))%></phone>
+ <phone type="cell"><%=Action.escapeHtml(XMLUtilities.escape(person.getCellPhone()))%></phone>
+ <email type="home"><%=Action.escapeHtml(XMLUtilities.escape(person.getHomeEmail()))%></email>
+ <email type="work"><%=Action.escapeHtml(XMLUtilities.escape(person.getWorkEmail()))%></email>
+ <address type="home"><%=Action.escapeHtml(XMLUtilities.escape(person.getHomeAddress()))%></address>
+ <address type="work"><%=Action.escapeHtml(XMLUtilities.escape(person.getWorkAddress()))%></address>
+ </person>
+</pre>
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.