OverviewSingleDeprecated

jsx3.app

class Server

Object
->jsx3.lang.Object
  ->jsx3.app.Server

All Implemented Interfaces:

jsx3.gui.Alerts, jsx3.net.URIResolver, jsx3.util.EventDispatcher

class Server
extends jsx3.lang.Object
The controller of the JSX architecture.

Field Summary
jsx3.app.Cache
Deprecated. Use Server.getCache()
jsx3.app.DOM
Deprecated. Use Server.getDOM()
Object<String, String>
Deprecated. Use Server.getEnv()
static String
HELP
The subject of an event that instances of this class publish when a context help hot key is pressed in the context of a DOM node that has a help ID.
static String
INITED
The subject of an event that jsx3.app.Server publishes when an instance of this class is created.
jsx3.gui.Block
Deprecated. Use Server.getBodyBlock()
jsx3.gui.Block
Deprecated. Use Server.getRootBlock()
Constructor Summary
void
init(strAppPath : String, objGUI : HTMLElement, bPaint : boolean, objEnv : Object)
Sets environment variables used by this class (the controller for the JSX architecture)
Method Summary
jsx3.gui.Window
createAppWindow(strName : String)
Creates a new jsx3.gui.Window instance for this server.
void
deleteCookie(name : String, path : String, domain : String)
delete a cookie
void
call to shut down a server instance and free up resources used by the server (cache,dom,etc)
jsx3.app.Model
To implement jsx3.gui.Alerts interface.
jsx3.gui.Window
getAppWindow(strName : String)
Retrieves a previously created jsx3.gui.Window instance.
jsx3.gui.Block
Returns the body block for this server (JSXBODY)
jsx3.app.Cache
Returns the XML/XSL cache for this server
String
getCookie(name : String, bRaw : ?)
Returns the value for the Cookie with the given @name
jsx3.app.DOM
Returns the DOM for this server
jsx3.util.Locale
Returns the default locale of this server.
HTMLDocument
Returns the browser document object containing a particular JSX object.
String
getDynamicProperty(strPropName : String, strToken : String...)
Returns the value of the dynamic property @strPropName
String
getEnv(strEnvKey : String)
Returns the value of an environment setting of this server.
jsx3.app.Model
getJSX(strId : String)
Looks up a DOM node owned by this server by id or by name.
jsx3.app.Model
getJSXById(strId : String)
Looks up a DOM node owned by this server by id.
jsx3.app.Model
getJSXByName(strId : String)
Looks up a DOM node owned by this server by name.
jsx3.util.Locale
Returns the current locale of this server.
HTMLElement
Returns the browser DOM object where a particulat JSX object renders.
jsx3.gui.Block
Returns the root block for this server (JSXROOT)
Array<jsx3.app.Model>
Returns the list of objects that are children of the body object.
jsx3.app.Server
Deprecated.
jsx3.app.Settings
Returns the settings of this server/project per config.xml
jsx3.gui.WindowBar
Returns handle to a descendant taskbar belonging to this server instance (this is where JSXDialog instances will try to minimize to if it exists); returns null if none found; if no taskbar is found, dialogs are not minimized, but are 'window shaded'—like a Mac used to do
String
static String
Deprecated.
void
Invokes context-sensitive help as though the user had pressed the help hot key in the context of the DOM node objJSX.
jsx3.gui.Window
Loads a new jsx3.gui.Window instance from a component file.
jsx3.xml.Document | jsx3.net.Service | null
loadInclude(strSrc : String | jsx3.net.URI, strId : String, strType : String, bReload : String)
Loads an external resource into this server instance.
jsx3.xml.Document | jsx3.net.Service | null
loadResource(strId : String)
Loads an application resource.
void
Paints this application and its default component into the application view port on the host HTML page.
jsx3.net.URI
relativizeURI(strURI : String | jsx3.net.URI, bRel : ?)
void
Reloads all resource files that are localized.
jsx3.net.URI
Resolves a URI that is referenced from a file in this server.
void
setCookie(name : String, value : String, expires : Date, path : String, domain : String, secure : boolean, bRaw : ?)
Sets a Cookie with the given name and value
void
setDimensions(left : int | Array, top : int, width : int, height : int)
set all four dimensions for a jsx3.Server instance, allowing the developer to adjust the width/height/left/width for the server.
void
setDynamicProperty(strPropName : String, vntValue : String)
updates a single dynamic style property; dynamic properties are used by jsx3.gui.Block objects that extend the astract class, jsx3.gui.Block;
void
Sets the locale of this server.
String
void
Removes a loaded JavaScript or CSS resource from the browser DOM.
Methods Inherited From jsx3.util.EventDispatcher
publish, subscribe, unsubscribe, unsubscribeAll
Methods Inherited From jsx3.gui.Alerts
alert, configureAlert, confirm, prompt
Methods Inherited From jsx3.lang.Object
clone, equals, eval, getClass, getInstanceOf, getInstanceOfClass, getInstanceOfPackage, instanceOf, isInstanceOf, isSubclassOf, jsxmix, jsxsuper, jsxsupermix, setInstanceOf
Field Detail

