18
CHAPTER 2-1 Cisco Subscriber Edge Services Manager Web Developer Guide OL-2068-01 2 Basic SESM Customization and Development In some Cisco SESM deployments, you can use one of the sample SESM web applications as a starting point and accomplish look-and-feel modifications to the JSP pages without changing the preprogrammed SESM software. This chapter explains how to do basic customization of the look-and-feel elements of an SESM web application. The chapter discusses these topics: Customizing an SESM Web-Application: An Overview, page 2-1 Changing the Look-and-Feel Elements, page 2-2 Using a Sample SESM Web Application, page 2-3 Developing an SESM Web Application, page 2-6 The SESM software uses Java resource bundles and properties files for localization of text, labels on web-page controls, and messages. For information on localization and resource bundles, see Chapter 5, “SESM Internationalization and Localization.” Customizing an SESM Web-Application: An Overview When you develop a Cisco SESM web application, three levels of web-application customization are possible: basic, advanced, and system integrator. Basic SESM Customization In some Cisco SESM deployments, you can use one of the sample SESM web applications as a starting point and accomplish look-and-feel modifications to the JSP pages without changing the preprogrammed SESM software. In this type of customization, the developer might change text, images, and the positioning of elements on a page. Basic customization might be appropriate when using SESM for Small-to-Medium-Size Enterprise (SME) wireless LAN hotspots that require simple look-and-feel changes to the web application or require some subset of SESM functionality, such as authentication.

Basic SESM Customization and Developmentdocstore.mik.ua/univercd/cc/td/doc/solution/sesm/sesm_313/webde… · The SESM software uses Java resource bundles and properties files for

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Basic SESM Customization and Developmentdocstore.mik.ua/univercd/cc/td/doc/solution/sesm/sesm_313/webde… · The SESM software uses Java resource bundles and properties files for

Cisco Subscriber Edge ServOL-2068-01

C H A P T E R 2

tartingmed

nts of

ls on

are

tartingmed

forlation.

Basic SESM Customization and Development

In some Cisco SESM deployments, you can use one of the sample SESM web applications as a spoint and accomplish look-and-feel modifications to the JSP pages without changing the preprogramSESM software. This chapter explains how to do basic customization of the look-and-feel elemean SESM web application. The chapter discusses these topics:

• Customizing an SESM Web-Application: An Overview, page 2-1

• Changing the Look-and-Feel Elements, page 2-2

• Using a Sample SESM Web Application, page 2-3

• Developing an SESM Web Application, page 2-6

The SESM software uses Java resource bundles and properties files for localization of text, labeweb-page controls, and messages. For information on localization and resource bundles, seeChapter 5,“SESM Internationalization and Localization.”

Customizing an SESM Web-Application: An OverviewWhen you develop a Cisco SESM web application, three levels of web-application customizationpossible: basic, advanced, and system integrator.

Basic SESM CustomizationIn some Cisco SESM deployments, you can use one of the sample SESM web applications as a spoint and accomplish look-and-feel modifications to the JSP pages without changing the preprogramSESM software. In this type of customization, the developer might change text, images, and thepositioning of elements on a page. Basic customization might be appropriate when using SESM Small-to-Medium-Size Enterprise (SME) wireless LAN hotspots that require simple look-and-feechanges to the web application or require some subset of SESM functionality, such as authentic

2-1ices Manager Web Developer Guide

Page 2: Basic SESM Customization and Developmentdocstore.mik.ua/univercd/cc/td/doc/solution/sesm/sesm_313/webde… · The SESM software uses Java resource bundles and properties files for

Chapter 2 Basic SESM Customization and DevelopmentChanging the Look-and-Feel Elements

loselybasic

type fromape

cedion on

rators

nt of

t the allowdards

ts and static

atic JSP

the

This level of customization is also used by deployments whose business requirements correspond cto the existing structure of a sample SESM web application, such as NWSP. This chapter discussescustomization.

Advanced SESM CustomizationOther SESM deployments will require use of the more advanced customization techniques. In thisof SESM web-application customization, you might add or remove JSP pages, or move elementsone JSP page to another. You might add a JSP-page dimension decorator for the SESM user-shmechanism. You can accomplish some of the more advanced customizations by modifying thedeployment descriptor file (web.xml) for the SESM web application. You accomplish other advancustomizations by creating new JSP pages. No Java servlet programming is needed. For informatadvanced customization techniques, seeChapter 3, “Advanced SESM Customization.”

System-Integrator CustomizationSome service-provider deployments of SESM may need the professional services of system integto modify the functionality of the internal SESM software, such as the Java servlets for the SESMcontrols. This type of customization is beyond the scope of this guide and requires the involvemeCisco technical assistance.

Changing the Look-and-Feel ElementsBasic SESM web-application customizations involve changing the look-and-feel elements to meeservice provider’s brand requirements. The customizable JSP pages and look-and-feel elementsdevelopers to create web pages that incorporate artistic flexibility and meet corporate identity stanwithout requiring extensive JSP or Java programming expertise.

To meet the service provider’s corporate standards, you can modify static markup language elemenimages (template text) that appear in a template or JSP page. For example, you can change theHTML elements for text and formatting. In these elements, the developer can:

• Change the background colors and background images used in the JSP pages

• Adjust the layout of the JSP pages

• Modify or replace icons, images, and graphical elements used in the JSP pages

• Customize a style sheet

