Skip to main content
Jump to: navigation, search

Difference between revisions of "Riena/New And Noteworthy"

(M6)
(Navigation)
Line 65: Line 65:
 
</source>
 
</source>
  
 
+
====MessageBox====
 
[[Image:riena_messagebox_example.png]]
 
[[Image:riena_messagebox_example.png]]
  

Revision as of 10:19, 11 December 2008

M6

Navigation

  • The extension points "org.eclipse.riena.navigation.navigationNode" and "org.eclipse.riena.navigation.subModule" have been replaced by the new extension point "org.eclipse.riena.navigation.assemblies" that combines their functionality
  • It is now possible to use a hierarchical structure for modulegroup↔module↔submodule definitions within an assembly extension element reflecting the structure of the resulting navigation tree
  • There is a GenericNavigationAssembler that is able to create a sub tree from this description eliminating the need for custom INavigationAssembler (formerly INavigationNodeBuilder) implementations in most cases

→ Details

The module "UIProcess" from the Riena example client eg is completely defined declarative (except for the view and controller implementation, of course):

Riena Cient UIProcess.PNG

<assembly
    id="org.eclipse.riena.example.uiProcesses"
    name="uiProcesses_definition"
    parentTypeId="playground">
  <modulegroup
      name="uiProcesses_group"
      typeId="org.eclipse.riena.example.uiProcesses">
    <module
        name="uiProcesses"
        label="UIProcess"
        icon="org.eclipse.riena.example.client:/icons/ledred.png"
        closeable="false">
      <submodule
          typeId="org.eclipse.riena.example.uiProcess_1"
          name="uiProcess_1"
          label="Demo1"
          icon="org.eclipse.riena.example.client:/icons/ledlightgreen.png"
          view="org.eclipse.riena.example.client.views.UIProcessDemoSubModuleView"
          controller="org.eclipse.riena.example.client.controllers.UIProcessDemoSubModuleController"/>
      <submodule
          typeId="org.eclipse.riena.example.uiProcess_2"
          name="uiProcess_2"
          label="Demo2"
          view="org.eclipse.riena.example.client.views.UIProcessDemoSubModuleView"
          controller="org.eclipse.riena.example.client.controllers.UIProcessDemoSubModuleController"/>
    </module>
  </modulegroup>
</assembly>

Labels and other string value attributes may contain variables that are automatically replaces by their values upon node creation. → Details

<module
   label="Customer ${riena.navigation.nodeid:instanceId}"
   typeId="com.acme.customer.edit.module">

Multiple instances of the same submodule may be created depending on the number of objects in a collection or array. → Details

<foreach element="account" in="${riena.navigation.parameter:accounts}">
   <submodule
         label="Account ${riena.navigation.nodecontext:account.accountNo}"
         typeId="com.acme.customer.edit.account"
         instanceId="${riena.navigation.nodecontext:account.accountNo}"
         controller="..."
         view="..."/>
</foreach>

MessageBox

Riena messagebox example.png

  • First create control in the view:
// Create MessageBox control in view:
MessageBox messageBox = UIControlsFactory.createMessageBox(parent);
addUIControl(messageBox, "messageBox");

and obtain ridget in controller:

// Obtain MessageBoxRidget in controller:
IMessageBoxRidget messageBoxRidget = (IMessageBoxRidget) getRidget("messageBox");
  • Then configure ridget MessageBoxRidget:
// Configure MessageBoxRidget:
messageBox.setType(IMessageBoxRidget.Type.QUESTION);
messageBox.setTitle("Bridgekeeper");
messageBox.setText("What is your favourite colour?");
// Set options
IMessageBoxRidget.MessageBoxOption[] customOptions = new IMessageBoxRidget.MessageBoxOption[] {
new IMessageBoxRidget.MessageBoxOption("Blue"),
new IMessageBoxRidget.MessageBoxOption("Yellow")};
messageBox.setOptions(customOptions);
  • And show message box:
// Show MessageBoxRidget and get result:
IMessageBoxRidget.MessageBoxOption selectedOption = messageBox.show();
  • Items in a tree ridget can be disabled, by binding to a boolean property of the model element.
MyModel[] roots = { root1 };
MyModel element = ...;
// bind MyModel.isEnabled() or MyModel.getEnabled() to the enablement of a tree item
treeRidget.bindToModel(roots, MyModel.class, "children", "parent", "value", "enabled", null);
element.setEnabled(false); // will disable the 'element' item in the tree

Riena tree ridget with disabled items.png

  • Items in a tree ridget can be hidden, by binding to a boolean property of the model element.
