Customers + Partners log in button for customers and partners
mrc logo

**WARNING: This is an archived article: For the most current information on getting to the Web and creating Java applications using 100% Java with no prior Java training or need to learn Java, please visit the m-Power information page. Our Java capabilities are now Web 2.0-enabled, and 100% Java servlets.** If you'd like more information, or you'd like us to build you a sample over your own files, just let us know.

News & Views, November 2000

What Would You Like to See in This Newsletter?

Every month for many years, mrc has produced and distributed News & Views. It has always included product news, technical articles, and user tips. Hopefully you find value in your free subscription to News & Views. Our product specialists often help our customers on support calls by referring them to past newsletter articles, which tells me that even the articles from several years ago have value today.

This is your newsletter. The advent of the Internet and e-mail have allowed us to simplify its distribution, but the contents of News & Views have always been and will continue to be intended to increase your productive use of the mrc-Productivity Series.

Are you getting everything you want out of this newsletter? Is there a technical issue that you’d like us to cover? Please share your feedback with us! We want to ensure that the topics and issues covered in News & Views continue to provide value to our readers.

Please e-mail me at tracyd@mrc-productivity.com with your suggestions and comments.

Welcome New Customers!
    Alco Industries
    Munns & Dobbins
    Young & Company’s Brewery
    Dymax Adhesives
    Instant Auto
    Nu Horizons Electronics
    Judd Wire
Coming Soon to a Town Near You!

The IBM Extreme Business Tour is making a stop in your city! Take advantage of this educational opportunity and visit mrc at one of these shows:

    November 2, Los Angeles, CA
    November 7, Denver, CO
    November 14, Baltimore, MD
    November 17, Miami, FL

The IBM iSeries and AS/400e Technical Conference is an exceptional educational event designed to solve business challenges and unleash new levels of performance by identifying, understanding and learning how to exploit the latest AS/400 technical advances. Held November 6 - 10 in Orlando, Florida, the conference features presentations and hands-on labs, including those presented by mrc.

Click here for more information on these events.

Creating User-based Menus

This month’s technical article describes one method of creating user-specific Web menus, so that different applications are offered to different users. The method described here involves the use of record-level security, another important topic in today’s Web development considerations. Brian Crowley shows us how to implement this useful technique.

Several customers have asked for a method of displaying different application menus to different Web users. By linking the users’ profiles to specific menu files, you can display different applications to different people, based on how they log on. For example, applications intended for use by the sales department could be grouped together in one menu of sales-only applications and displayed to all sales people who log on.

First, create separate html menus for different users or different sets of users. To create the menus, you could use any free HTML-generating software (such as Microsoft FrontPage or Macromedia Dreamweaver), use the mrc Report to HTML template, or manually duplicate file mrcmenu.html.

Second, create a physical file that links users to menus. You can easily build a maintenance application within the mrc-Productivity Series to create and maintain this physical file. See Figure 1 for an example table. Include these fields:

    User Profile (length 10)
    Name (50)
    Menu URL (50)

Next, define a record-level-security external object that retrieves the user profile and passes it back. You can use mrc-shipped MRCAPPLLIB/ORTNUSER as the program to call. You need to define it to mrc as another external object. The important difference is that, when defining the one parameter for this external object, you need to include the text "*READE" in the parameter description. Including those six characters in the parameter description is what makes the object a "record-level security" object.

Also, define a client-side external object that is a URL client external object. It should have type "U, with no program or library specified, and should be available everywhere. The description will appear on the screen, so choose a description like "Click here to launch menu." It should have one parameter, which is the URL (length of 50, or whatever matches your Menu URL field in the DB file). Please see the mrc user manual for more information on how to specify a client-side external object.

Now you can create a retrieval built over this new table. Select all the fields and the key application by User Profile. Select the C/S application type "Java No Swing Single Record Inquiry." Include the first external object, mapping the User Profile for the record-level-security external-object parameter and using template location *INITOBJ. Include one SmartLink to an external object. Select the client external object from above. Map the Menu URL from the database table as the parameter to that object. When the user clicks that object, the Menu URL is passed to the browser and that menu is displayed.

Finally, create your own logon Web page. Copy the mrclogon.html to your own logon.html page. In your logon.html, change the HTML parameter for "StartMenu" to "Ixxxxx.html" where xxxxx is the retrieval you created above.

Now your users are ready to run the logon html page. Have the user run http://xxx.xxx.xxx.xxx/mrcjava/dd/logon.html from their browser. This could be an icon on the PC desktop or a link from an existing intranet/Internet site. When they logon with their user profile, the logon applet starts "Ixxxxx.html," the record-level security object forces their own record to be retrieved from the file, displaying their full name. See Figure 2 for an example of this simple application. When the user clicks the "Click here to launch menu" SmartLink button, the client side external object launches the menu that belongs to them.

If your menu might change often or you cannot logically group many users together into groups that would share the same menu, you could use a different approach. In the table, you could create a record per user AND application. Then, instead of creating a single record retrieval over the file, create a multiple record retrieval. Now, the user will see a row in a display table for each application that they are authorized to run, according to the database table. When the user selects a record and clicks the "Click here to launch application" button, that application is launched directly. This method eliminates the step required to create html menus manually. For this scenario, you might want to add a field to the table for "application description" so that you can display that text to the user.

mrc-Education Services

mrc offers training sessions at both your location and ours. Visit our education area for more information on our education services, or click here to view our schedule for the entire year. (You will have to log in with your user name and password to visit this area. If you need login instructions, please click here first.)