Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2010-05-13 08:27:20 +0000
committerEike Stepper2010-05-13 08:27:20 +0000
commitd67a03d88f19c6b08a180393bbcc562e63fd3060 (patch)
treebaa608cd25183ee300f0f8af293575ae62dfbd42 /plugins/org.eclipse.emf.cdo.examples.server
parent56fcba61c9eacef1386b570e08f9b07e7ab8a50b (diff)
downloadcdo-d67a03d88f19c6b08a180393bbcc562e63fd3060.tar.gz
cdo-d67a03d88f19c6b08a180393bbcc562e63fd3060.tar.xz
cdo-d67a03d88f19c6b08a180393bbcc562e63fd3060.zip
vserver
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.examples.server')
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/.classpath1
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/.jetproperties4
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/.project6
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/META-INF/MANIFEST.MF13
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/build.properties6
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/demo-server.css17
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/plugin.xml16
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/src-gen/templates/ConfigOverview.java61
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/src-gen/templates/RequestForm.java61
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/AbstractTemplateServlet.java119
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/ConfigOverviewServlet.java38
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/RequestFormServlet.java38
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/templates/configOverview.htmljet31
-rw-r--r--plugins/org.eclipse.emf.cdo.examples.server/templates/requestForm.htmljet31
14 files changed, 438 insertions, 4 deletions
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/.classpath b/plugins/org.eclipse.emf.cdo.examples.server/.classpath
index 64c5e31b7a..16057af74c 100644
--- a/plugins/org.eclipse.emf.cdo.examples.server/.classpath
+++ b/plugins/org.eclipse.emf.cdo.examples.server/.classpath
@@ -3,5 +3,6 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="src-gen/"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/.jetproperties b/plugins/org.eclipse.emf.cdo.examples.server/.jetproperties
new file mode 100644
index 0000000000..7be3f57ef1
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.examples.server/.jetproperties
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<jet-settings>
+ <template-container>templates</template-container> <source-container>src-gen</source-container>
+</jet-settings>
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/.project b/plugins/org.eclipse.emf.cdo.examples.server/.project
index b39adbdc1e..e29e7622e8 100644
--- a/plugins/org.eclipse.emf.cdo.examples.server/.project
+++ b/plugins/org.eclipse.emf.cdo.examples.server/.project
@@ -6,6 +6,11 @@
</projects>
<buildSpec>
<buildCommand>
+ <name>org.eclipse.emf.codegen.JETBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
@@ -22,6 +27,7 @@
</buildCommand>
</buildSpec>
<natures>
+ <nature>org.eclipse.emf.codegen.jet.IJETNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.examples.server/META-INF/MANIFEST.MF
index be29631c35..99d872e744 100644
--- a/plugins/org.eclipse.emf.cdo.examples.server/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.examples.server/META-INF/MANIFEST.MF
@@ -12,6 +12,15 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
org.eclipse.emf.cdo.server.net4j;bundle-version="[3.0.0,4.0.0)",
org.eclipse.net4j.db.h2;bundle-version="[3.0.0,4.0.0)",
org.eclipse.net4j.jvm;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.net4j.tcp;bundle-version="[3.0.0,4.0.0)"
+ org.eclipse.net4j.tcp;bundle-version="[3.0.0,4.0.0)",
+ org.apache.commons.logging;bundle-version="[1.0.0,2.0.0)",
+ org.eclipse.equinox.http.registry;bundle-version="[1.0.0,2.0.0)",
+ org.eclipse.equinox.http.servlet;bundle-version="[1.0.0,2.0.0)",
+ org.eclipse.equinox.http.jetty;bundle-version="[2.0.0,4.0.0)"
Export-Package: org.eclipse.emf.cdo.examples.server;version="3.0.0"
-Import-Package: org.h2.jdbcx;version="[1.1.0,1.2.0)"
+Import-Package: org.h2.jdbcx;version="[1.1.0,1.2.0)",
+ javax.servlet;version="[2.5.0,2.6.0)",
+ javax.servlet.http;version="[2.5.0,2.6.0)",
+ org.apache.commons.lang;version="[2.3.0,3.0.0)"
+Bundle-Activator: org.eclipse.emf.cdo.examples.server.OM$Activator
+Bundle-ActivationPolicy: lazy
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/build.properties b/plugins/org.eclipse.emf.cdo.examples.server/build.properties
index f4677dcb35..21cf4a5c2c 100644
--- a/plugins/org.eclipse.emf.cdo.examples.server/build.properties
+++ b/plugins/org.eclipse.emf.cdo.examples.server/build.properties
@@ -15,9 +15,11 @@ bin.includes = .,\
about.html,\
copyright.txt,\
plugin.xml,\
- demo-server.product
+ demo-server.product,\
+ demo-server.css
jars.compile.order = .
-source.. = src/
+source.. = src/,\
+ src-gen/
output.. = bin/
src.includes = about.html,\
copyright.txt
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/demo-server.css b/plugins/org.eclipse.emf.cdo.examples.server/demo-server.css
new file mode 100644
index 0000000000..9a6ede452e
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.examples.server/demo-server.css
@@ -0,0 +1,17 @@
+body {
+ background: #1c2a7e;
+ color: #e2e6ff;
+ font-family: Arial, sans-serif;
+}
+
+h1,h2,h3,h4 {
+ margin-bottom: 2px;
+}
+
+h2 {
+ margin-top: 16px;
+}
+
+h2,h4 {
+ color: #b7eaef;
+}
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/plugin.xml b/plugins/org.eclipse.emf.cdo.examples.server/plugin.xml
index e70a7e8d4c..5ad426b50f 100644
--- a/plugins/org.eclipse.emf.cdo.examples.server/plugin.xml
+++ b/plugins/org.eclipse.emf.cdo.examples.server/plugin.xml
@@ -25,4 +25,20 @@ Eike Stepper - initial API and implementation
</product>
</extension>
+ <extension
+ point="org.eclipse.equinox.http.registry.servlets">
+ <servlet
+ alias="/demo"
+ class="org.eclipse.emf.cdo.examples.server.DemoServlet"
+ load-on-startup="true"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.equinox.http.registry.resources">
+ <resource
+ alias="/demo.css"
+ base-name="/demo.css">
+ </resource>
+ </extension>
+
</plugin>
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/src-gen/templates/ConfigOverview.java b/plugins/org.eclipse.emf.cdo.examples.server/src-gen/templates/ConfigOverview.java
new file mode 100644
index 0000000000..0875b2270b
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.examples.server/src-gen/templates/ConfigOverview.java
@@ -0,0 +1,61 @@
+package templates;
+
+import org.eclipse.emf.cdo.examples.server.*;
+
+public class ConfigOverview
+{
+ protected static String nl;
+ public static synchronized ConfigOverview create(String lineSeparator)
+ {
+ nl = lineSeparator;
+ ConfigOverview result = new ConfigOverview();
+ nl = null;
+ return result;
+ }
+
+ public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
+ protected final String TEXT_1 = "";
+ protected final String TEXT_2 = NL + NL + "<html>" + NL + " <header>" + NL + "\t <title>" + NL + "\t\t\t";
+ protected final String TEXT_3 = NL + "\t </title>" + NL + "\t\t<link media=\"screen\" href=\"gastro.css\" type=\"text/css\" rel=\"stylesheet\">" + NL + "\t<header>" + NL + "<body>" + NL + "" + NL + "<h1>";
+ protected final String TEXT_4 = "</h1>" + NL + "<table border=\"0\" width=\"400\">";
+ protected final String TEXT_5 = NL + "\t<tr><td colspan=\"3\"><h2>";
+ protected final String TEXT_6 = "</h2></td></tr>" + NL + "\t<tr><td colspan=\"3\"><h4>";
+ protected final String TEXT_7 = "</h4></td></tr>" + NL + "\t";
+ protected final String TEXT_8 = NL + "\t\t<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td colspan=\"2\"><h3>";
+ protected final String TEXT_9 = "</h3></td></tr>" + NL + "\t\t<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td>";
+ protected final String TEXT_10 = "</td>" + NL + "\t\t\t\t\t<td align=\"right\" valign=\"bottom\" width=\"80\">";
+ protected final String TEXT_11 = " </td></tr>" + NL + "\t";
+ protected final String TEXT_12 = NL + "</table>" + NL + "" + NL + "</body>" + NL + "</html>";
+ protected final String TEXT_13 = NL;
+
+ public String generate(Object argument)
+ {
+ final StringBuffer stringBuffer = new StringBuffer();
+ stringBuffer.append(TEXT_1);
+ MenuCard menuCard = (MenuCard)argument;
+ stringBuffer.append(TEXT_2);
+ stringBuffer.append(GastroServlet.html(menuCard.getTitle()));
+ stringBuffer.append(TEXT_3);
+ stringBuffer.append(GastroServlet.html(menuCard.getTitle()));
+ stringBuffer.append(TEXT_4);
+ for (Section section : menuCard.getSections()) {
+ stringBuffer.append(TEXT_5);
+ stringBuffer.append(GastroServlet.html(section.getTitle()));
+ stringBuffer.append(TEXT_6);
+ stringBuffer.append(GastroServlet.html(section.getText()));
+ stringBuffer.append(TEXT_7);
+ for (Offering offering : section.getOfferings()) {
+ stringBuffer.append(TEXT_8);
+ stringBuffer.append(GastroServlet.html(offering.getName()));
+ stringBuffer.append(TEXT_9);
+ stringBuffer.append(GastroServlet.html(offering.getDescription()));
+ stringBuffer.append(TEXT_10);
+ stringBuffer.append(GastroServlet.html(offering.getPrice()));
+ stringBuffer.append(TEXT_11);
+ }
+ }
+ stringBuffer.append(TEXT_12);
+ stringBuffer.append(TEXT_13);
+ return stringBuffer.toString();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/src-gen/templates/RequestForm.java b/plugins/org.eclipse.emf.cdo.examples.server/src-gen/templates/RequestForm.java
new file mode 100644
index 0000000000..2b0f1e8137
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.examples.server/src-gen/templates/RequestForm.java
@@ -0,0 +1,61 @@
+package templates;
+
+import org.eclipse.emf.cdo.examples.server.*;
+
+public class RequestForm
+{
+ protected static String nl;
+ public static synchronized RequestForm create(String lineSeparator)
+ {
+ nl = lineSeparator;
+ RequestForm result = new RequestForm();
+ nl = null;
+ return result;
+ }
+
+ public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
+ protected final String TEXT_1 = "";
+ protected final String TEXT_2 = NL + NL + "<html>" + NL + " <header>" + NL + "\t <title>" + NL + "\t\t\t";
+ protected final String TEXT_3 = NL + "\t </title>" + NL + "\t\t<link media=\"screen\" href=\"gastro.css\" type=\"text/css\" rel=\"stylesheet\">" + NL + "\t<header>" + NL + "<body>" + NL + "" + NL + "<h1>";
+ protected final String TEXT_4 = "</h1>" + NL + "<table border=\"0\" width=\"400\">";
+ protected final String TEXT_5 = NL + "\t<tr><td colspan=\"3\"><h2>";
+ protected final String TEXT_6 = "</h2></td></tr>" + NL + "\t<tr><td colspan=\"3\"><h4>";
+ protected final String TEXT_7 = "</h4></td></tr>" + NL + "\t";
+ protected final String TEXT_8 = NL + "\t\t<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td colspan=\"2\"><h3>";
+ protected final String TEXT_9 = "</h3></td></tr>" + NL + "\t\t<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td>";
+ protected final String TEXT_10 = "</td>" + NL + "\t\t\t\t\t<td align=\"right\" valign=\"bottom\" width=\"80\">";
+ protected final String TEXT_11 = " </td></tr>" + NL + "\t";
+ protected final String TEXT_12 = NL + "</table>" + NL + "" + NL + "</body>" + NL + "</html>";
+ protected final String TEXT_13 = NL;
+
+ public String generate(Object argument)
+ {
+ final StringBuffer stringBuffer = new StringBuffer();
+ stringBuffer.append(TEXT_1);
+ MenuCard menuCard = (MenuCard)argument;
+ stringBuffer.append(TEXT_2);
+ stringBuffer.append(GastroServlet.html(menuCard.getTitle()));
+ stringBuffer.append(TEXT_3);
+ stringBuffer.append(GastroServlet.html(menuCard.getTitle()));
+ stringBuffer.append(TEXT_4);
+ for (Section section : menuCard.getSections()) {
+ stringBuffer.append(TEXT_5);
+ stringBuffer.append(GastroServlet.html(section.getTitle()));
+ stringBuffer.append(TEXT_6);
+ stringBuffer.append(GastroServlet.html(section.getText()));
+ stringBuffer.append(TEXT_7);
+ for (Offering offering : section.getOfferings()) {
+ stringBuffer.append(TEXT_8);
+ stringBuffer.append(GastroServlet.html(offering.getName()));
+ stringBuffer.append(TEXT_9);
+ stringBuffer.append(GastroServlet.html(offering.getDescription()));
+ stringBuffer.append(TEXT_10);
+ stringBuffer.append(GastroServlet.html(offering.getPrice()));
+ stringBuffer.append(TEXT_11);
+ }
+ }
+ stringBuffer.append(TEXT_12);
+ stringBuffer.append(TEXT_13);
+ return stringBuffer.toString();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/AbstractTemplateServlet.java b/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/AbstractTemplateServlet.java
new file mode 100644
index 0000000000..3684dedf62
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/AbstractTemplateServlet.java
@@ -0,0 +1,119 @@
+/**
+ * Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ *
+ * Initial Publication:
+ * Eclipse Magazin - http://www.eclipse-magazin.de
+ */
+package org.eclipse.emf.cdo.examples.server;
+
+import org.eclipse.net4j.util.io.IOUtil;
+
+import org.apache.commons.lang.StringEscapeUtils;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.text.NumberFormat;
+
+/**
+ * @author Eike Stepper
+ */
+public abstract class AbstractTemplateServlet extends HttpServlet
+{
+ private static final long serialVersionUID = 1L;
+
+ private Object template;
+
+ private Method method;
+
+ public AbstractTemplateServlet(Class<?> templateClass) throws InstantiationException, IllegalAccessException,
+ SecurityException, NoSuchMethodException
+ {
+ method = templateClass.getMethod("generate", Object.class);
+ template = templateClass.newInstance();
+ }
+
+ @Override
+ public final void init() throws ServletException
+ {
+ System.out.println("INIT " + getClass().getSimpleName());
+ doInit();
+ super.init();
+ }
+
+ @Override
+ public final void destroy()
+ {
+ System.out.println("DESTROY " + getClass().getSimpleName());
+ doDestroy();
+ super.destroy();
+ }
+
+ @Override
+ protected final void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
+ {
+ doPost(req, resp);
+ }
+
+ @Override
+ protected final void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
+ {
+ PrintWriter writer = resp.getWriter();
+
+ try
+ {
+ Object argument = getTemplateArgument(req);
+ String html = (String)method.invoke(template, argument);
+ writer.print(html);
+ }
+ catch (IllegalArgumentException ex)
+ {
+ throw new ServletException(ex);
+ }
+ catch (IllegalAccessException ex)
+ {
+ throw new ServletException(ex);
+ }
+ catch (InvocationTargetException ex)
+ {
+ throw new ServletException(ex);
+ }
+ finally
+ {
+ IOUtil.close(writer);
+ }
+ }
+
+ protected void doInit()
+ {
+ }
+
+ protected void doDestroy()
+ {
+ }
+
+ protected abstract Object getTemplateArgument(HttpServletRequest req);
+
+ public static String html(String value)
+ {
+ return StringEscapeUtils.escapeHtml(value);
+ }
+
+ public static String html(double value)
+ {
+ return html(NumberFormat.getCurrencyInstance().format(value));
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/ConfigOverviewServlet.java b/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/ConfigOverviewServlet.java
new file mode 100644
index 0000000000..62a5d970e6
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/ConfigOverviewServlet.java
@@ -0,0 +1,38 @@
+/**
+ * Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ *
+ * Initial Publication:
+ * Eclipse Magazin - http://www.eclipse-magazin.de
+ */
+package org.eclipse.emf.cdo.examples.server;
+
+import templates.ConfigOverview;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @author Eike Stepper
+ */
+public class ConfigOverviewServlet extends AbstractTemplateServlet
+{
+ private static final long serialVersionUID = 1L;
+
+ public ConfigOverviewServlet() throws InstantiationException, IllegalAccessException, SecurityException,
+ NoSuchMethodException
+ {
+ super(ConfigOverview.class);
+ }
+
+ @Override
+ protected Object getTemplateArgument(HttpServletRequest req)
+ {
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/RequestFormServlet.java b/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/RequestFormServlet.java
new file mode 100644
index 0000000000..3da6c0aa19
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.examples.server/src/org/eclipse/emf/cdo/examples/server/RequestFormServlet.java
@@ -0,0 +1,38 @@
+/**
+ * Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ *
+ * Initial Publication:
+ * Eclipse Magazin - http://www.eclipse-magazin.de
+ */
+package org.eclipse.emf.cdo.examples.server;
+
+import templates.RequestForm;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @author Eike Stepper
+ */
+public class RequestFormServlet extends AbstractTemplateServlet
+{
+ private static final long serialVersionUID = 1L;
+
+ public RequestFormServlet() throws InstantiationException, IllegalAccessException, SecurityException,
+ NoSuchMethodException
+ {
+ super(RequestForm.class);
+ }
+
+ @Override
+ protected Object getTemplateArgument(HttpServletRequest req)
+ {
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/templates/configOverview.htmljet b/plugins/org.eclipse.emf.cdo.examples.server/templates/configOverview.htmljet
new file mode 100644
index 0000000000..7180b6efc0
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.examples.server/templates/configOverview.htmljet
@@ -0,0 +1,31 @@
+<%@ jet
+ class="ConfigOverview"
+ package="templates"
+ imports="org.eclipse.emf.cdo.examples.server.*" %>
+
+<% MenuCard menuCard = (MenuCard)argument; %>
+
+<html>
+ <header>
+ <title>
+ <%=GastroServlet.html(menuCard.getTitle())%>
+ </title>
+ <link media="screen" href="gastro.css" type="text/css" rel="stylesheet">
+ <header>
+<body>
+
+<h1><%=GastroServlet.html(menuCard.getTitle())%></h1>
+<table border="0" width="400">
+<%for (Section section : menuCard.getSections()) {%>
+ <tr><td colspan="3"><h2><%=GastroServlet.html(section.getTitle())%></h2></td></tr>
+ <tr><td colspan="3"><h4><%=GastroServlet.html(section.getText())%></h4></td></tr>
+ <%for (Offering offering : section.getOfferings()) {%>
+ <tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td colspan="2"><h3><%=GastroServlet.html(offering.getName())%></h3></td></tr>
+ <tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td><%=GastroServlet.html(offering.getDescription())%></td>
+ <td align="right" valign="bottom" width="80"><%=GastroServlet.html(offering.getPrice())%> </td></tr>
+ <%}%>
+<%}%>
+</table>
+
+</body>
+</html>
diff --git a/plugins/org.eclipse.emf.cdo.examples.server/templates/requestForm.htmljet b/plugins/org.eclipse.emf.cdo.examples.server/templates/requestForm.htmljet
new file mode 100644
index 0000000000..52c0e87609
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.examples.server/templates/requestForm.htmljet
@@ -0,0 +1,31 @@
+<%@ jet
+ class="RequestForm"
+ package="templates"
+ imports="org.eclipse.emf.cdo.examples.server.*" %>
+
+<% MenuCard menuCard = (MenuCard)argument; %>
+
+<html>
+ <header>
+ <title>
+ <%=GastroServlet.html(menuCard.getTitle())%>
+ </title>
+ <link media="screen" href="gastro.css" type="text/css" rel="stylesheet">
+ <header>
+<body>
+
+<h1><%=GastroServlet.html(menuCard.getTitle())%></h1>
+<table border="0" width="400">
+<%for (Section section : menuCard.getSections()) {%>
+ <tr><td colspan="3"><h2><%=GastroServlet.html(section.getTitle())%></h2></td></tr>
+ <tr><td colspan="3"><h4><%=GastroServlet.html(section.getText())%></h4></td></tr>
+ <%for (Offering offering : section.getOfferings()) {%>
+ <tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td colspan="2"><h3><%=GastroServlet.html(offering.getName())%></h3></td></tr>
+ <tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td><%=GastroServlet.html(offering.getDescription())%></td>
+ <td align="right" valign="bottom" width="80"><%=GastroServlet.html(offering.getPrice())%> </td></tr>
+ <%}%>
+<%}%>
+</table>
+
+</body>
+</html>

Back to the top