MyModel[] roots = { root1 };
MyModel element = ...;
// bind MyModel.isAvailable() or MyModel.getAvailable() to the visibility of a tree item
treeRidget.bindToModel(roots, MyModel.class, "children", "parent", "value", null, "available");
element.setAvailable(false); // will hide 'element' item in the tree

Communication

Riena communication now attaches the called method name and a request id to the URL of each remote service call. So if you check your access log you see something like

yourhost 111.111.111.111 - 2008-11-22 13:15:12 POST /demo/hessian/CustomerWS?loadCustomer&RID-e5n70jkb HTTP/1.1 200

So you not only see the service "CustomerWS" but also the called method "loadCustomer" and a unique requestId "RID-e5n70jkb". The requestId can be used to track calls through your infrastructure (say you have logs in your loadbalancer, apache, tomcat whatever you can be sure to always find the correlated entries in the individual access.log files.

DialogView

Used to build dialogs that use the Riena concept of views and controllers (see also riena snippets).

Riena dialogView.png

  • Provide the view for the example dialog:
/**
 * The view for the example dialog.
 */
public class MyDialogView extends DialogView {
 
	public MyDialogView() {
                // specify null as parent composite here (default is the workbench shell)
		super(null);
	}
 
	protected AbstractWindowController createController() {
		return new MyDialogController();
	}
 
	protected Control buildView(Composite parent) {
 
		super.buildView(parent);
 
		Composite composite = new Composite(parent, SWT.NONE);
		composite.setLayout(new GridLayout(2, false));
 
		UIControlsFactory.createLabel(composite, "Input"); //$NON-NLS-1$
		Text input = UIControlsFactory.createText(composite);
		addUIControl(input, MyDialogController.RIDGET_ID_INPUT);
 
		Button okButton = UIControlsFactory.createButton(composite);
		okButton.setText("Ok"); //$NON-NLS-1$
		addUIControl(okButton, MyDialogController.RIDGET_ID_OK);
                ...
       }
}
  • Provide the controller for the example dialog:
/**
 * The controller for example dialog.
 */
public class MyDialogController extends AbstractWindowController {
 
	public static final String RIDGET_ID_INPUT = "input"; //$NON-NLS-1$
	public static final String RIDGET_ID_OK = "okButton"; //$NON-NLS-1$
 
	public void configureRidgets() {
 
		super.configureRidgets();
 
		getWindowRidget().setTitle("My Dialog"); //$NON-NLS-1$
 
		ITextRidget input = (ITextRidget) getRidget(RIDGET_ID_INPUT);
		input.setText("Input please"); //$NON-NLS-1$
 
		IActionRidget okAction = (IActionRidget) getRidget(RIDGET_ID_OK);
		okAction.addListener(new IActionListener() {
			public void callback() {
                                ...
				getWindowRidget().dispose();
			}
		});
                ...
       }
}
  • Build and open the example dialog:
	new HelloDialogView().build();

Global Exception Handling

Riena now includes a global exception handler manager which is called if an exception occurs and is caught by the framework. You can register one or multiple Exception Handler through an extension like this:

<extension
         point="org.eclipse.riena.core.exception.handlers">
      <exceptionHandler
            class="org.eclipse.riena.internal.core.exceptionhandler.SimpleExceptionHandler"
            name="Simple riena core handler">
      </exceptionHandler>
   </extension>

An Exception has a name (for documentation and reference), a class (that has to implement IExceptionHandler) and a before attribute. "before" references the name of any other exceptionhandler before this exception handler must be called. a blank or null value puts the exceptionhandler at the end. The framework currently makes these calls in server tier when calling the remote service and in the ui thread. The global exception handler has a chance to handle the exception and acknowledge that it did by returning OK:

return Action.Ok;

If it didnt handle this exception than it should return

return Action.NotHandled

After the exceptionhandler is called the exception still thrown. Exception Handlers are intended to allow logging or display of a message dialog or any kind of notification as appropriate. They don't make exception handling in general unnecessary.

Client Monitoring

Client monitoring is similar to the Eclipse Usage Data Collector [1], i.e. both collect data on the client and transfer this data to a server for further processing. Riena's client monitoring is capable of collecting data from various sources (e.g. logs, custom logs, usage data of course too, ..) and is of course extensible.

Riena clients are typically used for business applications. For this type of application it is viable for operators (better word here!) to be informed of problems or failures before users stumble upon them. This can be achieved with the client monitoring. This automatically generated information is often more precise than bug reports.

You can have a brief look at this feature within our example client application (Bundle: org.eclipse.riena.example.client, Launch configuration: SWT ExampleApplication.launch). To activate the monitoring you have to add the bundle org.eclipse.riena.monitor.client to the launch configuration and modify the plugin.xml. Within the plugin.xml search for "org.eclipse.riena.monitor.collector". There are two extensions in comments. Remove the comments. Now the example is ready to run. Before you do this, start the Riena Sample App Server (Bundle: org.eclipse.riena.sample.app.server, Launch configuration: Riena Sample App Server.launch). When the example client is up navigate to "Playground" >> "LogCollector". Here it is possible to create log and custom log events. If you create a log event with level warn or error all collected events up to this time will be transferred to the server. The server will print the received log events to the console.

A more in depth "Getting started" will follow soon.

M5

  • Made Riena View Parts (i.e. subclasses of SubModuleView) usable in RCP. The necessary steps are described in bug 247102.
  • [Marker] Disabled fields should show no content (feature request) (bug 245630)
// Disabling a ridget
ISingleChoiceRidget ridget;
ridget.setEnabled(false);

Riena disabled ridget.png

  • [Marker] Lock the selection in Tree and Table ridgets that are output only (bug 245632)
  • Added a NumericTextRidget. It supports an arbitrary number of digits. Grouping can be turned on or off. Negative numbers can be allowed or blocked. It can automatically mark negative numbers red (can be disabled). See INumericValueTextFieldRidget for more info.
// Create special SWT Text widget in view:
Text text = UIControlsFactory.createTextNumeric(parent), "txtInteger");
addUIControl(text, "txtInteger");
// Obtain NumericTextRidget in controller:
INumericValueTextFieldRidget numericTextRidget = (INumericValueTextFieldRidget) getRidget("txtInteger");