If you are performing only basic look-and-feel customizations, you must avoid changing programmelements within the JSP pages. Do not change directives and code in scripting elements such asexpressions, scriptlets, and declarations.

Customizing some of the SESM functionality that is preprogrammed into the JSP pages can beaccomplished by configuring the application. Other functionality changes may require modifying code in the JSP pages. For information on these types of customization, seeChapter 3, “Advanced SESMCustomization.”

2-2Cisco Subscriber Edge Services Manager Web Developer Guide

OL-2068-01

Page 3: Basic SESM Customization and Developmentdocstore.mik.ua/univercd/cc/td/doc/solution/sesm/sesm_313/webde… · The SESM software uses Java resource bundles and properties files for

Chapter 2 Basic SESM Customization and DevelopmentUsing a Sample SESM Web Application

es a

ion isments.s and

reebe JSP

ns areDA,

ample

portaliewinger

Using a Sample SESM Web ApplicationEach sample Cisco SESM web application, such as New World Service Provider (NWSP), includfully functional set of web components. Each sample web application uses the same SESMinfrastructure. The simplest, fastest-to-implement approach to developing an SESM web applicatto use the components in a sample SESM web application and then change the look-and-feel eleThis section provides an overview of the set of components in the sample SESM web applicationfocuses on the NWSP web application.

The sample NWSP, PDA, and WAP web applications share many of the same components.

The sets of infrastructure components provided in the PDA and WAP sample web applications aidentical to the NWSP set of infrastructure components. However, because the PDA and WAP wapplications are designed for specific client devices, they use JSP pages that are different from thpages of NWSP.

The sets of resources (Java resource bundles) used in the PDA and WAP sample web applicatiovery similar to the NWSP set of resources. The deployment descriptor files used for the NWSP, Pand WAP applications are also very similar.

For more detailed information on the elements that appear on the JSP pages associated with a sSESM web application, seeChapter 4, “Sample SESM Web Applications.”

NWSP User InterfaceThe NWSP user interface provides a web portal for network services. The subscriber uses the webfor subscribing to and selecting services, changing account details, creating subaccounts, and vsession status and messages.Figure 2-1 shows the home page from the NWSP web application’s usinterface.

2-3Cisco Subscriber Edge Services Manager Web Developer Guide

OL-2068-01

Page 4: Basic SESM Customization and Developmentdocstore.mik.ua/univercd/cc/td/doc/solution/sesm/sesm_313/webde… · The SESM software uses Java resource bundles and properties files for

Chapter 2 Basic SESM Customization and DevelopmentUsing a Sample SESM Web Application

s:

sks

sksy area.

changeents

roundtools

Figure 2-1 NWSP Home Page

The Home page and many other pages in the NWSP web application are organized into five part

• Banner—One or more images for product and brand identification.

• Navigation bar—A set of buttons that link to other pages where the subscriber can perform tasuch as service subscription or view information such as service status.

• Service list—A tree of icons and associated service names that the subscriber uses to selectsubscribed services from a tree of services and service groups.

• Body—An area for the content provided by the NWSP web application. Forms for subscriber tasuch as account management, service subscription, and subaccount creation appear in the bod(With NWSP, network services are displayed in a new browser window.)

• Log Out button—A button to log out of the NWSP web application.

JavaServer PagesThe sample SESM web applications are implemented in a set of JSP pages and Java servlets. Tothe look and feel of an SESM sample web application, you need to become familiar with the elemthat are present in the JSP pages provided in a sample SESM web application such as NWSP.

The JSP pages in the NWSP web application include a complete set of customizable images, backgcolors, icons, buttons, a navigation bar, and style sheets. For NWSP, the Fireworks graphics designwere used to create the icons for the service list and the buttons for the navigation bar.

1 Banner

2 Navigation bar

3 Service list

4 Body

5 Log Out button

2

1

3

4

6976

1

5

2-4Cisco Subscriber Edge Services Manager Web Developer Guide

OL-2068-01

Page 5: Basic SESM Customization and Developmentdocstore.mik.ua/univercd/cc/td/doc/solution/sesm/sesm_313/webde… · The SESM software uses Java resource bundles and properties files for

Chapter 2 Basic SESM Customization and DevelopmentUsing a Sample SESM Web Application

anment.

s theheize the

nativefiles

n bartton in

button.

seriesor

a newisting

sheetsesigners the

leased

ery samehange

Banner Images and Background Colors

In the NWSP banner (seeFigure 2-1), the images and background colors are used for branding. You creplace these images with company, product, and brand logos that are appropriate for your deploy

Icons and Buttons

For the NWSP service list and navigation bar (seeFigure 2-1), the icons and buttons are provided invarious formats, including GIF, JPEG, and PNG.

• The GIF and JPEG image files are incorporated into the web pages. Their small file size makeoptimized GIF and JPEG files suitable for downloading. You can also use these files to edit timages. You can use Fireworks or another graphics design tool, such as Photoshop, to customimages and embedded text.

• The PNG files are used when the web designer edits the images. Because PNG format is theFireworks file format, you can use Fireworks to customize the images and embedded text. PNGcan also be read by other graphics applications, such as Photoshop.

Buttons, such as the Log Out button and Cancel button, that do not appear in the NWSP navigatioare defined once in a single JSP page or in a Dreamweaver template. You can customize each buthe one location where it is defined and have the change take effect in all JSP pages that use the

Navigation Bar

