summaryrefslogtreecommitdiff
path: root/projects/net.wotonomy.web/src/main/java/net/wotonomy
diff options
context:
space:
mode:
authorBenjamin Culkin <scorpress@gmail.com>2024-10-14 11:31:28 -0400
committerBenjamin Culkin <scorpress@gmail.com>2024-10-14 11:31:28 -0400
commitba949758b37592fc967f9ffdb6c5d1b0c54c9313 (patch)
treebb8267ae43be0154d20d5daaee33a66a60abc824 /projects/net.wotonomy.web/src/main/java/net/wotonomy
parent3b4fbed3a6a4c2a57e53324260827d1ce13b3133 (diff)
Add additional commented out logging
Add some additional logging that I used to figure out how associations and the like work
Diffstat (limited to 'projects/net.wotonomy.web/src/main/java/net/wotonomy')
-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
5 files changed, 20 insertions, 6 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 {