20
SilverDev by Experia Wizard Tutorial Develop with just a few clicks graphical applications on IBM i – AS/400

[Tutorial] SilverDev Wizard - english

Embed Size (px)

DESCRIPTION

Learn How to Create with Just a Few Clicks a GUI Application for your IBM i - AS/400, in RPG.

Citation preview

Page 1: [Tutorial]  SilverDev Wizard - english

SilverDev by Experia

Wizard Tutorial

Develop with just a few clicks

graphical applications on IBM i – AS/400

Page 2: [Tutorial]  SilverDev Wizard - english

SilverDev – Wizard Tutorial

Experia -- All Rights Reserved -- 2 / 20

Content

1. Introduction. .............................................................................................................................................. 3 2. Schemes Tool ............................................................................................................................................. 4 3. Database Viewer ....................................................................................................................................... 4 4. Saving the Scheme. ................................................................................................................................... 5 5. Configuring the Table ................................................................................................................................ 6 6. How to Create a Grid with the Wizard ...................................................................................................... 7 7. Generating the Source............................................................................................................................... 9 8. Compiling the Program ............................................................................................................................ 10 9. Distributing the Program ......................................................................................................................... 10 10. Running the Program .......................................................................................................................... 12 11. Selection Wizard ................................................................................................................................. 13 12. Create a Form with the Wizard ........................................................................................................... 15 13. Going Further: How to Display an Image ............................................................................................ 17 14. Modifiying the Generated Source ....................................................................................................... 19 15. Protection Against Overwritting ......................................................................................................... 19 16. Tools .................................................................................................................................................... 19

Page 3: [Tutorial]  SilverDev Wizard - english

SilverDev – Wizard Tutorial

Experia -- All Rights Reserved -- 3 / 20

1. Introduction.

With this tutorial you will learn how to create a graphical application in a few clicks using SilverDev Wizard.

You will create this application :

You have to install SilverDev on your server. You can download a free 60-day trial on

http://www.silverdev.com/test-silverdev.php

Page 4: [Tutorial]  SilverDev Wizard - english

SilverDev – Wizard Tutorial

Experia -- All Rights Reserved -- 4 / 20

2. Schemes Tool

Run the Designer.exe program and sign in with your as400 profile.

1 Access the "Tools/Databas

scheme" menu

2 The "Schemes" window is

displayed on the screen.

Click the "New scheme"

button to open a new blank

scheme

3. Database Viewer

1 Use the "DataBase" icon to display

the database assistant

Page 5: [Tutorial]  SilverDev Wizard - english

SilverDev – Wizard Tutorial

Experia -- All Rights Reserved -- 5 / 20

2 Type "SILVERDEMO/SDDM*" in the

search field to display all files

beginning with sddm in the

SilverDemo library.

The SilverDemo library is installed

with the SilverDev product.

3

Drag and drop into the scheme the

following files :

• SDDMAUT

• SDDMBKS

• SDDMBKS3

• SDDMGEND

• SDDMPUB

• SDDMTHM

Links are created automatically

between the tables.

These links are deduced from the sql

constraints between the tables.

When working on your own files, if there are

no sql constraints between the tables, you can

link two tables in the scheme manually.

To link two tables manually, use the button as shown

on the right.

4. Saving the Scheme.

To save the scheme, use the button shown on the right in the

"Schemes" window.

Page 6: [Tutorial]  SilverDev Wizard - english

SilverDev – Wizard Tutorial

Experia -- All Rights Reserved -- 6 / 20

5. Configuring the Table

Double-click the SDDMAUT table. A dialog box is displayed.

Fill in the "Foreign key parameters" fields as shown below:

Do the same for the SDDMPUB, SDDMTHM and SDDMGENDER tables.

The "pick list" option is selected for the SDDMTHM and SDDMGENDER files, because they do not contain many

records.

The SDDMAUT and SDDMPUB files have too many records to display them all in a pick list, which is why

"External program" is selected for these files.

We'll see later how these settings interact with the Wizard.

Some fields may be filled in automatically. The selection type is chosen based on the number of

records in the table and the field to display is the first alpha field in the table.

Page 7: [Tutorial]  SilverDev Wizard - english

SilverDev – Wizard Tutorial

Experia -- All Rights Reserved -- 7 / 20

6. How to Create a Grid with the Wizard

Select the SDDMBKS3 table in the scheme and choose "Grid wizard" in the right click menu.

In the window displayed, we have chosen to select all options to have the most sophisticated program

