Package com.webobjects.appserver

Examples of com.webobjects.appserver.WOAssociation


     */
  @Override
    public void validationFailedWithException(Throwable t, Object value, String keyPath) {
      if (keyPath != null && "<none>".equals(keyPath) && t instanceof ValidationException) {
        ValidationException e = (ValidationException) t;
        WOAssociation valueAssociation = (WOAssociation) _keyAssociations.valueForKey("value");
        if (valueAssociation != null) {
          keyPath = valueAssociation.keyPath();
        }
        t = new ValidationException(e.getMessage(), e.object(), keyPath);
      }
      parent().validationFailedWithException(t, value, keyPath);
    }
View Full Code Here


    _styles = new NSMutableDictionary();
    for (Enumeration enumerator = _associations.keyEnumerator(); enumerator.hasMoreElements();) {
      String key = (String) enumerator.nextElement();
      if(key.startsWith("style.")) {
        String styleKey = key.substring(6);
        WOAssociation association = _associations.removeObjectForKey(key);
        if("background-image.type".equals(styleKey)) {
          _mimeType = association;
        } else if("unit".equals(styleKey)) {
          _unit = association;
        } else {
View Full Code Here

       }
     }
     if(_styles.count() > 0) {
       for (Enumeration enumerator = _styles.keyEnumerator(); enumerator.hasMoreElements();) {
         String key = (String) enumerator.nextElement();
         WOAssociation association = (WOAssociation) _styles.objectForKey(key);
         Object value = association.valueInComponent(component);
         if(value != null) {
           String stringValue;
           if("background-image".equals(key)) {
             if (value instanceof NSData) {
               NSData data = (NSData) value;
View Full Code Here

        }
        String value = binding.substring(equalsIndex + 1).trim();
        if (value.length() == 0) {
          throw new WOHelperFunctionDeclarationFormatException("<WOHelperFunctionDeclarationParser> Missing value in line:\n" + binding + "\nfor declaration:\n" + declarationHeader + " " + declarationBody);
        }
        WOAssociation association = WOHelperFunctionDeclarationParser._associationWithKey(value, _quotedStrings);
        Object quotedString = _quotedStrings.objectForKey(key);
        if (quotedString != null) {
          associations.setObjectForKey(association, quotedString);
        }
        else {
View Full Code Here

    // }
    return associations;
  }

  public static WOAssociation _associationWithKey(String associationValue, NSDictionary quotedStrings) {
    WOAssociation association = null;
    if (associationValue != null && associationValue.startsWith("~")) {
      int associationValueLength = associationValue.length();
      StringBuilder ognlValue = new StringBuilder();
      int lastIndex = 0;
      int index = 0;
View Full Code Here

  //  Methods
  //********************************************************************

  @Override
  protected boolean isDisabledInContext(WOContext context) {
    WOAssociation disabled = (WOAssociation) ERXKeyValueCodingUtilities.privateValueForKey(this, "_disabled");
    return disabled != null && disabled.booleanValueInComponent(context.component());
  }
View Full Code Here

                 }
             }
            
             String valueAsString = null;
             String displayStringAsString = null;
             WOAssociation displayStringAssociation = null;
             if(ERXKeyValueCodingUtilities.fieldForKey(this, "_string") != null) {
               displayStringAssociation = (WOAssociation) ERXKeyValueCodingUtilities.privateValueForKey(this, "_string");
             } else {
               displayStringAssociation = (WOAssociation) ERXKeyValueCodingUtilities.privateValueForKey(this, "_displayString");
             }

             if (displayStringAssociation != null || _value != null) {

        if (displayStringAssociation != null) {
                    Object displayString = displayStringAssociation.valueInComponent(parent);
                    if (displayString != null)
                    {
                        displayStringAsString = displayString.toString();
                        if (_value != null)
                        {
View Full Code Here

     */
  @Override
    public void validationFailedWithException(Throwable t, Object value, String keyPath) {
      if (keyPath != null && "<none>".equals(keyPath) && t instanceof ValidationException) {
        ValidationException e = (ValidationException) t;
        WOAssociation valueAssociation = (WOAssociation) _keyAssociations.valueForKey("value");
        if (valueAssociation != null) {
          keyPath = valueAssociation.keyPath();
        }
        t = new ValidationException(e.getMessage(), e.object(), keyPath);
      }
      parent().validationFailedWithException(t, value, keyPath);
    }
View Full Code Here

   * Bridge to an AjaxComponent.
   */
  protected Object valueInComponent(WOComponent component) {
  Object value = component.valueForBinding(_bindingName);
    if (value instanceof WOAssociation) {
      WOAssociation association = (WOAssociation) value;
      value = association.valueInComponent(component);
    }
  if (value == null) {
    value = _defaultValue;
  }
    return value;
View Full Code Here

  Object value = null;
  if (associations != null) {
    value = associations.objectForKey(_bindingName);
    // This is needed for the double step to resolve the value for ^ notation
    if (value instanceof WOAssociation) {
      WOAssociation association = (WOAssociation) value;
      value = association.valueInComponent(component);
    }
  }
  if (value == null) {
    value = _defaultValue;
  }
View Full Code Here

TOP

Related Classes of com.webobjects.appserver.WOAssociation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.