A Dreamweaver navigation bar (sometimes called a nav bar) is a set of buttons that appears on aof related web pages and that provides a consistent mechanism for navigation between pages. Fexample, the NWSP web application contains a navigation bar (seeFigure 2-1) below the banner on mostof its pages.

When modifying a Dreamweaver navigation bar, you can use the existing NWSP buttons or createset of buttons. You can use Fireworks or another graphics design tool to change the text on the exNWSP buttons. For more information on the navigation bar, see the“NWSP Navigation Bar” section onpage 4-15.

Style Sheets

The NWSP web application uses Cascading Style Sheets for its presentation elements. The styledefine classes for the textual elements that are used on the JSP pages. The style sheets allow dto change fonts, margins, colors, and other aspects of style that control the layout and design ofNWSP web pages. The style sheets used by NWSP are located in the \install_dir\nwsp\docroot\stylesdirectory. In other SESM web applications such as PDA, there may be multiple brand-specific stysheets in different directories from which the SESM software dynamically selects one style sheet bon the subscriber’s brand.

Dreamweaver TemplatesThe sample NWSP web application includes two Dreamweaver templates. These files have thesuffix.dwt and reside in the /nwsp/docroot/templates directory. Dreamweaver templates can be vuseful for customizing or maintaining a web application’s JSP pages when many pages have thelayout. By modifying a template and then updating the JSP pages that use the template, you can cthe look and feel of an entire set of pages very quickly.

2-5Cisco Subscriber Edge Services Manager Web Developer Guide

OL-2068-01

Page 6: Basic SESM Customization and Developmentdocstore.mik.ua/univercd/cc/td/doc/solution/sesm/sesm_313/webde… · The SESM software uses Java resource bundles and properties files for

Chapter 2 Basic SESM Customization and DevelopmentDeveloping an SESM Web Application

ted anded onmplate,odify

t a

part ofents.

to

eps:

y do

ages,

evice

When a JSP page is derived from a template, the JSP page has locked regions that cannot be edieditable regions that can be edited. The intention with locked regions is that if changes are requira locked region, the changes are made in the template file. After the changes are made to the teall files that use the template can then be automatically updated to incorporate the changes. You mthe template and update all occurrences on the web site using the Dreamweaverupdate commands inthe Modify > Templates menu.

The use of Dreamweaver templates and automatic updating is a recommended approach but norequirement.

If changes are required to individual JSP pages (as opposed to in a Dreamweaver template), thethe individual JSP page that you can modify appears between BeginEditable and EndEditable commFor example, the main editable area in the mainTemplate.dwt is empty, allowing each JSP page provide content that is appropriate for its purpose:

!-- #BeginEditable "main" -->&nbsp;<!-- #EndEditable -->

For more information on templates, see the“NWSP Templates” section on page 4-10 and theDreamweaver UltraDev documentation.

Developing an SESM Web ApplicationDepending on the service provider’s business requirements for an SESM web application, the strequired to develop the application may vary. These steps are described in the following sections

• Defining the Business Requirements, page 2-6

• Designing and Implementing an SESM Web Application, page 2-7

• Debugging an SESM Web Application, page 2-13

• Managing an SESM Web Site, page 2-18

Tip One error that developers frequently commit when developing an SESM web application is that thenot perform the steps requiredto compile the JSP pages after they have modified them. The SESMsample web applications are installed withprecompiled JSP pages. After changing the JSP pages, youmust take a few simple steps to recompile them successfully. For information on compiling JSP psee the“JSP Compilation” section on page 2-8.

Defining the Business RequirementsThe process of defining the business requirements for a specific service provider’s SESM webapplication can be organized around the following questions:

• What functionality is required?

• What look-and-feel elements (icons, images, background colors, and style sheets) must becustomized?

• Will SESM web pages be rendered to match one or more subscriber characteristics, such as dor brand?

2-6Cisco Subscriber Edge Services Manager Web Developer Guide

OL-2068-01

Page 7: Basic SESM Customization and Developmentdocstore.mik.ua/univercd/cc/td/doc/solution/sesm/sesm_313/webde… · The SESM software uses Java resource bundles and properties files for

Chapter 2 Basic SESM Customization and DevelopmentDeveloping an SESM Web Application

is

riber’s

style

JAR

,

• What types of localization (if any) are required?

– If only English-language subscribers will use an SESM web application, the base set ofcomponents in a sample SESM web application may not require localization.

– If subscribers use a single language other than English, a single web site localized for thlanguage may be sufficient.

– If subscribers use many languages, rendering SESM web pages localized for each subsclanguage and character set may be required.

• Do any application-specific messages need to be internationalized and localized?

Designing and Implementing an SESM Web ApplicationThe design and implementation phases may involve one or more of the following tasks:

• Modifying the functionality of a sample SESM web application

• Customizing the look and feel of web elements such as icons, images, background colors, andsheets

• Localizing web elements

• Creating additional locale-specific properties files

• Designing, implementing, and populating a sparse-tree directory

• Coding revised or new JSP-pages dimension decorators for the user-shape mechanism

• Configuring the web application deployment descriptor file

• Internationalizing and localizing exceptions

SESM Class Libraries

The Cisco SESM software provides several specialized Java class libraries that encapsulate thefunctionality required in an SESM web application. The SESM class libraries are distributed in the(Java archive) files listed inTable 2-1. In the table,install_dir is the directory where the SESM softwareis installed, andwebapp is a directory where a sample SESM web application, such as NWSP, isinstalled.

Table 2-1 JAR Files for an SESM Web Application

JAR File Description

