Sun ONE Identity Server Customization and API Guide |
Appendix C
WAR FilesSun One Identity Server contains a number of web application archive (WAR) files. These packages contain Java servlets and JavaServer Pages (JSP) pages that add functionality to the application. This chapter explains WAR files in general, their contents in an Identity Server deployment and which files can be modified. It contains the following sections:
OverviewThe Java 2 Platform, Enterprise Edition (J2EE) platform (on which Identity Server is built) uses a component model to create full-scale applications. A component is self-contained functional software code assembled with other components into a J2EE application. The J2EE application components (which can be deployed separately on different servers) include:
- Client components (including dynamic web pages, applets, and a Web browser) that run on the client machine.
- Web components (including servlets and JSP) that run within a web container.
- Business components (code that meets the needs of a particular enterprise domain such as banking, retail, or finance) that also run within the web container.
- Enterprise infrastructure software that runs on legacy machines.
The web components tier in the Identity Server model can be customized based on each organization’s needs. This appendix concerns itself with this tier.
Web Components
When a web browser executes a J2EE application, it deploys server-side objects called web components. There are two types of web components: Servlets and JavaServer Pages (JSP).
- Servlets are small Java programs that dynamically process requests and construct responses from a web browser; they run within web containers.
- JSP are text-based documents that contain static template data [HTML, Scalable Vector Graphics (SVG), Wireless Markup Language (WML), or eXtensible Markup Language (XML)], and elements that construct dynamic content (in the case of Identity Server, servlets).
When a J2EE application is called, the JSP and corresponding servlets are constructed by the web browser.
Packaging Web Components
In general, all J2EE components are packaged separately and bundled together into an Enterprise Archive (EAR) file for application deployment. The Web Components, in particular, are packaged in web application archives (WAR). Each WAR contains the servlets and/or JSP, a deployment descriptor, and related resource files.
Note
The WAR is the same format as a JavaARchive (JAR). However, an eXtensisible Markup Language (XML) deployment descriptor file must also be created.
Static HTML files and JSP are stored at the top level of the WAR directory. The top-level directory contains the WEB-INF sub-directory which contains the following:
- Server-side classes (Servlets, JavaBean components and related Java class files) must be stored in the WEB-INF/classes directory.
- Auxiliary JARs (tag libraries and any utility libraries called by server-side classes) must be stored in the WEB-INF/lib directory.
- web.xml—the web component deployment descriptor is stored in the WEB-INF directory.
- Tag library descriptor files
When modifying the files included in Identity Server WARs, customers are changing web components and thus, customizing their deployment.
WARs And Their ContentsIdentity Server contains a number of WARs that can be modified to customize an Identity Server deployment. The WARs themselves are located in IdentityServer_base/SUNWam and include:
The following sections detail the files within each WAR that can be modified and those that SHOULD NOT be modified.
console.war
The following sections detail the modifiable and non-modifiable documents contained within console.war. The path names are based on the directory structure discussed in Packaging Web Components.
console.war Modifiable Files
These directories contain files that can be modified.
- web.xml and related XML files used for constructructing it are located in IdentityServer_base/SUNWam/web-apps/applications/WEB-INF/.
- Modifiable JavaScript files are located in IdentityServer_base/SUNWam/web-apps/applications/console/js/.
- Modifiable JSP are located in the following directories dependant upon the service that deploys them:
- IdentityServer_base/SUNWam/web-apps/applications/console/auth/
- IdentityServer_base/SUNWam/web-apps/applications/console/federation/
- IdentityServer_base/SUNWam/web-apps/applications/console/policy/
- IdentityServer_base/SUNWam/web-apps/applications/console/service/
- IdentityServer_base/SUNWam/web-apps/applications/console/session/
- IdentityServer_base/SUNWam/web-apps/applications/console/user/
- Modifiable image files are located in IdentityServer_base/SUNWam/web-apps/applications/console/images/.
- Modifiable stylesheets are located in IdentityServer_base/SUNWam/web-apps/applications/console/css/.
console.war Non-Modifiable Files
These directories contain files that SHOULD NOT be modified.
password.war
The following sections detail the modifiable and non-modifiable documents contained within password.war. The path names are based on the directory structure discussed in Packaging Web Components.
password.war Modifiable Files
These directories contain files that can be modified.
- web.xml and related XML files used for constructructing it are located in IdentityServer_base/SUNWam/web-apps/password/WEB-INF/.
- Modifiable JSP are located in IdentityServer_base/SUNWam/web-apps/password/password/ui/.
- Modifiable image files are located in IdentityServer_base/SUNWam/web-apps/password/password/images/.
- Modifiable stylesheets are located in IdentityServer_base/SUNWam/web-apps/password/password/css/.
password.war Non-Modifiable Files
These directories contain files that SHOULD NOT be modified.
services.war
The following sections detail the modifiable and non-modifiable documents contained within services.war. The path names are based on the directory structure discussed in Packaging Web Components.
services.war Modifiable Files
These directories contain files that can be modified.
- web.xml and related XML files used for constructructing it are located in IdentityServer_base/SUNWam/web-apps/services/WEB-INF/.
- JavaScript files are located in IdentityServer_base/SUNWam/web-apps/services/js/.
- JSP are located in the following directories dependant upon the service that requires the customization:
- Image files are located in the following directories dependant upon the service to which the images apply:
- Stylesheets are located in the following directories dependant upon the service to which they apply:
services.war Non-Modifiable Files
These directories contain files that SHOULD NOT be modified.
Updating Modified WARsOnce a file within a WAR is modified, the WAR itself needs to be updated with the newly modified file. Following is the procedure to update a WAR.
- cd IdentityServer_base/SUNWam
This is the directory in which the WARs are kept.
- jar -uvf WARfilename.war <path_to_modified_file>
The -uvf option replaces the old file with the newly modified file. For example:
jar -uvf console.war newfile/index.html
replaces the index.html file in console.war with the index.html file located in IdentityServer_base/SUNWam/newfile.
- rm newfile/index.html
Delete the modified file.
Redeploying Modified WARsOnce updated, the WARs need be redeployed to their web container. The web container provides services such as request dispatching, security, concurrency, and life cycle management. It also gives the web components access to the J2EE APIs. The following procedures are specific to each particular WAR and web container. After redeploying the war files, all related servers need to be restarted.
Note
The BEA WebLogic Server 6.1 and Sun ONE Application Server web containers do not requireWARs to be exploded. They are deployed as WARs.
BEA WebLogic Server 6.1
The following commands are used on BEA WebLogic Server 6.1 to redeploy Identity Server WARs.
Note
amconsole, amserver and ampassword are the default console, server and password deploy URIs, respectively.
To Deploy console.war On WebLogic
java weblogic.deploy -url protocol://server_host:server_port -component amconsole:WL61 _server_name deploy WL61_admin_password amconsole IdentityServer_base/SUNWam/console.war
To Deploy services.war on WebLogic
java weblogic.deploy -url protocol://server_host:server_port -component amserver:WL61 _server_name deploy WL61_admin_password amserver IdentityServer_base/SUNWam/services.war
To Deploy password.war on WebLogic
java weblogic.deploy -url protocol://server_host:server_port -component ampassword:WL61 _server_name deploy WL61_admin_password ampassword IdentityServer_base/SUNWam/password.war
Note
For more complete information on the Java utility weblogic.deploy and its options, see the BEA WebLogic Server 6.1 documentation.
Sun ONE Application Server 7.0
The following commands are used on Sun ONE Application Server 7.0 to redeploy Identity Server WARs.
To Deploy console.war On Sun ONE Application Server
asadmin deploy -u S1AS_administrator -w S1AS_administrator_password -H console_server_host -p S1AS_server_port --type web secure_flag --contextroot console_deploy_uri --name amconsole --instance S1AS_instance IdentityServer_base/SUNWam/console.war
To Deploy services.war On Sun ONE Application Server
asadmin deploy -u S1AS_administrator -w S1AS_administrator_password -H server_host -p S1AS_server_port --type web secure_flag --contextroot server_deploy_uri --name amserver --instance S1AS_instance IdentityServer_base/SUNWam/services.war
To Deploy password.war on Sun ONE Application Server
asadmin deploy -u S1AS_administrator -w S1AS_administrator_password -H console_server_host -p S1AS_administrator_server_port --type web secure_flag --contextroot password_deploy_uri --name ampassword --instance S1AS_instance IdentityServer_base/SUNWam/password.war
Note
For more complete information on the asadmin deploy command and its options, see the Sun ONE Application Server 7.0 Developer’s Guide.
IBM WebSphere Application Server
For detailed instructions on how to deploy WARs in an IBM WebSphere Application Server container, see the documentation at http://www-3.ibm.com/software/webservers/studio/doc/v40/studioguide/en/html/sdsscenario1.html.