Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EDT:How to move RBD app to EDT"

 
(21 intermediate revisions by 5 users not shown)
Line 1: Line 1:
An EDT project has different layout with an RBD project, the best way to make RBD code working in EDT is to create a new EDT project and copy the code to it. There have also been some changes to the EGL language that may require you to change your RBD-developed code to be modified prior to running on EDT. 
+
An EDT project has a different layout than an Rational Business Developer project. The best way to make Rational Business Developer code work in EDT is to create a new EDT project and copy the code to it. There have also been some changes to the EGL language that may require you to change your code before it can be run with EDT.&nbsp; In addition to the information mentioned below, a high level overview of changes can be found on the [[EDT:The_Differences_between_EDT_0.7.0_and_RBD|Differences between EDT 0.7.0 and IBM Rational Business Developer]] page.<br>
  
== Move code to an EDT project ==
+
== Move code to an EDT project ==
  
 
#Create a new EDT project.  
 
#Create a new EDT project.  
##If the application contains RUI Handlers, choose either '''Web2.0 client application''' or '''Web 2.0 client application with service''' depending on if the application also contains services.  
+
##If the application contains RUI Handlers, choose either '''Web 2.0 client application''' or '''Web 2.0 client application with service''' depending on whether the application contains services.  
##If the application contains only Programs and common code, choose '''Basic'''.
+
##If the application contains only Programs and common code, choose '''Basic'''.  
#Copy EGL files and packages from the RBD project to the EDT project
+
#Copy EGL files and packages from the Rational Business Developer project to the EDT project.
#Configure EGL Compiler and generators. Compiler setting is a new feature in EDT which allows setting of different generators for each package and file.  
+
#Configure the EGL Compiler and generators. The Compiler setting is a new feature in EDT which allows specifying generators for each package or file.  
##Select JavaScript Generator for Rich UI Handlers, Widgets and any common parts(Record, Library) which are referenced by Rich UI Handlers or Widgets
+
##Select JavaScript Generator for Rich UI Handlers, Widgets and any common parts (Record, Library) which are referenced by Rich UI Handlers or Widgets.
##Select Java Generator for Services, Programs and any common parts referenced by Services or Programs
+
##Select Java Generator for Services, Programs and any common parts referenced by Services or Programs.
##Common parts require both JavaScript Generator and Java Generator are suggest to be put into a separate package which is configured with both Generators
+
##Common parts that require both JavaScript Generator and Java Generator should be put into a separate package configured with both Generators.
##Compiler setting of a parent resource is inherited by the children. Setting the package is usually good enough.
+
##The compiler setting of a parent resource is inherited by the children, so setting at the package level is usually good enough.  
##Refactor package and code is sometimes necessary
+
##Refactoring packages and code is sometimes necessary.
 
+
  
 
== Modify EGL code  ==
 
== Modify EGL code  ==
This is a handy list of thing to modify. It is recorded when we move RBD samples and test apps to EDT.  
+
 
