A. Sistemas de carbono
A.3. Nanotubos de carbono
Figure 3-56 shows the administrator view of the home page for our boat company. It contains the same links available from the customer view plus additional links that are only accessible by the company administrator.
Figure 3-56 Home page: Administrator view
Different content for different users
In our boat company example, the only differences between the customer view and the administrator view are additional service links in the administrator view. The home pages for both user types can be implemented with a single file, using the iSeries Access for Web
include list
support. Like the %%CONTENT%% replacement tag in the template file, your home page can contain an include list replacement tag. The format of the include list tag is: %%include list=file%%file identifies a file containing list items to include as links in a table. The list of items included can be tailored to an individual user, a group of users, or all users (*PUBLIC). When the home page is displayed, this tag is replaced with the appropriate set of links for the current user profile. You can find a sample include list in the directory
/QIBM/ProdData/Access/Web2/config/info.policies.
Our boat example adds links only if the current user is BOATADMIN. We add the following lines to the home page to do this:
<tr>
<td>%%include list=/boats/homepage/adminserv.policies%%</td> </tr>
The contents of the adminserv.policies file are:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <QiwaPolicies>
<profile name="BOATADMIN"> <homepage>
<listItem name="Work with invoices">
<href>/webaccess/iWASpool?queue=BOATS/INVOICES</href> </listItem>
<listItem name="Check messages">
<href>/webaccess/iWAMessages?msgq=BOATS/COMMENTS</href> </listItem>
<listItem name="Check system messages">
<href>/webaccess/iWAMessages?msgq=QSYS/QSYSOPR</href> </listItem>
<listItem name="Administrator tasks"> <href>/webaccess/iWACommandList</href> </listItem>
<listItem name="Manage incoming items"> <href>/webaccess/iWAMyFolder</href> </listItem>
<listItem name="Monitor jobs">
<href>/webaccess/iWAJobList?jobtype=user</href> </listItem>
</homepage> </profile> </QiwaPolicies>
If you want links that only customers can access, add another profile section to the file.
Supported replacement tags
iSeries Access for Web supports a number of additional replacement tags in home page files:
%%TITLE%% is replaced with the page title.
%%USER%% is replaced with the authenticated user name.
%%SYSTEM%% is replaced with the name of the iSeries server being accessed.
%%VERSION%% is replaced with the version of iSeries Access for Web installed.
Update home page
This link exists as a design convenience and should be removed when the home page is complete. When a new version of the home page is saved, this link provides a fast path to the general customize page for updating the home page setting. Clicking OK takes you back to the updated home page.
This link uses the %%USER%% replacement tag to update the home page file for the current user. By using the replacement tag, this link can be used to test the customer view as well as the administrator view. This assumes the customer user profile is enabled to update the home page setting during the home page design phase.
The source for the link is:
<a href="/webaccess/iWACustomizeGeneral?profile=%%USER%%">Update home page</a>
Tip: You need to use character references for characters that can be included in an XML
document. For example, if you have a link with multiple parameters, you need to replace & with &.
Administrator functions
The following sections discuss the services available to the boat company administrator. The links for these services are not contained in the home page file directly. Instead, they are specified in the include list file. See “Different content for different users” on page 67 for the source of each of these links.
Work with invoices
This link displays the contents of a printer output queue for working with customer invoices. See Figure 3-57. You can use the customize function to choose which columns and actions are shown in the list, as well as the order in which the columns are displayed. In this example, the invoice number is stored as user data and is displayed in the first column.
Figure 3-57 Displaying contents of the printer output queue
Figure 3-58 Viewing the printer output
The PDF option can be used to mail a PDF version of the invoice to the customer. See Figure 3-59.
Check messages
This link displays the contents of the message queue where customer comments are sent. See Figure 3-60.
Check system messages
This link displays the contents of the system operator queue. It provides a way to check system status messages. See Figure 3-61.
Administrator tasks
This link displays the My Commands list for accessing commonly run tasks. You can use the customize function to choose which columns are shown in the list, as well as the order in which the columns are displayed. In this example, a command is used to back up the contents of the BOATS library. See Figure 3-62.
The Prompt action can be used to view or change the command parameters. In our boat example, the command is submitted as a batch job since it could take a long time to complete. See Figure 3-63.
Manage incoming items
This link uses the My Folder list as a way to manage items needing to be handled. See Figure 3-64.
Figure 3-64 Displaying items in a personal folder
In this example, the list contains the results of a database query. These results identify inventory needing to be restocked. The results are stored in the Microsoft Excel format. The Open action is used to view the item. See Figure 3-65.
Monitor jobs
This link displays the list of active jobs for the current user. The administrator could monitor the job list to check the status of the save library batch job. See Figure 3-66.
Figure 3-66 Viewing the active jobs