/[Apache-SVN]/cocoon/branches/BRANCH_2_1_X/src/blocks/databases/samples/org-db/employee.xsp
ViewVC logotype

Diff of /cocoon/branches/BRANCH_2_1_X/src/blocks/databases/samples/org-db/employee.xsp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- cocoon/branches/BRANCH_2_1_X/src/blocks/databases/samples/org-db/employee.xsp	2005/05/03 18:18:50	167950
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/databases/samples/org-db/employee.xsp	2005/05/03 18:22:14	167951
@@ -15,11 +15,9 @@
   limitations under the License.
 -->
 
-<xsp:page
-          language="java"
+<xsp:page language="java"
           xmlns:xsp="http://apache.org/xsp"
-          xmlns:esql="http://apache.org/cocoon/SQL/v2"
->
+          xmlns:esql="http://apache.org/cocoon/SQL/v2">
   <page>
     <xsp:logic>
       String empID = request.getParameter("employee");
@@ -29,52 +27,53 @@
     </xsp:logic>
 
     <resources>
-       <resource type="file" href="employee.xml?cocoon-view=pretty-content">Descriptor</resource>
-       <resource type="file" href="../transform/sql-page.xml.sql">Schema</resource>
-       <resource type="doc" href="userdocs/actions/database-actions.html">Actions</resource>
-       <resource type="doc" href="userdocs/xsp/esql.html">ESQL</resource>
+      <resource type="file" href="employee.xml?cocoon-view=pretty-content">Descriptor</resource>
+      <resource type="file" href="../schema.sql">Schema</resource>
+      <resource type="doc" href="userdocs/actions/database-actions.html">Actions</resource>
+      <resource type="doc" href="userdocs/xsp/esql.html">ESQL</resource>
     </resources>
 
     <title>Manage Employees</title>
     <para style="backgroud-color:#ff0000"><xsp:expr>(message == null?"":message)</xsp:expr></para>
     <content>
       <form name="EmployeeSelection">
-          <select size="1" name="employee"
-              onChange="top.location.href=window.location.pathname + '?employee=' + document.forms['EmployeeSelection'].employee.options[document.forms['EmployeeSelection'].employee.options.selectedIndex].value">
-            <option value="-1">-- New employee --</option>
-            <esql:connection>
-              <esql:pool>personnel</esql:pool>
-              <esql:execute-query>
-                <esql:query>select id, department_id, name from employee order by name</esql:query>
-                <esql:results>
-                  <esql:row-results>
-                      <xsp:logic>
+        <select size="1" name="employee"
+          onChange="top.location.href=window.location.pathname + '?employee=' + document.forms['EmployeeSelection'].employee.options[document.forms['EmployeeSelection'].employee.options.selectedIndex].value">
+          <option value="-1">-- New employee --</option>
+          <esql:connection>
+            <esql:pool>personnel</esql:pool>
+            <esql:execute-query>
+              <esql:query>select id, department_id, name from employee order by name</esql:query>
+              <esql:results>
+                <esql:row-results>
+                  <xsp:logic>
                         if (<esql:get-string column="id"/>.equals(empID)) {
                             depID = <esql:get-string column="department_id"/>;
-			    name = <esql:get-string column="name"/>;
-			    xspAttr.addAttribute("", "selected", "selected", "CDATA", "");
+			                      name = <esql:get-string column="name"/>;
+			                      xspAttr.addAttribute("", "selected", "selected", "CDATA", "");
                         }
-                      </xsp:logic>
-                    <option>
-                      <xsp:attribute name="value"><esql:get-int column="id"/></xsp:attribute>
-                      <esql:get-string column="name"/>
-                    </option>
-                  </esql:row-results>
-                </esql:results>
-              </esql:execute-query>
-            </esql:connection>
-          </select>
+                  </xsp:logic>
+                  <option>
+                    <xsp:attribute name="value"><esql:get-int column="id"/></xsp:attribute>
+                    <esql:get-string column="name"/>
+                  </option>
+                </esql:row-results>
+              </esql:results>
+            </esql:execute-query>
+          </esql:connection>
+        </select>
       </form>
+
       <form action="" method="POST" name="EmployeeEntry">
         <script>document.forms["EmployeeEntry"].action = window.location.pathname</script>
         <input type="hidden" name="employee">
-	  <xsp:attribute name="value"><xsp:expr>((empID != null) ? empID : "")</xsp:expr></xsp:attribute>
-	</input>
+          <xsp:attribute name="value"><xsp:expr>((empID != null) ? empID : "")</xsp:expr></xsp:attribute>
+        </input>
         <para>Employee Name:
-	  <input name="name" type="text">
-	   <xsp:attribute name="value"><xsp:expr>((name != null) ? name : "")</xsp:expr></xsp:attribute>
-	  </input>
-	</para>
+          <input name="name" type="text">
+            <xsp:attribute name="value"><xsp:expr>((name != null) ? name : "")</xsp:expr></xsp:attribute>
+          </input>
+        </para>
         <para>Department:
           <select name="department">
             <option value="-1">-- Select department --</option>
@@ -84,11 +83,11 @@
                 <esql:query>select id, name from department order by name</esql:query>
                 <esql:results>
                   <esql:row-results>
-                      <xsp:logic>
+                    <xsp:logic>
                         if (<esql:get-string column="id"/>.equals(depID)) {
-			    xspAttr.addAttribute("", "selected", "selected", "CDATA", "");
+			                    xspAttr.addAttribute("", "selected", "selected", "CDATA", "");
                         }
-                      </xsp:logic>
+                    </xsp:logic>
                     <option>
                       <xsp:attribute name="value"><esql:get-int column="id"/></xsp:attribute>
                       <esql:get-string column="name"/>

 

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26