WebObjects 5.2.3

com.webobjects.eodistribution
Class WOJavaClientComponent

java.lang.Object
  extended bycom.webobjects.appserver.WOElement
      extended bycom.webobjects.appserver.WOComponent
          extended bycom.webobjects.eodistribution.WOJavaClientComponent
All Implemented Interfaces:
Cloneable, NSKeyValueCoding, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions, NSValidation, Serializable, WOActionResults

public class WOJavaClientComponent
extends WOComponent

WOJavaClientComponent is the web component used by Java Client applications in connection with Web Start or other desktop applications installed on client machines. It passes on several parameters including the codebase and EOApplication specific parameters like the initial EOInterfaceController subclass name and language.

WOJavaClientComponent is used on the server side to determine the EOApplication specific parameters and to handle the communication with the client application. The bindings of the WOJavaClientComponent are the single place where the client side arguments are configured, independent of the deployment mechanism of the client desktop application (Web Start, preinstalled desktop application).

WOJavaClientComponents sends the values of all bindings to the client application, even if you add additional bindings. The values of these bindings will be available on the client side through the arguments method of the EOApplication instance. Thus you can use the WOJavaClientComponent to create arguments for the client.

Standard Bindings of WOJavaClientComponent

The following bindings are used by all Java Client desktop applications:

codebase The codebase of the application. If not specified, defaults to a URL appropriate for downloading classes through the application's resource manager.
interfaceControllerClassName The class name of the initial EOInterfaceController subclass. If specified, the client will automatically instantiate and run an instance of the specified class (which has to be a subclass of EOInterfaceController) during startup. For simple, one window applications this is all you need to specify to initialize the user interface.
applicationClassName The class name of the EOApplication instance. If not specified, defaults to com.webobjects.eoapplication.EOApplication. For Direct to Java Client applications, you have to set the value to com.webobjects.eogeneration.client.EODynamicApplication (or your own subclass).
applicationName The descriptive name of the client application. If not specified, defaults to the name of the WebObjects server application.
splashIconName The name of an icon to be displayed in a splash screen window during startup.
splashIconURL The URL of an icon to be displayed in a splash screen window during startup.
language The language to run the client with.
channelClassName The class name of the distribution channel to be used by the client. If not specified, defaults to the standard Java Client HTTP channel. If a client is running as a desktop application, this parameter also has to be specified as a command line argument. Specifying it in the WOJavaClientComponent is not sufficient since a connection with a distribution channel is already established when the arguments are read from the WOJavaClientComponent (a distribution channel has to be instantiated before arguments are read from the WOJavaClientComponent).

The following bindings are used to generate Web Start specific information:

vendor The name of the vendor of the application.
homepage The homepage of the client application (the page displayed in browsers to enter the application).
applicationDescription A description of the client application.
applicationIcon The (optional) URL for an icon used by Web Start to represent the client application.
needsAllPermissions A flag indicating whether the application needs all permissions (versus running in an applet-like sandbox).
jarFileNames The array of jar file names to be downloaded by Web Start. If not specified, all client side jar files of all bundles of the application are listed.

The following bindings are used only by clients not started through WebStart (preinstalled desktop applications):

downloadClientClasses This binding is used to determine which classes should be downloaded before the client application really starts up. You usually bind this binding to methods on the WOJavaClientComponent by specifying one of the string values noDownloadClientClasses (default if binding is not specified at all), mainBundleClientClasses, customFrameworksClientClasses, or customBundlesClientClasses. If not specified, no classes are downloaded.
downloadClientClassURLs The URLs from where to download the classes specified through the downloadClientClasses binding. You only need to specify this binding if you have special needs, the URLs can usually be determined automatically.

The following bindings are special:

