Websydian v6.1 online documentationOnline documentation - WebsydianExpress v3.5

2E Model

Contents

Included in the WebsydianExpress installation for iSeries is a 2E-model.

The model is on the oldest release level of 2E, that is supported by CA. This level is 8.0.

The model contains the well-known Horse-application. We have used the Horse entity to demonstrate how to develop a classical "Work with .." application using WebsydianExpress function API’s.

The model also contains wrappers to all of the API’s that are available with WebsydianExpress.

These functions are scoped under the file named "WebsydianExpress".

A number of 2E function templates are also contained in the delivered model.

In order to be able to pass many parameters between functions it has been necessary to create three structure-files:
1. WebsydianExpress Errors
2. WebsydianExpress User
3. WebsydianExpress Session

Copying to your own model

To use WebsydianExpress API’s in your own models, you need to copy objects from the model you have received to the model where you want to use the API’s.

In order to do so, you must use the command YCPYMDLOBJ.
Included in the model delivered to you is a model object list for copying. This list is named EXPRESS. 

 

Before copying you have to ensure that the model library WXPMDL and the MDL library for your own model is in the library list. The MDL library for your own model must be the first MDL library in the library list.

 

Perform these actions:

Use the YCHGLIBL command to work with the model you want to import the definitions into.

ADDLIBLE WXPMDL *LAST


From model library . . . . . . . > WXPMDL        Name, *CURLIB           

To model library . . . . . . . . > (your model)  Name, *CURLIB           

Copy option  . . . . . . . . . .   *PREPASS      *PREPASS, *COPY         

Copy CPF names . . . . . . . . .   *YES          *YES, *NO               

Copy text  . . . . . . . . . . .   *YES          *YES, *NO, *FUN, *OPR   

Copy conditions  . . . . . . . .   *ALL          *ALL, *SELECTED         

Copy subordinate functions . . .   *DBF          *DBF, *INT, *ALL, *NONE 

Duplicate name action  . . . . .   *REJECT       *REJECT, *GENERATE      

Target version to replace  . . .   *CURRENT      *FIRST, *CURRENT        

Model object list for copy . . .   EXPRESS       Name, *MDLPRF, *SELECT, *

Target generation library  . . .   *MDLVAL       Name, *MDLVAL, *NONE    

Reserve app.object prefices  . .   *NEXT         Name, *NEXT, *NONE      

Severity filter  . . . . . . . .   *ANY          0-30, *ANY, *ERROR      

Expand required objects  . . . .   *NO           *YES, *NO               

Locking method . . . . . . . . .   *BYOBJECT     *MODEL, *BYOBJECT    

 

The model you have received is named WXPMDL. You should start with a *PREPASS thats check that the copying will not result in any errors.

Set Expand required objects to *NO, in order not to get more objects copied than necessary.

If the *PREPASS gives you an error-free list, you can do the real copy using YCPYMDLOBJ with Copy option *COPY.

Now you are ready to use WebsydianExpress APIs in /2E.

Result of copying

The copying-process should result in two new entities

"Websydian Express"

"Websydian Express Work"

Because this entities does not have any fields, in order to se it you need to select Rel lvl = DFN at the top of the database relations screen.

Five 2E functions templates have also been copied to your model - these are scoped under the *Template file:

  1. W2E/EventHandler

  2. W2E/GridPageGenerator

  3. W2E/LoadGrid

  4. W2E/PageGenerator

  5. W2E/ProcessEntryPoint


Furthermore the copy has resulted in the Structure files:

  1. WebsydianExpress Errors

  2. WebsydianExpress User

  3. WebsydianExpress Session

  4. Websydian Express Role

These files are only used for passing parameters.

The copying also resulted in a number of new fields added to your model. All fields related to WebsydianExpress are in the model prefixed with W2E/.
All the generation-names for these fields are on the other hand postfixed with the letters W2. This is done to hopefully avoid name clashing with fields already in your model.