From aedc34d55462a75e329bbf342251ff6504cd117e Mon Sep 17 00:00:00 2001 From: Benjamin Culkin Date: Sun, 19 May 2024 17:56:33 -0400 Subject: Initial import from SVN --- .../src/main/java/net/wotonomy/web/WOFrame.java | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOFrame.java (limited to 'projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOFrame.java') diff --git a/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOFrame.java b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOFrame.java new file mode 100644 index 0000000..30dd4bc --- /dev/null +++ b/projects/net.wotonomy.web/src/main/java/net/wotonomy/web/WOFrame.java @@ -0,0 +1,60 @@ + +package net.wotonomy.web; + +import net.wotonomy.foundation.NSArray; +import net.wotonomy.foundation.NSDictionary; + +public class WOFrame extends WODynamicElement { + + public WOFrame() { + super(); + } + + public WOFrame(String aName, NSDictionary assocs, WOElement template) { + super(aName, assocs, template); + } + + public String frameName(WOContext c) { + String x = (String)valueForProperty("name", c.component()); + if (x != null) + return x; + return c.elementID(); + } + + public String url(WOContext c) { + //Check if the href property is set + String href = stringForProperty("href", c.component()); + if (href != null) + return href; + href = stringForProperty("pageName", c.component()); + if (href != null || associations.objectForKey("action") != null) { //write this component's URL + return c.componentActionURL(); + } + href = stringForProperty("directActionName", c.component()); + if (href != null) { //compose the direct action URL + String fullActionName = stringForProperty("actionClass", c.component()); + if (fullActionName != null) + fullActionName = fullActionName + "/" + href; + else + fullActionName = href; + return c.directActionURLForActionNamed(fullActionName, + urlFields(c.component())); + } + //Coded needed here to support filename/framework and data/mimeType. + return null; + } + + public void appendToResponse(WOResponse r, WOContext c) { + r.appendContentString(" 0) + r.appendContentString(moreFields); + r.appendContentString(">"); + } + +} \ No newline at end of file -- cgit v1.2.3