Riena numeric text ridget.png

  • Added a DecimalTextRidget. It has a fixed number of decimal and fraction digits. Grouping can be turned on or off. See IDecimalValueTextFieldRidget for more info.
// Create special SWT Text widget in view:
Text text = UIControlsFactory.createTextDecimal(parent), "txtDecimal");
addUIControl(text, "txtDecimal");
// Obtain DecimalTextRidget in controller:
IDecimalValueTextFieldRidget decimalTextRidget = (IDecimalValueTextFieldRidget) getRidget("txtDecimal");

Riena decimal text ridget.png

  • Added a DateTextRidget. It supports structured editing of a formatted date/time/date-time String, according to a predefined formatter pattern. See IDateTextFieldRidget for more info.
// Create special SWT Text widget in view:
Text text = UIControlsFactory.createTextDecimal(parent), "txtDate");
addUIControl(text, "txtDate");
// Obtain DecimalTextRidget in controller:
IDateTextFieldRidget  dateTextRidget = (IDateTextFieldRidget  ) getRidget("txtDate");
dateTextRidget.setFormat(IDateTextFieldRidget.FORMAT_DDMMYYYY);

Riena date text ridget.png

  • IServicePublisher modified unpublish method: It used to get a path as parameter which was enough for Hessian and some SOAP implementation but not flexible enough. Now it receives the full RemoteServiceDescription Object which contains among other things the path
  • GenericObjectCache has a few tests now and supports generics for key and value
  • Riena's security is changing to no longer be based on JAAS directly but on Equinox Security
    • first step is to base the authentication process on Equinox Security's model with extension points for login module, callbackhandler etc.
    • some refactoring for authorization were done
  • Until there is a need expressed we will stop doing extensive testing using the java SecurityManager because its pretty uncommon that Equinox Container run within a SecurityManager environment
  • removed all dependencies to ConfigurationAdmin. Now all configuration for URLs (i.e. hostname) is done using core.variables
  • Nodes of the navigation (e.g. module or sub-application) can be disabled or hidden. (At the moment disabled or hidden sub-module are not displayed correct)
    Navi.png
    Image 1: All modules are enabled and visible
    NaviModuleDisabled.png
    Image 2: Module "Module 1.1.2" is disabled
    NaviModuleHidden.png
    Image 3: Module "Module 1.1.2" is hidden
public interface INavigationNode extends IMarkable {
  ...
	void setVisible(boolean visible);
 
	boolean isVisible();
 
	void setEnabled(boolean enabled);
 
	boolean isEnabled();
  ...
}

M4

Collection Information about New and Noteworthy for M4

  • support Attachments (binary blobs) in Remote Service calls
    • ability to create an "Attachment" object (a java object from Riena) from a URL, InputStream or File and pass it as parameter or return it from a method call
    • the Attachment can read on the target as if it where a local container
  • improved Exception handling for remote services
    • calls to remote services no longer return RemoteFailure with the real exception nested inside but they return the actually exception. we check that this exception is actually allowed by the method signature so the client isnt "surprised", we also let RuntimeExceptions go through. For checked exceptions like IOExceptions Riena nicely wraps them in a RemoteFailure
  • Ridgets for Trees and Trees with columns.

