You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by mi...@apache.org on 2014/03/16 10:06:22 UTC

[33/50] [abbrv] git commit: [OLINGO-171] Improved archetype for e.g. OSGi

[OLINGO-171] Improved archetype for e.g. OSGi


Project: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/commit/3519f396
Tree: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/tree/3519f396
Diff: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/diff/3519f396

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 3519f396ab6492aa5bfd7f3b4fc18ab6365c976b
Parents: e2c9537
Author: Michael Bolz <mi...@apache.org>
Authored: Sun Feb 23 10:01:36 2014 +0100
Committer: Michael Bolz <mi...@apache.org>
Committed: Sun Feb 23 10:01:36 2014 +0100

----------------------------------------------------------------------
 .../main/resources/archetype-resources/pom.xml  |   8 +-
 .../src/main/java/model/ResourceHelper.java     |  96 ----------
 .../AnnotationSampleServiceFactory.java         |  88 ---------
 .../util/AnnotationSampleDataGenerator.java     | 177 +++++++++++++++++++
 .../src/main/webapp/index.jsp                   |  24 +++
 5 files changed, 205 insertions(+), 188 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3519f396/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
index 828a291..fb64c28 100644
--- a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
@@ -8,8 +8,8 @@
   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. -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
 
@@ -26,7 +26,7 @@
     <version.compiler-plugin>2.3.2</version.compiler-plugin>
     <version.deploy-plugin>2.8.1</version.deploy-plugin>
     <version.eclipse-plugin>2.9</version.eclipse-plugin>
-    <version.jetty-plugin>9.0.6.v20130930</version.jetty-plugin>
+    <version.jetty-plugin>8.1.14.v20131031</version.jetty-plugin>
     <!-- Dependency Versions -->
     <version.cxf>2.7.6</version.cxf>
     <version.servlet-api>2.5</version.servlet-api>
@@ -84,7 +84,7 @@
         </configuration>
       </plugin>
       <plugin>