install_dir/lib/lib/com.cisco.sesm.lib.jar

Classes for Java Management Extensions (JMX),JUnit utilities, and logging facilities used by anSESM web application.

install_dir/webapp/docroot/Web-inf/lib/com.cisco.sesm.contextlib.jar

Classes for the SESM decorators and controllersinternationalization and localization, and taglibraries.

install_dir/webapp/docroot/Web-inf/lib/jsp.jar

Classes for the precompiled JSP pages.

install_dir/webapp/docroot/Web-inf/lib/sesm.jar

Classes for core and model services such asauthentication, authorization, service connection,and billing.

2-7Cisco Subscriber Edge Services Manager Web Developer Guide

OL-2068-01

Page 8: Basic SESM Customization and Developmentdocstore.mik.ua/univercd/cc/td/doc/solution/sesm/sesm_313/webde… · The SESM software uses Java resource bundles and properties files for

Chapter 2 Basic SESM Customization and DevelopmentDeveloping an SESM Web Application

, the

le,iler if

adocu arervlets,doc by

an

lasses

n thesary

ll thes the

the

TheCLASSPATH environment variable must be set toinstall_dir/webapp/docroot/Web-inf/lib to tell theJava compiler the location of the com.cisco.sesm.lib.jar file. In the sample SESM web applicationsenvironment variable is set through the start script (for example, startNWSP.sh on UNIX andstartNWSP.cmd on Windows), which is executed when the web application is started. Any JAR fiincluding com.cisco.sesm.contextlib.jar, jsp.jar, and sesm.jar files, can be found by the Java compit resides in the web application’s /Web-inf/lib directory.

Javadoc Documentation

The Cisco SESM software includes a full set of online documentation in Javadoc format. The Javdocumentation includes information on all Java classes that implement the SESM software. If yocustomizing the JSP pages of an SESM web application, the Java class descriptions for control sedecorator servlets, JavaBeans, and tag libraries are of particular interest. You can access the Javaopening the file \install_dir\docs\apidoc\index.html in a browser.

JSP Compilation

The use of precompiled JSP pages allows an SESM server that has the required Java RuntimeEnvironment (JRE) to run the NWSP web application. If an SESM server has the JRE, it can runSESM web application without having a Java 2 SDK installed.

The JSP pages in each sample SESM web application are precompiled and the resulting servlet care installed in the \install_dir\webapp\docroot\Web-inf\lib\jsp.jar file. In the path name,install_dir isthe directory where the SESM software is installed, andwebapp is a directory where a sample SESMweb application, such as NWSP, is installed.

A Java 2 SDK is not required to run an SESM web application. However, to perform development oJSP pages, youmustinstall the Java 2 SDK on the development machine. The Java 2 SDK is necesfor recompiling changed JSP pages. For information on the required Java 2 SDK, see the“Hardware andSoftware Requirements for Development” section on page 1-6.

Tip On machines that are used for SESM web application development, we recommend that you instaJava 2 SDK before you install the SESM software. In that way, the SESM installation program useJava 2 SDK in the SESM web application startup scripts, rather than a JRE.

To check whether a Java 2 SDK is installed on the development machine, look for a tools.jar file inJDK_install_dir/lib directory, whereJDK_install_dir is the location where you think the Java 2 SDK islocated. If the tools.jar file is present, a Java 2 SDK is installed.

If you install the Java 2 SDKbefore installing SESM, read the“Recompiling and the web.xml File”section on page 2-9.

If you need to install the Java 2 SDKafter installing SESM, read the“Installing a Java 2 SDK AfterInstalling SESM” section on page 2-8and the“Recompiling and the web.xml File” section on page 2-9.

Installing a Java 2 SDK After Installing SESM

If you install the Java 2 SDKafter installing SESM, you must do the following:

• Ensure that theJDK_HOME environment variable points to the directory where you installed theJava 2 SDK.

• Edit the SESM application startup script to use the Java 2 SDK.

2-8Cisco Subscriber Edge Services Manager Web Developer Guide

OL-2068-01

Page 9: Basic SESM Customization and Developmentdocstore.mik.ua/univercd/cc/td/doc/solution/sesm/sesm_313/webde… · The SESM software uses Java resource bundles and properties files for

Chapter 2 Basic SESM Customization and DevelopmentDeveloping an SESM Web Application

DKava

tion

l fileges. To

The SESM application startup scripts are named startWEBAPP.cmd on Windows-based installations andstartWEBAPP.sh on UNIX-based installations. In the script name,WEBAPP is the name of the webapplication. For example, the startup script for NWSP is startNWSP.cmd or startNWSP.sh.

In the startup script on a Windows-based installation, change the line that specifies the Java 2 Slocation (JDK_HOME) to point to the correct directory, and uncomment the two lines that check for a Jcompiler (JAVAC). For example:

rem find some java or otherset JDK_HOME=D:\jdk1.3

set JAVA=%JDK_HOME%\bin\java.exeset JAVAC=%JDK_HOME%\bin\javac.exe

rem Note that we only need this if we are developing, so for nowrem we can comment the check out. Developers should remove these commentsrem if exist "%JAVAC%" goto gotjdkhomerem echo JDK_HOME does not point to a valid JDK. JSPs will not be compiled.

In startup script on a UNIX-based installation, change the line that specifies the Java 2 SDK loca(JDK_HOME) to point to the correct directory, and uncomment the four lines that check for a Javacompiler (JAVAC). For example:

