use of com.webobjects.appserver.WOElement in project wonder-slim by undur.
the class WOHTMLWebObjectTag method template.
public WOElement template() {
NSMutableArray nsmutablearray = null;
if (_children == null) {
return null;
}
Enumeration enumeration = _children.objectEnumerator();
if (enumeration != null) {
nsmutablearray = new NSMutableArray(_children.count());
StringBuilder stringbuffer = new StringBuilder(128);
while (enumeration.hasMoreElements()) {
Object obj1 = enumeration.nextElement();
if (obj1 instanceof String) {
stringbuffer.append((String) obj1);
} else {
if (stringbuffer.length() > 0) {
WOHTMLBareString wohtmlbarestring1 = new WOHTMLBareString(stringbuffer.toString());
nsmutablearray.addObject(wohtmlbarestring1);
stringbuffer.setLength(0);
}
nsmutablearray.addObject(obj1);
}
}
if (stringbuffer.length() > 0) {
WOHTMLBareString wohtmlbarestring = new WOHTMLBareString(stringbuffer.toString());
stringbuffer.setLength(0);
nsmutablearray.addObject(wohtmlbarestring);
}
}
WOElement obj = null;
if (nsmutablearray != null && nsmutablearray.count() == 1) {
Object obj2 = nsmutablearray.objectAtIndex(0);
if (obj2 instanceof WOComponentReference) {
obj = new WODynamicGroup(_name, null, (WOElement) obj2);
} else {
obj = (WOElement) obj2;
}
} else {
obj = new WODynamicGroup(_name, null, nsmutablearray);
}
return obj;
}
use of com.webobjects.appserver.WOElement in project wonder-slim by undur.
the class WOHelperFunctionParser method parseHTML.
private WOElement parseHTML() throws WOHelperFunctionHTMLFormatException, WOHelperFunctionDeclarationFormatException, ClassNotFoundException {
WOElement currentWebObjectTemplate = null;
if (_HTMLString != null && _declarations != null) {
WOHelperFunctionHTMLParser htmlParser = new WOHelperFunctionHTMLParser(this, _HTMLString);
htmlParser.parseHTML();
String webobjectTagName = _currentWebObjectTag.name();
if (webobjectTagName != null) {
throw new WOHelperFunctionHTMLFormatException("There is an unbalanced WebObjects tag named '" + webobjectTagName + "'.");
}
currentWebObjectTemplate = _currentWebObjectTag.template();
}
return currentWebObjectTemplate;
}
use of com.webobjects.appserver.WOElement in project wonder-slim by undur.
the class WOIFrame method frameContent.
public WOElement frameContent() {
WOElement aContentElement = null;
if (hasBinding("pageName")) {
String aPageName = (String) _WOJExtensionsUtil.valueForBindingOrNull("pageName", this);
aContentElement = pageWithName(aPageName);
} else if (hasBinding("value")) {
aContentElement = (WOElement) _WOJExtensionsUtil.valueForBindingOrNull("value", this);
} else if (hasBinding("actionName")) {
aContentElement = (WOElement) parent().valueForBinding((String) valueForBinding("actionName"));
}
return aContentElement;
}
use of com.webobjects.appserver.WOElement in project wonder-slim by undur.
the class WOHTMLWebObjectTag method _elementWithDeclaration.
private static WOElement _elementWithDeclaration(WODeclaration wodeclaration, String s, WOElement woelement, NSArray nsarray) throws ClassNotFoundException, WOHelperFunctionDeclarationFormatException {
WOElement woelement1 = null;
if (wodeclaration != null) {
String s1 = wodeclaration.type();
if (s1 != null) {
if (NSLog.debugLoggingAllowedForLevelAndGroups(3, 8388608L)) {
NSLog.debug.appendln("<WOHTMLWebObjectTag> will look for " + s1 + " in the java runtime.");
}
Class class1 = _NSUtilities.classWithName(s1);
if (class1 == null) {
if (NSLog.debugLoggingAllowedForLevelAndGroups(3, 8388608L)) {
NSLog.debug.appendln("<WOHTMLWebObjectTag> will look for com.webobjects.appserver._private." + s1 + " .");
}
class1 = WOBundle.lookForClassInAllBundles(s1);
if (class1 == null) {
NSLog.err.appendln("WOBundle.lookForClassInAllBundles(" + s1 + ") failed!");
} else if (!(com.webobjects.appserver.WODynamicElement.class).isAssignableFrom(class1)) {
class1 = null;
}
}
if (class1 != null) {
if (NSLog.debugLoggingAllowedForLevelAndGroups(3, 8388608L)) {
NSLog.debug.appendln("<WOHTMLWebObjectTag> Will initialize object of class " + s1);
}
if ((com.webobjects.appserver.WOComponent.class).isAssignableFrom(class1)) {
if (NSLog.debugLoggingAllowedForLevelAndGroups(3, 8388608L)) {
NSLog.debug.appendln("<WOHTMLWebObjectTag> will look for " + s1 + " in the Compiled Components.");
}
woelement1 = _componentReferenceWithClassNameDeclarationAndTemplate(s1, wodeclaration, woelement, nsarray);
} else {
woelement1 = _elementWithClass(class1, wodeclaration, woelement);
}
} else {
if (NSLog.debugLoggingAllowedForLevelAndGroups(3, 8388608L)) {
NSLog.debug.appendln("<WOHTMLWebObjectTag> will look for " + s1 + " in the Frameworks.");
}
woelement1 = _componentReferenceWithClassNameDeclarationAndTemplate(s1, wodeclaration, woelement, nsarray);
}
} else {
throw new WOHelperFunctionDeclarationFormatException("<WOHTMLWebObjectTag> declaration object for dynamic element (or component) named " + s + "has no class name.");
}
} else {
throw new WOHelperFunctionDeclarationFormatException("<WOHTMLTemplateParser> no declaration for dynamic element (or component) named " + s);
}
WOGenerationSupport.insertInElementsTableWithName(woelement1, s, wodeclaration.associations());
return woelement1;
}
use of com.webobjects.appserver.WOElement in project wonder-slim by undur.
the class WOHTMLWebObjectTag method template.
public WOElement template() {
NSMutableArray nsmutablearray = null;
if (_children == null) {
return null;
}
Enumeration enumeration = _children.objectEnumerator();
if (enumeration != null) {
nsmutablearray = new NSMutableArray(_children.count());
StringBuilder stringbuffer = new StringBuilder(128);
while (enumeration.hasMoreElements()) {
Object obj1 = enumeration.nextElement();
if (obj1 instanceof String) {
stringbuffer.append((String) obj1);
} else {
if (stringbuffer.length() > 0) {
WOHTMLBareString wohtmlbarestring1 = new WOHTMLBareString(stringbuffer.toString());
nsmutablearray.addObject(wohtmlbarestring1);
stringbuffer.setLength(0);
}
nsmutablearray.addObject(obj1);
}
}
if (stringbuffer.length() > 0) {
WOHTMLBareString wohtmlbarestring = new WOHTMLBareString(stringbuffer.toString());
stringbuffer.setLength(0);
nsmutablearray.addObject(wohtmlbarestring);
}
}
WOElement obj = null;
if (nsmutablearray != null && nsmutablearray.count() == 1) {
Object obj2 = nsmutablearray.objectAtIndex(0);
if (obj2 instanceof WOComponentReference) {
obj = new WODynamicGroup(_name, null, (WOElement) obj2);
} else {
obj = (WOElement) obj2;
}
} else {
obj = new WODynamicGroup(_name, null, nsmutablearray);
}
return obj;
}
Aggregations