Cache

jsx3.app.Cache Cache
Deprecated. Use Server.getCache()

DOM

jsx3.app.DOM DOM
Deprecated. Use Server.getDOM()

ENVIRONMENT

Object<String, String> ENVIRONMENT
Deprecated. Use Server.getEnv()

HELP

static String HELP
The subject of an event that instances of this class publish when a context help hot key is pressed in the context of a DOM node that has a help ID. The event has the following fields:

INITED

static String INITED
The subject of an event that jsx3.app.Server publishes when an instance of this class is created. The target of the event object is the initialized server.

JSXBODY

jsx3.gui.Block JSXBODY
Deprecated. Use Server.getBodyBlock()

JSXROOT

jsx3.gui.Block JSXROOT
Deprecated. Use Server.getRootBlock()
Constructor Detail

init

void init(strAppPath : String, objGUI : HTMLElement, bPaint : boolean, objEnv : Object)
Sets environment variables used by this class (the controller for the JSX architecture)

Parameters:

strAppPathURL (either relative or absolute) for the application to load
objGUIthe browser element (body, div, span, td, etc) into which the GI application should load
bPaintfalse if null; if true, the application VIEW will immediately be generated.
objEnv
Method Detail

createAppWindow

jsx3.gui.Window createAppWindow(strName : String)
Creates a new jsx3.gui.Window instance for this server. A branch of the DOM of this application can be placed in this window in order to distribute the application across multiple browser windows.

Parameters:

strNamethe unique name of the window to create

Throws:

{jsx3.lang.IllegalArgumentException}if there already exists a window in this server by that name

Returns:

 

Since:

3.2

deleteCookie

void deleteCookie(name : String, path : String, domain : String)
delete a cookie

Parameters:

namename of the cookie
pathpath where the cookie is valid (default: path of calling document)
domaindomain where the cookie is valid (default: domain of calling document)

destroy

void destroy()
call to shut down a server instance and free up resources used by the server (cache,dom,etc)

getAlertsParent

jsx3.app.Model getAlertsParent()
To implement jsx3.gui.Alerts interface.

Returns:

the root block.  

Overrides:

getAlertsParent in jsx3.gui.Alerts

getAppWindow

jsx3.gui.Window getAppWindow(strName : String)
Retrieves a previously created jsx3.gui.Window instance.

Parameters:

strNamethe unique name of the window to retrieve

Returns:

the window instance or null if no such window exists. 

Since:

3.2

getBodyBlock

jsx3.gui.Block getBodyBlock()
Returns the body block for this server (JSXBODY)

Returns:

 

getCache

jsx3.app.Cache getCache()
Returns the XML/XSL cache for this server

Returns:

 

getCookie

String getCookie(name : String, bRaw : ?)
Returns the value for the Cookie with the given @name

Parameters:

namename of the cookie
bRaw

Returns:

 

getDOM

jsx3.app.DOM getDOM()
Returns the DOM for this server

Returns:

 

getDefaultLocale

jsx3.util.Locale getDefaultLocale()
Returns the default locale of this server. This is configured with the default_locale configuration setting.

Returns:

 

Since:

3.2

getDocumentOf

HTMLDocument getDocumentOf(objJSX : jsx3.app.Model)
Returns the browser document object containing a particular JSX object. This method inspects whether the JSX object is a descendent of the root block of this server or one of its jsx3.gui.Window roots.

Parameters:

objJSX

Returns:

document object  

getDynamicProperty

String getDynamicProperty(strPropName : String, strToken : String...)
Returns the value of the dynamic property @strPropName

Parameters:

strPropNameid for this dynamic property among all properties
strTokenif present tokens such as {0}, {1}, {n} will be replaced with the nth element of this vararg array