Riena treetable.png

  • Menu Bar and Tool Bar (Cool Bar) below sub-application switcher
  • Status Line (with message, number, date and time)
  • Resizing of shell (without OS-Shell-Border)
  • After adding / removing validation rules from an IEditableRidget you can now invoke revalidate() to update the ridget's validation state:
IEditableRidget ridget;
ridget.removeValidationRule(numbersOnly);
ridget.revalidate();
  • The TableRidget and TreeTableRidget will automatically show checkbox images on columns that contain a boolean value. Riena table with checkbox.png
  • The TreeTableRidget now supports "grouping" for tree nodes. Enabling grouping, will hide the column values for rows that contain a tree node that has children. See IGroupedTreeTableRidget for details.
TreeTableRidget ridget;
ridget.setGroupingEnabled(true);

Riena grouped tree table.png

  • SingleChoiceRidget and MultipleChoiceRidget have been implemented.

Riena choice ridgets.png

  • ITreeRidget.setRootsVisible(boolean) can be used to hide / show the root node in a ITreeRidget
  • two new extension points added to configure navigation targets in the tree-like Riena UI application model
    • INavigationNodeId added to identify nodes
      • the interface INavigationNode was extended with a new method getNodeId() that returns an INavigationNodeId
      • an INavigationNodeId has a 'type' part and an 'instance' part both being arbitrary Strings. It is suggested to use a package-like naming for the typeId to ensure uniqueness across an application
      • the typeId defines the type of a node like 'com.acme.banking.bankingSubApplication' or 'com.acme.banking.accountModule'
      • the instanceId is used to distinguish between nodes of the same type like multiple account nodes with different account numbers. The instanceId is optional and may be null for nodes of which only one instance can exist.
    • INavigationNode.navigate(INavigationNodeId) method added to navigate to another node
      • if a node with the specified ID exists it is activated
      • if no node is found a new instance is created first
      • INavigationNode.create(INavigationNodeId) only creates nodes without activating them and may be used for initialization
    • extension point "org.eclipse.riena.navigation.navigationNodeType"
      • defines how to create nodes of a given typeId
      • an implementation of the interface INavigationNodeBuilder returns a single navigation node or the root of a new subtree in the application model
      • parentTypeId sets where to place the new node in the application model. If the parent node does not exist it will be created too
      • the class of the parent node must be the one required for the created node e.g. an ISubApplicationNode for an IModuleGroupNode
    • extension point "org.eclipse.riena.navigation.subModuleType"
      • defines how to represent a sub module in the work area. A sub module is the only navigation node in the Riena UI that does not come with a default presentation
      • view refers to an "org.eclipse.ui.view" extension
      • controller must be a subclass of IController. An instance is created for every submodule node and equiped with a set of Ridgets that is bound to the UI-widgets in the view
<extension point="org.eclipse.riena.navigation.navigationNodeType">
   <navigationNodeType
         typeId="com.acme.example.barModule"
         nodeBuilder="com.acme.example.FooModuleBuilder"
         parentTypeId="com.acme.example.fooModuleGroup" />
</extension>
<extension point="org.eclipse.riena.navigation.subModuleType">
   <subModuleType
         typeId="com.acme.example.bazSubModule"
         view="com.acme.example.BazSubModuleView"
         controller="com.acme.example.BazSubModuleController" />
</extension>
  • Riena now provides UIProcesses for easy synchronization and visualization of parallel jobs
    • Based on eclipse jobs API
    • Integration of exisiting eclipse jobs
    • Dialog visualizing activity and progress
    • Support for visual contexts (describing under which circumstances an UIProcess is visualized)
    • Thread-Serialized callback methods (initialUpdateUi, updateUi, finalUpdateUi)

Uiprocess2.JPG

  • Markers in navigation tree

Error and mandatory marker are displayed in the navigation tree for these sub modules that have marked widgets.

TreeItemMarker.png

  • Riena now supports sending Attachments (binary large chunks) as parameter or returnvalues in remote service calls, data is transferred in the remote service call.
  • Modular Riena - New RCP example: The project org.eclipse.riena.sample.client.rcpmail shows how to use Ridgets in a regular RCP application/ViewPart, without using the rest of Riena. This may be interesting for developers that want to utilize Riena's Ridget concept without fully migrating their RCP application to Riena.
  • Code Snippets: Created a wiki page with code samples that teach you how to use Ridgets. We'll keep adding more examples as the project progresses.
  • Output markers: Ridgets with an output marker are "read only". Their content cannot be changed by the user.
ITextFieldRidget ridget;
ridget.setOutputOnly(true);
  • Mandatory markers: Ridgets with a mandatory marker must be filled out by the user.

Riena mandatory.png

ITextFieldRidget ridget;
ridget.setMandatory(true);

Copyright © Eclipse Foundation, Inc. All Rights Reserved.