possible.

When you click the "Fields" tab, the file’s field list is displayed. The wizard automatically detects the best

column type to suit each field. The NAMEAUT, NAMEPUB and NAMETHEME fields come from tables other

than the one we are working on. They are displayed in a different color.

The previous settings determine which fields are displayed and the column type.

It is possible to add, change or delete certain fields.

Page 8: [Tutorial]  SilverDev Wizard - english

SilverDev – Wizard Tutorial

Experia -- All Rights Reserved -- 8 / 20

1

Click the check box in the Filter

column on the TITLE field row.

2

Tick the "Start" checkbox.

This will generate a search criterion

on the start of the TITLE field.

3

Use the "File/Apply to scheme" menu

to apply the wizard information to the

scheme.

4

A wizard figure is added to the

scheme.

The wizard properties can be

modified by double-clicking this

figure.

Page 9: [Tutorial]  SilverDev Wizard - english

SilverDev – Wizard Tutorial

Experia -- All Rights Reserved -- 9 / 20

7. Generating the Source

1 Now, we are going to generate the

RPG program source using the

"File/Generate" menu.

2 A window is displayed to select a

context.

Select the Silverdemo context.

3 The results tab is displayed.

A grid displays the operations carried

out by the wizard.

Successfully completed operations are

indicated by a green dot.

4 The screen object has now been created, along with the rpg program source that appears in the background.

Close the wizard window to access the rpg source that has been generated.

You can use the F10 key to switch between the rpg source and the screen.

Page 10: [Tutorial]  SilverDev Wizard - english

SilverDev – Wizard Tutorial

Experia -- All Rights Reserved -- 10 / 20

You can change the screen and program source manually, but this is not covered by this tutorial.

For information on how to create a program manually, use the "QuickStart" and "Programming guide"

documents, available to download on http://www.silverdev.com/test-silverdev.php.

8. Compiling the Program

1 To compile the program, use

the "Compiling/Generate

program" menu.

2 The compilation results are

displayed in another window.

Since the rpg source has not

been changed, there is no

reason for compilation to fail.

9. Distributing the Program

Now that we have created our first program, we are

going to use MyDesk to add an icon to run the

application.

Make sure you are a SilverDev administrator by adding

your profile name to the silverdev/psvdadm file.

Run the MyDesk.exe program, sign in using the "Server/Connection"

menu.

Right click the directory where you want to create the icon and access

the "New application" menu.

Fill in the fields as shown on the figure opposite:

Page 11: [Tutorial]  SilverDev Wizard - english

SilverDev – Wizard Tutorial

Experia -- All Rights Reserved -- 11 / 20

A window is displayed to set the access rights to this application.

We choose to authorize everyone to access this application.

The program called by this icon is Silverdemo/Ctuto1.

This program is a cl program created with the following code:

The purpose of this program is to add SILVERDEMO to the library list and to call the lstsddmbks program

created using the wizard.

You can create this cl in SILVERDEMO/QCLSRC source file.

Page 12: [Tutorial]  SilverDev Wizard - english

SilverDev – Wizard Tutorial

Experia -- All Rights Reserved -- 12 / 20

10. Running the Program

You can now double click the icon created in MyDesk.

The program starts and the following screen is displayed:

The application already allows the records

to be filtered on the header field, to be

sorted on one or more columns, to be

deleted or modified directly in the grid.

However, if you double click a row or click the button in the publisher column, an error message is displayed

In the grid wizard, we designed calls to

the FRMSDDMBKS, LSTSDDMPUB and

LSTSDDMAUT programs, but these

programs do not yet exist.

We are now going to use the wizard to

create these programs.

Page 13: [Tutorial]  SilverDev Wizard - english

SilverDev – Wizard Tutorial

Experia -- All Rights Reserved -- 13 / 20

11. Selection Wizard

1

Select the SDDMPUB table in

the scheme, right click and

open the "Selection Wizard"

menu

2

Do not change anything in the

"General" tab.

3 In the "Fields" tab, add a filter

on the NAMEPUB field, like we

did in the main program.

4 Apply the wizard to

the scheme using

the "File/Apply to

scheme" menu.

5 Generate the

program source

using the "File/

Generate" menu.

Page 14: [Tutorial]  SilverDev Wizard - english

SilverDev – Wizard Tutorial

Experia -- All Rights Reserved -- 14 / 20

6 Select the SILVERDEMO

context.

7

The generation results are