Returns:

value of the property  

getEnv

String getEnv(strEnvKey : String)
Returns the value of an environment setting of this server. Valid keys correspond to deployment options and are (case-insensitive):

Parameters:

strEnvKeythe key of the environment value to return

Returns:

 

getJSX

jsx3.app.Model getJSX(strId : String)
Looks up a DOM node owned by this server by id or by name.

Parameters:

strIdeither the id (_jsxid) of the object or its name (jsxname)

Returns:

the JSX object or null if none found 

See Also:

jsx3.app.DOM.get()

getJSXById

jsx3.app.Model getJSXById(strId : String)
Looks up a DOM node owned by this server by id.

Parameters:

strIdthe id (_jsxid) of the object

Returns:

the JSX object or null if none found 

See Also:

jsx3.app.DOM.getById()

getJSXByName

jsx3.app.Model getJSXByName(strId : String)
Looks up a DOM node owned by this server by name. If more than one such objects exist, only one is returned.

Parameters:

strIdthe name (jsxname) of the object

Returns:

the JSX object or null if none found 

See Also:

jsx3.app.DOM.getByName()

getLocale

jsx3.util.Locale getLocale()
Returns the current locale of this server. If the locale has been set explicitly with setLocale(), that locale is returned. Otherwise, getDefaultLocale() is consulted, and finally the system-wide locale.

Returns:

 

Since:

3.2

getRenderedOf

HTMLElement getRenderedOf(objJSX : jsx3.app.Model)
Returns the browser DOM object where a particulat JSX object renders. This method inspects the main root of this server as well as all of its jsx3.gui.Window roots.

Parameters:

objJSX

Returns:

DOM object  

getRootBlock

jsx3.gui.Block getRootBlock()
Returns the root block for this server (JSXROOT)

Returns:

 

getRootObjects

Array<jsx3.app.Model> getRootObjects()
Returns the list of objects that are children of the body object. These are the root objects in a serialization file and the root nodes in the Component Hierarchy palette.

Returns:

 

getServer

jsx3.app.Server getServer()
Deprecated.
Conforms to the EventDispatcher contract.

Returns:

this object. 

getSettings

jsx3.app.Settings getSettings()
Returns the settings of this server/project per config.xml

Returns:

 

getTaskBar

jsx3.gui.WindowBar getTaskBar(objJSX : jsx3.app.Model)
Returns handle to a descendant taskbar belonging to this server instance (this is where JSXDialog instances will try to minimize to if it exists); returns null if none found; if no taskbar is found, dialogs are not minimized, but are 'window shaded'—like a Mac used to do

Parameters:

objJSXif null, this.JSXROOT is assumed; otherwise the object in the DOM from which to start looking for a descendant taskbar (a jsx3.gui.WindowBar instance)

Returns:

 

getUriPrefix

String getUriPrefix()

Returns:

 

Overrides:

getUriPrefix in jsx3.net.URIResolver

Since:

3.2

getVersion

static String getVersion()
Deprecated.
Returns version of the JSX runtime; separate versions are also available for GUI and Operational classes

Returns:

app version number (major (MM), minor (mm), and dot release (dd)) MM.mm.dd 

invokeHelp

void invokeHelp(objJSX : jsx3.app.Model)
Invokes context-sensitive help as though the user had pressed the help hot key in the context of the DOM node objJSX.

Parameters:

objJSX

Since:

3.5

See Also:

HELP

loadAppWindow

jsx3.gui.Window loadAppWindow(strSource : jsx3.xml.Entity | String)
Loads a new jsx3.gui.Window instance from a component file.

Parameters:

strSourceeither an XML document containing the window to load or the URL of the component to load.

Throws:

{jsx3.lang.Exception}if the loaded entity is not an instance of jsx3.gui.Window or if the name of window is not unique with respect to the already loaded windows

Returns:

 

Since:

3.2

loadInclude

jsx3.xml.Document | jsx3.net.Service | null loadInclude(strSrc : String | jsx3.net.URI, strId : String, strType : String, bReload : String)
Loads an external resource into this server instance. What this method does depends on the strType parameter.

Parameters:

strSrcthe path to the resource.
strIdthe unique identifier of the resource. A resource loaded by this method may clobber a previously loaded resource of the same type and id.
strTypethe type of include, one of: css, jss, xml, xsl, script (for JavaScript), services (for mapping rules), or ljss.
bReloadif true, a JavaScript or CSS file is reloaded from the remote server without checking the local browser cache. Other types of resources are not affected by this parameter.

