                                        README
                         Running the GetPackageInfoAp Applet



GetPackageInfoAp is a Java Applet that you can use to list the Solaris software
packages that are installed on a system running Solaris WBEM Services. You can
select a package and display the detailed information about the package.

You can use this applet to connect to a CIM Object Manager running on your
local system or a remote system.

Note that the examples here are taken from Solaris platform, that /usr/java
points to jdk1.2 and that WBEM files are installed on "/usr" directory.

Requirements
============
To run the applet you need either:

- Java Development Kit (JDK) 1.2 Appletviewer
- Netscape Navigator 4.7
- Java-enabled Web browser that uses JRE 1.2.2 or has the Java Plug-in 1.2.2
  software enabled
- You must run this applet on a client that has network access to a system
  running the CIM Object Manager

Running the Applet Using Appletviewer
=====================================

You can run the GetPackageInfoAp applet using the JDK 1.2 Appletviewer.

To run the applet GetPackageInfoAp using the Appletviewer:

1.  Type the following command:

appletviewer -J-Djava.security.policy=/usr/demo/wbem/applet/applet.policy 
/usr/demo/wbem/applet/GetPackageInfoAp.html


Running the Applet in Netscape Navigator 4.7 
=============================================

The Netscape Navigator 4.7 browser that is installed with Solaris 8 includes
JRE 1.2.2 and will run the applet.

You can run the GetPackageInfoAp applet in a Java-enabled Web browser that
includes the Java Runtime Environment (JRE) 1.2.2 or is configured to use
Java Plug-in 1.2.2 software. 

If you are using a Netscape Navigator 4.7 browser that was not shipped with
Solaris 8, you might need to download the Java Plug-in 1.2.2 software.
Java[tm] Plug-In (JPI) is a product that enables customers to direct applets
on their internet web pages to run using Sun's Java 2 Runtime Environment,
Standard Edition JRE instead of the web browser's default virtual machine. 
 
1. Start the browser and open this file:

   /usr/demo/wbem/applet/GetPackageInfoAp.html 

2.  If your browser is not configured to use Java Plug-in 1.2.2 
    software, it will ask you to download it.

3.  Download Java Plug-in 1.2.2 software and following the 
    instructions on the web site to install it on your system.

    Solaris - http://www.sun.com/software/solaris/netscape/jpis/index.html
    Windows - http://java.sun.com/products/jdk/1.2/jre/download-windows.html 

    For information on using Plug-ins in Netscape, see 
    http://www.netscape.com/plugins/index.html.

    NOTE:  On Solaris systems, if you have more than one version of Netscape
    on your system, you might need to set the NPX_PLUGIN_PATH environment
    variable to the path where the Java Plug-in software is installed. For
    example, if you installed the Java Plug-in software in
    /opt/NSCPcom/plugins, set NPX_PLUGIN_PATH as follows:

        setenv NPX_PLUGIN_PATH /opt/NSCPcom/plugins

4.  Edit the java.security file in the lib/security directory where the 
    Java Runtime Environment is installed. For example, if you are running 
    Java 1.2 on Solaris 8 and using /usr/java1.2/jre, you would 
    edit /usr/java1.2/jre/lib/security/java.security.

    This applet security policy file grants all permission.
    You may want to change the policy to a more ristricted one or
    remove the line from the java.security file after you have 
    finished testing. 

    Add this line to the end of the following section in the file:

    policy.url.3=file:///usr/demo/wbem/applet/applet.policy

    # The default is to have a single system-wide policy file, 
    # and a policy file in the user's home directory.
    policy.url.1=file:${java.home}/lib/security/java.policy
    policy.url.2=file:${user.home}/.java.policy

5. Exit and restart the Netscape browser and open the applet:

   /usr/demo/wbem/applet/GetPackageInfoAp.html



Customizing the Applet
======================

For speed GetPackageInfoAp gets only the first 9 packages. You can change the 
code to get all of them. See /usr/demo/wbem/applet/GetPackageInfoAp.java.

To compile, make sure your environment setup includes JDK1.2 and the classpath:
CLASSPATH=.:/usr/sadm/lib/wbem/cimom.jar:/usr/sadm/lib/wbem/cimapi.jar:/usr/sadm/lib/xml.jar


To enable the Netscape Communicator preference
security.lower_java_network_security_by_trusting_proxies. (For more detail see 
Netscape web site. http://www.netscape.com or
http://developer.netscape.com/tech/security/index.html)


Enabling the Java Applet to "Phone Home"
======================================== 

You may need to enable the Java Applet to "phone home" or make a socket
connection.

1. Edit /usr/demo/wbem/applet/GetPackageInfoAp.html

2. Locate the following section:

    <body>
    <h1>Get Package Parameters</h1>

3. Add the following lines:

      <SCRIPT LANGUAGE="JavaScript1.2" ARCHIVE="ScriptSigs.jar" 
ID="ReadPrefScript">

netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesRead");
              var prefValue = 
navigator.preference("security.lower_java_network_security_by_trusting_proxies"
);
              document.write("The current value of the proxy preference is: " + 
prefValue);
      </SCRIPT>
      <SCRIPT LANGUAGE="JavaScript1.2" ARCHIVE="ScriptSigs.jar" 
ID="WritePrefScript">
              
netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite")
;

navigator.preference("security.lower_java_network_security_by_trusting_proxies"
, 
"true");
      </SCRIPT>