# Check we can find a suitable version of the JDKJDK_HOME=/usr/java1.2

JAVAC=$JDK_HOME/bin/$JAVACEXEJAVA=$JDK_HOME/bin/$JAVAEXE

# Note that we only need this if we are developing, so for now# we can comment the check out. Developers should remove these commentsif [ ! -x $JAVAC ]then

echo WARNING: JDK_HOME does not point to a valid JDK. JSPs can not be compiled.fi

Recompiling and the web.xml File

The web.xml file in \install_dir\webapp\docroot\Web-inf is the SESM web application deploymentdescriptor file. This file defines how the Jetty web server finds the JSP pages. The default web.xmfor each sample SESM web application specifies that the web server uses the precompiled JSP pacompile modified JSP pages, use the web.recompile.xml file in place of the default web.xml file.

Note Until you perform the following steps, changing the JSP pages ininstall_dir/webapp/docroot has noeffect on the HTML pages that the NWSP web application displays.

To recompile modified JSP pages in the NWSP web application, you must do the following:

Step 1 Stop the web server.

Step 2 In the \install_dir\nwsp\docroot\Web-inf directory, rename the web.xml to web.xml.bak.

Step 3 In the \install_dir\nwsp\docroot\Web-inf directory, rename web.recompile.xml to web.xml.

Step 4 Restart the web server.

.

2-9Cisco Subscriber Edge Services Manager Web Developer Guide

OL-2068-01

Page 10: Basic SESM Customization and Developmentdocstore.mik.ua/univercd/cc/td/doc/solution/sesm/sesm_313/webde… · The SESM software uses Java resource bundles and properties files for

Chapter 2 Basic SESM Customization and DevelopmentDeveloping an SESM Web Application

howost

uide

A and

e does

n be

ication

ande

group

erver

se an, the

AP

aviorlated

Demo Mode

You can install or configure the SESM software for demonstration mode (Demo mode) to observethe NWSP web application works. In Demo mode, the NWSP web application can demonstrate mSESM functionality. For information on installing or configuring for Demo mode, see theCiscoSubscriber Edge Services Manager and Subscriber Policy Engine Installation and Configuration G.

Note The sample PDA and WAP demo applications also work in Demo mode. However, because the PDWAP applications demonstrate only the subset of SESM functionality that is appropriate for theirtargeted devices, this description of Demo mode focuses on the NWSP web application.

Demo mode is also useful during some phases of web-application development because this modnot require other system components, such as a configured SSG.

• If the web designer modifies the look and feel of the NWSP web application, the changes caviewed in Demo mode to observe the results.

• If the web developer changes programmatic pieces of a JSP page, many changes in web-applbehavior can be initially tested in Demo mode to verify the results.

For the NWSP sample application, Demo mode uses a Merit RADIUS file for subscriber, service,service group information. By default, the Merit RADIUS file is named demo.txt and resides in th\install_dir\nwsp\config directory. A Merit RADIUS file is an ASCII file that you can modify using atext editor. Using Demo mode, you can observe how changes to a subscriber, service, or serviceprofiles affect the NWSP web application.

Tip If you make changes to the demo.txt file, you will not be able to observe the changes until the web sis stopped and restarted.

Captive Portal and Demo Mode

The full set of behaviors of the Captive Portal solution cannot be observed in Demo mode becauconfigured SSG and its TCP Redirect feature are required to make the solution work. For this reasoCaptive Portal software is not installed in a Demo mode installation of SESM.

To run Captive Portal in Demo mode, you must install the Captive Portal software in RADIUS or LDmode, and then start the Captive Portal web application using the-mode option. For example:

startCAPTIVEPORTAL.sh -mode Demo

With Captive Portal running in Demo mode, you can use simulated HTTP requests to view the behof the Captive Portal servlet and the content web applications. For example, you could send a simuHTTP request to the message portal servlet (MessagePortalServlet ) if you included the requiredquery-string parameters (such asCPURLandCPDURATION) in the request. For information on the CaptivePortal solution and the query-string parameters, see the“Captive Portal Web Application” section onpage 4-23.

2-10Cisco Subscriber Edge Services Manager Web Developer Guide

OL-2068-01

Page 11: Basic SESM Customization and Developmentdocstore.mik.ua/univercd/cc/td/doc/solution/sesm/sesm_313/webde… · The SESM software uses Java resource bundles and properties files for

Chapter 2 Basic SESM Customization and DevelopmentDeveloping an SESM Web Application

US

t, andP web

erces one webe.

set ofAP

and

re of thendow

RADIUS Mode Functionality

To simulate RADIUS mode functionality (such as service selection), the subscriber, service, andservice-group profiles in demo.txt use the standard RADIUS attributes and vendor-specific RADIattributes (VSAs). The attributes are described in theCisco Subscriber Edge Services Manager andSubscriber Policy Engine Installation and Configuration Guide. For example, the following profile fromdemo.txt is for the subscriber radiususer:

radiususer Password = "cisco" Service-Type = Framed-User, Account-Info = "Ainternet-blue", Account-Info = "Ninternet-blue", Account-Info = "Niptv", Account-Info = "Ngames", Account-Info = "Ndistlearn", Account-Info = "Ncorporate", Account-Info = "Nshop", Account-Info = "Nbanking", Account-Info = "Nvidconf" Account-Info = "Hhttp://www.spiderbait.com"

DESS Mode Functionality