distributionContext This binding is a server side only binding which is not sent to clients. You can use it to specify a different EODistributionContext (or subclass) to be used by the WOJavaClientComponent on the server side than the default one. If not specified, the default distribution context is an EODistributionContext with the session's default editing context and the session itself as delegate.
JNLPComponentName This binding is a server side only binding which is not sent to clients. You can use it to specify the name of a WOComponent (usually a WOJavaClientJNLP subclass used to generate the JNLP information for Web Start).
temporaryGIDBase This binding is used to generate unique values for temporary global IDs. Do not modify or remove this binding.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.webobjects.appserver.WOComponent
WOComponent.Event
 
Nested classes inherited from class com.webobjects.foundation.NSKeyValueCoding
NSKeyValueCoding.DefaultImplementation, NSKeyValueCoding.ErrorHandling, NSKeyValueCoding.Null, NSKeyValueCoding.UnknownKeyException, NSKeyValueCoding.Utility, NSKeyValueCoding.ValueAccessor
 
Nested classes inherited from class com.webobjects.foundation.NSKeyValueCodingAdditions
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility
 
Nested classes inherited from class com.webobjects.foundation.NSValidation
NSValidation.DefaultImplementation, NSValidation.Utility, NSValidation.ValidationException
 
Field Summary
static String ApplicationClassNameKey
          The name of the applicationClassName binding.
static String ApplicationDescriptionKey
          The name of the applicationDescription binding.
static String ApplicationIconKey
          The name of the applicationIcon binding.
static String ApplicationNameKey
          The name of the applicationName binding.
static String ApplicationURLKey
          The name of the client side parameter containing the application URL.
static String ChannelClassNameKey
          The name of the channelClassName binding.
static String ClientPrincipalClassBundleInfoKey
          The name of bundle info plist key looked up in all bundles to find the names of the client side principal classes.
static String CodebaseKey
          The name of the codebase binding.
static String ComponentURLKey
          The name of the client side parameter containing the component URL of the WOJavaClientComponent.
static String DidVendComponentURLNotification
          The name of the notification sent when the WOJavaClientComponent determines its component URL.
static String DistributionContextKey
          The name of the distributionContext binding.
static String DownloadClientClassesKey
          The name of the downloadClientClasses binding.
static String DownloadClientClassURLsKey
          The name of the downloadClientClassURLs binding.
static String HomepageKey
          The name of the homepage binding.
static String InterfaceControllerClassNameKey
          The name of the interfaceControllerClassName binding.
static String J2SEVersionKey
          The name of the j2seVersion binding.
static String JarFilesNamesKey
          The name of the jarFileNames binding.
static String JNLPComponentNameKey
          The name of the JNLPComponentName binding.
static String LanguageKey
          The name of the language binding.
static String NeedsAllPermissionsKey
          The name of the needsAllPermissions binding.
 String otherParameterName
          A public variable used in a repetition to create a list of all non-standard bindings.
static String PrincipalClassNamesKey
          The name of the principalClassNames binding.
static String SessionIDKey
          The name of the client side parameter containing the session ID.
static String SplashIconNameKey
          The name of the splashIconName binding.
static String SplashIconURLKey
          The name of the splashIconURL binding.
static String TemporaryGIDBaseKey
          The name of the temporaryGIDBase binding.
static String VendorKey
          The name of the vendor binding.
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding
NullValue
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
KeyPathSeparator
 
Constructor Summary
WOJavaClientComponent(WOContext context)
          Creates a new WOJavaClientComponent in a given context.
 