See the [http://wiki.eclipse.org/EDT:EGL_Language_conversion EGL Language conversion page] for more information about updates to EGL.  
+
#Use Organize Imports (Ctrl+Shift+O) to let EDT import the correct widgets and system parts. This is needed for almost all EGL files because of the package name changes.
The [http://wiki.eclipse.org/EDT:Code_snippets Code snippets page] is also a good place to find code.  
+
#Below is a handy list of things to modify. It is recorded when we moved Rational Business Developer samples and test apps to EDT. See the [[EDT:EGL Language conversion|EGL Language conversion page]] for more information about updates to EGL. The [[EDT:Code snippets|Code snippets page]] is also a good place to find code.
  
 
{| class="wikitable"
 
{| class="wikitable"
! style="width: 35%" | RBD
 
! style="width: 35%" | EDT
 
|Comments
 
 
|-
 
|-
|<source lang="java">
+
! bgcolor="#bbbbb0" align="center" style="width: 35%;" | Rational Business Developer
 +
! bgcolor="#bbbbb0" align="center" style="width: 35%;" | EDT
 +
! bgcolor="#bbbbb0" align="center" | Comments
 +
|-
 +
| <source lang="java">
 +
myInt int = 3;
 +
myInt int = null;
 +
</source>
 +
| <source lang="java">
 +
myInt int = 3;
 +
myInt int? = null;
 +
</source>
 +
| In Rational Business Developer, you could set a non-nullable variable to null (in certain cases). This is not allowed in EDT. You must indicate the variable is nullable by using the&nbsp;? See [[EDT:Language Overview02#Nullability|Nullability]].
 +
|-
 +
| <source lang="java">
 
employeeList Employee[0];
 
employeeList Employee[0];
</source>
+
</source>  
|<source lang="java">
+
| <source lang="java">
 
employeeList Employee[];
 
employeeList Employee[];
</source>
+
</source>  
|Dimension is not allowed on Array declaration, change to [ ].  
+
| Dimension is not allowed on an Array declaration, change to [ ].
 
|-
 
|-
|<source lang="java">
+
| <source lang="java">
program MyProgram type BasicProgram {}
+
library MyLibrary type BasicLibrary {}
+
record recordName type BasicRecord
+
</source>
+
|<source lang="java">
+
program MyProgram
+
record recordName
+
library MyLibrary
+
</source>
+
|Basic stereotypes including BasicLibrary, BasicProgram, BasicRecord are removed. A part without stereotype is the basic type
+
|-
+
|<source lang="java">
+
 
myService1 MyService {@DedicatedService};
 
myService1 MyService {@DedicatedService};
</source>
+
</source>  
|<source lang="java">
+
| <source lang="java">
 
myService1 MyService?{@DedicatedService};
 
myService1 MyService?{@DedicatedService};
</source>
+
</source>  
|Service-access variable has to be defined as nullable with a ?
+
| Service-access variable has to be defined as nullable with a&nbsp;?
 
|-
 
|-
|<source lang="java">
+
| <source lang="java">
 
myService1 MyService {@bindService{bindingKey = "abc"}};
 
myService1 MyService {@bindService{bindingKey = "abc"}};
</source>
+
</source>  
|<source lang="java">
+
| <source lang="java">
 
myService1 MyService?{@Resource {bindingKey = "abc"}};
 
myService1 MyService?{@Resource {bindingKey = "abc"}};
  
Line 62: Line 60:
  
 
myService1 MyService?;
 
myService1 MyService?;
myService1 = SysLib.getResource("abc");
+
myService1 = Resources.getResource("abc");
</source>
+
</source>  
|@Resource annotation is new in EDT. Search "resource annotation" in help for the details.
+
| The @Resource annotation is new in EDT. For details, search the Help for "resource annotation".
 
|-
 
|-
|<source lang="java">
+
| <source lang="java">
 
writeStderr("hello world!");
 
writeStderr("hello world!");
</source>
+
</source>  
|<source lang="java">
+
| <source lang="java">
 
Syslib.writeStderr("hello world!");
 
Syslib.writeStderr("hello world!");
</source>
+
</source>  
|all needs to be fully qualified with library name i.e. sysLib, dateTimeLib, serviceLib, xmlLib...etc.
+
| System libraries (sysLib, dataTimeLib, serviceLib, etc.) need to be fully qualified with a library name.
 
|-
 
|-
|<source lang="java">
+
| <source lang="java">
 +
program MyProgram type BasicProgram {}
 +
library MyLibrary type BasicLibrary {}
 +
record MyRecord type BasicRecord
 +
</source>
 +
| <source lang="java">
 +
program MyProgram
 +
library MyLibrary
 +
record MyRecord
 +
</source>
 +
| Basic stereotypes including BasicLibrary, BasicProgram, BasicRecord are removed. A part without a stereotype is the basic type.
 +
|-
 +
| <source lang="java">
 
Record Attendee {
 
Record Attendee {
 
XMLStructure = XMLStructureKind.simpleContent}
 
XMLStructure = XMLStructureKind.simpleContent}
Line 82: Line 92:
  
 
target String{@JavaScriptProperty {}};
 
target String{@JavaScriptProperty {}};
</source>
+
</source>  
|<source lang="java">
+
| <source lang="java">
 
Record Attendee {@XMLValue {
 
Record Attendee {@XMLValue {
 
kind = XMLStructureKind.simpleContent}}
 
kind = XMLStructureKind.simpleContent}}
Line 91: Line 101:
  
 
target String{@Property {}};
 
target String{@Property {}};
</source>
+
</source>  
| See [http://wiki.eclipse.org/EDT:EGL_Language_conversion EGL Language conversion page] for more annotation changes.
+
| See the [[EDT:EGL Language conversion|EGL Language conversion page]] for more annotation changes.
 
|-
 
|-
 +
| <source lang="java">
 +
egl.defineWidget('utils', 'QueryUtils',
 +
'egl.ui.rui', 'Widget',
 +
</source>
 +
| <source lang="java">
 +
egl.defineWidget('utils', 'QueryUtils',
 +
'eglx.ui.rui', 'Widget',
 +
</source>
 +
| EGL Widget package changed from '''egl.ui.rui''' to '''eglx.ui.rui''', make corresponding changes when defining custom widgets with JS.
 +
|-
 +
| <source lang="java">
 +
t time;
 +
</source>
 +
| <source lang="java">
 +
t timestamp("yyyyMMddHHmm");
 +
</source>
 +
| '''time''' is replaced with '''timestamp'''.
 +
For more changes in Date and Time types, check the EDT online help
  
 +
|-
 +
| <source lang="java">
 +
DateTimeLib.currentDate();
 +
DateTimeLib.currentTime();
 +
DateTimeLib.currentTimeStamp();
 +
</source>
 +
| <source lang="java">
 +
d Date;
 +
t Timestamp;
 +
</source>
 +
| The default value for a new Date variable is the current date. The default value for a new Timestamp variable is the current date/time. Time is not a supported type (use Timestamp instead).
 +
|-
 +
| <source lang="java">
 +
cTimeStamp Timestamp;
 +
DateTimeLib.dayOf(cTimeStamp);
 +
DateTimeLib.weekdayOf(cTimeStamp);
 +
DateTimeLib.monthOf(cTimeStamp);
 +
DateTimeLib.yearOf(cTimeStamp);
 +
DateTimeLib.dateOf(cTimeStamp);
  
 +
s String = "Some string of characters";
 +
index int = Strlib.indexOf(s,"a");
 +
s = Strlib.clip(s);
 +
s = Strlib.lowerCase(s);
 +
s = Strlib.upperCase(s);
 +
</source>
 +
| <source lang="java">
 +
cTimeStamp timestamp;
 +
cTimeStamp.dayOf();
 +
cTimeStamp.weekdayOf();
 +
cTimeStamp.monthOf();
 +
cTimeStamp.yearOf();
 +
cTimeStamp.dateOf();
  
 +
s String = "Some string of characters";
 +
index int = s.indexOf(s,"a");
 +
s = s.clip();
 +
s = s.toLowerCase();
 +
s = s.toUpperCase();
 +
</source>
 +
| Many operations become part of the type ('''timestamp''', '''date''', '''string'''). Check out the online help. Or you can type . after the variable name to let Content Assist tell you what's available. String and Date has more operations available then in Rational Business Developer.
 +
|-
 +
| <source lang="java">
 +
var money(8,2);
 +
var num(8,2);
 +
var bin(9);
 +
</source>
 +
| <source lang="java">
 +
var decimal(8,2);
 +
var decimal(8,2);
 +
var decimal(9);
 +
</source>
 +
| '''money''', '''num''' &amp; '''bin''' are not supported, use '''decimal''' instead. Check '''EGL numeric types''' in online help for more details.
 +
|-
 +
| <source lang="java">
 +
ServiceLib.convertFromJSON(json, eglType);
 +
ServiceLib.convertToJSON(eglType any);
 +
</source>
 +
| <source lang="java">
 +
JsonLib.convertFromJSON(json string,eglType);
 +
JsonLib.convertToJSON(eglType any);
 +
</source>
 +
| The two methods are moved to JsonLib
 +
|-
 +
| <source lang="java">
 +
call ... returning to ...
 +
onException ServiceLib.serviceExceptionHandler;
 +
</source>
 +
| <source lang="java">
 +
call ... returning to ...
 +
onException myExceptionHandler;
 +
</source>
 +
| ServiceLib.serviceExceptionHandler is not in EDT, write your own ExceptionHandler. You can write a function name and press Ctrl+1 to let quick fix create the function for you.
 +
|}
  
 +
<br> '''Language elements not supported in EDT'''
  
 
+
*Called program
 
+
*DataItem
 
+
*Datatable
 +
*Structured Record
 +
*Form, FormGroup,
 +
*DataTimeLib.currentTime, DateTimeLib.timeOf, DataTimeLib.timeValue
 +
*Interval
 +
*Move statement,
 +
*maxSize, validValues,
 +
*RuntimeException
  
 
[[Category:EDT]]
 
[[Category:EDT]]

Latest revision as of 00:20, 15 May 2012

An EDT project has a different layout than an Rational Business Developer project. The best way to make Rational Business Developer code work in EDT is to create a new EDT project and copy the code to it. There have also been some changes to the EGL language that may require you to change your code before it can be run with EDT.  In addition to the information mentioned below, a high level overview of changes can be found on the Differences between EDT 0.7.0 and IBM Rational Business Developer page.

Move code to an EDT project

  1. Create a new EDT project.
    1. If the application contains RUI Handlers, choose either Web 2.0 client application or Web 2.0 client application with service depending on whether the application contains services.
    2. If the application contains only Programs and common code, choose Basic.
  2. Copy EGL files and packages from the Rational Business Developer project to the EDT project.
  3. Configure the EGL Compiler and generators. The Compiler setting is a new feature in EDT which allows specifying generators for each package or file.
    1. Select JavaScript Generator for Rich UI Handlers, Widgets and any common parts (Record, Library) which are referenced by Rich UI Handlers or Widgets.
    2. Select Java Generator for Services, Programs and any common parts referenced by Services or Programs.
    3. Common parts that require both JavaScript Generator and Java Generator should be put into a separate package configured with both Generators.
    4. The compiler setting of a parent resource is inherited by the children, so setting at the package level is usually good enough.
    5. Refactoring packages and code is sometimes necessary.

Modify EGL code

  1. Use Organize Imports (Ctrl+Shift+O) to let EDT import the correct widgets and system parts. This is needed for almost all EGL files because of the package name changes.
  2. Below is a handy list of things to modify. It is recorded when we moved Rational Business Developer samples and test apps to EDT. See the EGL Language conversion page for more information about updates to EGL. The Code snippets page is also a good place to find code.
Rational Business Developer EDT Comments
myInt int = 3;
myInt int = null;
myInt int = 3;
myInt int? = null;
In Rational Business Developer, you could set a non-nullable variable to null (in certain cases). This is not allowed in EDT. You must indicate the variable is nullable by using the ? See Nullability.
employeeList Employee[0];
employeeList Employee[];
Dimension is not allowed on an Array declaration, change to [ ].
myService1 MyService {@DedicatedService};
myService1 MyService?{@DedicatedService};
Service-access variable has to be defined as nullable with a ?
myService1 MyService {@bindService{bindingKey = "abc"}};
myService1 MyService?{@Resource {bindingKey = "abc"}};
 
or 
 
myService1 MyService?;
myService1 = Resources.getResource("abc");
The @Resource annotation is new in EDT. For details, search the Help for "resource annotation".
writeStderr("hello world!");
Syslib.writeStderr("hello world!");
System libraries (sysLib, dataTimeLib, serviceLib, etc.) need to be fully qualified with a library name.
program MyProgram type BasicProgram {}
library MyLibrary type BasicLibrary {}
record MyRecord type BasicRecord
program MyProgram
library MyLibrary
record MyRecord
Basic stereotypes including BasicLibrary, BasicProgram, BasicRecord are removed. A part without a stereotype is the basic type.
Record Attendee {
XMLStructure = XMLStructureKind.simpleContent}
 
ExternalType BrowserUtils ... {
javaScriptName = "BrowserUtils" ...}	
 
target String{@JavaScriptProperty {}};
Record Attendee {@XMLValue {
kind = XMLStructureKind.simpleContent}}
 
ExternalType BrowserUtils ... {
externalName= "BrowserUtils" ...}
 
target String{@Property {}};
See the EGL Language conversion page for more annotation changes.
egl.defineWidget('utils', 'QueryUtils', 
'egl.ui.rui', 'Widget',
egl.defineWidget('utils', 'QueryUtils', 
'eglx.ui.rui', 'Widget',
EGL Widget package changed from egl.ui.rui to eglx.ui.rui, make corresponding changes when defining custom widgets with JS.
t time;
t timestamp("yyyyMMddHHmm");
time is replaced with timestamp.

For more changes in Date and Time types, check the EDT online help

DateTimeLib.currentDate();
DateTimeLib.currentTime();
DateTimeLib.currentTimeStamp();
d Date;
t Timestamp;
The default value for a new Date variable is the current date. The default value for a new Timestamp variable is the current date/time. Time is not a supported type (use Timestamp instead).
cTimeStamp Timestamp;
DateTimeLib.dayOf(cTimeStamp);
DateTimeLib.weekdayOf(cTimeStamp);
DateTimeLib.monthOf(cTimeStamp);
DateTimeLib.yearOf(cTimeStamp);
DateTimeLib.dateOf(cTimeStamp);
 
s String = "Some string of characters";
index int = Strlib.indexOf(s,"a");
s = Strlib.clip(s);
s = Strlib.lowerCase(s);
s = Strlib.upperCase(s);
cTimeStamp timestamp;
cTimeStamp.dayOf();
cTimeStamp.weekdayOf();
cTimeStamp.monthOf();
cTimeStamp.yearOf();
cTimeStamp.dateOf();
 
s String = "Some string of characters";
index int = s.indexOf(s,"a");
s = s.clip();
s = s.toLowerCase();
s = s.toUpperCase();
Many operations become part of the type (timestamp, date, string). Check out the online help. Or you can type . after the variable name to let Content Assist tell you what's available. String and Date has more operations available then in Rational Business Developer.
var money(8,2);
var num(8,2);
var bin(9);
var decimal(8,2);
var decimal(8,2);
var decimal(9);
money, num & bin are not supported, use decimal instead. Check EGL numeric types in online help for more details.
ServiceLib.convertFromJSON(json, eglType);
ServiceLib.convertToJSON(eglType any);
JsonLib.convertFromJSON(json string,eglType);
JsonLib.convertToJSON(eglType any);
The two methods are moved to JsonLib
call ... returning to ... 
onException ServiceLib.serviceExceptionHandler;
call ... returning to ... 
onException myExceptionHandler;
ServiceLib.serviceExceptionHandler is not in EDT, write your own ExceptionHandler. You can write a function name and press Ctrl+1 to let quick fix create the function for you.


Language elements not supported in EDT

  • Called program
  • DataItem
  • Datatable
  • Structured Record
  • Form, FormGroup,
  • DataTimeLib.currentTime, DateTimeLib.timeOf, DataTimeLib.timeValue
  • Interval
  • Move statement,
  • maxSize, validValues,
  • RuntimeException

Copyright © Eclipse Foundation, Inc. All Rights Reserved.