To simulate DESS mode functionality (such as subscriber self-subscription, account managemensubaccount creation), the allowed subscriber profile attributes have been extended so that the NWSapplication can demonstrate DESS mode features:

• Different types of subscriber privileges (for service selection, service subscription, accountmanagement, and subaccount creation)

• Account attributes with X.500 information (title, given name, surname, and so on)

• Services and service groups that are available for subscription but not yet subscribed

• Parent account names for subaccounts

The extended set of attributes like other RADIUS attributes used by an SESM web application arread-only. However, NWSP in Demo mode does correctly simulate DESS mode functionality. Foexample, in Demo mode, if a subscriber adds or deletes a subscription, the list of subscribed servithe My Services page and in the service list are dynamically updated. The changes persist until thserver is stopped. The NWSP web application does not modify attributes in the Merit RADIUS fil

Note The extended set of subscriber profile attributes are allowed for Demo mode only. The extendedattributes are not valid vendor-specific attributes (VSAs). They are not valid in RADIUS mode or LDmode and are not recognized by the SSG. They should not be added to the RADIUS dictionary.

In NWSP, the demo.txt file contains two subscriber profiles for simulating DESS mode: ldapuser1ldapuser2. These subscriber profiles provide examples of the attribute extensions. For detailedinformation on the extended set of attributes for demonstrating DESS features, see theCisco SubscriberEdge Services Manager and Subscriber Policy Engine Installation and Configuration Guide.

Dreamweaver UltraDev 4 Live Data Window

When you are developing a Cisco SESM web application, you can use the Live Data window featuDreamweaver UltraDev 4 to make changes to your JSP pages in a live data environment. UnlikeDocument window, which uses placeholders for dynamic content on a JSP page, the Live Data wishows the actual dynamic content that is generated by the JSP page.

2-11Cisco Subscriber Edge Services Manager Web Developer Guide

OL-2068-01

Page 12: Basic SESM Customization and Developmentdocstore.mik.ua/univercd/cc/td/doc/solution/sesm/sesm_313/webde… · The SESM software uses Java resource bundles and properties files for

Chapter 2 Basic SESM Customization and DevelopmentDeveloping an SESM Web Application

ta,

data

ps.sts for

Figure 2-2 shows how myAccount.jsp is displayed in the Live Data window. To display dynamic daUltraDev runs the JSP page on the web server before displaying it in the Live Data window. InFigure 2-2, notice that the Live Data window displays services in the service list and any subscriber(for example, first name and last name) in the subscriber profile.

Figure 2-2 Live Data Window

Note Editing in a live data environment is available starting with Dreamweaver UltraDev 4.

To configure and use the Live Data window for the NWSP web application, perform the following steThe procedure assumes that the web server is running on the local machine and listening for requethe NWSP web application on port 8080.

Step 1 Start Dreamweaver UltraDev 4.

Step 2 In theSite menu, clickNew Site.

Step 3 In theCategory list, click Local Info and specify the following:

Site Name: NWSP

Local Root Folder:C:\SESM_location\nwsp\docroot\ (In this procedure,C:\SESM_location is thelocation where the SESM software is installed.)

HTTP Address: http://localhost:8080

Step 4 In theCategory list, click Remote Info and specify the following:

Access: Local/Network

Remote Folder:C:\SESM_location\nwsp\docroot\

Step 5 In theCategory list, click Application Server and specify the following:

Server Model: JSP 1.0

Scripting Language: Java

2-12Cisco Subscriber Edge Services Manager Web Developer Guide

OL-2068-01

Page 13: Basic SESM Customization and Developmentdocstore.mik.ua/univercd/cc/td/doc/solution/sesm/sesm_313/webde… · The SESM software uses Java resource bundles and properties files for

Chapter 2 Basic SESM Customization and DevelopmentDeveloping an SESM Web Application

lues,

o thefile.

ndow,

t be

teation

angetion

Page Extension: .jsp

Access: Local/Network

Remote Folder:C:\SESM_location\nwsp\docroot\ (for example)

URL Prefix: http://localhost:8080/user=golduser/device=pc/locale=en/shape/

In URL Prefix, the values given after the port number are test decorator values that useURL-to-servlet mapping to specify the user, device, and locale. For information on using test vasee the“Using Test Decorators” section on page 2-14.

Note To use the test decorators specified in the URL Prefix, copy the contents of the web.dev.xml file tend of the web.xml file used by the SESM web application, and then save the modified web.xml Restart the web server. The web.dev.xml file is located in the \install_dir\nwsp\config directory.

Step 6 Click OK .

Step 7 To use the Live Data window to view a JSP page:

a. Double-click the name of the JSP page.

b. In the Document window that displays the JSP page, from theView menu, clickLive Data.

UltraDev displays the actual dynamic content that is generated by the JSP page. In the Live Data wiyou can edit the page’s layout and JSP-page content. For information on editing in a live dataenvironment, seeUsing Dreamweaver UltraDev, which is available on the web at:

http://www.macromedia.com/support/ultradev/documentation/using_ultradev_4.html

General Web Development Considerations

Some general web development considerations for a Cisco SESM web application include:

• We recommend the technique in which the web application redirects aPOSTrequest to aGETrequest.The Cisco SESM software has no mechanisms that support or prevent this technique.

• The decoration JSP pages and include files must not write and flush any characters to theServletOutputStream . If either does, the forwarding HTTP request throws anIllegalStateException . This restriction is imposed by the servlet container.

• As is usual with any web application, all references to a web resource from a web page musrelative.