Method Summary
 void appendToResponse(WOResponse response, WOContext context)
          Overridden for internal purposes.
 String applicationClassName()
          Returns the value of the applicationClassName binding.
 String applicationDescription()
          Returns a description of the application.
 String applicationIcon()
          Returns the value of the applicationIcon binding.
 String applicationName()
          Returns the name used for client applications.
 String applicationURL()
          Returns a string containing the application URL the client uses to communicate with the WOJavaClientComponent.
 String channelClassName()
          Returns the value of the channelClassName binding.
 NSDictionary clientSideRequestApplicationParameters()
          Returns a dictionary with the values of all the client bindings that have been set.
 String codebase()
          Returns the codebase to be used by Java Client applications.
 String componentURL()
          Returns a string containing the receiver's component URL.
 NSArray customBundlesClientClasses()
          This method is used in combination with the downloadClientClasses binding.
 NSArray customFrameworksClientClasses()
          This method is used in combination with the downloadClientClasses binding.
 EODistributionContext distributionContext()
          Returns the distribution context used by this component.
 NSArray downloadClientClasses()
          Returns an array of classes to be downloaded to desktop application clients before they start.
 NSArray downloadClientClassURLs()
          Returns an array of URLs to downloaded client classes for desktop application clients.
 WOActionResults handleClientRequest()
          Using the receiver's distribution context, generates a response for a client request.
 String homepage()
          Returns the URL for the client application's home page.
 String interfaceControllerClassName()
          Returns the value of the interfaceControllerClassName binding.
 WOActionResults invokeAction(WORequest request, WOContext context)
          Overridden for internal purposes to dispatch Java Client requests.
 String j2seVersion()
          Returns the value of the j2seVersion binding.
 NSArray jarFileNames()
          Returns the names of all jar files to be downloaded by Web Start for the client application.
 String JNLPComponentName()
          Returns the name of the WebObjects component used to generate the JNLP information to start the client application through Web Start.
 String language()
          Returns the value of the language binding.
 NSArray mainBundleClientClasses()
          This method is used in combination with the downloadClientClasses binding.
 boolean needsAllPermissions()
          Returns whether the application needs all permissions (versus running in an applet-like sandbox).
 NSArray noDownloadClientClasses()
          This method is used in combination with the downloadClientClasses binding.
 Object principalClassNames()
          Returns the names of all principal classes for the client side.
 String sessionID()
          Returns a string containing the receiver's session ID.
 String splashIconName()
          Returns the value of the splashIconName binding.
 String splashIconURL()
          Returns the value of the splashIconURL binding.
 boolean synchronizesVariablesWithBindings()
          Overridden from the superclass to return false.
 String temporaryGIDBase()
          Returns a value used to generate unique values for temporary global IDs.
 String vendor()
          Returns the name of the vendor of the application.
static String webStartActionURL(WOContext context, String pageName)
          This static method returns the URL for calling a direct action which returns the JNLP file that initiates the WebStart download/update by the web browser.
 
Methods inherited from class com.webobjects.appserver.WOComponent
application, awake, baseURL, bindingKeys, canAccessFieldsDirectly, canGetValueForBinding, canSetValueForBinding, clone, context, debugString, descriptionForResponse, ensureAwakeInContext, frameworkName, generateResponse, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hasBinding, hasSession, isCachingEnabled, isEventLoggingEnabled, isStateless, logString, name, pageWithName, parent, path, pathURL, performParentAction, pullValuesFromParent, pushValuesToParent, reset, session, set_componentUnroll, set_unroll, setCachingEnabled, setValueForBinding, sleep, takeValueForKey, takeValueForKeyPath, takeValuesFromRequest, template, templateWithHTMLString, templateWithName, toString, unableToSetNullForKey, validateTakeValueForKeyPath, validateValueForKey, validationFailedWithException, valueForBinding, valueForKey, valueForKeyPath
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ApplicationClassNameKey

public static final String ApplicationClassNameKey
The name of the applicationClassName binding.


ApplicationDescriptionKey

public static final String ApplicationDescriptionKey
The name of the applicationDescription binding.


ApplicationIconKey

public static final String ApplicationIconKey
The name of the applicationIcon binding.


ApplicationNameKey

public static final String ApplicationNameKey
The name of the applicationName binding.


ApplicationURLKey

public static final String ApplicationURLKey
The name of the client side parameter containing the application URL.


ChannelClassNameKey

public static final String ChannelClassNameKey
The name of the channelClassName binding.


ClientPrincipalClassBundleInfoKey

public static final String ClientPrincipalClassBundleInfoKey
The name of bundle info plist key looked up in all bundles to find the names of the client side principal classes.


CodebaseKey

public static final String CodebaseKey
The name of the codebase binding.


ComponentURLKey

public static final String ComponentURLKey
The name of the client side parameter containing the component URL of the WOJavaClientComponent.


DidVendComponentURLNotification

public static final String DidVendComponentURLNotification
The name of the notification sent when the WOJavaClientComponent determines its component URL.


DistributionContextKey

public static final String DistributionContextKey
The name of the distributionContext binding.


DownloadClientClassURLsKey

public static final String DownloadClientClassURLsKey
The name of the downloadClientClassURLs binding.


DownloadClientClassesKey

public static final String DownloadClientClassesKey
The name of the downloadClientClasses binding.


HomepageKey

public static final String HomepageKey
The name of the homepage binding.


InterfaceControllerClassNameKey

public static final String InterfaceControllerClassNameKey
The name of the interfaceControllerClassName binding.


J2SEVersionKey

public static final String J2SEVersionKey
The name of the j2seVersion binding.


JNLPComponentNameKey

public static final String JNLPComponentNameKey
The name of the JNLPComponentName binding.


JarFilesNamesKey

public static final String JarFilesNamesKey
The name of the jarFileNames binding.


LanguageKey

public static final String LanguageKey
The name of the language binding.


NeedsAllPermissionsKey

public static final String NeedsAllPermissionsKey
The name of the needsAllPermissions binding.


PrincipalClassNamesKey

public static final String PrincipalClassNamesKey
The name of the principalClassNames binding.


SessionIDKey

public static final String SessionIDKey
The name of the client side parameter containing the session ID.


SplashIconNameKey

public static final String SplashIconNameKey
The name of the splashIconName binding.


SplashIconURLKey

public static final String SplashIconURLKey
The name of the splashIconURL binding.


TemporaryGIDBaseKey

public static final String TemporaryGIDBaseKey
The name of the temporaryGIDBase binding.


VendorKey

public static final String VendorKey
The name of the vendor binding.


otherParameterName

public String otherParameterName
A public variable used in a repetition to create a list of all non-standard bindings.

Constructor Detail

WOJavaClientComponent

public WOJavaClientComponent(WOContext context)
Creates a new WOJavaClientComponent in a given context.

Parameters:
context - the WebObjects context for the WOJavaClientComponent
Method Detail

JNLPComponentName

public String JNLPComponentName()
Returns the name of the WebObjects component used to generate the JNLP information to start the client application through Web Start. If the receiver has a JNLPComponentName binding, the value of that binding is returned. Otherwise, the WOJavaClientJNLP class is used.

Returns:
the class name of the WebObjects component generating JNLP

appendToResponse

public void appendToResponse(WOResponse response,
                             WOContext context)
Overridden for internal purposes. You should never invoke this method directly or override it.

Overrides:
appendToResponse in class WOComponent
Parameters:
response - the WebObjects response
context - the WebObjects context
See Also:
WOComponent.invokeAction(WORequest aRequest, WOContext aContext), WOComponent.takeValuesFromRequest(WORequest aRequest, WOContext aContext)

applicationClassName

public String applicationClassName()
Returns the value of the applicationClassName binding. If specified, determines the class used for the EOApplication instance on the client side.

Returns:
the value of the applicationClassName binding

applicationDescription

public String applicationDescription()
Returns a description of the application. If the receiver has an applicationDescription binding, the value of that binding is returned. Otherwise, "WebObjects Java Client Application" is used.

Returns:
the application description

applicationIcon

public String applicationIcon()
Returns the value of the applicationIcon binding. If specified, the value will be used for specifying an icon for the application used by Web Start.

Returns:
the icon URL

applicationName

