This example illustrates how to use continuous capture to build a simple drill-down portlet where the initial page displays customer sites. On the initial page, you can click a site ID to “drill-down” and see details about the selected customer.
The example uses the Customer View sample application, which allows you to access detailed information about customers.
The Customer View sample is not a fully functioning
application. Because some records are not fully populated, use the
examples provided.
Building a drill-down portlet
Log in to Web Studio.
In a Web browser, enter:
http://<host>.<domain>:<port>/onepage/index.html
where <hostname> is the name of the machine on which EP 6.1 is installed, <domain> is the domain in which that machine resides, and <port> is the port used to connect to the onepage application.
For example, if you are using the default host name and domain installed with EP, enter:
http://demo.sybase.com:4040/onepage/index.html
In a development environment, your port number may be different,
and in a production system, the port number may not be necessary
at all.
When the Web Studio Login window appears, enter a user name and a password with administrator privileges.
For this example, the default administrator user name and
password are opsuper
(user
name) and 0psuper
(password).
The first character of the password is the number zero.
Select Portlets from the Build menu in the left pane, select New from the Portlet Manager Status menu, and click New to launch the Portlet Builder.
In the Portlet Builder, click the arrow to the right of Add, and select Web Element. You see the Web Studio – New Web Element window.
Access the Customer View application:
In the Location field, enter the URL for the CustomerView application in this format:
http://<host>:<port>/custview/Search.jsp
where, <host> is the fully-qualified hostname for the machine where the application is installed, and <port> is the HTTP port used to access the application, for example:
http://edev-2k.sybase.com:4040/custview/Search.jsp
For this example, use the hostname for the machine where Enterprise Portal is installed.
Click Find. The Login window displays.
Enter any value for User ID and Password and click Login. These values are ignored by the CustomerView sample application.
In CustomerView, select the customer site:
Select the General Search tab and look for the Search By Company Name section. The search is case sensitive.
Enter sybase
into
the Company Name field, and verify that the General Search and Show
Customers With Active Licences options are selected.
For the CustomerView application, valid entries are
sybase
, ebank
,
and ianywhere
.
Click Find. A page displays showing customer sites.
Click Next.
Place the cursor over any site entry in the table, and click the mouse. You see various presentation possibilities.
Scroll through the presentation possibilities and find a five-column grid-like entry.
Click the Select button at the left of the entry, and click Next.
Click Next to bypass the Split window.
Split rules allow you to add parameters by which to split the columns or rows in the table. For example, you can split a table by columns, rows, or by a delimiter (comma, space, and so on). See the Enterprise Portal Developers Guide, Chapter 5 in the section called “Advanced Portlet Creation,” for more information.
In the Define window, complete these options in the Define Record Layout section:
Record Layout – select Rows.
Records Contain Labels – select this option.
Labels Are Displayed in Record – enter 1
.
Transpose Rows and Columns – changes the vertical range of cells to a horizontal range, and the horizontal range of cells to a vertical range. Leave this option unselected (unchecked) for this example.
Click Preview to see the result of defining the record layout, then click Next.
In the Filter window, define a filter rule that includes only records 1– 3. In the Add Filter Rule section:
Select Include Fields from the first drop-down list.
Select Number from the second drop-down list.
Enter 1-3
in the
third field to indicate that you want to use only records 1, 2,
and 3. Click Add.
Records 1-3 are highlighted in the Preview section, and the new rule appears under the Current Filter Rules section. Click Next.
In the Parameter window, click Next to bypass the parameter definition window.
In the Window Preview window, in Element Name, enter Customer Sites. Click Next.
In the Continuous Capture window, click Continue, since the goal of this example is to demonstrate continuous capture.
See “Continuous capture mechanism” for information about the continuous
capture mechanism.
In the pop-up window, click OK to display the Defining Continuous Capture window, which includes the capture that you defined as the initial page.
Define a continuous capture page:
With Format set to One Click, click the link for the first site, then click Next. The Site Profile for the selected link displays. This page allows you to select a desired feature on the captured page.
Click on any text within the Bill To or Sold To areas. Several presentation styles for the data display.
Choose one that preserves the look and feel of the original. Click Select, and then click Next.The Continuous Capture window displays, this time showing the Continuous Capture definition. The window shows the capture level (in this case, 1), the URL, and the corresponding CCL used to extract the requested feature.
Sample level 1 URL:
http://demo\.sybase\.com:4040/custview/ ReportsBuilder\.jsp\?&customerNo=88786&siteId=2 &reportName=None
Sample corresponding CCL:
Cells( <?xml version="1.0"?><params><target type=""/></params>, Feature (C1AAANCAABDA002, Load("_0_", void)));
Click Continue.
Click OK to define another continuous capture window using the same steps. This time, capture the details for the second site in the list. The window shows the two capture levels defined so far, and shows that both URLs map to the same CCL.
Click Generate URL Pattern. The two URLs are replaced with a single generalized URL, as are the two CCLs.
Sample URL (generalized from levels 1 and 2):
http://demo\.sybase\.com:4040/custview/ ReportsBuilder\.jsp\?&customerNo=[^&#]*8siteID= [^&#]*&reportName=None
Sample CCL (same):
Cells( <?xml version="1.0"?><params><target type=""/></params>, Feature (C1AAANCAABDA002, Load("_0_", void)));
Notice that the URL has been turned into a “regular expression” that matches all customers and site IDs.
Click Finish to exit the Continuous Capture step and return to the Portlet Builder window.
In the Element List, the new Customer Site element name displays. In the right pane, the three columns, Site ID, Company Name, and Location display.
Click Save, and configure the portlet:
Content tab – enter CustomerView as the Name of the portlet.
Roles tab – click Add All to allow all users with the available roles to access the portlet.
Presentation tab – select Display Within IFrame and No Popup.
Review the format in the Window Preview.
Click Finish.
When you see the confirmation that the portlets was saved successfully, click OK.
In Portlet Builder, click Preview and test the portlet by clicking any of the Site ID links. You should see details for the target site.
Click Close to exit the Portlet Builder.
Approve the Customer Sites portlet:
Select New from the Portlet Manager Status menu.
In the detail pane, right-click the Customer Sites portlet and select Approval Status | Approved from the menu.
When you see the message that the portlet has been saved successfully, click OK.
Select Approved from the Portlet Manager Status menu and verify that the portlet name now displays under the Approved status.
Copyright © 2004. Sybase Inc. All rights reserved. |
![]() |