![]() |
![]() |
|
|
Deploying the New Example Portal
In this chapter, we will log in as different users to see the portal in action. Then we will enhance the exampleportal login to increment the users' AcmePoints.
This topic includes the following sections:
Viewing the New Example Portal
We have set up everything we need to view the new example portal. Now we will view the example portal on the WebLogic Server. To view the frequent visitor personalization message, we will log in as democustomer. To view the infrequent visitor hints, we will not log into the portal; the portal will then treat us as if we have zero AcmePoints. To get to the portal, go to http://<machine-name>:<port>/application/exampleportal.
Note: Windows users: Do not use the Start Menu exampleportal URL.
Logging In as a Frequent Visitor
Viewing Infrequent Visitor Hints
Enhancing the Example Portal Login
You can add a code to a login page to have the page increment each user's AcmePoints each time they visit the exampleportal. To enhance the login, insert code similar to the example below into the login page. The code increments the logged in users' AcmePoints by 1 each time they log in.
<%-- Load the user's profile into scope. --%>
<um:getProfile scope="session" profileKey="<%=username%>" />
<%-- Get current AcmePoints --%>
<um:getProperty id="points" propertySet="exampleportal" propertyName="AcmePoints"/>
<%
// increment AcmePoints
long newTot = ((Long)points).longValue() + 1;
Long newTotal = new Long(newTot);
%>
<%-- Set incremented AcmePoints --%>
<um:setProperty propertySet="exampleportal" propertyName="AcmePoints" value="<%=newTotal%>"/>
The login page is:
<install-dir>\server\public_html\portals\repository\_userlogin.jsp
Follow these steps to add this code:
<%--setUser(username, request) --%>
example code goes here
<%--If multiple groups, set group check to true --%>
Note: You can also see this property by looking at the AcmePoints propery for username Acme. For more information, see Editing User Properties.
![]() |
![]() |
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|