Understanding the IBM WebFacing Tool: A Guided Tour (IBM Illustrated Guide series)

You are going to link index.html to a cascading style sheet. The style sheet used in this application is a sample included in the workbench. You will change the heading of the page, add your own logo, and then add some moving text. The first step, however, is to locate the index.html file and open it in Page Designer.

You need to open the Web perspective to find the right dialogs for the task. You then need to copy and paste the index.html file that you work with. This is necessary because Page Designer will remove one line of source from the file (because it assumes that the line is incorrect). Unfortunately, WebFacing needs this line, so after you finish with Page Designer, you will copy this line from your backup copy and add it to the updated index.html. If you do not do this, the links on this page will not work anymore.

After making the backup copy, you are ready to use the index.html file with Page Designer.

Switching to the Navigator View

In the Development Studio Client workbench, open the Web perspective:

On the Select Perspective dialog, as shown in Figure 13.39,

Figure 13.39: Select Perspective dialog

You should now have the Web perspective open in your workbench with the Navigator view open. You will use this view to locate and then work with the index.html file.

As mentioned before, you are making a backup copy of this file:

The Folder Selection dialog displays (Figure 13.41).

Figure 13.41: Folder Selection dialog

A file with the name Copy of index.html will be created. You will use this file later to copy a line and add it to the original file.

The next step is to examine the index.html page and change it using Page Designer.

Starting Page Designer

Page Designer is comparable to SDA for 5250 panels or GUI windows for GUI pages, but, as its name indicates, it helps with designing Web pages. As in SDA or CODE Designer, you need not type source statements in an editor, because Page Designer creates the source for you from your design choices. Here, the generated source consists of HTML tags instead of DDS statements.

To open Page Designer,

Page Designer opens on the right side of the workbench.

This is where you can enhance the Web page. You are ready to use Page Designer. You will notice three tabs at the bottom of the Page Designer work area (see Figure 13.42). These tabs allow you to switch between different views.

Figure 13.42: Page Designer with three tabs, one of them the Design tab

These views are

Make sure you are on the design page by

Working with Page Properties

The Attributes dialog (Figure 13.44) opens.

Figure 13.44: Changing the text for the Web page

The page now has a title. Now you will give this page more color , by adding a background and specifying attribute definitions for text and links. This is accomplished by linking this page to a style sheet.

Linking a Cascading Style Sheet to the Web Page

Now you will add a style sheet to the Web page. You can use a style sheet employed by your company or you can use one of the sample style sheets provided with Development Studio Client.

In the lower right pane in the workbench,

At the left bottom pane in the workbench,

You should see thumbnail icons of all the styles available as shown in Figure 13.45.

Figure 13.45: Linking a style to the Web page

In the thumbnail view,

After a short while, the style sheet properties are applied and the colors in the page change to the style sheet definitions, as shown in Figure 13.46.

Figure 13.46: index.html page with style properties

Adding a Logo to the Page using the Logo Wizard

Now you will add a Logo using the Logo Wizard, provided with Development Studio Client.

The Create Logo dialog opens.

In the Text field on top of the wizard page,

The first of four text attribute pages appears (Figure 13.49).

Figure 13.49: Logo Wizard Specify Text page

The Select Color page displays (Figure 13.50).

Figure 13.50: Logo Wizard Select Color page

The Select Outline page appears, as shown in Figure 13.51:

Figure 13.51: Logo Wizard Select Outline page

The Select Text Effect page appears, as shown in Figure 13.52.

Figure 13.52: Logo Wizard Select Text Effect page

You are back in the Create Logo page. If you like, you might want to select an attractive background for your logo by using the Background Image push button. I will let you discover this feature on your own.

On the Create Logo page,

Back in Page Designer, the logo will appear. It will be a bit big, so I want you to resize it:

Figure 13.54 gives you an indication of how small it should be, but it does not matter if it is not exactly the way I sized it in the picture. As long as you like your logo and its size, you are doing just fine.

Figure 13.54: Resizing the logo in Page Designer

You are finished with the logo design, but some more work needs to be done.

Adding a Heading 1 Tag to the Page

Now I want you to insert an attractive heading below the logo:

A frame appears where you can enter text:

Now I want you to further enhance this page by inserting one of the sample pictures that come with Development Studio Client.

Adding a Picture to the Page

In the workbench underneath the Navigator view,

On the dialog pane beside the Gallery view,

The design window now contains a picture, as shown in Figure 13.58.

Figure 13.58: Design window with picture added

You might want to resize the picture to fill more of the page.

You are almost finished. You just need to add some moving text to the page.

Adding Moving Text to the Page

A Heading 3 frame is created on the design page, as shown in Figure 13.59.

Figure 13.59: Web page with Heading 3 frame

Leave the cursor positioned inside the Heading 3 frame.

The Attributes dialog displays, as shown in Figure 13.61.

Figure 13.61: Attributes dialog

Those two last selections just specify that the text is not to slide indefinitely. If you think your user would prefer some more movement on the page, feel free to change these settings.

The design page should look like Figure 13.62.

Figure 13.62: Design page with Header 3 text

To save some space, remove some of the line break tags:

To see the page as it would appear in a browser,

You will notice that your Heading 3 text is sliding (see Figure 13.64).

Figure 13.64: Web page shown in browser, with text moving

Changing the Text Color in Page Designer

You might notice that the text color in the Heading 1 area and the background color interfere a little bit with each other. One easy way to change this problem is to apply another color to certain areas of the text. To complete that task, go back to the design page:

On the bottom dialog underneath the Page Designer window,

Except for a bit of clean-up, you are finished; now the selected text displays with the color you selected.

Cleaning up the Page

One more thing you need to do is remove the default text added by the WebFacing Tool, as shown in Figure 13.66.

Figure 13.66: Text to be deleted from Web page

You are almost ready to run the application again. As I mentioned in the beginning of this section, Page Designer deletes one line from the HTML source, which it assumes is incorrect, even though it is actually needed on the page. Version 5.0 of Page Designer fixed this problem, but I will show you how to fix it for Version 4.0.

In the Navigator view, you need to open Page Designer with the backup copy of the index.html file:

Another Page Designer session opens for the Copy of index.html file. In this new Page Designer session,

In the source editor, as shown in Figure 13.69,

Figure 13.69: Editor with source of Copy of index.html

Around line 47 you will see a line with a warning icon:

Page Designer should still be open with the index.html file. If not, you need to open it:

In the source editor window of the index.html file,

The string from the Copy of index.html file is now inside the index.html file, as shown in Figure 13.70.

Figure 13.70: Page Designer with index.html file and copied string

Switch to the WebFacing perspective:

In the Navigator view or WebFacing Projects view,

Your newly designed index.html page displays, and you can run your application.

Категории