Package com.webobjects.appserver._private

Examples of com.webobjects.appserver._private.WOConstantValueAssociation


    }
    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;
  }
View Full Code Here


    private WOElement template(WOComponent component) {
      WOElement content =  component._childTemplate();
      WOElement result = null;
      String templateName = (_templateName == null) ? null : (String) _templateName.valueInComponent(component);
      if (content instanceof WODynamicGroup) {
      WODynamicGroup group = (WODynamicGroup) content;
      if (templateName == null) {
        // MS: If you don't set a template name, then let's construct all the children of
        // this element that are NOT ERXWOTemplate's, so we don't double-display.  This lets
        // you use an ERXWOComponentContent and have it just act like a "default" template
        // that skips all the children that are explicitly wrapped in an ERXWOTemplate.
        NSMutableArray<WOElement> originalChildrenElements = group.childrenElements();
        if (originalChildrenElements != null && originalChildrenElements.count() > 0) {
          NSMutableArray<WOElement> nonTemplateChildrenElements = new NSMutableArray<WOElement>();
          for (WOElement originalChild : originalChildrenElements) {
            if (!(originalChild instanceof ERXWOTemplate)) {
              nonTemplateChildrenElements.addObject(originalChild);
            }
          }
          result = new WODynamicGroup(null, null, nonTemplateChildrenElements);
        }
      }
      else {
            for(Enumeration e = group.childrenElements().objectEnumerator(); e.hasMoreElements() && result == null ; ) {
              WOElement current = (WOElement) e.nextElement();
              if(current instanceof ERXWOTemplate) {
                ERXWOTemplate template = (ERXWOTemplate)current;
                String name = template.templateName(component);
                if(name.equals(templateName)) {
View Full Code Here

  public boolean hastTemplateInComponent() {
    boolean result = false;

    WOElement content =  _childTemplate();
    if (content instanceof WODynamicGroup) {
      WODynamicGroup group = (WODynamicGroup) content;
      for(Enumeration<WOElement> e = group.childrenElements().objectEnumerator(); e.hasMoreElements() && !result ; ) {
        WOElement current = e.nextElement();
        if(current instanceof ERXWOTemplate) {
          result = true;
        }
      }
View Full Code Here

    boolean result = false;

    WOElement content = _childTemplate();
    if (content instanceof WODynamicGroup)
    {
      WODynamicGroup group = (WODynamicGroup) content;
      for (Enumeration<WOElement> e = group.childrenElements().objectEnumerator(); e.hasMoreElements() && !result;)
      {
        WOElement current = e.nextElement();
        if (current instanceof ERXWOTemplate)
        {
          result = true;
View Full Code Here

        if(result == null) {
            result = _childCases.objectForKey("default");
        }
        if(result == null) {
            result = new WOHTMLBareString("");
        }
        return result;
    }
View Full Code Here

        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;
View Full Code Here

    protected WOElement _defaultTemplate;
   
    public ERXWOComponentContent(String name, NSDictionary associations, WOElement woelement) {
        super(name, associations, woelement);
        _templateName = (WOAssociation) associations.objectForKey("templateName");
        _defaultTemplate = woelement == null ? new WOHTMLBareString("") : woelement;
    }
View Full Code Here

          headers.setObjectForKey(new NSArray<String>(header.getValue().split(",")), header.getKey());
        }
       
        // content
        ChannelBuffer _content = request.getContent();
    NSData contentData = (_content.readable()) ? new WOInputStreamData(new NSData(new ChannelBufferInputStream(_content), 4096)) : NSData.EmptyData;         
   
    // create request
    WORequest _worequest = WOApplication.application().createRequest(
        request.getMethod().getName(),
        request.getUri(),
View Full Code Here

     * ... it will figure out that the sourceObject is "person", the relationshipKey is "company"
     * and the sourceEntityName is "Person".
     * </p>
     */
    protected void loadBindingsFromSelection() {
      WOKeyValueAssociation selectionAssociation = (WOKeyValueAssociation)_associationWithName("selection");
      if (selectionAssociation != null) {
        String selectionKeyPath = selectionAssociation.keyPath();
        WOComponent parent = parent();
        int lastDotIndex = selectionKeyPath.lastIndexOf('.');
        if (lastDotIndex == -1) {
          _sourceObject = parent;
          _relationshipKey = selectionKeyPath;
View Full Code Here

        if(_templateName == null || !_templateName.isValueConstant()) {
            //throw new IllegalStateException("You must bind 'templateName' to a constant string: " + associations);
        }
        _template = woelement;
        if(_template == null) {
          _template = new WONoContentElement();
        }
    }
View Full Code Here

TOP

Related Classes of com.webobjects.appserver._private.WOConstantValueAssociation

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.