summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOAssociation.java6
-rw-r--r--projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOComponent.java2
-rw-r--r--projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WODynamicElement.java4
-rw-r--r--projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WORepetition.java8
-rw-r--r--projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOString.java6
-rw-r--r--wotonomy-web-test/pom.xml7
-rw-r--r--wotonomy-web-test/src/main/java/Main.java1
7 files changed, 20 insertions, 14 deletions
diff --git a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOAssociation.java b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOAssociation.java
index 89623a6..86cfb0c 100644
--- a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOAssociation.java
+++ b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOAssociation.java
@@ -88,8 +88,11 @@ public class WOAssociation implements java.io.Serializable {
return null;
if (value != null)
return value;
- if (path != null)
+ if (path != null) {
+ //System.err.printf("Querying for path '%s' in component '%s'\n", path, aComponent);
return aComponent.valueForKey(path);
+ }
+
throw new RuntimeException("WOAssociation: neither value nor path specified!");
}
@@ -99,6 +102,7 @@ public class WOAssociation implements java.io.Serializable {
*/
public void setValue(Object aValue, WOComponent aComponent) {
if (path != null) {
+ //System.err.printf("Setting value '%s' for key '%s' in component '%s'\n", aValue, path, aComponent);
aComponent.takeValueForKey(aValue, path);
return;
}
diff --git a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOComponent.java b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOComponent.java
index 69b1118..8e8082d 100644
--- a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOComponent.java
+++ b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOComponent.java
@@ -469,8 +469,10 @@ public class WOComponent extends WOElement implements WOActionResults, net.woton
public Object valueForBinding(String aBinding) {
WOComponent parent = parent();
if (associations != null) {
+ //System.err.printf("Querying for association '%s' in component '%s'", aBinding, this);
WOAssociation assoc = (WOAssociation) associations.objectForKey(aBinding);
if (assoc != null && parent != null) {
+ //System.err.printf("Reading association '%s' for binding '%s' from component '%s'\n", assoc, aBinding, this);
return assoc.valueInComponent(parent);
}
}
diff --git a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WODynamicElement.java b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WODynamicElement.java
index 62ea6ae..4aab168 100644
--- a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WODynamicElement.java
+++ b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WODynamicElement.java
@@ -131,8 +131,10 @@ public abstract class WODynamicElement extends WOElement {
/** Convenience method for setting the value of an association. */
void setValueForProperty(String key, Object value, WOComponent c) {
WOAssociation a = (WOAssociation) associations.objectForKey(key);
- if (a != null && a.isValueSettable())
+ //System.err.printf("Attempting to set value '%s' for key '%s' in component %s (assoc. '%s')\n\tAssociations: %s\n", value, key, c, a, associations);
+ if (a != null && a.isValueSettable()) {
a.setValue(value, c);
+ }
}
/**
diff --git a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WORepetition.java b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WORepetition.java
index 607ab97..7d3e47f 100644
--- a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WORepetition.java
+++ b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WORepetition.java
@@ -31,7 +31,7 @@ public class WORepetition extends WODynamicElement {
protected Object item;
protected Collection list;
protected Iterator iterator;
-
+
protected WORepetition() {
super();
}
@@ -171,8 +171,8 @@ public class WORepetition extends WODynamicElement {
}
protected void pushValuesToParent(WOComponent c) {
- setValueForProperty("index", new Integer(index), c);
+ setValueForProperty("index", Integer.valueOf(index), c);
setValueForProperty("item", item, c);
- }
-
+ //System.err.printf("Loop index %d, item '%s' named item in component '%s'\n", index, item, c);
+ }
}
diff --git a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOString.java b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOString.java
index 0c471d7..a3977db 100644
--- a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOString.java
+++ b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOString.java
@@ -66,8 +66,12 @@ public class WOString extends WODynamicElement {
escapeHTML = true;
}
+ @Override
public void appendToResponse(WOResponse aResponse, WOContext aContext) {
WOComponent c = aContext.component();
+
+ //System.err.println("WOString value bound to " + (WOAssociation) associations.objectForKey("value"));
+
numberformat = stringForProperty("numberformat", c);
dateformat = stringForProperty("dateformat", c);
formatter = (Format) valueForProperty("formatter", c);
@@ -102,6 +106,8 @@ public class WOString extends WODynamicElement {
result = "nil";
}
}
+
+ //System.err.printf("WOString pre-value '%s' post-value '%s'\n", value, result);
if (escapeHTML) {
aResponse.appendContentHTMLString(result.toString());
} else {
diff --git a/wotonomy-web-test/pom.xml b/wotonomy-web-test/pom.xml
index 44fd16a..ce0ee17 100644
--- a/wotonomy-web-test/pom.xml
+++ b/wotonomy-web-test/pom.xml
@@ -1,15 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>
-
<groupId>com.ashardalon</groupId>
<artifactId>wotonomy-web-test</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>war</packaging>
-
<name>Wotonomy web test</name>
<description>This is a test of the Wotonomy framework</description>
-
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.report.sourceEncoding>UTF-8</project.report.sourceEncoding>
@@ -18,7 +15,6 @@
<compiler-plugin.version>3.11.0</compiler-plugin.version>
<war-plugin.version>3.4.0</war-plugin.version>
</properties>
-
<dependencies>
<dependency>
<groupId>jakarta.platform</groupId>
@@ -104,10 +100,8 @@
</execution>
</executions>
</plugin>
-
</plugins>
</build>
-
<reporting>
<plugins>
<plugin>
@@ -125,7 +119,6 @@
</plugin>
</plugins>
</reporting>
-
<distributionManagement>
<site>
<id>ashardalon-dav</id>
diff --git a/wotonomy-web-test/src/main/java/Main.java b/wotonomy-web-test/src/main/java/Main.java
index a12ca44..0820fbc 100644
--- a/wotonomy-web-test/src/main/java/Main.java
+++ b/wotonomy-web-test/src/main/java/Main.java
@@ -50,5 +50,4 @@ public class Main extends WOComponent {
setShowTime(!getShowTime());
return this;
}
-
}