A web application can be deployed with a prefix, which is specified in the web.xml file. An absolureference to another web resource within the same web application must include the web applicprefix. However, the web application has no knowledge of the web application prefix. Therefore,references to web resources must be relative.

Debugging an SESM Web ApplicationIf an SESM web application is not operating as expected, you can use the SESM logging utility to chthe details of the information reported in the log files to diagnose a problem. For detailed informaon logging and debugging mechanisms available for an SESM web application, see theCisco SubscriberEdge Services Manager and Subscriber Policy Engine Installation and Configuration Guide.

2-13Cisco Subscriber Edge Services Manager Web Developer Guide

OL-2068-01

Page 14: Basic SESM Customization and Developmentdocstore.mik.ua/univercd/cc/td/doc/solution/sesm/sesm_313/webde… · The SESM software uses Java resource bundles and properties files for

Chapter 2 Basic SESM Customization and DevelopmentDeveloping an SESM Web Application

andervlet

nntilrvlet

dor.

ge,he, makeh the

s are web

per to

mon

ation

used

valuesis.

do the

The following hints may help with debugging an SESM web application:

• Most web servers can be set up so that the servlet code generated from JSP pages is savedavailable for examination. With the Jetty web server, when the JSP pages are compiled, the scode is put in a temporary directory that is determined by the machine’s Java VirtualMachine (JVM). Normally, the temporary directory is /tmp or /usr/tmp on UNIX, and C:\TEMP oWindows NT or Windows 2000. The servlet code can be examined in the temporary directory uit is deleted by the operating system’s normal cleanup mechanism. For information on where secode is located with other web servers, refer to the documentation from your web server ven

• With the Internet Explorer browser, when an error occurs in the dynamic portion of a JSP paInternet Explorer displays an alternative “friendly” (and less helpful) HTTP error message if tShow friendly HTTP error messages box is checked. To view server-generated error messagessure this box is not checked in the Advanced Tab for Internet Options, which you access througTools menu.

• Some SESM web application files such as web.xml and the properties files for resource bundleread once when the web application is started. Changes to these files have no effect until theapplication is stopped and restarted.

Using Test Decorators

The SESM software includes a number of Java servlets calledtest decorators that are very useful fordevelopment and testing of an SESM web application. The test decorators allow the SESM develoset specific values for

• User name and password

• Locale language, country, and variant

• Other dimensions of the user shape such as brand and device

The web.dev.xml file has declarations for a number of test decorators preconfigured with some comvalues. For NWSP, the web.dev.xml file is located in the \install_dir\nwsp\config directory. You can addto or modify the test values in web.dev.xml to meet your development and testing needs. For informon user-shape decoration and decorators, see the“SESM Software Concepts” section on page 3-6.

Note To use the test decorators, copy the contents of the web.dev.xml file to the end of the web.xml fileby the SESM web application, and then save the modified web.xml file. Restart the web server.

Each test decorator has an associated URL-to-servlet mapping that allows you to specify the testin the URL when requesting an SESM web page. When the URL for a web application resource preceded by URL-mapped test decorators, the corresponding test decorator servlets are invokedConsider the following URL requesting myAccount—a control servlet for the My Account page:

http://localhost:8080/user=golduser/device=pda/locale=de/myAccount

When the preceding URL is used in demonstration mode, test decorator servlets are invoked andfollowing:

• Authenticate the user name and password for golduser

• Set thedevice dimension of the user shape topda

• Set thelocale dimension of the user shape tode (Germany)

2-14Cisco Subscriber Edge Services Manager Web Developer Guide

OL-2068-01

Page 15: Basic SESM Customization and Developmentdocstore.mik.ua/univercd/cc/td/doc/solution/sesm/sesm_313/webde… · The SESM software uses Java resource bundles and properties files for

Chapter 2 Basic SESM Customization and DevelopmentDeveloping an SESM Web Application

t of

e

against

red in

The following sections provide information on the test users, locales, anddevice andbrand dimensionsthat are preconfigured in the web.xml file. For information on how you can modify and add to the setest values and for information on the test decorator servlets, seeAppendix B, “SESM Utility ServletsQuick Reference”.

Test Users

Table 2-2 lists some of the test users, passwords, and URL mappings that are preconfigured in thweb.dev.xml file. For each URL mapping, theTestUserDecorator servlet sets the user name andpassword to the values shown in the table.TestUserDecorator then automatically attempts toauthenticate with the user name and password. In Demo mode, the SESM software authenticatesthe subscriber profiles defined in the Merit RADIUS file demo.txt. The demo.txt file resides in the/config directory of the SESM web application.

Test Locales

Table 2-3lists some of the test locales, associated values, and URL mappings that are preconfiguthe web.dev.xml file. For each URL mapping, theLocaleDecorator servlet sets thelocale dimension tothe value shown in the table.

Table 2-2 Test Users: Names and Password

User Name and Password URL Mapping

User name: user1Password: cisco