public String applicationName()
Returns the name used for client applications. If the receiver has an applicationName binding, the value of that binding is returned. Otherwise, the name of the WebObjects (server) application is used.

Returns:
the application name

applicationURL

public String applicationURL()
Returns a string containing the application URL the client uses to communicate with the WOJavaClientComponent.

Returns:
the application URL used by the client

channelClassName

public String channelClassName()
Returns the value of the channelClassName binding. If specified, determines the class used for the distribution channel on the client side. Otherwise, a standard Java Client HTTP channel is used by the client.

Returns:
the value of the channelClassName binding

clientSideRequestApplicationParameters

public NSDictionary clientSideRequestApplicationParameters()
Returns a dictionary with the values of all the client bindings that have been set. This method is used by Java Client applications to get all the arguments.

Returns:
a dictionary with all client bindings

codebase

public String codebase()
Returns the codebase to be used by Java Client applications. If the receiver has a codebase binding, the value of that binding is returned. Otherwise, this method returns a URL to look up Java classes from the resource manager appropriate for all types of deployment (web server, direct connect, etc.).

Returns:
the codebase for client applications

componentURL

public String componentURL()
Returns a string containing the receiver's component URL.

Returns:
the component URL

customBundlesClientClasses

public NSArray customBundlesClientClasses()
This method is used in combination with the downloadClientClasses binding. Returns an array with the names of all client classes from all custom (not standard WebObjects) bundles (main bundle and frameworks) used by the application.

Returns:
an array with the names of all custom bundles (main bundle and frameworks) client classes
See Also:
downloadClientClasses()

customFrameworksClientClasses

public NSArray customFrameworksClientClasses()
This method is used in combination with the downloadClientClasses binding. Returns an array with the names of all client classes from all custom (not standard WebObjects) frameworks used by the application.

Returns:
an array with the names of all custom frameworks client classes
See Also:
downloadClientClasses()

distributionContext

public EODistributionContext distributionContext()
Returns the distribution context used by this component. The distribution context is the object that handles all client requests.

Returns:
the distribution context

downloadClientClassURLs

public NSArray downloadClientClassURLs()
Returns an array of URLs to downloaded client classes for desktop application clients.

Returns:
the array of download class URLs

downloadClientClasses

public NSArray downloadClientClasses()
Returns an array of classes to be downloaded to desktop application clients before they start.

Returns:
the array of download classes for desktop application clients
See Also:
noDownloadClientClasses(), mainBundleClientClasses(), customFrameworksClientClasses(), customBundlesClientClasses()

handleClientRequest

public WOActionResults handleClientRequest()
Using the receiver's distribution context, generates a response for a client request.

Returns:
the client request return value
See Also:
distributionContext(), EODistributionContext.responseToClientMessage(NSData)

homepage

public String homepage()
Returns the URL for the client application's home page. If the receiver has a homepage binding, the value of that binding is returned. Otherwise, the application URL is used.

Returns:
the homepage URL

interfaceControllerClassName

public String interfaceControllerClassName()
Returns the value of the interfaceControllerClassName binding. If specified, the client automatically instantiates an interface controller of the specified class and displays its user interface while starting up.

Returns:
the value of the interfaceControllerClassName binding

invokeAction

public WOActionResults invokeAction(WORequest request,
                                    WOContext context)
Overridden for internal purposes to dispatch Java Client requests. You should never invoke this method directly or override it.

Overrides:
invokeAction in class WOComponent
Parameters:
request - the WebObjects request
context - the WebObjects context
Returns:
a WOActionResults containing the result of the request
See Also:
WOComponent.appendToResponse(WOResponse aResponse, WOContext aContext), WOComponent.takeValuesFromRequest(WORequest aRequest, WOContext aContext)

j2seVersion

public String j2seVersion()
Returns the value of the j2seVersion binding. If specified, the value will be used for specifying the version of the J2SE for Web Start to run the application with.

Returns:
the J2SE version string

jarFileNames

