Search in sources :

Example 21 with WOElement

use of com.webobjects.appserver.WOElement in project wonder-slim by undur.

the class ERXWOComponentContent method invokeAction.

@Override
public WOActionResults invokeAction(WORequest worequest, WOContext wocontext) {
    WOComponent component = wocontext.component();
    WOElement template = template(component);
    WOActionResults result;
    if (template != null) {
        wocontext._setCurrentComponent(component.parent());
        result = template.invokeAction(worequest, wocontext);
        wocontext._setCurrentComponent(component);
    } else {
        result = _defaultTemplate.invokeAction(worequest, wocontext);
    }
    return result;
}
Also used : WOActionResults(com.webobjects.appserver.WOActionResults) WOComponent(com.webobjects.appserver.WOComponent) WOElement(com.webobjects.appserver.WOElement)

Example 22 with WOElement

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;
}
Also used : WOHTMLBareString(com.webobjects.appserver._private.WOHTMLBareString) WOElement(com.webobjects.appserver.WOElement)

Example 23 with WOElement

use of com.webobjects.appserver.WOElement in project wonder-slim by undur.

the class WOHTMLWebObjectTag method dynamicElement.

public WOElement dynamicElement(NSDictionary nsdictionary, NSArray nsarray) throws WOHelperFunctionDeclarationFormatException, ClassNotFoundException {
    String s = name();
    WOElement woelement = template();
    WODeclaration wodeclaration = (WODeclaration) nsdictionary.objectForKey(s);
    return _elementWithDeclaration(wodeclaration, s, woelement, nsarray);
}
Also used : WODeclaration(com.webobjects.appserver._private.WODeclaration) WOHTMLBareString(com.webobjects.appserver._private.WOHTMLBareString) WOElement(com.webobjects.appserver.WOElement)

Example 24 with WOElement

use of com.webobjects.appserver.WOElement in project wonder-slim by undur.

the class WOHTMLWebObjectTag method _elementWithClass.

private static WOElement _elementWithClass(Class class1, WODeclaration wodeclaration, WOElement woelement) {
    WOElement woelement1 = WOApplication.application().dynamicElementWithName(class1.getName(), wodeclaration.associations(), woelement, null);
    if (NSLog.debugLoggingAllowedForLevelAndGroups(3, 8388608L)) {
        NSLog.debug.appendln("<WOHTMLWebObjectTag> Created Dynamic Element with name :" + class1.getName());
        NSLog.debug.appendln("Declaration : " + wodeclaration);
        NSLog.debug.appendln("Element : " + woelement1.toString());
    }
    return woelement1;
}
Also used : WOElement(com.webobjects.appserver.WOElement)

Example 25 with WOElement

use of com.webobjects.appserver.WOElement in project wonder-slim by undur.

the class WOHelperFunctionParser method parse.

public WOElement parse() throws WOHelperFunctionDeclarationFormatException, WOHelperFunctionHTMLFormatException, ClassNotFoundException {
    parseDeclarations();
    for (Enumeration e = declarations().objectEnumerator(); e.hasMoreElements(); ) {
        WODeclaration declaration = (WODeclaration) e.nextElement();
        processDeclaration(declaration);
    }
    WOElement woelement = parseHTML();
    return woelement;
}
Also used : Enumeration(java.util.Enumeration) WODeclaration(com.webobjects.appserver._private.WODeclaration) WOElement(com.webobjects.appserver.WOElement)

Aggregations

WOElement (com.webobjects.appserver.WOElement)26 WOHTMLBareString (com.webobjects.appserver._private.WOHTMLBareString)8 Enumeration (java.util.Enumeration)6 WODeclaration (com.webobjects.appserver._private.WODeclaration)4 WODynamicGroup (com.webobjects.appserver._private.WODynamicGroup)4 WOComponent (com.webobjects.appserver.WOComponent)3 NSMutableArray (com.webobjects.foundation.NSMutableArray)3 WOActionResults (com.webobjects.appserver.WOActionResults)2 WOComponentReference (com.webobjects.appserver._private.WOComponentReference)2 WOHTMLCommentString (com.webobjects.appserver._private.WOHTMLCommentString)2 NSArray (com.webobjects.foundation.NSArray)2 WOResponse (com.webobjects.appserver.WOResponse)1 WOConstantValueAssociation (com.webobjects.appserver._private.WOConstantValueAssociation)1 WODynamicElementCreationException (com.webobjects.appserver._private.WODynamicElementCreationException)1 ERXWOTemplate (er.extensions.components.conditionals.ERXWOTemplate)1 Iterator (java.util.Iterator)1 List (java.util.List)1