-        <groupId>org.eclipse.jetty</groupId>
+        <groupId>org.mortbay.jetty</groupId>
         <artifactId>jetty-maven-plugin</artifactId>
         <version>${version.jetty-plugin}</version>
       </plugin>

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3519f396/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/ResourceHelper.java
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/ResourceHelper.java b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/ResourceHelper.java
deleted file mode 100644
index d509d28..0000000
--- a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/ResourceHelper.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * 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.
- ******************************************************************************/
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-package ${package}.model;
-
-import java.awt.image.BufferedImage;
-import java.awt.image.WritableRaster;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import javax.imageio.ImageIO;
-
-/**
- *
- */
-public class ResourceHelper {
-
-  public static byte[] loadAsByte(String resource) {
-    return load(resource, new byte[0]);
-  }
-
-  public static byte[] load(String resource, byte[] defaultResult) {
-    InputStream instream = null;
-    try {
-      instream = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);
-      if (instream == null) {
-        return defaultResult;
-      }
-      ByteArrayOutputStream stream = new ByteArrayOutputStream();
-      int b = 0;
-      while ((b = instream.read()) != -1) {
-        stream.write(b);
-      }
-
-      return stream.toByteArray();
-    } catch (IOException e) {
-      throw new RuntimeException(e);
-    } finally {
-      if(instream != null) {
-        try {
-          instream.close();
-        } catch (IOException ex) { }
-      }
-    }
-  }
-
-  public enum Format {BMP, JPEG, PNG, GIF};
-  
-  public static byte[] generateImage() {
-    return generateImage(Format.PNG);
-  }
-  
-  public static byte[] generateImage(Format format) {
-    try {
-      int width = 320;
-      int height = 320;
-      BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_BINARY);
-      WritableRaster raster = image.getRaster();
-      
-      int mod = format.ordinal() + 2;
-      for (int h = 0; h < height; h++) {
-        for (int w = 0; w < width; w++) {
-          if (((h / 32) + (w / 32)) % mod == 0) {
-            raster.setSample(w, h, 0, 0);
-          } else {
-            raster.setSample(w, h, 0, 1);
-          }
-        }
-      }
-      
-      ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
-      ImageIO.write(image, format.name(), out);
-      return out.toByteArray();
-    } catch (IOException ex) {
-      return new byte[0];
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3519f396/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/processor/AnnotationSampleServiceFactory.java
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/processor/AnnotationSampleServiceFactory.java b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/processor/AnnotationSampleServiceFactory.java
index 5b346cc..176e1c2 100644
--- a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/processor/AnnotationSampleServiceFactory.java
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/processor/AnnotationSampleServiceFactory.java
@@ -28,7 +28,6 @@ import ${package}.model.Manufacturer;
 import java.util.Calendar;
 import java.util.Locale;
 import org.apache.olingo.odata2.annotation.processor.api.AnnotationServiceFactory;
-import org.apache.olingo.odata2.annotation.processor.core.datasource.DataStore;
 import org.apache.olingo.odata2.api.ODataCallback;
 import org.apache.olingo.odata2.api.ODataDebugCallback;
 import org.apache.olingo.odata2.api.ODataService;
@@ -60,7 +59,6 @@ public class AnnotationSampleServiceFactory extends ODataServiceFactory {
     static {
       try {
         ANNOTATION_ODATA_SERVICE = AnnotationServiceFactory.createAnnotationService(MODEL_PACKAGE);
-        initializeSampleData();
       } catch (ODataApplicationException ex) {
         throw new RuntimeException("Exception during sample data generation.", ex);
       } catch (ODataException ex) {
@@ -95,7 +93,6 @@ public class AnnotationSampleServiceFactory extends ODataServiceFactory {
   }
 
   private class ScenarioErrorCallback implements ODataErrorCallback {
-
     private final Logger LOG = LoggerFactory.getLogger(ScenarioErrorCallback.class);
 
     @Override
@@ -106,90 +103,5 @@ public class AnnotationSampleServiceFactory extends ODataServiceFactory {
 
       return EntityProvider.writeErrorDocument(context);
     }
-
-  }
-
-  private static <T> DataStore<T> getDataStore(Class<T> clz) throws DataStore.DataStoreException {
-    return DataStore.createInMemory(clz, true);
-  }
-
-  private static void initializeSampleData() throws ODataApplicationException {
-    DataStore<Car> carDs = getDataStore(Car.class);
-    Calendar updated = Calendar.getInstance();
-    Car c1 = createCar("F1 W02", 167189.00, 2011, updated);
-    carDs.create(c1);
-    Car c2 = createCar("F1 W04", 242189.99, 2013, updated);
-    carDs.create(c2);
-    Car c3 = createCar("FF2013", 199189.11, 2013, updated);
-    carDs.create(c3);
-    Car c4 = createCar("FF2014", 299189.11, 2014, updated);
-    carDs.create(c4);
-
-    DataStore<Driver> driverDs = getDataStore(Driver.class);
-    Driver d1 = createDriver("Mic", "Shoemaker", "The Fast", createDateTime(1985, 6, 27), c1);
-    driverDs.create(d1);
-    Driver d2 = createDriver("Nico", "Mulemountain", null, createDateTime(1969, 1, 3), c2);
-    driverDs.create(d2);
-    Driver d3 = createDriver("Kimi", "Heikkinen", "Iceman", createDateTime(1979, 10, 17), c3);
-    driverDs.create(d3);
-
-    Address addressStar = createAddress("Star Street 137", "Stuttgart", "70173", "Germany");
-    Manufacturer manStar = createManufacturer("Star Powered Racing", addressStar, createDateTime(1954, 7, 4), c1, c2);
-
-    Address addressHorse = createAddress("Horse Street 1", "Maranello", "41053", "Italy");
-    Manufacturer manHorse = createManufacturer("Horse Powered Racing", addressHorse, createDateTime(1929, 11, 16), c3, c4);
-
-    DataStore<Manufacturer> manDs = getDataStore(Manufacturer.class);
-    manDs.create(manStar);
-    manDs.create(manHorse);
-  }
-
-  private static Calendar createDateTime(int year, int month, int day) {
-    Calendar cal = Calendar.getInstance(Locale.ENGLISH);
-    cal.clear();
-    cal.set(year, month - 1, day);
-    return cal;
-  }
-
-  private static Car createCar(String name, double price, int modelyear, Calendar updated) {
-    Car car = new Car();
-    car.setModel(name);
-    car.setModelYear(modelyear);
-    car.setPrice(price);
-    car.setUpdated(updated.getTime());
-    return car;
-  }
-
-  private static Driver createDriver(String name, String lastname, String nickname, Calendar birthday, Car car) {
-    Driver driver = new Driver();
-    driver.setName(name);
-    driver.setLastname(lastname);
-    driver.setNickname(nickname);
-    driver.setBirthday(birthday);
-    driver.setCar(car);
-    car.setDriver(driver);
-    return driver;
-  }
-
-  private static Manufacturer createManufacturer(String name, Address address, Calendar founded, Car... cars) {
-    Manufacturer m = new Manufacturer();
-    m.setName(name);
-    m.setAddress(address);
-    m.setFounded(founded);
-    for (Car car : cars) {
-      car.setManufacturer(m);
-      m.getCars().add(car);
-    }
-    return m;
-  }
-
-  private static Address createAddress(final String street, final String city, final String zipCode,
-          final String country) {
-    Address address = new Address();
-    address.setStreet(street);
-    address.setCity(city);
-    address.setZipCode(zipCode);
-    address.setCountry(country);
-    return address;
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3519f396/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/util/AnnotationSampleDataGenerator.java
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/util/AnnotationSampleDataGenerator.java b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/util/AnnotationSampleDataGenerator.java
new file mode 100644
index 0000000..c543c9e
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/util/AnnotationSampleDataGenerator.java
@@ -0,0 +1,177 @@
+/*******************************************************************************
+ * 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.
+ ******************************************************************************/
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package}.util;
+
+import org.apache.olingo.odata2.api.commons.HttpStatusCodes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+/**
+ *
+ */
+public class AnnotationSampleDataGenerator {
+  private final Logger LOG = LoggerFactory.getLogger(AnnotationSampleDataGenerator.class);
+
+  public static final String HTTP_METHOD_PUT = "PUT";
+  public static final String HTTP_METHOD_POST = "POST";
+
+  public static final String HTTP_HEADER_CONTENT_TYPE = "Content-Type";
+  public static final String HTTP_HEADER_ACCEPT = "Accept";
+  
+  public static final String APPLICATION_JSON = "application/json";
+  public static final boolean PRINT_RAW_CONTENT = true;
+
+  public static void main(String[] args) {
+    generateData("http://localhost:8080/MyFormula.svc");
+  }
+
+  public static void generateData(String serviceUrl) {
+    AnnotationSampleDataGenerator app = new AnnotationSampleDataGenerator();
+    app.generateSampleData(serviceUrl);
+  }
+
+  public void generateSampleData(String serviceUrl) {
+    String usedFormat = APPLICATION_JSON;
+
+    String manufacturerStar = "{\"Id\":\"1\",\"Name\":\"Star Powered Racing\",\"Founded\":\"/Date(-489024000000+0060)/\"," +
+            "\"Address\":{\"Street\":\"Star Street 137\",\"City\":\"Stuttgart\",\"ZipCode\":\"70173\",\"Country\":\"Germany\"}}";
+    String manufacturerHorse = "{\"Id\":\"2\",\"Name\":\"Horse Powered Racing\",\"Founded\":\"/Date(-1266278400000+0060)/\"," +
+            "\"Address\":{\"Street\":\"Horse Street 1\",\"City\":\"Maranello\",\"ZipCode\":\"41053\",\"Country\":\"Italy\"}}";
+
+    String manufacturersUri = serviceUrl + "/Manufacturers";
+    createEntity(manufacturersUri, manufacturerStar, usedFormat);
+    createEntity(manufacturersUri, manufacturerHorse, usedFormat);
+
+    String carOneWithInlineDriverOne =
+            "{\"Id\":\"1\",\"Model\":\"F1 W02\",\"Price\":\"167189.0\",\"ModelYear\":2011,\"Updated\":\"/Date(1392989833964)/\"," +
+            "\"Driver\":{\"Id\":\"1\",\"Name\":\"Mic\",\"Lastname\":\"Shoemaker\",\"Nickname\":\"The Fast\",\"Birthday\":\"/Date(488671200000)/\"}}";
+    String carTwoWithInlineDriverTwo =
+            "{\"Id\":\"2\",\"Model\":\"F1 W04\",\"Price\":\"242189.99\",\"ModelYear\":2013,\"Updated\":\"/Date(1392990355793)/\"," +
+            "\"Driver\":{\"Id\":\"2\",\"Name\":\"Nico\",\"Lastname\":\"Mulemountain\",\"Nickname\":null,\"Birthday\":\"/Date(-31366800000)/\"}}";
+    String carThreeWithInlineDriverThree =
+            "{\"Id\":\"3\",\"Model\":\"FF2013\",\"Price\":\"199189.11\",\"ModelYear\":2013,\"Updated\":\"/Date(1392990355793)/\"," +
+            "\"Driver\":{\"Id\":\"3\",\"Name\":\"Kimi\",\"Lastname\":\"Heikkinen\",\"Nickname\":\"Iceman\",\"Birthday\":\"/Date(308962800000)/\"}}";
+    String carFour = "{\"Id\":\"4\",\"Model\":\"FF2014\",\"Price\":\"299189.11\",\"ModelYear\":2014,\"Updated\":\"/Date(1392973616419)/\"}";
+
+    createEntity(manufacturersUri + "('1')/Cars", carOneWithInlineDriverOne, usedFormat);
+    createEntity(manufacturersUri + "('1')/Cars", carTwoWithInlineDriverTwo, usedFormat);
+    createEntity(manufacturersUri + "('2')/Cars", carThreeWithInlineDriverThree, usedFormat);
+    createEntity(manufacturersUri + "('2')/Cars", carFour, usedFormat);
+  }
+
+  private void createEntity(String absoluteUri, String content, String contentType) {
+    try {
+      writeEntity(absoluteUri, content, contentType, HTTP_METHOD_POST);
+    } catch (IOException e) {
+      throw new RuntimeException("Exception during data source initialization generation.", e);
+    } catch (URISyntaxException e) {
+      throw new RuntimeException("Exception during data source initialization generation.", e);
+    }
+  }
+
+  private void writeEntity(String absoluteUri, String content, String contentType, String httpMethod)
+      throws IOException, URISyntaxException {
+
+    print(httpMethod + " request on uri: " + absoluteUri + ":\n  " + content + "\n");
+    //
+    HttpURLConnection connection = initializeConnection(absoluteUri, contentType, httpMethod);
+    byte[] buffer = content.getBytes("UTF-8");
+    connection.getOutputStream().write(buffer);
+
+    // if a entity is created (via POST request) the response body contains the new created entity
+    HttpStatusCodes statusCode = HttpStatusCodes.fromStatusCode(connection.getResponseCode());
+    if(statusCode == HttpStatusCodes.CREATED) {
+      // get the content as InputStream and de-serialize it into an ODataEntry object
+      InputStream responseContent = connection.getInputStream();
+      logRawContent(httpMethod + " response:\n  ", responseContent, "\n");
+    } else if(statusCode == HttpStatusCodes.NO_CONTENT) {
+      print("No content.");
+    } else {
+      checkStatus(connection);
+    }
+
+    //
+    connection.disconnect();
+  }
+
+  private void print(String content) {
+    LOG.info(content);
+  }
+
+
+  private HttpStatusCodes checkStatus(HttpURLConnection connection) throws IOException {
+    HttpStatusCodes httpStatusCode = HttpStatusCodes.fromStatusCode(connection.getResponseCode());
+    if (400 <= httpStatusCode.getStatusCode() && httpStatusCode.getStatusCode() <= 599) {
+      connection.disconnect();
+      throw new RuntimeException("Http Connection failed with status " + httpStatusCode.getStatusCode() + " " + httpStatusCode.toString());
+    }
+    return httpStatusCode;
+  }
+
+  private InputStream logRawContent(String prefix, InputStream content, String postfix) throws IOException {
+    if(PRINT_RAW_CONTENT) {
+      byte[] buffer = streamToArray(content);
+      print(prefix + new String(buffer, "UTF-8") + postfix);
+      return new ByteArrayInputStream(buffer);
+    }
+    return content;
+  }
+
+
+  private HttpURLConnection initializeConnection(String absoluteUri, String contentType, String httpMethod)
+          throws IOException {
+    URL url = new URL(absoluteUri);
+    HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+
+    connection.setRequestMethod(httpMethod);
+    connection.setRequestProperty(HTTP_HEADER_ACCEPT, contentType);
+    if(HTTP_METHOD_POST.equals(httpMethod) || HTTP_METHOD_PUT.equals(httpMethod)) {
+      connection.setDoOutput(true);
+      connection.setRequestProperty(HTTP_HEADER_CONTENT_TYPE, contentType);
+    }
+
+    return connection;
+  }
+
+
+  private byte[] streamToArray(InputStream stream) throws IOException {
+    byte[] result = new byte[0];
+    byte[] tmp = new byte[8192];
+    int readCount = stream.read(tmp);
+    while(readCount >= 0) {
+      byte[] innerTmp = new byte[result.length + readCount];
+      System.arraycopy(result, 0, innerTmp, 0, result.length);
+      System.arraycopy(tmp, 0, innerTmp, result.length, readCount);
+      result = innerTmp;
+      readCount = stream.read(tmp);
+    }
+    stream.close();
+    return result;
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/3519f396/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/webapp/index.jsp
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/webapp/index.jsp b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/webapp/index.jsp
index 1d43be0..5efc100 100644
--- a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/webapp/index.jsp
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/webapp/index.jsp
@@ -86,6 +86,30 @@ th, td { border: 1px solid; padding: 20px; }
                 </ul>
             </td>
         </tr>
+        <tr>
+            <td valign="bottom">
+                <div class="code">
+                    <%
+                        if (request.getParameter("genSampleData") != null) { //genSampleData is the name of your button, not id of that button.
+                            String requestUrl = request.getRequestURL().toString();
+                            if(requestUrl.endsWith("index.jsp")) {
+                                requestUrl = requestUrl.substring(0, requestUrl.length()-9);
+                            }
+                            ${package}.util.AnnotationSampleDataGenerator.generateData(requestUrl + "MyFormula.svc");
+                            response.sendRedirect(requestUrl);
+                        }
+                    %>
+                    <form method="POST">
+                        <div>
+                            For generation of sample data this button can be used.
+                            <br/>
+                            But be aware that multiple clicking results in multiple data generation.
+                        </div>
+                        <input type="submit" id="genSampleData" name="genSampleData" value="Generate sample Data"/>
+                    </form>
+                </div>
+            </td>
+        </tr>
     </table>
 </body>
 </html>