Skip navigation
Currently Being Moderated

SparkWeb Programmatic Launch Configuration

VERSION 19  Click to view document history
Created on: Dec 21, 2007 9:26 AM by David Smith - Last Modified:  Jul 29, 2008 4:35 PM by Daniel Henninger

SparkWeb 0.9.0 and later can query javascript in the parent html page for configuration information. The following is an example of of setting all the currently accepted parameters.

 

<script type="text/javascript">
function jive_sparkweb_getConfig()
{
        return {
               server: "localhost",
               port: "7080",
               bindPath: "/http-bind/",
               connectionType : "http",
               autologin: "true",
               username: "admin",
               password: "admin",
               policyFileURL: "http://www.example.com/sub/dir/crossdomain.xml"
               // policyFileURL: "xmlsocket://foo.com:414"
     };
}
</script>

 

The table below lists the available parameters with their valid values.

 

Variable

Description

Values

server

Hostname to use for opening the socket

String representing the hostname

port

port on the hostname

"5222" by default

bindPath

The path section of the url to use for http binding

"/http-bind/" by default

connectionType

type of connection to the server

"socket", "http" , "https"

autologin

Skip the login window when true

"true" , "false"

username

Username of the user logging in

String representing the username

 

password

Password of the user logging in

String representing the password of the user

policyFileURL

URL that specifies the location of a cross-domain policy file

String representing the URL. The URI can be http:// or xmlsocket:// (default is: "xmlsocket://yourserver.tld:5229").

red (3.4.4 and later)

Tints the window background color by multiplying the amount of red by this number

Red multiplier

green (3.4.4 and later)

Tints the window background color by multiplying the amount of green by this number

Green multiplier

blue (3.4.4 and later)

Tints the window background color by multiplying the amount of blue by this number

Blue multiplier

 

Loading Custom Stylesheets

 

For more complex visual changes than simply tinting the window color, you can use Flex's CSS system. Replace the SparkWebSkin.swf file in assets/css/ with one of your own creation (Adobe's documentation is at http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?co ntext=LiveDocs_Book_Parts&file=styles_069_26.html ). A sample stylesheet that changes the orange gradient background to a rather garish red-to-blue one follows:

 

Application
{
     backgroundGradientColors: #FF0000, #0000FF;
}

 

Changing logout behavior

 

When SparkWeb logs out, it does so by calling a javascript function called refreshPage. As the name implies, the default behavior of this function simply reloads the page, but you can implement it to behave any way you choose. An example implementation that navigates to igniterealtime.org instead is below.

 

function refreshPage()
{
    window.navigate("http://igniterealtime.org");
}
Comments (18)