Take a New Look At Web Option

Seeking to move your CA 2E business applications from the green screen to the web? Web Option can make that much easier with its seamless integration with CA 2E. This integration provides the framework on which to develop a highly usable and good looking web application using primarily your CA 2E skills. Even better, you can accomplish the move in phases. You will find the development workflow almost identical to the way you work with CA 2E now.

Modernize in Phases

The first phase of the conversion process is ‘just in time’ screen conversion; once the Web Option server is running, the application can be converted automatically. Web Option provides rules that allow you to have control over the look and feel of the pages.

The second phase creates HTML skeletons from each of the screens in the application. This conversion can be completed screen by screen or as a batch job on a group of screens. You input the rules that define the company brand and get screens with the look and feel that matches your brand. The screens are generated with a uniform look and interface, but you always have the opportunity to customize individual screen elements. During this process, you can also integrate Javascript to provide additional interactive capability to elements, such as providing date pickers or rich text editors. You can even integrate with Dojo, JQuery or other Javascript libraries to extend the capabilities further.

The third phase is optional. You might already have the great looking application you desire from phase two. In the third phase, you can start refactoring the screen navigation so that the screens flow as true web applications as a user engages with them. The scripting language that comes with Web Option remembers parameters and flow-through screens without having to display every screen in the flow.

Simple Maintenance

One of the great strengths of Web Option is that its close integration with 2E removes the issues with double maintenance that other web-facing products suffer from. It follows much the same flow that you are used to from working with CA 2E. You can readily make changes to the action diagram or screen. For example, if you want to add a new field to a screen, all you need to do is regenerate the screen, just as you would do to generate new RPG or COBOL code. Instead of using a ‘J’ to generate it, you’ll use an ‘H’ to generate the HTML. All your formatting and customization is preserved. That’s it!

New Web Option Training

CM First has developed a Web Option class to provide developers with a solid foundation on how to develop applications. The class demonstrates the set-up, configuration and the ‘just in time’ pages then shows you how to customize the page skeletons and integrate Javascript and CSS. By the time a developer completes this course, he or she will have a great understanding of the basics of web development with Web Option.

Add User Macro Capability to Web Option Screens

Web Option allows you to set up screens so users can record their own macros. This is a great way to give users more control over what they do on their screens on the Web.

In order to add this capability to a specific screen follow these simple steps.

1.   Add a one character field on to a screen. This allows you to place the macro drop down any place on the screen you want.  The field will not contain any data. It is used only as a place holder. womacro01

2. Next you need to add and element customization to the screen.  Web Option allows you to customize any element on the screen in this case we only need to customize the new field you just added.  The customization will change how the field displays in the web.

womacro02

 

3. Now you need to look for file YSCRIPT in your Web Option environment.  By default it has one member in it. You will need to add a new member to the file for each user that will have the ability to create macros.  The member you add for each user must be the same as their login id. So if your user’s log in id is BILLB the member needs to be called BILLB in YSCRIPT.  You will also need to set the authority in the member to *ALL.

womacro03

 

4. Regenerate the Function and the HTML for the function.

5. Now it works best to end the Web Option server and the Web server and then start them back up again.  Any time a new member is added to Y2SCRIPT the Web Option server needs to be restarted.

6. Go to the screen that contains the macro drop down from your Web Option URL. You will see the field that has the macro capability added to it.

womacro04

Interview Question 6 Answer

Parameters can be passed between functions as Field (FLD), Record (RCD) or Key (KEY).  Each one has a different meaning in the program and can effect such how your program is called. For example, if you call an external function from a native RPG program you will need to pass the parameters as a FLD.  

CA defines each method of passing values as: 

FLD 

Each specified field is passed as an individual parameter. This must be specified for *FIELD or *NONE parameter lines. 

RCD 

A single parameter with the length of the specified access path is passed. The parameter contains space for all the fields associated with the access path, which can individually be specified as parameters. 

KEY 

A single parameter with the length of the combined keys of the specified access path is passed. The parameter contains space for all the key fields that can be individually specified as parameters. 

(CA 2E 8.6 Manual)

Use Domain Fields for Maintainable Applications

