Prerequisite: To instantiate an EJ element, there are three elements need to configure here: field mapping, JDBC DAO, and UDTT EJ. UDTT Element Factory uses the XML file to generate a UDTT EJ instance.
1 Use the following XML file sample for configuration:
Prerequisite: The most common operation of Electronic Journal (EJ) is to add an EJ record during traction. Add an EJ records you need to do the following steps:
1 Get a new instance of EJRecord using the method of getNewEJRecordInstance
2 Set the required data into the EJRecord. The setRestoreDetailDataToRecord, a member function of the EJUtils class, is to serialize the second parameter and assign the result to the RestoreDetailData, which is one of record's fix fields.
3 Call addRecord method to add the record into the repository
Note You don't have to destroy the EJ instance. Because EJ instance is instantiated with the UDTT Element Factory, the destroy function is called by the container automatically.
The UNICOM® Digital Transformation Toolkit (UDTT™) Electronic Journal Viewer (EJV) provides a SWT Composite that contains the query GUI and result presentation GUI. Those two parts are encapsulated in the Composite, but you can configure them in the XML file. Perform the following procedure to configure the EJV GUI:
1 Add the class mappings into the XML configuration file. It binds the XML tag name with the implementing class. For example: QueryConditionFieldDescriptor corresponds to the com.ibm.btt.bc.ej.viewer.config.QueryConditionFieldDescriptor java class. Use the following codes:
The following query condition GUI is generated by the above configuration code. User ID, Sequence Number, and Date are added by the UDTT EJ automatically.
3 Configure the result fields in UDTT Element Factory XML configuration file. For example:
The UNICOM® Digital Transformation Toolkit (UDTT™) Electronic Journal Viewer (EJV) provides an EJViewerComposite wrapped org.eclipse.swt.widgets.Composite, containing the query GUI and result presentation GUI. To use the UDTT EJV, add the EJV Composite to the UDTT RCP framework. Perform the following steps to use the EJV:
1 Add an EJV activity. Open the UDTT RCP framework, extend com.ibm.btt.rcp.activity.activities, and add activity EJViewer. The following figure displays the Extension Element Details panel:The com.ibm.btt.bc.common.activity.BCActivity class is in the com.ibm.btt.bc.common plugin, and shared as activity class for nearly all UDTT Business Components. The parameter of the EJ Viewer activity is a string integrated by two parts. The first part is com.ibm.btt.bc.ej.viewer.impl.EJViewerCompositeFactory which is provided by UDTT EJV, and the second is ejvconfig which is the ID of EJViewerConfigurationObject you have configured in the XML file.
2 Add the navigation item for EJV. Extend com.ibm.btt.rcp.navigator.items, and add an item. The following figure displays the Extension Element Details panel:
The activityId is the ID of the EJ Viewer activity.
3 Add a few code. In the start method of Activitor, the following code should be added to initialize the UDTT Element Factory for Busniess Component:
InitManager.reset("jar:///btt/btt.xml"); BasicElementFactory ejFactory = new BasicElementFactory("jar:///com/ibm/btt/bc/ej/viewer/ut/ej.xml"); BTTFactory.setElementFactory(ejFactory);
After Completing This Task: Now the EJV can be used in the RCP application. Input the query conditions, click the query button, and then the result is displayed in the table.
Prerequisite: The UDTT EJV provides the EJRestroeTransactionXUIImp java class, which provides the EJRestoreTransactionListener interface for the recurrence. And the EJRestoreTransactionListener interface provides the restore method to implement recurrence.
public void restore(EJRecord record,Composite displayParent) throws Exception;
During the transaction, when you add an EJRecord, if you want the record to be recurred, store the transaction data in the RestoreData field and the XUI information in the RestoreDetailData field. The restore method will use the information to complete the recurrence.
For example, add EJRestroeTransactionXUIImp for recurrence in the UDTT Element Factory XML configuration file.
After Completing This Task: After the query results are retrieved and presented in the table, you can double-click one row to trigger the recurrence of the corresponding transaction.