Overview | File | Class | Tree | Index | Help
| The Gravey 2.5 Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## Class EDO

    Object
       |
       +--GrvObject
             |
             +--EDO

class EDO
extends GrvObject

This class defines a framework for Editable Domain Objects.

Note that subclasses MUST override the clone() method.
Version: 2.0
Author: Bruce Wallace (PolyGlotInc.com)
See:

- konstructor()

Defined in grvEDO.js

Field Summary
`<static> Object` | `kMsgSep`

Constructor Summary
`EDO ()`

Method Summary
`String` | `action()` return our edit state translated to a broadcast message code
`void` | `addMe()` mark this entity as being newly added
`String` | `buildUpdateItemPost()` return an UpdateItem Message (as a POST argument) for (just) this particular EDO formatted as:
     "UPDATES={class}~{key}~{action}~{content}~END_UPDATE"
     where the fields are defined as follows...
`String` | `canCreate(<boolean> appendFlag)` Is it legal to create a new one of "this/these"?
`String` | `canDelete()` Is it legal to delete "this"?
`String` | `canEdit()` Is it legal to edit "this"?
`boolean` | `canToggleExpand( <boolean> doAllFlag )` can this EDO toggle the "expanded" flag?
`boolean` | `canUncreate(<boolean> appendFlag)` If created, can we undo creation?
`EDO` | `clone()` return a clone of "this" object.
`void` | `collapse()` force this EDO to be collapsed
`void` | `deleteMe()` mark this EDO as deleted
`String` | `dump()` return the debug details of "this"
`void` | `editMe()` mark this entity as having been edited
`String` | `edoToolTip( <EDOIndex> xi )` return the DEFAULT tooltip for "this"
`void` | `expand()` force this EDO to be expanded
`String` | `getEditRule( <String> optPropID )` return the edit/validation rule for the specified property.
`String` | `getValidity(<String> ID)` return the validity "code" of the specified attribute
`boolean` | `inEdit()` return whether this entity has been changed since last save
`boolean` | `inLimbo()` Is this EDO undead?
`boolean` | `isActive()` Is this EDO active and editable?
`boolean` | `isDeleted()` is this entity newly added?
`boolean` | `isExpanded()` return whether this EDO is collapsed or open
`boolean` | `isNew()` is this entity newly added?
`boolean` | `isValid()` return whether this EDO has validated data
`boolean` | `isViewable()` return whether this EDO can be viewed if desired
`void` | `konstructor( <Function> CLAZZ, <EDOHolderModel> parentHolder, <array> propValues, <String> editDate, <String> editUser, <int> theKey, <int> optEditStatus, <String> optName )`
`void` | `makeReadOnly()` convert all property edit rules into "read-only"
`Array` | `propValues()` generate array of editable property values
`Array` | `pushEncodedValues( pArray )` push into given array the editable property values URI encoded
`void` | `pushPosts( <Array> posts )` push into given array all AJAX SAVE Post params for this model
`void` | `pushUpdateFields( <Array> uFields )` push into given array all EDO-specific fields of the UpdateItem message.
`Array` | `pushValues( pArray )` push into given array the editable property values
`void` | `setValidity(<String> ID,<String> v)` set the validity code of the specified attribute
`String` | `state()` return the formatted version of our edit state
`void` | `toggleExpand( <boolean> optValue )` toggle (or set) the "expanded" flag of this EDO.
`String` | `toolTip( <EDOIndex> xi )` return the tooltip for "this"
`String` | `toString()` return "this" as human-readable string
`void` | `undeleteMe()` restore this EDO to its pre-deleted state
`void` | `uneditMe()` restore this EDO to its pre-edited state

Methods inherited from class GrvObject
`souper, souper_, isInstanceOf`

Field Detail

### kMsgSep

    <static> Object kMsgSep

Constructor Detail

### EDO

    EDO()

Version: 2.0
Author: Bruce Wallace (PolyGlotInc.com)
See:

- konstructor()

Method Detail

### action

    String action()

return our edit state translated to a broadcast message code

### addMe

    void addMe()

mark this entity as being newly added

### buildUpdateItemPost

    String buildUpdateItemPost()

return an UpdateItem Message (as a POST argument) for (just) this particular EDO formatted as:

     "UPDATES={class}~{key}~{action}~{content}~END_UPDATE"
     where the fields are defined as follows...
         {class}  = the entity's type
         {key}    = the entity's unique key number
         {action} = the entity's action code
     (encode as strings 'C','D', and 'U' for values create, delete, and update.)
         {content}= the EDO's specific content in EDO-specific-format

### canCreate

    String canCreate(<boolean> appendFlag)

Is it legal to create a new one of "this/these"?

Parameters:

`appendFlag` - if true then append else insert