displayed in the "Results" tab.

8 Restart the LSTSDDMBKS

program. Now, when you click

the button in the Publisher

column…

9 …the LSTSDDMPUB program is

called and the following

window is displayed.

Page 15: [Tutorial]  SilverDev Wizard - english

SilverDev – Wizard Tutorial

Experia -- All Rights Reserved -- 15 / 20

12. Create a Form with the Wizard

1

Now, we are going to create

the FRMSDDMBKS program.

This program is called by

double clicking the grid of the

main program.

Select the SDDMBKS table in

the scheme, right click and click

the "Form wizard" menu.

2 In the General tab, the error

message type can be changed

to have something more

sophisticated

3 Note in the parameters tab

that the wizard has prepared

two parameters for the

program.

4

Use the "File/Apply to scheme"

and "File/Generate" menus as

before.

The results are displayed:

Then use the "Compile/

Generate program" menu.

Page 16: [Tutorial]  SilverDev Wizard - english

SilverDev – Wizard Tutorial

Experia -- All Rights Reserved -- 16 / 20

5

Restart the LSTSDDMBKS

program; it is now possible to

call the form by double clicking

the grid or via "Form" in the

right click popup menu.

6 In the form, the button next to

the Publisher field calls the

LSTSDDMPUB program that we

have already called from the

main program.

7 In the Wizard, we specified that

title and price were mandatory.

So, if we try to validate without

filling in these two fields, a grid

with the error list will be

displayed. Double click a row to

indicate the field in error.

Page 17: [Tutorial]  SilverDev Wizard - english

SilverDev – Wizard Tutorial

Experia -- All Rights Reserved -- 17 / 20

13. Going Further: How to Display an Image

1 We are going to work on

the FRMSDDMBKS wizard

again.

Double click the wizard in

the scheme:

2

In the wizard window,

select the "Fields" tab and

click "Add a calculated

field" menu item.

3

Fill in the fields as shown

on the right:

4

In the "Custom blocks" tab, write the following code:

C eval img1 = '/silverdev/De mo/Books/images/Img'+ C %char(idbook)+'.jpg'

5 Use the "File/Apply to scheme" and "File/Generate" menus.

Then use the "Compilation/Generate program" menu as before.

Page 18: [Tutorial]  SilverDev Wizard - english

SilverDev – Wizard Tutorial

Experia -- All Rights Reserved -- 18 / 20

6 Restart the LSTSSDDMBKS application; the form now has an image:

Page 19: [Tutorial]  SilverDev Wizard - english

SilverDev – Wizard Tutorial

Experia -- All Rights Reserved -- 19 / 20

14. Modifiying the Generated Source

Once a program has been generated by the wizard, the screens or rpg source can be modified manually.

To do so, use the "Tools/Context…" menu item and select a context. The program list in this context is then

displayed. Double click an item in the list to open the rpg source and the screen in design. You can then modify

the generated source like any SilverDeb program.

15. Protection Against Overwritting

Once a program has been modified manually, you cannot use the wizard to overwrite your work; the following

message will be displayed:

The wizard can still be used to generate in another context, under another name or after removing the objects

you have manually changed.

16. Tools

Scheme Printing Change the Appearance of an Object

Open the « Visual properties » menu with a right click.

Page 20: [Tutorial]  SilverDev Wizard - english

SilverDev – Wizard Tutorial

Experia -- All Rights Reserved -- 20 / 20

Copyright Information.

The information contained in this document may be modified without notification and may not be considered binding in

any manner upon EXPERIA Europe. Software packages are supplied under licence or confidentiality agreement. The

software package may only be used, copied or reproduced onto any support in compliance with the terms of the said

licence or confidentiality agreement. The buyer may only make copies for backup or archiving purposes.

No part of the manual or software package may be reproduced or transmitted via any means, electronic or otherwise,

including photocopying, recording or any other storage, processing or information retrieval process for any purpose other

than the buyer’s personal use without express, written permission from EXPERIA Europe.

IBM, AS/400, iSeries, System i, i5, Power i are registered trademarks belonging to International Business Machines

Corporation.

Windows is a registered trademark belonging to Microsoft.

All other products are registered trademarks belonging to their respective companies.

Contact Us:

EXPERIA Europe 4, rue L.Beridot

Les jardins d'Epione

F-38500 VOIRON

www.experia.com

www.silverdev.com

Information [email protected]

Technical Support [email protected]

Phone +33 (0)4 76 67 07 70