Throws:

{jsx3.lang.IllegalArgumentException}if strType in not a valid type.

Returns:

the return type depends on the strType parameter. See the method description. 

loadResource

jsx3.xml.Document | jsx3.net.Service | null loadResource(strId : String)
Loads an application resource. This method looks up a resource registered with this application by its id. The resource must be registered in the config.xml file of this application.

Parameters:

strIdunique identifier for the resource (its unique id as an application resource file).

Returns:

the return type depends on the type of resource. See the documentation for loadInclude() for more information. 

See Also:

loadInclude()

paint

void paint(objXML : jsx3.xml.Document)
Paints this application and its default component into the application view port on the host HTML page. The system class loader calls this method once all the required resources of the application have loaded. The order of actions taken by this method is:
  1. Load the default component file
  2. Execute the onload script for the application
  3. Paint the default component in the view port

Parameters:

objXMLthe pre-loaded default component document.

relativizeURI

jsx3.net.URI relativizeURI(strURI : String | jsx3.net.URI, bRel : ?)

Parameters:

strURIthe URI to relativize.
bRel

Returns:

the relativized URI. 

Overrides:

relativizeURI in jsx3.net.URIResolver

Since:

3.2

reloadLocalizedResources

void reloadLocalizedResources()
Reloads all resource files that are localized. This method should be called after calling setLocale() for the server to render properly in the new locale.

Since:

3.2

resolveURI

jsx3.net.URI resolveURI(strURI : String | jsx3.net.URI)
Resolves a URI that is referenced from a file in this server. This method takes into account the changes in resource addressing between 3.1 and 3.2. For version 3.1, the URI is resolved as any URI in the system, using jsx3.resolveURI(). In version 3.2, the URI is taken as relative to the application folder. In particular, a relative URI will be resolved to a base of the application folder, an absolute URI will be unaffected.

Parameters:

strURIthe URI to resolve.

Returns:

the resolved URI. 

Overrides:

resolveURI in jsx3.net.URIResolver

Since:

3.2

See Also:

jsx3.net.URIResolver, jsx3.resolveURI()

setCookie

void setCookie(name : String, value : String, expires : Date, path : String, domain : String, secure : boolean, bRaw : ?)
Sets a Cookie with the given name and value

Parameters:

namename of the cookie
valuevalue of the cookie
expiresvalid jscript date object. for example: new Date("11:59:59 12-31-2004")
pathpath where the cookie is valid (default: path of calling document)
domaindomain where the cookie is valid (default: domain of calling document)
securevalid jscript date object. for example: new Date("11:59:59 12-31-2004")
bRaw

setDimensions

void setDimensions(left : int | Array, top : int, width : int, height : int)
set all four dimensions for a jsx3.Server instance, allowing the developer to adjust the width/height/left/width for the server. Must be called during/after the onload event for the server instance as it affects the VIEW for the server. Updates the absolutely positioned element that contains JSXROOT.

Parameters:

leftthe new left value or a JavaScript array containing all four new values (in pixels)
top href="../../Array.html">Array, top : int, width : int, height : int)
set all four dimensions for a jsx3.Server instance, allowing the developer to adjust the width/height/left/width for the server. Must be called during/after the onload event for the server instance as it affects the VIEW for the server. Updates the absolutely positioned element that contains JSXROOT.

Parameters:

leftthe new left value or a JavaScript array containing all four new values (in pixels)
topthe new top value (in pixels)
widththe new width value (in pixels)
heightthe new height value (in pixels)

setDynamicProperty

void setDynamicProperty(strPropName : String, vntValue : String)
updates a single dynamic style property; dynamic properties are used by jsx3.gui.Block objects that extend the astract class, jsx3.gui.Block;

Parameters:

strPropNameid for this dynamic property among all properties
vntValuevalue of the property; if null, the property with the name, @strPropName will be removed

setLocale

void setLocale(objLocale : jsx3.util.Locale)
Sets the locale of this server.

Parameters:

objLocale

Since:

3.2

toString

String toString()

Returns:

 

Overrides:


unloadInclude

void unloadInclude(strId : String)
Removes a loaded JavaScript or CSS resource from the browser DOM.

Parameters:

strIdthe id used when loading the resource.

See Also: