org.apache.myfaces.tobago.model
Class AbstractCrud

java.lang.Object
  extended by org.apache.myfaces.tobago.model.AbstractCrud
All Implemented Interfaces:
Crud

public abstract class AbstractCrud
extends Object
implements Crud


Constructor Summary
protected AbstractCrud()
           
 
Method Summary
 String cancelItem()
          Managed bean (controller) method to exit the crud detail view without saving.
 String createItem()
          Managed bean (controller) method to create a new item on the CRUD detail view.
 String deleteItem()
          Managed bean (controller) method to delete an selected item.
protected abstract  boolean doCreateItem()
           Hook for the implementation of business logic, after invoking the action createItem().
protected abstract  boolean doDeleteItem()
           Hook for the implementation of business logic, after invoking the action deleteItem().
protected abstract  boolean doSaveItem()
           Hook for the implementation of business logic, after invoking the action saveItem().
protected abstract  boolean doShowItem()
           Hook for the implementation of business logic, after invoking the action showItem().
 String editItem()
          Managed bean (controller) method to show and edit an selected item on the CRUD detail view.
protected  String getDefaultOutcome()
           
 boolean getShowDetail()
          Indicates if the crud component should show the crud detail view otherwise the crud master view is shown
 boolean isItemEditable()
          Indicates wether an item shown in the CRUD detail view is editable.
protected  void reset()
          Helper mehtod to reset the controllers attributes.
 String saveItem()
          Managed bean (controller) method to save changes to a existing item or save a newly created item on the crud detail view.
 void setDefaultOutcome(String defaultOutcome)
          Set the outcome for all actions of the crud component.
 String showItem()
          Managed bean (controller) method to show an selected item on the CRUD detail view.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCrud

protected AbstractCrud()
Method Detail

getShowDetail

public final boolean getShowDetail()
Description copied from interface: Crud
Indicates if the crud component should show the crud detail view otherwise the crud master view is shown

Specified by:
getShowDetail in interface Crud
Returns:
True if the detail view should be shown, false if the master view should be shown
See Also:
Crud.getShowDetail()

isItemEditable

public final boolean isItemEditable()
Description copied from interface: Crud
Indicates wether an item shown in the CRUD detail view is editable.

Specified by:
isItemEditable in interface Crud
Returns:
true if the shown item is editable, false if not
See Also:
Crud.isItemEditable()

deleteItem

public final String deleteItem()
Description copied from interface: Crud
Managed bean (controller) method to delete an selected item.

Specified by:
deleteItem in interface Crud
Returns:
The outcome after the method was executed
See Also:
Crud.deleteItem()

doDeleteItem

protected abstract boolean doDeleteItem()

Hook for the implementation of business logic, after invoking the action deleteItem(). If the execution of the business logic completed successfully, the method has to return true. Otherwise the method has to return false.

Returns:
true if the method completed sucessfully, false if not

showItem

public final String showItem()
Description copied from interface: Crud
Managed bean (controller) method to show an selected item on the CRUD detail view.

Specified by:
showItem in interface Crud
Returns:
The outcome after the method was executed
See Also:
Crud.showItem()

editItem

public final String editItem()
Description copied from interface: Crud
Managed bean (controller) method to show and edit an selected item on the CRUD detail view.

Specified by:
editItem in interface Crud
Returns:
The outcome after the method was executed
See Also:
Crud.editItem()

doShowItem

protected abstract boolean doShowItem()

Hook for the implementation of business logic, after invoking the action showItem(). If the execution of the business logic completed successfully, the method has to return true. Otherwise the method has to return false.

Returns:
true if the method completed sucessfully, false if not

createItem

public final String createItem()
Description copied from interface: Crud
Managed bean (controller) method to create a new item on the CRUD detail view.

Specified by:
createItem in interface Crud
Returns:
The outcome after the method was executed
See Also:
Crud.createItem()

doCreateItem

protected abstract boolean doCreateItem()

Hook for the implementation of business logic, after invoking the action createItem(). If the execution of the business logic completed successfully, the method has to return true. Otherwise the method has to return false.

Returns:
true if the method completed sucessfully, false if not

saveItem

public final String saveItem()
Description copied from interface: Crud
Managed bean (controller) method to save changes to a existing item or save a newly created item on the crud detail view.

Specified by:
saveItem in interface Crud
Returns:
The outcome after the method was executed
See Also:
Crud.saveItem()

doSaveItem

protected abstract boolean doSaveItem()

Hook for the implementation of business logic, after invoking the action saveItem(). If the execution of the business logic completed successfully, the method has to return true. Otherwise the method has to return false.

Returns:
true if the method completed sucessfully, false if not

cancelItem

public final String cancelItem()
Description copied from interface: Crud
Managed bean (controller) method to exit the crud detail view without saving.

Specified by:
cancelItem in interface Crud
Returns:
The outcome after the method was executed
See Also:
Crud.cancelItem()

getDefaultOutcome

protected final String getDefaultOutcome()
Returns:
The outcome for the actions of the crud component

setDefaultOutcome

public final void setDefaultOutcome(String defaultOutcome)
Set the outcome for all actions of the crud component.

Parameters:
defaultOutcome - The outcome for all actions of the crud component

reset

protected void reset()
Helper mehtod to reset the controllers attributes.



Copyright © 2002-2011 Apache Software Foundation. All Rights Reserved.