/user=user1/*

User name: user2Password: cisco

/user=user2/*

User name: user31Password: cisco

/user=user31/*

User name: user42Password: cisco

/user=user42/*

User name: user43Password: cisco

/user=user43/*

User name: user44Password: cisco

/user=user44/*

User name: golduserPassword: cisco

/user=golduser/*

User name: subgolduserPassword: cisco

/user=subgolduser/*

Table 2-3 Test Locales

Locale Value URL Mapping

Australia au /locale=au/*

France fr /locale=fr/*

Germany de /locale=de/*

2-15Cisco Subscriber Edge Services Manager Web Developer Guide

OL-2068-01

Page 16: Basic SESM Customization and Developmentdocstore.mik.ua/univercd/cc/td/doc/solution/sesm/sesm_313/webde… · The SESM software uses Java resource bundles and properties files for

Chapter 2 Basic SESM Customization and DevelopmentDeveloping an SESM Web Application

ton isllow

ears

Test Devices and Brands

Table 2-4 lists some of the test devices, brands, associated values, and URL mappings that arepreconfigured in the web.dev.xml file. For each URL mapping, theTestDimensionDecorator servlet setsthedevice or brand dimension to the value shown in the table.

Using Device Simulators for WAP and WML

WAP phone simulators are very useful for development and testing an SESM web application thagenerates WAP content using Wireless Markup Language (WML). The sample WAP web applicatidesigned for providing content to a subscriber who is using a WAP phone. WAP phone simulators ayou to view WAP content by using the HTTP protocol to access the JSP pages of an SESM webapplication.Figure 2-3 shows the home page and service list of the WAP web application as it appon a Nokia simulator.

Great Britain engbuk

/locale=en/*/locale=gb/*/locale=uk/*

Italy it /locale=it/*

Portugal pt /locale=pt/*

Spain es /locale=es/*

Sweden se /locale=se/*

USA us /locale=us/*

Table 2-3 Test Locales (continued)

Locale Value URL Mapping

Table 2-4 Test Devices and Brands

Device or Brand Value URL Mapping

WAP device wap /device=wap/*

PDA device pda /device=pda/*

PC device pc /device=pc/*

XML device xml /device=xml/*

NWSP brand nwsp /brand=nwsp/*

Unstyled brand unstyled /brand=unstyled/*

Gold brand gold /brand=gold/*

Silver brand silver /brand=silver/*

Bronze brand bronze /brand=bronze/*

No brand an empty string /brand=/*

2-16Cisco Subscriber Edge Services Manager Web Developer Guide

OL-2068-01

Page 17: Basic SESM Customization and Developmentdocstore.mik.ua/univercd/cc/td/doc/solution/sesm/sesm_313/webde… · The SESM software uses Java resource bundles and properties files for

Chapter 2 Basic SESM Customization and DevelopmentDeveloping an SESM Web Application

om aning

kiaAP

latorclickbox

Figure 2-3 WAP Phone Simulator

When the HTTP protocol mode is used to access an SESM web application, you request pages frSESM web application in the usual manner. For example, to log on to SESM, you specify the followURL: http://web_server:8080, whereweb_server is the IP address of the Jetty web server.

The NWSP and WAP web applications recognize many WAP phone simulators, including the NoMobile Internet Toolkit simulator, the Openwave UP.Simulator (version4.0 and 4.1), and the WinWPro simulator. The NWSP and WAP web applications set thedevice dimension of the user shape towap

when these simulators are the client device.

WAP phone simulators that are available on the web include:

• Nokia Mobile Internet Toolkit contains two simulators and is available at Forum Nokia:

http://www.forum.nokia.com/

• UP.SDK for WML from Openwave Systems Inc. contains a simulator and is available at:

http://developer.openwave.com

To use the UP.Simulator and the HTTP protocol to access an SESM web application, the UP.Simumust be configured to use HTTP Direct as the UP.Link Setting. To do this, start the UP.Simulator,UP.Link Settings from the Settings menu, and then click HTTP Direct in the UP.Link Settings dialog(Figure 2-4).

Figure 2-4 UP.Link Settings for the UP.Simulator

2-17Cisco Subscriber Edge Services Manager Web Developer Guide

OL-2068-01

Page 18: Basic SESM Customization and Developmentdocstore.mik.ua/univercd/cc/td/doc/solution/sesm/sesm_313/webde… · The SESM software uses Java resource bundles and properties files for

Chapter 2 Basic SESM Customization and DevelopmentDeveloping an SESM Web Application

n. Forthat

ver.

causeul.

ation.

ornput,dowyouata

Managing an SESM Web SiteDreamweaver has a number of features that may be useful for developing an SESM web applicatioexample, if a Dreamweaver template is modified, you can automatically update all files in a web siteuse the template. To use some Dreamweaver features, you must define a web site in Dreamwea

To define an SESM web application as a site, do the following:

Step 1 From theDreamweaver Site menu, chooseNew Site and specify the required information.

Step 2 In theLocal Info dialog box, specify the /webapp/docrootdirectory of the SESM web application as theLocal Root Folder.

Step 3 In theSite Map Layout dialog box, specify home.jsp as the Home Page.

After the site is defined in this manner, Dreamweaver creates a useful Site Files view. However, behome.jsp is designed to contain few links to other JSP pages, the Site Map view is not very usef

For detailed information on setting up and managing a site, refer to the Dreamweaver document

The Dreamweaver Preview in Browser feature is of limited use with an SESM web application. Fexample, in the NWSP web application, most JSP pages require some form of input. Without the ithe web browser displays an error page. If you are using Dreamweaver UltraDev 4, the Live Data winfeature is an excellent alternative to the Preview in Browser feature. The Live Data window allowsto view dynamic data in a sample SESM web application. For information on configuring the Live Dwindow, see the“Dreamweaver UltraDev 4 Live Data Window” section on page 2-11.

2-18Cisco Subscriber Edge Services Manager Web Developer Guide

OL-2068-01