Developing maintainable 2E applications takes thought before writing any action diagram code or even before creating fields.  One of the great features of Synon is the ability to create fields by referencing other fields.  Once a field is referenced, all fields that reference the base field take on the attributes of the base field.  The concept is easy.  Let’s see how using this concept can help make more maintainable applications.

 How to use Domain fields effectively:

  • Plan ahead and create many of the domain fields.
  • Use a specific identifier for the domain fields.
  • If you create a file and a domain field does not exist for the new field, create the new domain field first.
  • Make sure all developers follow the standards.

It is important to plan ahead when using referenced fields as domain fields.  The benefits you receive for this planning will last for years if properly maintained. A great benefit is that if you ever move your model to Web Option, you can point a style to a domain field and all of the fields that reference the domain field will pick up the HTML styles of the domain field.  Within your model, you can also make mass changes. Any changes to your domain fields will change all the fields that reference it. This is quite powerful.

One of the important items to plan out is the way you will identify the domain fields.  Some show use a *, other use D) while others might use a D_.  It is good to have the identifier as the first few characters of the field.  Then, the name of the field needs to let the developer know what the field is, without having to look at the field properties (ie. D_Text_25).  It is very important to pick a standard and stick with it. 

Besides the a naming standard, you should create a handful of the primary fields your system will use. Typically, this responsibility will be left with the DBA. If you have one person in your company that does this, the job is much easier.  The DBA will also be responsible to create domain fields that do not exist for new database fields.  Stick to the plan any time a database field is created it MUST reference a domain field.

If each developer has the ability to act as a DBA, then standards need to be enforced even more strictly.  Any time a new database field is created, it MUST reference a domain field. 

Many existing models have not followed the practice of using domain fields.  Is it worth fixing this?  In most cases, not if you have a large model. The job would be too large for the benefits.  If you have a fairly small model, then it may be worth creating a plan to update the fields as projects are completed.

Even though it takes planning, up front work and discipline to use Domain fields, years down the road you will either be glad you maintained the practice or you will regret not following the standards.  The benefits will outweigh the struggle to maintain the standards.

CA 2E / Synon Interview Series: Question 6

The understanding of parameter context is a very important area in building 2E functions.  Explain the difference in passing parameters by FLD, RCD or KEY contexts. 

Synon 2E Custom Default Templates

Synon 2E has a feature that has been around since version 8.5 that can become very handy in reducing work and implementing standards.  This feature can become a real time saver for your company.  I personally like this feature because there are standard ways I like to create my functions.  Now, I can have most of the basics already set up before I start coding.  Let me walk you through the steps and show you how simple it is to create a default template and how seamless it is to implement.

Step 1 – You will need to sign in as Designer to make the this fully functional. If you do not sign in as administrator you will not be able to make your template the default template.

Step 2 – Find the *Template object in Edit Database relations.

Step 3 – F into *Template and create a new function to serve as your new default template. 

Step 4 – Edit the function with the logic you want to include in your default template. Save the function when complete. 

Step 5 – Go to the function options with a Z and F7. 

Step 6 – Change the Option field Default prototype function to Y instead of N. 

Step 7 – You have now create a new Default prototype. In order to use your new *Template simply create the same type of function as the *Template. It will include all the custom code and parameters you put into the *Template.  

Interview Question 5 Answer

List 2 numeric and 3 alphanumeric field types.

[table "3" not found /]

CA 2E / Synon Interview Series: Question 5

List 2 numeric and 3 alphanumeric field types.

Happy Holidays

Happy Holidays from CM First Group

Photo: Arthur Häberli, Lez Genevez switzerland – 2012

CA 2E (Synon) WebCast November 28, 2012 at 10 am EST

Please join us for the CA Plex / 2E Global User Community Webcast on November 28, 2012 at 10 am EST
Topic: – What’s New in CA 2E – Presented by Rory Hewitt, Software Architect, CA Technologies

Registration and connection information is on the url below

 

https://communities.ca.com/web/ca-plex-ca-2e-global-user-community/message-board/-/message_boards/view_message/99601093?&#p_19

 

 
 
© 2013 CM First Group - All rights reserved