Returns:

errmsg or null

### canDelete

    String canDelete()

Is it legal to delete "this"?

Returns:

errmsg or null

### canEdit

    String canEdit()

Is it legal to edit "this"?

Returns:

errmsg or null

### canToggleExpand

    boolean canToggleExpand( <boolean> doAllFlag )

can this EDO toggle the "expanded" flag?

Parameters:

`doAllFlag` - if true, all EDOs are to be set

### canUncreate

    boolean canUncreate(<boolean> appendFlag)

If created, can we undo creation?

Parameters:

`appendFlag` - if true then append else insert

### clone

    EDO clone()

return a clone of "this" object.

ABSTRACT: sub classes of EDO should override this.

### collapse

    void collapse()

force this EDO to be collapsed

### deleteMe

    void deleteMe()

mark this EDO as deleted

### dump

    String dump()

return the debug details of "this"

### editMe

    void editMe()

mark this entity as having been edited

### edoToolTip

    String edoToolTip( <EDOIndex> xi )

return the DEFAULT tooltip for "this"

Parameters:

`xi` - edo index

### expand

    void expand()

force this EDO to be expanded

### getEditRule

    String getEditRule( <String> optPropID )

return the edit/validation rule for the specified property. If no property is specified then return entire set of rules for this EDO. Each Rule is one character long.

Parameters:

`optPropID` - optional property ID

See:

- MVCDualStringController

### getValidity

    String getValidity(<String> ID)

return the validity "code" of the specified attribute

Parameters:

`ID` - repayment attribute name

### inEdit

    boolean inEdit()

return whether this entity has been changed since last save

### inLimbo

    boolean inLimbo()

Is this EDO undead? (i.e in limbo)

Returns:

true if in Limbo

### isActive

    boolean isActive()

Is this EDO active and editable? (i.e not deleted or in limbo)

Returns:

true if active

### isDeleted

    boolean isDeleted()

is this entity newly added?

### isExpanded

    boolean isExpanded()

return whether this EDO is collapsed or open

Returns:

true if open

### isNew

    boolean isNew()

is this entity newly added?

### isValid

    boolean isValid()

return whether this EDO has validated data

### isViewable

    boolean isViewable()

return whether this EDO can be viewed if desired

### konstructor

    void konstructor( <Function> CLAZZ, <EDOHolderModel> parentHolder, <array> propValues, <String> editDate, <String> editUser, <int> theKey, <int> optEditStatus, <String> optName )

Parameters:

`CLAZZ` - this EDO's "class"

`parentHolder` - holder model containing this

`propValues` - array of property initial values

`editDate` - date of last edit

`editUser` - ID of last user to edit

`theKey` - Oracle primary key of this record

`optEditStatus` - optional edit status where the status codes are: 0=no-change; 1=delete; 2=create; 3=hidden; 4=update

`optName` - optional name of this instance

### makeReadOnly

    void makeReadOnly()

convert all property edit rules into "read-only"

### propValues

    Array propValues()

generate array of editable property values

Returns:

value array

### pushEncodedValues

    Array pushEncodedValues( pArray )

push into given array the editable property values URI encoded

Returns:

resultant array

### pushPosts

    void pushPosts( <Array> posts )

push into given array all AJAX SAVE Post params for this model

Parameters:

`posts` - string array containing POST params

### pushUpdateFields

    void pushUpdateFields( <Array> uFields )

push into given array all EDO-specific fields of the UpdateItem message. This default implementation generates content formatted as

     "{property1}~{property2}~...~{propertyN}~"
     where the fields are defined as follows...
         {propertyI} = the i-th editable property of this EDO

Parameters:

`uFields` - string array containing Update Msg fields

### pushValues

    Array pushValues( pArray )

push into given array the editable property values

Returns:

resultant array

### setValidity

    void setValidity(<String> ID,<String> v)

set the validity code of the specified attribute

Parameters:

`ID` - repayment attribute name

`v` - validity "code" (actually an error message or null)

### state

    String state()

return the formatted version of our edit state

### toggleExpand

    void toggleExpand( <boolean> optValue )

toggle (or set) the "expanded" flag of this EDO.

Parameters:

`optValue` - if specified, set flag to it, else toggle

### toolTip

    String toolTip( <EDOIndex> xi )

return the tooltip for "this"

Parameters:

`xi` - edo index

### toString

    String toString()

return "this" as human-readable string

### undeleteMe

    void undeleteMe()

restore this EDO to its pre-deleted state

### uneditMe

    void uneditMe()

restore this EDO to its pre-edited state

Overview | File | Class | Tree | Index | Help
| The Gravey 2.5 Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Documentation generated by JSDoc on Thu Jan 6 12:47:09 2011