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

## Class EDOHolderModel

    Object
       |
       +--GrvObject
             |
             +--MVCObserver
                   |
                   +--MVCModel
                         |
                         +--EDOHolderModel

class EDOHolderModel
extends MVCModel

This abstract class encapsulates the functionality of a data model managing a set of editable domain objects (EDOs).

The following methods MUST be overridden
- isDirty()
- isValid()
- _resetEDOs()
- keysMatch()
- propMatch()
- hasEDO()
- _newEDO()
- getEDO()
- createEDO()
- appendEDO()
- pushPosts()
- getUpdatedProperty()
- createSelectionItem()

Second, this model implements the MVCBoolModel.isTrue() interface where the value reflects whether this model is "dirty".
Version: 2.0
Author: Bruce Wallace (PolyGlotInc.com)
See:

- konstructor()
- EDOIndex
- EDOSelectedModel

Defined in grvEDO.js

Constructor Summary
`EDOHolderModel ()`

Method Summary
`EDO` | `_newEDO(<EDOIndex> xi)` return a new blank EDO of the type implied by EDOIndex
`void` | `_reset()` clear EDOs and update timestamp but dont publish
`void` | `_resetEDOs()` clear EDOs ABSTRACT: sub classes of EDOHolderModel should override this
`EDOIndex` | `appendEDO(<EDOIndex> xi)` create new EDO which is appended at end of EDO list
`String` | `canCreateEDO(<EDOIndex> xi,<boolean> appendFlag)` Is it legal to create a new EDO?
`String` | `canDeleteEDO(<EDOIndex> xi)` Is it legal to delete selected EDO?
`String` | `canEditEDO(<EDOIndex> xi)` Is it legal to edit selected EDO?
`boolean` | `canToggleExpand( <boolean> doAllFlag, <EDOIndex> xi )` can we toggle the "expanded" flag of the specified EDO?
`boolean` | `canUncreateEDO(<EDOIndex> xi,<boolean> appendFlag)` If created, can we undo creation?
`EDOIndex` | `createEDO(<EDOIndex> xi)` create new EDO which is inserted after selected EDO
`EDOHolderSelectionItem ABSTRACT: sub classes of EDOHolderModel should override this` | `createSelectionItem()` create a new item for the selection list from current EDO
`void` | `deleteEDO(<EDOIndex> xi)` delete the specified EDO
`void` | `editEDO(<EDOIndex> xi)` enable editing on the specified EDO
`String` | `getCRUDtype()` return the type of CRUD event that caused EDOHolder reload.
`void` | `getEDO(<EDOIndex> xi)` return reference to the specified editable domain object
`Object ABSTRACT: sub classes of EDOHolderModel should override this` | `getUpdatedProperty()` return the updated properties from the current EDO needed for select list update
`boolean ABSTRACT: sub classes of EDOHolderModel should override this` | `hasEDO()` return whether there is currently an EDO
`boolean ABSTRACT: sub classes of EDOHolderModel should override this` | `isDirty()` return whether any EDOs are changed for this model
`boolean` | `isExpandedEDO(<EDOIndex> xi)` return whether the specified EDO is collapsed or open
`boolean` | `isTrue()` MVCBoolModel API: return "I am modified" flag
`boolean ABSTRACT: sub classes of EDOHolderModel should override this` | `isValid()` return whether all EDOs are valid for this model
`void` | `justCreated()` handle CRUD event: "just created EDOHolder"
`void` | `justDeleted()` handle CRUD event: "just deleted EDOHolder"
`void` | `justRead()` handle CRUD event: "just loaded EDOHolder"
`void` | `justUpdated()` handle CRUD event: "just updated EDOHolder"
`boolean` | `keysMatch(<EDOHolderSelectionItem> item)` return whether current EDO matches selection item "key"
`void` | `konstructor( <MVCSelectionModel> holderSelectionModel, <Object> loadXslDOM, <String> entityName )`
`EDO` | `newEDO(<EDOIndex> xi)` return a new blank EDO of the type implied by EDOIndex
`EDO` | `openEDO(<EDOIndex> xi)` return the specified EDO with the intent to change its attributes
`boolean` | `propMatch(<EDOHolderSelectionItem> item)` return whether current EDO matches selection item "properties"
`void` | `pushPosts( <Array> posts )` push into given array all AJAX SAVE Post params for this model
`void` | `reloaded()` handle "EDOHolder reloaded" event.
`void` | `requestLoad( <Object> edoHolderSelected )` Make a Load-Data request to the AJAX server.
`void` | `requestSave( <Object> edoHolderSelected, <String> updates )` Make a Save-Data request to the AJAX server.
`void` | `reset()` clear list and publish
`void` | `save()` save all of the edits into the database via service layer
`void` | `toggleExpand( <boolean> doAllFlag, <EDOIndex> xi )` toggle the "expanded" flag of the specified EDO.
`void` | `undeleteEDO(<EDOIndex> xi)` undelete the specified EDO
`void` | `uneditEDO(<EDOIndex> xi)` rollback edit on the specified EDO
`void` | `update()` handle update events from the EDOHolder Selection Model
`<static> Object` | `AjaxRequest( <String> theType, <String> theKey, <Function> replyHandler, <String> optPostData, <boolean> optWaitFlag )` Make a REST-style AJAX request to the server.

