com.softwareag.mdm.ui
Class UIBeanEditor

java.lang.Object
  extended bycom.softwareag.mdm.ui.UIBeanEditor

public abstract class UIBeanEditor
extends Object

Abstract class for implementing user interface components on master data. A user interface editor displays and modifies the value hold by an adaptation node.

Schema definition

A specific user interface component may be associated to any element declaration that is a terminal value or under a terminal value (see SchemaNode.isTerminalValue()). The component must be declared under the element xs:annotation/xs:appinfo:

 <xs:annotation>
   <xs:appinfo>
     <mdm:uiBean class="com.foo.MyUIBean" />
   <xs:appinfo>
 </xs:annotation>
where com.foo.MyUIBean is the fully qualified name of a class implementing this interface. The declaration may also use parameters:
 <mdm:uiBean class="com.foo.MyUIBean">
        <param1>...</param1>
        <param2>...</param2>
 </mdm:uiBean>
where param1 and param2 are JavaBean properties of com.foo.MyUIBean class.

For more information, read JavaBeans specification.

Schema definition through BeanInfo declaration

This option is only needed when the developer does not want to repeat the schema declaration <mdm:uiBean class="..."> each time a JavaBean class is referenced in schemas.

When a schema node is associated to a JavaBean (by attribute mdm:class="..."), it is possible to specify once the association between the JavaBean and its default UIBeanEditor. This association is declared by the standard BeanInfo extension class. This class extends java.beansSimpleBeanInfo and it must implement the following method:

  public BeanDescriptor getBeanDescriptor()
  {
      return new BeanDescriptor(MyBean.class, UIMyBean.class);
  }
	

Life-cycle

  1. When an webMethods Master Data Manager session generates HTTP response including a bean editor, the class specified is instantiated through its default constructor and the JavaBean properties' setters are called (in the example above, setParam1(...) and setParam2(...)). Then, one of the methods addFor... is called.
  2. When the page generated in the previous step is submitted and the server receives corresponding HTTP request, then this is the same instance that is responsible for handling the parameters of the HTTP request: methods shallValidateInput(UIRequestContext) and optionally validateInput(UIRequestContext) are called.

Multi-threading

webMethods MDM container ensures that an instance executes no more than one thread at a given time.

Behaviour for Lists

If this editor applies to a complex node with maxOccurs > 1, it is instanciated for the List and also for each occurrence in the list.

In order to distinguish the whole List from one of its item, the developer can check current context path. For example:

 public void addForEdit(UIResponseContext aContext);
 {
   Step step = aContext.getPathInAdaptation().getLastStep();
   if (step.isIndexed())
   {
     int i = step.getIndex();
     // Editor applies to occurrence at index i
     .../...
   }
   else
   {
     // Editor applies to the list
     // Use the default behaviour for default list management
     aContext.addUIBestMatchingEditor(Path.SELF, "");
   }
 }
	

See Also:
Step.isIndexed()

Constructor Summary
UIBeanEditor()
           
 
Method Summary
abstract  void addForDisplay(UIResponseContext aResponse)
          Adds HTML or DHTML content to HTTP response.
abstract  void addForEdit(UIResponseContext aResponse)
          Adds HTML or DHTML content to HTTP response.
abstract  void addForPrint(UIResponseContext aResponse)
          Adds HTML or DHTML content to HTTP response.
 boolean shallValidateInput(UIRequestContext aRequest)
          If this method returns true, user input associated with this editor will be validated.
 void validateInput(UIRequestContext aRequest)
          This method offers the opportunity to perform specific validation on user input.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UIBeanEditor

public UIBeanEditor()
Method Detail

addForDisplay

public abstract void addForDisplay(UIResponseContext aResponse)
Adds HTML or DHTML content to HTTP response. The resulting page should allow to display the current bean instance within webMethods Master Data Manager.


addForEdit

public abstract void addForEdit(UIResponseContext aResponse)
Adds HTML or DHTML content to HTTP response. The resulting page should allow to edit the current bean instance within webMethods Master Data Manager.


addForPrint

public abstract void addForPrint(UIResponseContext aResponse)
Adds HTML or DHTML content to HTTP response. The resulting page should allow to display the current bean instance in a printable page.


shallValidateInput

public boolean shallValidateInput(UIRequestContext aRequest)
If this method returns true, user input associated with this editor will be validated. It it returns false, user input is ignored beyond the execution of this method.

More precisely, user input validation implies first that the container validates automatically the input associated with each component that has been added via one of the addUI...() methods. Then the method validateInput() is called on this instance.

Default implementation returns always true.

See Also:
validateInput(UIRequestContext)

validateInput

public void validateInput(UIRequestContext aRequest)
This method offers the opportunity to perform specific validation on user input. It does typically by retrieving HTTP parameter values from the incoming request and checking them, so as to feed validation context with new converted values and/or with error messages.

This method is called only if the method shallValidateInput() has returned true and after the container has automatically validated the input associated with each component that has been added via one of the UIResponseContext.addUI...() methods.

Default implementation does nothing.

See Also:
shallValidateInput(UIRequestContext)


(report a bug)
webMethods MDM 4.2.8 [0558]
Copyright Software AG 2000-2007. All rights reserved.