Record Editor 0.88a

There have been a lot of changes since the last production version (not all are visible to the users).

See Changes for a complete list of changes, but briefly the changes are:

Change Requests

Problem / Change / Feature requests are welcome can be made at any of:

Note: At the RecordEditor Forum there are currently forums entries for Feature Requests and User Interface requests.

Note: I do actually appreciate when people report problems, I may not fix them straight away but I generally try to fix them.

Installing

Platform Command
WindowsRun RecordEdit_Installer_for_HSQL_0.86.exe

Upgrading

Upgrading from version 0.68 or latter

To upgrade I would suggest

DB Location (Windows 7 / Vista) C:\Users\<user_id>\RecordEditor_HSQL\Database\recordedit.script
DB Location (Windows XP) C:\Documents and Settings\<user_id>\RecordEditor_HSQL\Database\recordedit.script

Upgrading from version 0.67 or earlier

If upgrading from Version 0.67 or earlier, you will need to find and backup the database. See ReadMe_UpgradeFromPre68.html for more details.

 


 

Velocity Support

Velocity 1.7 is now included as Standard with the RecordEditor.

Velocity is "Template Engine", for those that do not know what means, it is a bit like a Mail-Merge function in a Word processor. In the RecordEditor it can be used to reformat a file.

Following is a Velocity Template to create a HTML Table from the PO Header records in a file. The Velocity Template loops through the Selected Records, You can access fields either via (RecordNumber, Field_Number) or Field_Name.

 5 &nbsp;&nbsp;
 6 <table CELLPADDING="3">
 7   <TR><TH BGCOLOR=blue><font color=white><b>&nbsp;&nbsp;$fileName&nbsp;&nbsp;</b></font></TH></TR>
 8 </table>
 9 &nbsp;
10 <table border="1">
11   <TR>
12     <TH ALIGN="LEFT" VALIGN="TOP" BGCOLOR="#DADADA">DC</TH>
13     <TH ALIGN="LEFT" VALIGN="TOP" BGCOLOR="#DADADA">Purchase Order</TH>
14     <TH ALIGN="LEFT" VALIGN="TOP" BGCOLOR="#DADADA">Supplier</TH>
15     <TH ALIGN="LEFT" VALIGN="TOP" BGCOLOR="#DADADA">Receipt Date</TH>
16     <TH ALIGN="LEFT" VALIGN="TOP" BGCOLOR="#DADADA">Receipt Time</TH>
17   </TR>
18 
19 #foreach( $rec in $records )
20  #if ( ${rec.getField(0, 0)} == "RH" )
21   <tr>
22     <td>${rec.getField("Brand Dc No Rh")}</td>
23     <td>${rec.getField("Order No Rh")}</td>
24     <td>${rec.getField("Sup Id Rh")}</td>
25     <td>${rec.getField("Receipt Date Rh")}</td>
26     <td>${rec.getField("Receipt Time Rh")}</td>
27   </tr>
28  #end
29 #end
30 </table>
31 <p>&nbsp;<p>

There are several Sample skeletons supplied. These all work with RecordEditor objects.

Sample Velocity Skeletons

Skeleton Description
toCsv_Comma.vmConvert file to a comma delimited CSV file.
TablePerRowPreferedLayout.vmConvert file to a HTML one table per message.
AmsReceiptHtml2.vmShows accessing fields by name (RecordEditor name).
zXmlStyleSheet1.vmProcessing the "Expanded Tree".

 


 

Velocity / Script Variables

Variables available in velocity templates / scripts include

Variable Command
$layoutRecordEditor File Description (or layout).

${layout.getFileDesc()}

$recordsList of RecordEditor Lines for single message files there will be one element, for delimited files multiple.
$treeRootThis Tree display root (A java MutableTreeNode). This will be File element with no data associated with it.
$treeNodesThis is list of list of Tree Nodes. The example zXmlStyleSheet1.vm uses this variable, it reformats Xsl Transforms.
This code should retrive all the nodes
1 #foreach( $nodeList in $treeNodes )
2 #*  *##set( $lastElement = $nodeList.size() - 1)
3 #*  *##set ( $rec = $nodeList.get($lastElement).getLine())
4 #end
$RecordEditorDataRecordEditor Data, Fields include:
  • ${RecordEditorData.view} gets the current file view. This field implements Iterable, so you can loop through all lines.
  • ${RecordEditorData.view.getBaseFile()} gets the current file. This field implements Iterable, so you can loop through all lines.
  • ${RecordEditorData.view.htmlCharsToVars(someString)} This method will return a String with HTML control characters (<, > etc) replaced by the appropriate variables.

 


 

Script Support

With RecordEditor 0.88 you can use various scripting languages to write a file being editted (or selected portion of the File) to an output file. Currently scripting is fairly limitted (see Script Variables) but if you are going to use the Scripting option, let me know what you want / need.

On installation you will have EMCA Script (Javascript). Other Scripting languages like Jython or JRuby can be added:

Following is a Jython Script to export the Current file as a Comma Delimited file:

 1 ###
 2 ###   This will loop through all the selected Records.
 3 ###   For protocol buffers / Avro Editors, child records will 
 4 ###   not be included
 5 ###
 6 
 7 print 'hello from python'
 8 print outputFile
 9 my_file = open(outputFile,'w')
10 
11 for line in records:
12         idx = line.getPreferredLayoutIdx()
13         count = layout.getRecord(idx).getFieldCount()
14         i = 0
15         sep = ''
16         
17         while i < count:
18                 my_file.write(sep)
19                 
20                 v = line.getField(idx, i)
21                 if (v is None):
22                         v = ""
23 
24                 my_file.write(str(v))
25                 sep = ','
26                 i = i + 1
27         my_file.write('\n')
28 
29 my_file.close()
30 

Note: Adding a scripting language will slow down the RecordEditor startup (Particularly Jython).

 

 


 

 

Record Selection Screen

To start the Record selection editor Press the appropriate button on the record group screen:

On the record Selection you enter fields and the criteria

For the Field, operator and value fields just enter the values. For the And / Or value you can change by clicking on the And / Or, it will swap

The screen only supports simple expressions of the form

        (     field1 = value1
          and field2 = value2
          and field3 > value3
         )
      or (    field4 < value4
          and field5 > value5
         )
      or (    field6 = value6
          and field7 > field8
             ..........

             

The system only supports simple Or ~ And Expressions. It does not support complicated expressions or And ~ Or expressions.

If Field values are entered at the Group level They will be included as well.

The above will be interpreted as

       Record Type = S1
  and
      (
          (    f1  = v1
           and f2  = v2
          )
       or (    f3  = v3
           and f4  = v4
          )
      )
 


Thanks

Creation of Software takes a lot of effort and I would like to thank the creators of the following open source packages (used by the RecordEditor):

 

I also use:

 


Changes

All the changes since "production" release (0.69.1) are listed in the following sections

Release 0.88a

Release 0.88

Release 0.86

Release 0.85

Release 0.80.6

Release 0.80.2

On the SaveAs/Export screen there is

Release 0.80.1 Tree (including Xml)