Methods inherited from class MVCModel
`dumpSubscribers, toString, dirty, clean, neverChanged, publish, GET, _SET, SET, updateStamp, BeginTransaction, EndTransaction, addObserver, delObserver, notifyObservers`

Methods inherited from class MVCObserver
`subscribe`

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

Constructor Detail

### EDOHolderModel

    EDOHolderModel()

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

- konstructor()
- EDOIndex
- EDOSelectedModel

Method Detail

### _newEDO

    EDO _newEDO(<EDOIndex> xi)

return a new blank EDO of the type implied by EDOIndex

Parameters:

`xi` - edo index

ABSTRACT: sub classes of EDOHolderModel should override this

### _reset

    void _reset()

clear EDOs and update timestamp but dont publish

### _resetEDOs

    void _resetEDOs()

clear EDOs

ABSTRACT: sub classes of EDOHolderModel should override this

### appendEDO

    EDOIndex appendEDO(<EDOIndex> xi)

create new EDO which is appended at end of EDO list

Parameters:

`xi` - edo index

ABSTRACT: sub classes of EDOHolderModel should override this

Returns:

EDOIndex of new EDO

### canCreateEDO

    String canCreateEDO(<EDOIndex> xi,<boolean> appendFlag)

Is it legal to create a new EDO?

Parameters:

`xi` - edo index

`appendFlag` - if true then append else insert

Returns:

errmsg or null

### canDeleteEDO

    String canDeleteEDO(<EDOIndex> xi)

Is it legal to delete selected EDO?

Parameters:

`xi` - edo index

Returns:

errmsg or null

### canEditEDO

    String canEditEDO(<EDOIndex> xi)

Is it legal to edit selected EDO?

Parameters:

`xi` - edo index

Returns:

errmsg or null

### canToggleExpand

    boolean canToggleExpand( <boolean> doAllFlag, <EDOIndex> xi )

can we toggle the "expanded" flag of the specified EDO?

Parameters:

`doAllFlag` - if true, set all of the EDOs to new value

`xi` - edo index

### canUncreateEDO

    boolean canUncreateEDO(<EDOIndex> xi,<boolean> appendFlag)

If created, can we undo creation?

Parameters:

`xi` - edo index

`appendFlag` - if true then append else insert

### createEDO

    EDOIndex createEDO(<EDOIndex> xi)

create new EDO which is inserted after selected EDO

Parameters:

`xi` - edo index

ABSTRACT: sub classes of EDOHolderModel should override this

Returns:

EDOIndex of new EDO

### createSelectionItem

    EDOHolderSelectionItem  ABSTRACT: sub classes of EDOHolderModel should override this createSelectionItem()

create a new item for the selection list from current EDO

### deleteEDO

    void deleteEDO(<EDOIndex> xi)

delete the specified EDO

Parameters:

`xi` - edo index

### editEDO

    void editEDO(<EDOIndex> xi)

enable editing on the specified EDO

Parameters:

`xi` - edo index

### getCRUDtype

    String getCRUDtype()

return the type of CRUD event that caused EDOHolder reload.

Returns:

type of CRUD event encoded as char 'C' or 'R' or 'U' or 'D'

### getEDO

    void getEDO(<EDOIndex> xi)

return reference to the specified editable domain object

Parameters:

`xi` - edo index

