org.openfjord.business.workflow
Class ElementManagerDelegate

java.lang.Object
  |
  +--org.openfjord.business.workflow.ElementManagerDelegate
All Implemented Interfaces:
ElementManager

public class ElementManagerDelegate
extends java.lang.Object
implements ElementManager

Title: openFJORD

Description: open Flexible Java Online Research Designer

Copyright: Copyright (c) by Ingo Düppe 2003

Company: University of Muenster

Implementation of the business delegate pattern.

Usage:
ElementManager manager = new ElementManagerDelegate();

Version:
1.0
Author:
Ingo Düppe
See Also:
ElementManager, ElementManagerBean

Constructor Summary
ElementManagerDelegate()
          Constructor, initialize the delegate class
 
Method Summary
 SurveyElementContainer addElement(SurveyElement element, SurveyElementContainer parent)
          This method will create a new server side element and will add it to the parent element.
 SurveyElementContainer deleteElement(SurveyElement element)
          Deletes a specific service side element specified by the primary key information of the value object
 SurveyElementContainer getContainer(java.lang.String elementId)
          Returning a survey element container with his sub elements defined by his primary key.
 SurveyElementContainer getContainer(SurveyElement element)
          Returning a survey element container with his sub elements defined by his value object.
 SurveyElementContainer moveElement(SurveyElement element, int offset)
          Moves the element to a new position in the same container
 SurveyElementContainer moveElement(SurveyElement element, SurveyElementContainer destination)
          Moves the element from the current parent container to the new parent container
 SurveyElementContainer updateContainer(SurveyElementContainer container)
          Updates the server side element container with new data.
 SurveyElementContainer updateElement(SurveyElement element)
          Updates the server side element with new data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementManagerDelegate

public ElementManagerDelegate()
Constructor, initialize the delegate class

Method Detail

getContainer

public SurveyElementContainer getContainer(SurveyElement element)
                                    throws NoElementContainerException
Description copied from interface: ElementManager
Returning a survey element container with his sub elements defined by his value object. The receiving container object contains the parent object and his direct sub elements.

Specified by:
getContainer in interface ElementManager
Returns:
the container with sub elements of the first level
NoElementContainerException

getContainer

public SurveyElementContainer getContainer(java.lang.String elementId)
Description copied from interface: ElementManager
Returning a survey element container with his sub elements defined by his primary key. The receiving container object contains the parent object and his direct sub elements.

Specified by:
getContainer in interface ElementManager
Parameters:
elementId - the primary key of the element container
Returns:
the container with sub elements of the first level

updateContainer

public SurveyElementContainer updateContainer(SurveyElementContainer container)
Description copied from interface: ElementManager
Updates the server side element container with new data. This method will not update any sub elements.

Specified by:
updateContainer in interface ElementManager
Parameters:
container - value object with the new data
Returns:
SurveyElementContainer with updated fields

addElement

public SurveyElementContainer addElement(SurveyElement element,
                                         SurveyElementContainer parent)
Description copied from interface: ElementManager
This method will create a new server side element and will add it to the parent element. If the element value object contains primary key information of a server side element, it will add this element to the parent container.

Specified by:
addElement in interface ElementManager
Parameters:
element - the new element
parent - element will add to the parent container object
Returns:
SurveyElementContainer with all direct sub elements even the new one.

updateElement

public SurveyElementContainer updateElement(SurveyElement element)
Description copied from interface: ElementManager
Updates the server side element with new data. It is mandatory that this value object containing a primary key information of the server side element.

Specified by:
updateElement in interface ElementManager
Parameters:
element - value object with new data.
Returns:
SurveyElementContainer which containing the updated element as sub element

deleteElement

public SurveyElementContainer deleteElement(SurveyElement element)
Description copied from interface: ElementManager
Deletes a specific service side element specified by the primary key information of the value object

Specified by:
deleteElement in interface ElementManager
Parameters:
element - value object containing primary key information
Returns:
SurveyElementContainer without the deleted element

moveElement

public SurveyElementContainer moveElement(SurveyElement element,
                                          int offset)
Description copied from interface: ElementManager
Moves the element to a new position in the same container

Specified by:
moveElement in interface ElementManager
Parameters:
element - the value object
offset - new position relative to the old
Returns:
SurveyElementContainer with the new position of the element

moveElement

public SurveyElementContainer moveElement(SurveyElement element,
                                          SurveyElementContainer destination)
Description copied from interface: ElementManager
Moves the element from the current parent container to the new parent container

Specified by:
moveElement in interface ElementManager
Parameters:
element - the value object of the server side element with primary key information
destination - new parent container object
Returns:
SurveyElementContainer with the new position of the element


openFJORD Copyright © 2003 University of Muenster.