Search in sources :

Example 6 with WODeclaration

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

the class NotTagProcessor method createDeclaration.

@Override
public WODeclaration createDeclaration(String elementName, String elementType, NSMutableDictionary associations) {
    String newElementType = "ERXWOConditional";
    if (associations.objectForKey("negate") != null) {
        throw new IllegalArgumentException("You already specified a binding for 'negate' of " + associations.objectForKey("negate") + " on a wo:not.");
    }
    associations.setObjectForKey(new WOConstantValueAssociation(Boolean.TRUE), "negate");
    return super.createDeclaration(elementName, newElementType, associations);
}
Also used : WOConstantValueAssociation(com.webobjects.appserver._private.WOConstantValueAssociation)

Example 7 with WODeclaration

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

the class NotTagProcessor method createDeclaration.

@Override
public WODeclaration createDeclaration(String elementName, String elementType, NSMutableDictionary associations) {
    String newElementType = "ERXWOConditional";
    if (associations.objectForKey("negate") != null) {
        throw new IllegalArgumentException("You already specified a binding for 'negate' of " + associations.objectForKey("negate") + " on a wo:not.");
    }
    associations.setObjectForKey(new WOConstantValueAssociation(Boolean.TRUE), "negate");
    return super.createDeclaration(elementName, newElementType, associations);
}
Also used : WOConstantValueAssociation(com.webobjects.appserver._private.WOConstantValueAssociation)

Example 8 with WODeclaration

use of com.webobjects.appserver._private.WODeclaration 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 9 with WODeclaration

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

the class WOHelperFunctionParser method didParseOpeningWebObjectTag.

public void didParseOpeningWebObjectTag(String s, WOHelperFunctionHTMLParser htmlParser) throws WOHelperFunctionHTMLFormatException {
    if (WOHelperFunctionTagRegistry.allowInlineBindings()) {
        int spaceIndex = s.indexOf(' ');
        int colonIndex;
        if (spaceIndex != -1) {
            colonIndex = s.substring(0, spaceIndex).indexOf(':');
        } else {
            colonIndex = s.indexOf(':');
        }
        if (colonIndex != -1) {
            WODeclaration declaration = parseInlineBindings(s, colonIndex);
            s = "<wo name = \"" + declaration.name() + "\"";
        }
    }
    _currentWebObjectTag = new WOHTMLWebObjectTag(s, _currentWebObjectTag);
    log.debug("Inserted WebObject with Name '{}'.", _currentWebObjectTag.name());
}
Also used : WODeclaration(com.webobjects.appserver._private.WODeclaration)

Example 10 with WODeclaration

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

the class WOHelperFunctionParser method processDeclaration.

protected void processDeclaration(WODeclaration declaration) {
    NSMutableDictionary associations = (NSMutableDictionary) declaration.associations();
    Enumeration bindingNameEnum = associations.keyEnumerator();
    while (bindingNameEnum.hasMoreElements()) {
        String bindingName = (String) bindingNameEnum.nextElement();
        WOAssociation association = (WOAssociation) associations.valueForKey(bindingName);
        WOAssociation helperAssociation = parserHelperAssociation(association);
        if (helperAssociation != association) {
            associations.setObjectForKey(helperAssociation, bindingName);
        }
    }
}
Also used : WOAssociation(com.webobjects.appserver.WOAssociation) Enumeration(java.util.Enumeration) WOHTMLCommentString(com.webobjects.appserver._private.WOHTMLCommentString) NSMutableDictionary(com.webobjects.foundation.NSMutableDictionary)

Aggregations

WODeclaration (com.webobjects.appserver._private.WODeclaration)12 Enumeration (java.util.Enumeration)10 WOHTMLCommentString (com.webobjects.appserver._private.WOHTMLCommentString)8 WOElement (com.webobjects.appserver.WOElement)6 NSMutableDictionary (com.webobjects.foundation.NSMutableDictionary)6 WOAssociation (com.webobjects.appserver.WOAssociation)4 WOConstantValueAssociation (com.webobjects.appserver._private.WOConstantValueAssociation)4 WOHTMLBareString (com.webobjects.appserver._private.WOHTMLBareString)4 WOComponentDefinition (com.webobjects.appserver._private.WOComponentDefinition)2 WOComponentReference (com.webobjects.appserver._private.WOComponentReference)2 WOKeyValueAssociation (com.webobjects.appserver._private.WOKeyValueAssociation)2 NSDictionary (com.webobjects.foundation.NSDictionary)2