diff options
| author | Benjamin Culkin <scorpress@gmail.com> | 2024-05-21 17:52:46 -0400 |
|---|---|---|
| committer | Benjamin Culkin <scorpress@gmail.com> | 2024-05-21 17:52:46 -0400 |
| commit | 3403adc8ac690439605072f9c4dc30995abac99f (patch) | |
| tree | bf039d2cab23157aeb8721328cfb4845bc7b7958 | |
| parent | 8283e417245b26abd290f7e6fd0511869802fc82 (diff) | |
More work on getting a working example
Took a little bit, but I fixed the bindings and found the place where
they are supposed to be
20 files changed, 33 insertions, 512 deletions
diff --git a/wotonomy-web-test/WEB-INF/classes/Application.java b/wotonomy-web-test/WEB-INF/classes/Application.java deleted file mode 100644 index 815e210..0000000 --- a/wotonomy-web-test/WEB-INF/classes/Application.java +++ /dev/null @@ -1,14 +0,0 @@ -// Decompiled by Jad v1.5.8c. Copyright 2001 Pavel Kouznetsov. -// Jad home page: http://www.geocities.com/kpdus/jad.html -// Decompiler options: packimports(3) fieldsfirst nonlb space -// Source File Name: Application.java - -import java.io.PrintStream; -import net.wotonomy.web.WOApplication; - -public class Application extends WOApplication { - - public Application() { - System.out.println("Application()"); - } -} diff --git a/wotonomy-web-test/WEB-INF/classes/DirectAction.java b/wotonomy-web-test/WEB-INF/classes/DirectAction.java deleted file mode 100644 index f5dc851..0000000 --- a/wotonomy-web-test/WEB-INF/classes/DirectAction.java +++ /dev/null @@ -1,71 +0,0 @@ - -import java.io.PrintStream; -import java.util.Date; -import net.wotonomy.foundation.NSArray; -import net.wotonomy.foundation.NSDictionary; -import net.wotonomy.web.*; - -public class DirectAction extends WODirectAction { - - private Date testing; - - public DirectAction(WORequest aRequest) { - super(aRequest); - testing = new Date(); - System.out.println("DirectAction()"); - } - - public WOActionResults defaultAction() { - return pageWithName("Main"); - } - - public Object getTesting() { - return testing; - } - - public void setTesting(Date anObject) { - testing = anObject; - } - - public WOActionResults testAction() { - System.out.println("DirectAction.testAction()"); - takeFormValuesForKeyArray(request().formValues().allKeys()); - WOResponse response = new WOResponse(); - response.appendContentString("This is really just a test."); - response.appendContentString("<p>"); - response.appendContentString(Application.application().name()); - response.appendContentString("<p>"); - response.appendContentHTMLString("<p>"); - response.appendContentString("<p>"); - response.appendContentString(getTesting().toString()); - response.appendContentString("<p>"); - response.appendContentString(request().formValues().toString()); - response.appendContentString("<p>"); - response.appendContentString("browserLanguages: "); - response.appendContentString(request().browserLanguages().toString()); - response.appendContentString("<p>"); - response.appendContentString("uri: "); - response.appendContentString(request().uri().toString()); - response.appendContentString("<p>"); - response.appendContentString("adaptorPrefix: "); - response.appendContentString(request().adaptorPrefix().toString()); - response.appendContentString("<p>"); - response.appendContentString("applicationName: "); - response.appendContentString(request().applicationName().toString()); - response.appendContentString("<p>"); - response.appendContentString("requestHandlerKey: "); - response.appendContentString(request().requestHandlerKey().toString()); - response.appendContentString("<p>"); - response.appendContentString("requestHandlerPath: "); - response.appendContentString(request().requestHandlerPath().toString()); - response.appendContentString("<p>"); - response.appendContentString("requestHandlerPathArray: "); - response.appendContentString(request().requestHandlerPathArray().toString()); - response.appendContentString("<p>"); - response.appendContentString("method: "); - response.appendContentString(request().method().toString()); - response.appendContentString("<p>"); - response.appendContentString("content: "); - return response; - } -} diff --git a/wotonomy-web-test/WEB-INF/classes/Main.java b/wotonomy-web-test/WEB-INF/classes/Main.java deleted file mode 100644 index a12ca44..0000000 --- a/wotonomy-web-test/WEB-INF/classes/Main.java +++ /dev/null @@ -1,54 +0,0 @@ -import net.wotonomy.foundation.NSDate; -import net.wotonomy.web.*; - -public class Main extends WOComponent { - - private boolean showing; - private String textFieldValue; - - public Main() { - super(); - showing = true; - } - - public NSDate getCurrentTime() { - return new NSDate(); - } - - public boolean getShowTime() { - return showing; - } - public void setShowTime(boolean value) { - showing = value; - } - - public WOActionResults submit() { - System.out.println("Form Submitted"); - System.out.println("textfield says '" + getTextValue() + "'"); - return null; - } - - public void takeValuesFromRequest(WORequest r, WOContext c) { - System.out.println("taking values from request"); - if (r.formValueForKey("show") != null) - setShowTime(r.formValueForKey("show").equals("true")); - } - - public String getTimeLinkString() { - return showing ? "Hide the time display" : "Show time display"; - } - - public void setTextValue(String value) { - textFieldValue = value; - } - public String getTextValue() { - return textFieldValue; - } - - public WOComponent switchTime() { - System.out.println("switching time display"); - setShowTime(!getShowTime()); - return this; - } - -} diff --git a/wotonomy-web-test/WEB-INF/classes/Main.wo/Main.html b/wotonomy-web-test/WEB-INF/classes/Main.wo/Main.html deleted file mode 100644 index 6729a94..0000000 --- a/wotonomy-web-test/WEB-INF/classes/Main.wo/Main.html +++ /dev/null @@ -1,22 +0,0 @@ -<HTML> -<HEAD><TITLE>MyTest</TITLE></HEAD> -<BODY> - -<WEBOBJECT NAME=showTime> -The time is <WEBOBJECT NAME=time></WEBOBJECT>. -<BR><BR> -</WEBOBJECT> -<WEBOBJECT NAME=timeLink></WEBOBJECT> - -<WEBOBJECT NAME=FORM> -Here's a textfield: <WEBOBJECT NAME=textfield></WEBOBJECT> -<WEBOBJECT NAME=submit></WEBOBJECT> -</WEBOBJECT> - -<BR><BR> -Here's a link to an <WEBOBJECT NAME=EXTLINK>external site</WEBOBJECT>. -<BR> -And here's a link to a <WEBOBJECT NAME=DIRLINK>direct action</WEBOBJECT>. - -</BODY> -</HTML> diff --git a/wotonomy-web-test/WEB-INF/classes/Main.wo/Main.wod b/wotonomy-web-test/WEB-INF/classes/Main.wo/Main.wod deleted file mode 100644 index 16bd25e..0000000 --- a/wotonomy-web-test/WEB-INF/classes/Main.wo/Main.wod +++ /dev/null @@ -1,22 +0,0 @@ -<HTML> -<HEAD><TITLE>MyTest</TITLE></HEAD> -<BODY> - -<WEBOBJECT NAME=showTime> -The time is <WEBOBJECT NAME=time></WEBOBJECT>. -<BR><BR> -</WEBOBJECT> -<WEBOBJECT NAME=timeLink></WEBOBJECT> - -<WEBOBJECT NAME=FORM> -Here's a textfield: <WEBOBJECT NAME=textfield></WEBOBJECT> -<WEBOBJECT NAME=submit></WEBOBJECT> -</WEBOBJECT> - -<BR><BR> -Here's a link to an <WEBOBJECT NAME=EXTLINK>external site</WEBOBJECT>. -<BR> -And here's a link to a <WEBOBJECT NAME=DIRLINK>direct action</WEBOBJECT> (not implemented yet). - -</BODY> -</HTML> diff --git a/wotonomy-web-test/WEB-INF/classes/OtherAction.java b/wotonomy-web-test/WEB-INF/classes/OtherAction.java deleted file mode 100644 index 00a3155..0000000 --- a/wotonomy-web-test/WEB-INF/classes/OtherAction.java +++ /dev/null @@ -1,21 +0,0 @@ -//A direct action subclass, with only one method -//that gets called from Main.wo - -import net.wotonomy.foundation.*; -import net.wotonomy.web.*; - -public class OtherAction extends WODirectAction { - - public OtherAction(WORequest r) { - super(r); - } - - public WOActionResults linkTestAction() { - System.out.println("creating and configuring Main.wo"); - WOComponent page = pageWithName("Main"); - page.takeValueForKey(new Boolean(false), "showTime"); - page.takeValueForKey("direct action called", "textValue"); - return page; - } - -} diff --git a/wotonomy-web-test/WEB-INF/classes/Session.java b/wotonomy-web-test/WEB-INF/classes/Session.java deleted file mode 100644 index e3e9de7..0000000 --- a/wotonomy-web-test/WEB-INF/classes/Session.java +++ /dev/null @@ -1,10 +0,0 @@ -//Empty session file - -import net.wotonomy.web.WOSession; - -public class Session extends WOSession { - - public Session() { - } - -} diff --git a/wotonomy-web-test/WEB-INF/web.xml b/wotonomy-web-test/WEB-INF/web.xml deleted file mode 100644 index b505b52..0000000 --- a/wotonomy-web-test/WEB-INF/web.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> - -<!DOCTYPE web-app - PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" - "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd"> - -<web-app> - <servlet> - <servlet-name>ApplicatonServlet</servlet-name> - <servlet-class>Application</servlet-class> - </servlet> - - <servlet-mapping> - <servlet-name>ApplicatonServlet</servlet-name> - <url-pattern>/</url-pattern> - </servlet-mapping> -</web-app> diff --git a/wotonomy-web-test/src/main/java/Main.wo/Main.html b/wotonomy-web-test/src/main/java/Main.wo/Main.html deleted file mode 100644 index 6729a94..0000000 --- a/wotonomy-web-test/src/main/java/Main.wo/Main.html +++ /dev/null @@ -1,22 +0,0 @@ -<HTML> -<HEAD><TITLE>MyTest</TITLE></HEAD> -<BODY> - -<WEBOBJECT NAME=showTime> -The time is <WEBOBJECT NAME=time></WEBOBJECT>. -<BR><BR> -</WEBOBJECT> -<WEBOBJECT NAME=timeLink></WEBOBJECT> - -<WEBOBJECT NAME=FORM> -Here's a textfield: <WEBOBJECT NAME=textfield></WEBOBJECT> -<WEBOBJECT NAME=submit></WEBOBJECT> -</WEBOBJECT> - -<BR><BR> -Here's a link to an <WEBOBJECT NAME=EXTLINK>external site</WEBOBJECT>. -<BR> -And here's a link to a <WEBOBJECT NAME=DIRLINK>direct action</WEBOBJECT>. - -</BODY> -</HTML> diff --git a/wotonomy-web-test/src/main/java/Main.wo/Main.wod b/wotonomy-web-test/src/main/java/Main.wo/Main.wod deleted file mode 100644 index 16bd25e..0000000 --- a/wotonomy-web-test/src/main/java/Main.wo/Main.wod +++ /dev/null @@ -1,22 +0,0 @@ -<HTML> -<HEAD><TITLE>MyTest</TITLE></HEAD> -<BODY> - -<WEBOBJECT NAME=showTime> -The time is <WEBOBJECT NAME=time></WEBOBJECT>. -<BR><BR> -</WEBOBJECT> -<WEBOBJECT NAME=timeLink></WEBOBJECT> - -<WEBOBJECT NAME=FORM> -Here's a textfield: <WEBOBJECT NAME=textfield></WEBOBJECT> -<WEBOBJECT NAME=submit></WEBOBJECT> -</WEBOBJECT> - -<BR><BR> -Here's a link to an <WEBOBJECT NAME=EXTLINK>external site</WEBOBJECT>. -<BR> -And here's a link to a <WEBOBJECT NAME=DIRLINK>direct action</WEBOBJECT> (not implemented yet). - -</BODY> -</HTML> diff --git a/wotonomy-web-test/src/main/java/OtherAction.java b/wotonomy-web-test/src/main/java/OtherAction.java index 00a3155..95e840a 100644 --- a/wotonomy-web-test/src/main/java/OtherAction.java +++ b/wotonomy-web-test/src/main/java/OtherAction.java @@ -13,7 +13,7 @@ public class OtherAction extends WODirectAction { public WOActionResults linkTestAction() { System.out.println("creating and configuring Main.wo"); WOComponent page = pageWithName("Main"); - page.takeValueForKey(new Boolean(false), "showTime"); + page.takeValueForKey(false, "showTime"); page.takeValueForKey("direct action called", "textValue"); return page; } diff --git a/wotonomy-web-test/src/main/webapp/Main.wo/Main.html b/wotonomy-web-test/src/main/webapp/Main.wo/Main.html deleted file mode 100644 index 6729a94..0000000 --- a/wotonomy-web-test/src/main/webapp/Main.wo/Main.html +++ /dev/null @@ -1,22 +0,0 @@ -<HTML> -<HEAD><TITLE>MyTest</TITLE></HEAD> -<BODY> - -<WEBOBJECT NAME=showTime> -The time is <WEBOBJECT NAME=time></WEBOBJECT>. -<BR><BR> -</WEBOBJECT> -<WEBOBJECT NAME=timeLink></WEBOBJECT> - -<WEBOBJECT NAME=FORM> -Here's a textfield: <WEBOBJECT NAME=textfield></WEBOBJECT> -<WEBOBJECT NAME=submit></WEBOBJECT> -</WEBOBJECT> - -<BR><BR> -Here's a link to an <WEBOBJECT NAME=EXTLINK>external site</WEBOBJECT>. -<BR> -And here's a link to a <WEBOBJECT NAME=DIRLINK>direct action</WEBOBJECT>. - -</BODY> -</HTML> diff --git a/wotonomy-web-test/src/main/webapp/Main.wo/Main.wod b/wotonomy-web-test/src/main/webapp/Main.wo/Main.wod deleted file mode 100644 index 16bd25e..0000000 --- a/wotonomy-web-test/src/main/webapp/Main.wo/Main.wod +++ /dev/null @@ -1,22 +0,0 @@ -<HTML> -<HEAD><TITLE>MyTest</TITLE></HEAD> -<BODY> - -<WEBOBJECT NAME=showTime> -The time is <WEBOBJECT NAME=time></WEBOBJECT>. -<BR><BR> -</WEBOBJECT> -<WEBOBJECT NAME=timeLink></WEBOBJECT> - -<WEBOBJECT NAME=FORM> -Here's a textfield: <WEBOBJECT NAME=textfield></WEBOBJECT> -<WEBOBJECT NAME=submit></WEBOBJECT> -</WEBOBJECT> - -<BR><BR> -Here's a link to an <WEBOBJECT NAME=EXTLINK>external site</WEBOBJECT>. -<BR> -And here's a link to a <WEBOBJECT NAME=DIRLINK>direct action</WEBOBJECT> (not implemented yet). - -</BODY> -</HTML> diff --git a/wotonomy-web-test/src/main/webapp/WEB-INF/classes/Application.java b/wotonomy-web-test/src/main/webapp/WEB-INF/classes/Application.java deleted file mode 100644 index 815e210..0000000 --- a/wotonomy-web-test/src/main/webapp/WEB-INF/classes/Application.java +++ /dev/null @@ -1,14 +0,0 @@ -// Decompiled by Jad v1.5.8c. Copyright 2001 Pavel Kouznetsov. -// Jad home page: http://www.geocities.com/kpdus/jad.html -// Decompiler options: packimports(3) fieldsfirst nonlb space -// Source File Name: Application.java - -import java.io.PrintStream; -import net.wotonomy.web.WOApplication; - -public class Application extends WOApplication { - - public Application() { - System.out.println("Application()"); - } -} diff --git a/wotonomy-web-test/src/main/webapp/WEB-INF/classes/DirectAction.java b/wotonomy-web-test/src/main/webapp/WEB-INF/classes/DirectAction.java deleted file mode 100644 index f5dc851..0000000 --- a/wotonomy-web-test/src/main/webapp/WEB-INF/classes/DirectAction.java +++ /dev/null @@ -1,71 +0,0 @@ - -import java.io.PrintStream; -import java.util.Date; -import net.wotonomy.foundation.NSArray; -import net.wotonomy.foundation.NSDictionary; -import net.wotonomy.web.*; - -public class DirectAction extends WODirectAction { - - private Date testing; - - public DirectAction(WORequest aRequest) { - super(aRequest); - testing = new Date(); - System.out.println("DirectAction()"); - } - - public WOActionResults defaultAction() { - return pageWithName("Main"); - } - - public Object getTesting() { - return testing; - } - - public void setTesting(Date anObject) { - testing = anObject; - } - - public WOActionResults testAction() { - System.out.println("DirectAction.testAction()"); - takeFormValuesForKeyArray(request().formValues().allKeys()); - WOResponse response = new WOResponse(); - response.appendContentString("This is really just a test."); - response.appendContentString("<p>"); - response.appendContentString(Application.application().name()); - response.appendContentString("<p>"); - response.appendContentHTMLString("<p>"); - response.appendContentString("<p>"); - response.appendContentString(getTesting().toString()); - response.appendContentString("<p>"); - response.appendContentString(request().formValues().toString()); - response.appendContentString("<p>"); - response.appendContentString("browserLanguages: "); - response.appendContentString(request().browserLanguages().toString()); - response.appendContentString("<p>"); - response.appendContentString("uri: "); - response.appendContentString(request().uri().toString()); - response.appendContentString("<p>"); - response.appendContentString("adaptorPrefix: "); - response.appendContentString(request().adaptorPrefix().toString()); - response.appendContentString("<p>"); - response.appendContentString("applicationName: "); - response.appendContentString(request().applicationName().toString()); - response.appendContentString("<p>"); - response.appendContentString("requestHandlerKey: "); - response.appendContentString(request().requestHandlerKey().toString()); - response.appendContentString("<p>"); - response.appendContentString("requestHandlerPath: "); - response.appendContentString(request().requestHandlerPath().toString()); - response.appendContentString("<p>"); - response.appendContentString("requestHandlerPathArray: "); - response.appendContentString(request().requestHandlerPathArray().toString()); - response.appendContentString("<p>"); - response.appendContentString("method: "); - response.appendContentString(request().method().toString()); - response.appendContentString("<p>"); - response.appendContentString("content: "); - return response; - } -} diff --git a/wotonomy-web-test/src/main/webapp/WEB-INF/classes/Main.java b/wotonomy-web-test/src/main/webapp/WEB-INF/classes/Main.java deleted file mode 100644 index a12ca44..0000000 --- a/wotonomy-web-test/src/main/webapp/WEB-INF/classes/Main.java +++ /dev/null @@ -1,54 +0,0 @@ -import net.wotonomy.foundation.NSDate; -import net.wotonomy.web.*; - -public class Main extends WOComponent { - - private boolean showing; - private String textFieldValue; - - public Main() { - super(); - showing = true; - } - - public NSDate getCurrentTime() { - return new NSDate(); - } - - public boolean getShowTime() { - return showing; - } - public void setShowTime(boolean value) { - showing = value; - } - - public WOActionResults submit() { - System.out.println("Form Submitted"); - System.out.println("textfield says '" + getTextValue() + "'"); - return null; - } - - public void takeValuesFromRequest(WORequest r, WOContext c) { - System.out.println("taking values from request"); - if (r.formValueForKey("show") != null) - setShowTime(r.formValueForKey("show").equals("true")); - } - - public String getTimeLinkString() { - return showing ? "Hide the time display" : "Show time display"; - } - - public void setTextValue(String value) { - textFieldValue = value; - } - public String getTextValue() { - return textFieldValue; - } - - public WOComponent switchTime() { - System.out.println("switching time display"); - setShowTime(!getShowTime()); - return this; - } - -} diff --git a/wotonomy-web-test/src/main/webapp/WEB-INF/classes/Main.wo/Main.html b/wotonomy-web-test/src/main/webapp/WEB-INF/classes/Main.wo/Main.html index 6729a94..03d5f83 100644 --- a/wotonomy-web-test/src/main/webapp/WEB-INF/classes/Main.wo/Main.html +++ b/wotonomy-web-test/src/main/webapp/WEB-INF/classes/Main.wo/Main.html @@ -1,5 +1,6 @@ <HTML> <HEAD><TITLE>MyTest</TITLE></HEAD> + <BODY> <WEBOBJECT NAME=showTime> diff --git a/wotonomy-web-test/src/main/webapp/WEB-INF/classes/Main.wo/Main.wod b/wotonomy-web-test/src/main/webapp/WEB-INF/classes/Main.wo/Main.wod index 16bd25e..57b5656 100644 --- a/wotonomy-web-test/src/main/webapp/WEB-INF/classes/Main.wo/Main.wod +++ b/wotonomy-web-test/src/main/webapp/WEB-INF/classes/Main.wo/Main.wod @@ -1,22 +1,31 @@ -<HTML> -<HEAD><TITLE>MyTest</TITLE></HEAD> -<BODY> - -<WEBOBJECT NAME=showTime> -The time is <WEBOBJECT NAME=time></WEBOBJECT>. -<BR><BR> -</WEBOBJECT> -<WEBOBJECT NAME=timeLink></WEBOBJECT> - -<WEBOBJECT NAME=FORM> -Here's a textfield: <WEBOBJECT NAME=textfield></WEBOBJECT> -<WEBOBJECT NAME=submit></WEBOBJECT> -</WEBOBJECT> - -<BR><BR> -Here's a link to an <WEBOBJECT NAME=EXTLINK>external site</WEBOBJECT>. -<BR> -And here's a link to a <WEBOBJECT NAME=DIRLINK>direct action</WEBOBJECT> (not implemented yet). - -</BODY> -</HTML> +showTime : WOConditional { + +} + +time: WOString { + +} + +timeLink : WOHyperlink { + +} + +FORM : WOForm { + +} + +textfield : WOTextField { + +} + +submit : WOSubmitButton { + +} + +EXTLINK : WOHyperlink { + +} + +DIRLINK : WOHyperlink { + +} diff --git a/wotonomy-web-test/src/main/webapp/WEB-INF/classes/OtherAction.java b/wotonomy-web-test/src/main/webapp/WEB-INF/classes/OtherAction.java deleted file mode 100644 index 00a3155..0000000 --- a/wotonomy-web-test/src/main/webapp/WEB-INF/classes/OtherAction.java +++ /dev/null @@ -1,21 +0,0 @@ -//A direct action subclass, with only one method -//that gets called from Main.wo - -import net.wotonomy.foundation.*; -import net.wotonomy.web.*; - -public class OtherAction extends WODirectAction { - - public OtherAction(WORequest r) { - super(r); - } - - public WOActionResults linkTestAction() { - System.out.println("creating and configuring Main.wo"); - WOComponent page = pageWithName("Main"); - page.takeValueForKey(new Boolean(false), "showTime"); - page.takeValueForKey("direct action called", "textValue"); - return page; - } - -} diff --git a/wotonomy-web-test/src/main/webapp/WEB-INF/classes/Session.java b/wotonomy-web-test/src/main/webapp/WEB-INF/classes/Session.java deleted file mode 100644 index e3e9de7..0000000 --- a/wotonomy-web-test/src/main/webapp/WEB-INF/classes/Session.java +++ /dev/null @@ -1,10 +0,0 @@ -//Empty session file - -import net.wotonomy.web.WOSession; - -public class Session extends WOSession { - - public Session() { - } - -} |
