result = ar.result();
- //dump RowSet into jsonArray
- JsonArray jsonArray = new JsonArray();
- for (Row r : result) {
- jsonArray.add(r.toJson());
- }
- //sets the header to html
- rc.response().putHeader("Content-Type", "text/html; charset=UTF8")
- .end(jsonArray.encodePrettily());
- } else {
- System.out.println("Failure: " + ar.cause().getMessage());
- }
- }
-}
diff --git a/src/main/java/cavecomm/MainVerticle.java b/src/main/java/cavecomm/MainVerticle.java
deleted file mode 100644
index e23ebb6..0000000
--- a/src/main/java/cavecomm/MainVerticle.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package cavecomm;
-
-import io.vertx.core.AbstractVerticle;
-import io.vertx.core.MultiMap;
-import io.vertx.core.json.JsonObject;
-import io.vertx.ext.web.Router;
-
-public class MainVerticle extends AbstractVerticle {
- @Override
- public void start() throws Exception {
-
- //Template Engine / HTML Assembler
- //
- //TODO: actually make this work, for some reason io.vertx.ext.web.handler.TemplateEngine doesn't exist even though it does: https://vertx.io/docs/apidocs/io/vertx/ext/web/handler/package-summary.html
- io.vertx.ext.web.handler.TemplateEngine engine = io.vertx.reactivex.ext.web.templ.freemarker.FreeMarkerTemplateEngine.create();
- io.vertx.ext.web.handler.TemplateHandler templateHandler = io.vertx.ext.web.handler.TemplateHandler.create(engine);
-
- // Create a Routeir
- Router router = Router.router(vertx);
- // Mount the handler for all incoming requests at every path and HTTP method
-
- Database db = new Database(
- vertx,
- 5432,
- "localhost",
- "testdb",
- "testuser",
- "123");
-
-
- router.get("/jsonTest").handler(rc -> {
- db.executeQuery("SELECT * FROM testtable", rc, Database.OUTPUT_DATATYPE_JSON);
- }
- );
-
- router.get("/htmlTest").handler(rc -> {
- db.executeQuery("SELECT * FROM testtable", rc, Database.OUTPUT_DATATYPE_HTML);
- }
- );
-
- router.get("/dynamic/*").handler(templateHandler);
-
-
-
-
-
- router.route().handler(context -> {
- // Get the address of the request
- String address = context.request().connection().remoteAddress().toString();
- // Get the query parameter "name"
- MultiMap queryParams = context.queryParams();
- String name = queryParams.contains("name") ? queryParams.get("name") : "unknown";
-
-
- // Write a json response
- context.json(
- new JsonObject()
- .put("cavecomm", name)
- .put("address", address)
- .put("message", "Hello World")
- );
- });
-
- // Create the HTTP server
- vertx.createHttpServer()
- // Handle every request using the router
- .requestHandler(router)
- // Start listening
- .listen(8888)
- // Print the port
- .onSuccess(server ->
- System.out.println(
- "HTTP server started on port " + server.actualPort()
- )
- );
- }
-}
diff --git a/src/test/java/cavecomm/TestMainVerticle.java b/src/test/java/cavecomm/TestMainVerticle.java
deleted file mode 100644
index 347d39d..0000000
--- a/src/test/java/cavecomm/TestMainVerticle.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package cavecomm;
-
-import io.vertx.core.Vertx;
-import io.vertx.ext.unit.Async;
-import io.vertx.ext.unit.TestContext;
-import io.vertx.ext.unit.junit.RunTestOnContext;
-import io.vertx.ext.unit.junit.VertxUnitRunner;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@RunWith(VertxUnitRunner.class)
-public class TestMainVerticle {
-
- @Rule
- public RunTestOnContext rule = new RunTestOnContext();
-
- @Before
- public void deploy_verticle(TestContext testContext) {
- Vertx vertx = rule.vertx();
- vertx.deployVerticle(new MainVerticle(), testContext.asyncAssertSuccess());
- }
-
- @Test
- public void verticle_deployed(TestContext testContext) throws Throwable {
- Async async = testContext.async();
- async.complete();
- }
-}
diff --git a/templates/customerIndex_FreelancerListing.html b/templates/customerIndex_FreelancerListing.html
new file mode 100644
index 0000000..3cefb14
--- /dev/null
+++ b/templates/customerIndex_FreelancerListing.html
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+ Freelancer Profiles
+
+
+ Freelancer |
+ Basic Information |
+ Commission State |
+
+ {{#freelancerProfiles}}
+
+ {{name}} |
+ {{basicinformation}} |
+ {{commissionsclosed}} |
+
+ {{/freelancerProfiles}}
+
+
+
\ No newline at end of file
diff --git a/templates/customer_FreelancerListing.html b/templates/customer_FreelancerListing.html
new file mode 100644
index 0000000..e7df187
--- /dev/null
+++ b/templates/customer_FreelancerListing.html
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+ Freelancer: {{freelancername}}
+ Basic Profile:
+ {{freelancerbasicinformation}}
+
+ Detailed Profile:
+ {{freelancergeneralinformation}}
+
+ Return to freelancer selection
+
+
+ {{#templates}}
+
+ {{name}} |
+ {{content}} |
+
+ {{/templates}}
+
+
+
\ No newline at end of file
diff --git a/templates/customer_FreelancerListing_NOTFOUND.html b/templates/customer_FreelancerListing_NOTFOUND.html
new file mode 100644
index 0000000..a55fa7d
--- /dev/null
+++ b/templates/customer_FreelancerListing_NOTFOUND.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+ Freelancer: {{selectedfreelancername}} Could not be found!
+
+
+
\ No newline at end of file
diff --git a/templates/test.html b/templates/test.html
new file mode 100644
index 0000000..118adb7
--- /dev/null
+++ b/templates/test.html
@@ -0,0 +1,13 @@
+id: {{id}}
+customerEmailAddress: {{customeremailaddress}}
+freelancer: {{freelancer}}
+templateName: {{templatename}}
+currencyPreference: {{currencypreference}}
+priceUpFront: {{priceupfront}}
+priceOnDeliver: {{priceondeliver}}
+requestDescription: {{requestdescription}}
+upFrontInvoiceID: {{upfrontinvoiceid}}
+onDeliverInvoiceID: {{ondeliverinvoiceid}}
+upFrontPaid: {{upfrontpaid}}
+onDeliverPaid: {{ondeliverpaid}}
+accepted: {{accepted}}