ABSTRACT: sub classes of EDOHolderModel should override this

### getUpdatedProperty

    Object  ABSTRACT: sub classes of EDOHolderModel should override this getUpdatedProperty()

return the updated properties from the current EDO needed for select list update

Returns:

arbitrary value as needed

### hasEDO

    boolean  ABSTRACT: sub classes of EDOHolderModel should override this hasEDO()

return whether there is currently an EDO

### isDirty

    boolean  ABSTRACT: sub classes of EDOHolderModel should override this isDirty()

return whether any EDOs are changed for this model

### isExpandedEDO

    boolean isExpandedEDO(<EDOIndex> xi)

return whether the specified EDO is collapsed or open

Parameters:

`xi` - edo index

Returns:

true if open

### isTrue

    boolean isTrue()

MVCBoolModel API: return "I am modified" flag

### isValid

    boolean  ABSTRACT: sub classes of EDOHolderModel should override this isValid()

return whether all EDOs are valid for this model

### justCreated

    void justCreated()

handle CRUD event: "just created EDOHolder"

### justDeleted

    void justDeleted()

handle CRUD event: "just deleted EDOHolder"

### justRead

    void justRead()

handle CRUD event: "just loaded EDOHolder"

### justUpdated

    void justUpdated()

handle CRUD event: "just updated EDOHolder"

### keysMatch

    boolean keysMatch(<EDOHolderSelectionItem> item)

return whether current EDO matches selection item "key"

Parameters:

`item` - selection menu item

ABSTRACT: sub classes of EDOHolderModel should override this

### konstructor

    void konstructor( <MVCSelectionModel> holderSelectionModel, <Object> loadXslDOM, <String> entityName )

Parameters:

`holderSelectionModel` - model of which edoHolderModel is selected

`loadXslDOM` - XSL DOM that transforms newly loaded XML data into "this"

`entityName` - entity name of this instance

### newEDO

    EDO newEDO(<EDOIndex> xi)

return a new blank EDO of the type implied by EDOIndex

Parameters:

`xi` - edo index

### openEDO

    EDO openEDO(<EDOIndex> xi)

return the specified EDO with the intent to change its attributes

Parameters:

`xi` - edo index

### propMatch

    boolean propMatch(<EDOHolderSelectionItem> item)

return whether current EDO matches selection item "properties"

Parameters:

`item` - selection menu item

ABSTRACT: sub classes of EDOHolderModel should override this

### pushPosts

    void pushPosts( <Array> posts )

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

Parameters:

`posts` - string array containing POST params

ABSTRACT: sub classes of EDOHolderModel should override this

### reloaded

    void reloaded()

handle "EDOHolder reloaded" event.

### requestLoad

    void requestLoad( <Object> edoHolderSelected )

Make a Load-Data request to the AJAX server.

Parameters:

`edoHolderSelected` - selected item in observed model

### requestSave

    void requestSave( <Object> edoHolderSelected, <String> updates )

Make a Save-Data request to the AJAX server.

Parameters:

`edoHolderSelected` - selected item in observed model

`updates` - string of EDO update POSTs

### reset

    void reset()

clear list and publish

### save

    void save()

save all of the edits into the database via service layer

### toggleExpand

    void toggleExpand( <boolean> doAllFlag, <EDOIndex> xi )

toggle the "expanded" flag of the specified EDO.

Parameters:

`doAllFlag` - if true, set all of the EDOs to new value

`xi` - edo index

### undeleteEDO

    void undeleteEDO(<EDOIndex> xi)

undelete the specified EDO

Parameters:

`xi` - edo index

### uneditEDO

    void uneditEDO(<EDOIndex> xi)

rollback edit on the specified EDO

Parameters:

`xi` - edo index

### update

    void update()

handle update events from the EDOHolder Selection Model

### AjaxRequest

    <static> Object AjaxRequest( <String> theType, <String> theKey, <Function> replyHandler, <String> optPostData, <boolean> optWaitFlag )

Make a REST-style AJAX request to the server.

Parameters:

`theType` - requested entity name

`theKey` - unique key of requested entity

`replyHandler` - reply event handler static function

`optPostData` - optional string to pass as POST data

`optWaitFlag` - optional flag that if true says call synchronously (i.e. wait for reply)

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

Documentation generated by JSDoc on Sun Feb 11 13:28:59 2007