Project Wonder 2.0

er.extensions
Class ERXWORepetition

java.lang.Object
  extended bycom.webobjects.appserver.WOElement
      extended bycom.webobjects.appserver.WODynamicElement
          extended bycom.webobjects.appserver._private.WODynamicGroup
              extended byer.extensions.ERXWORepetition

public class ERXWORepetition
extends WODynamicGroup

Replacement for WORepetition. Adds support for List and Array, in addition to NSArray and Vector (which is a List in 1.4). This is listed as Radar #3325342 since June 2003. Should be installed via ERXPatcher.setClassForName(ERXWORepetition.class, "WORepetition") into the runtime system. Note that this implementation adds a small amount of overhead due to the creation of the Context for each RR phase, but this is preferable to having to give so many parameters.

Author:
ak

Nested Class Summary
protected  class ERXWORepetition.Context
          WOElements must be reentrant, so we need a context object or will have to add the parameters to every method.
 
Field Summary
protected  WOAssociation _count
           
protected  WOAssociation _index
           
protected  WOAssociation _item
           
protected  WOAssociation _list
           
 
Fields inherited from class com.webobjects.appserver._private.WODynamicGroup
_children
 
Fields inherited from class com.webobjects.appserver.WODynamicElement
_ConstructorParameters
 
Constructor Summary
ERXWORepetition(String string, NSDictionary associations, WOElement woelement)
          Designated Constructor.
 
Method Summary
protected  void _cleanupAfterIteration(int i, WOContext wocontext, WOComponent wocomponent)
          Cleans the WOContext after the loop iteration.
protected  int _count(ERXWORepetition.Context context, WOComponent wocomponent)
           
protected  void _failCreation(String message)
          Utility to throw an exception if the bindings are incomplete.
protected  String _indexOfChosenItem(WORequest worequest, WOContext wocontext)
           
protected  String _indexStringForSenderAndElement(String senderID, String elementID)
          Fills the context with the object given in the "list" binding.
protected  void _prepareForIterationWithIndex(ERXWORepetition.Context context, int index, WOContext wocontext, WOComponent wocomponent)
          Prepares the WOContext for the loop iteration.
 void appendToResponse(WOResponse woresponse, WOContext wocontext)
           
protected  ERXWORepetition.Context createContext(WOComponent wocomponent)
           
 WOActionResults invokeAction(WORequest worequest, WOContext wocontext)
           
 void takeValuesFromRequest(WORequest worequest, WOContext wocontext)
           
 String toString()
          Human readable description.
 
Methods inherited from class com.webobjects.appserver._private.WODynamicGroup
addChildElement, appendChildrenToResponse, childrenElements, EmptyGroup, hasChildrenElements, invokeChildrenAction, takeChildrenValuesFromRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_list

protected WOAssociation _list

_item

protected WOAssociation _item

_count

protected WOAssociation _count

_index

protected WOAssociation _index
Constructor Detail

ERXWORepetition

public ERXWORepetition(String string,
                       NSDictionary associations,
                       WOElement woelement)
Designated Constructor. Gets called by the template parser. Checks if the bindings are valid.

Method Detail

_failCreation

protected void _failCreation(String message)
Utility to throw an exception if the bindings are incomplete.


toString

public String toString()
Human readable description.


_prepareForIterationWithIndex

protected void _prepareForIterationWithIndex(ERXWORepetition.Context context,
                                             int index,
                                             WOContext wocontext,
                                             WOComponent wocomponent)
Prepares the WOContext for the loop iteration.


_cleanupAfterIteration

protected void _cleanupAfterIteration(int i,
                                      WOContext wocontext,
                                      WOComponent wocomponent)
Cleans the WOContext after the loop iteration.


_indexStringForSenderAndElement

protected String _indexStringForSenderAndElement(String senderID,
                                                 String elementID)
Fills the context with the object given in the "list" binding.


_indexOfChosenItem

protected String _indexOfChosenItem(WORequest worequest,
                                    WOContext wocontext)

_count

protected int _count(ERXWORepetition.Context context,
                     WOComponent wocomponent)

createContext

protected ERXWORepetition.Context createContext(WOComponent wocomponent)

takeValuesFromRequest

public void takeValuesFromRequest(WORequest worequest,
                                  WOContext wocontext)

invokeAction

public WOActionResults invokeAction(WORequest worequest,
                                    WOContext wocontext)

appendToResponse

public void appendToResponse(WOResponse woresponse,
                             WOContext wocontext)

Last updated: Do, Dez 9, 2004 • 12:46 PM CET

Copyright © 2002 – 2004 Project Wonder.