com.waveset.object
Interface ViewHandler

All Known Implementing Classes:
AbstractViewHandler

public interface ViewHandler

The interface of an object that can be registered to handle view requests. These will be called by ViewMaster when it receives a request for a view.


Method Summary
 WavesetResult checkinView(ViewMaster vm, GenericObject view, java.util.Map options)
          Save changes made to the view.
 GenericObject checkoutView(ViewMaster vm, java.lang.String id, java.util.Map options)
          Get an read/write view of an existing object.
 WavesetResult commitView(ViewMaster vm, GenericObject view, java.util.Map options)
          Save changes made to the view into the repository.
 GenericObject createView(ViewMaster vm, java.util.Map options)
          Create an empty object with an appropriate form.
 WavesetResult deleteView(ViewMaster vm, java.lang.String id, java.util.Map options)
          Delete the repository objects that are associated with the view id.
 Form getForm(ViewMaster vm, GenericObject view, java.lang.String formid, java.util.Map options)
          Get an alternative form for an existing view.
 GenericObject getView(ViewMaster vm, java.lang.String id, java.util.Map options)
          Get a read-only view of an existing object.
 boolean isFormHandler()
          Internal method called by ViewMaster.
 GenericObject refreshView(ViewMaster vm, GenericObject view, java.util.Map options)
          Refresh view contents.
 void unlockView(ViewMaster vm, GenericObject view, java.util.Map options)
          Unlock all object that underneath a particular view.
 

Method Detail

createView

public GenericObject createView(ViewMaster vm,
                                java.util.Map options)
                         throws WavesetException
Create an empty object with an appropriate form. Depending on the view, we might want to initialize the object with values, but this can also be defined in the form. The returned object will have been processed with Derivation and Default expressions defined in the form.

ViewMaster provides access to the repository, server cache, and authenticated session if necessary.

Throws:
WavesetException

getView

public GenericObject getView(ViewMaster vm,
                             java.lang.String id,
                             java.util.Map options)
                      throws WavesetException
Get a read-only view of an existing object. The returned object will have been processed with Derivation and Default expressions defined in the form.

ViewMaster provides access to the repository, server cache, and authenticated session.

Throws:
WavesetException

getForm

public Form getForm(ViewMaster vm,
                    GenericObject view,
                    java.lang.String formid,
                    java.util.Map options)
             throws WavesetException
Get an alternative form for an existing view. Also used when views use very large forms (e.g. the user form) and are not serialized with the view on the HttpSession, requiring the GUI to ask for it again when the form is posted.

Throws:
WavesetException

checkoutView

public GenericObject checkoutView(ViewMaster vm,
                                  java.lang.String id,
                                  java.util.Map options)
                           throws WavesetException
Get an read/write view of an existing object. Lock the underlying object(s) so they cannot be edited by someone other than the current session owner. The returned object will have been processed with Derivation and Default expressions defined in the form.

ViewMaster provides access to the repository, server cache, and authenticated session.

Throws:
WavesetException

unlockView

public void unlockView(ViewMaster vm,
                       GenericObject view,
                       java.util.Map options)
                throws WavesetException
Unlock all object that underneath a particular view.

Throws:
WavesetException

checkinView

public WavesetResult checkinView(ViewMaster vm,
                                 GenericObject view,
                                 java.util.Map options)
                          throws WavesetException
Save changes made to the view. The view will be processed with Expansion expressions defined in the form prior to saving. This may have two side effects depending on the view handler. Some view handlers will immediately save the changes in the view into the corresponding repository objects. Others will pass the view into a workflow process. The workflow process may perform approvals or allow further editing of the view. When a workflow is used, the workflow process will eventually call the commit() method when it is ready to permanently store the view changes in the repository.

Throws:
WavesetException

commitView

public WavesetResult commitView(ViewMaster vm,
                                GenericObject view,
                                java.util.Map options)
                         throws WavesetException
Save changes made to the view into the repository. This is intended to be called only by the workflow process that the view handler launches with checkinView. If the view handler does not launch a workflow process, then this method should throw an exception

Throws:
WavesetException

refreshView

public GenericObject refreshView(ViewMaster vm,
                                 GenericObject view,
                                 java.util.Map options)
                          throws WavesetException
Refresh view contents. In addition to handler specific operations, the view will also be processed with Expansion expressions, then Derivation expressions as defined in the form.

Throws:
WavesetException

isFormHandler

public boolean isFormHandler()
Internal method called by ViewMaster. Return true if the ViewHandler wishes to handle its own processing of Derivation, Default, and Expansion expressions. If false, the ViewMaster will do it. This allows simple views to use the default processing provided by ViewMaster.


deleteView

public WavesetResult deleteView(ViewMaster vm,
                                java.lang.String id,
                                java.util.Map options)
                         throws WavesetException
Delete the repository objects that are associated with the view id. This usually doesn't do much more than the deleteObject method, but some objects need to perform special processing when they are deleted, such as launching a workflow. Since workflows are hooked into the create, modify, and update operations through the view handlers, it makes sense to encapsulate delete behavior here too, even though there isn't a view object being exchanged.

Throws:
WavesetException