public NSArray jarFileNames()
Returns the names of all jar files to be downloaded by Web Start for the client application. If the receiver has a jarFileNames binding, the value of that binding is returned. Otherwise, the list of jar files is derived by looking up all client jar files of all bundles of the application.

Returns:
the array with the names of all jar files for Web Start

language

public String language()
Returns the value of the language binding. If specified, the client automatically uses this language as the preferred language.

Returns:
the value of the language binding

mainBundleClientClasses

public NSArray mainBundleClientClasses()
This method is used in combination with the downloadClientClasses binding. Returns an array with the names of all client classes from the main bundle of the application.

Returns:
an array with the names of all main bundle client classes
See Also:
downloadClientClasses()

needsAllPermissions

public boolean needsAllPermissions()
Returns whether the application needs all permissions (versus running in an applet-like sandbox). If the receiver has a needsAllPermissions binding, the value of that binding is returned. The default is false.

Returns:
true if the application needs all permissions; true otherwise

noDownloadClientClasses

public NSArray noDownloadClientClasses()
This method is used in combination with the downloadClientClasses binding. Returns an empty array to indicate that no classes should be downloaded to desktop application clients.

Returns:
an empty array
See Also:
downloadClientClasses()

principalClassNames

public Object principalClassNames()

Returns the names of all principal classes for the client side. These classes will be explicitly initialized when the application starts up. If the receiver has a principalClassNames binding, the value of that binding is returned. Otherwise, the list of principal classes is derived by looking up the "NSClientPrincipalClass" key in all info plist files of all bundles of the application.

This method (and thus the principalClassNames binding) must return either an NSArray containing all principal class names or a single String with all principal class names, separated by a space character.

Returns:
the principal classes for the client side (as array or string)

sessionID

public String sessionID()
Returns a string containing the receiver's session ID.

Returns:
the session ID

splashIconName

public String splashIconName()
Returns the value of the splashIconName binding. The splash icon is displayed in a window during client startup. You can also specify the splash icon with an URL.

Returns:
the value of the splashIconName binding
See Also:
splashIconURL()

splashIconURL

public String splashIconURL()
Returns the value of the splashIconURL binding. The splash icon is displayed in a window during client startup. You can also specify the splash icon with a name.

Returns:
the value of the splashIconURL binding
See Also:
splashIconName()

synchronizesVariablesWithBindings

public boolean synchronizesVariablesWithBindings()
Overridden from the superclass to return false.

Overrides:
synchronizesVariablesWithBindings in class WOComponent
Returns:
false
See Also:
WOComponent.valueForBinding(String aBindingName), WOComponent.setValueForBinding(Object aValue, String aBindingName), WOComponent.pullValuesFromParent(), WOComponent.pushValuesToParent(), WOComponent.isStateless()

temporaryGIDBase

public String temporaryGIDBase()
Returns a value used to generate unique values for temporary global IDs. Do not touch this value.

Returns:
a value you should not modify

vendor

public String vendor()
Returns the name of the vendor of the application. If the receiver has a vendor binding, the value of that binding is returned. Otherwise, "Unspecified Vendor" is used.

Returns:
the vendor name

webStartActionURL

public static String webStartActionURL(WOContext context,
                                       String pageName)
This static method returns the URL for calling a direct action which returns the JNLP file that initiates the WebStart download/update by the web browser. The entry web site for the client application should provide a link directing the web browser to this URL. In order to support multiple JNLP file settings and/or multiple applications, the page parameter can specify different pages (each having a different WOJavaClientComponent with its own bindings). If no page is specified, first the page name "JavaClient" and then "Main" will be looked for.

Parameters:
context - the WOContext (usually from the component having the link)
pageName - the name of page with the WOJavaClientComponent
Returns:
the URL for calling a direct action which returns the JNLP file

Last updated Thu Oct 21 15:04:16 PDT 2004.

Copyright © 2004 Apple Computer, Inc.