Currently Being Moderated

SparkWeb Programmatic Launch Configuration

VERSION 19

Created on: Dec 21, 2007 11:26 AM by David Smith - Last Modified:  Jul 29, 2008 6: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 {
             & nbsp; server: "localhost",
             & nbsp; port: "7080",
             & nbsp; bindPath: "/http-bind/",
             & nbsp; connectionType : "http",
             & nbsp; autologin: "true",
             & nbsp; username: "admin",
             & nbsp; password: "admin",
             & nbsp; policyFileURL: "http://www.example.com/sub/dir/crossdomain.xml"
             & nbsp; // 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");
}
Average User Rating
(0 ratings)




claude stabile claude stabile  says:

Hi !

 

best wishes for 2008.

Could you please specify in which file i should add the default server definition ? so i can target to my server instead of having ignite.org as a default server

 

Our test server is here : https://chat.free-solutions.org/plugins/enterprise/sparkweb/index.jsp

 

many thanks in advance for help

 

Regards

Jason L Jason L  says:

what file do I need to add this to and where is it located.

David Smith David Smith  says:

At the moment (3.4.4) there isn't an admin console interface to this functionality, as it's primarily intended for people running SparkWeb.swf standalone. However, you can edit the index.jsp file in the expanded jar directly. Search that file for jive_sparkweb_getConfig to see where to edit.

Jason L Jason L  says in response to David Smith:

is this 3.4.4 only?  if not then where do I find the index.jsp, because I have searched my system and can't find that file.  My test machine is 3.4.3 right now.

David Smith David Smith  says in response to Jason L:

Hrm. I seem to have assumed incorrectly on how one important bit worked here. I'll post when I have more information, but for the moment programmatic configuration is limited to SparkWeb.swf embedded in a custom page.

kdingman kdingman  says in response to David Smith:

I can't seem to find the index.jps file, either.  Any help would be appreciated.

André Heie Vik André Heie Vik  says:

This is pretty cool (and the Flex/Flash client is really slick), but it should also be possible to instruct the client to join a group chat at launch (example: join a chatroom related to the web page SparkWeb in launched from). Add SSO, and we have a winner

 

Could you provide an example of how to embed SparkWeb.swf in a custom page?

kdingman kdingman  says in response to kdingman:

I now have a index.html file with the above code in it.. but still cannot connect to sparkweb from outside the network.  I've tried to make the ports 5222 and 80, and I've tried socket and http.  I'm still not authorized to access sparkweb when I go to login.

Klamka Klamka  says in response to kdingman:

Can you tell me where can I find this file?

kdingman kdingman  says in response to Klamka:

I didn't have the file either... I created it from an example someone else had.  I think it might have to be a .jsp file but it works in house with my html file.  Any help with getting it to work externall, anybody?

Jason L Jason L  says in response to kdingman:

I don't really understand the stylesheet part.  Is that something I put in with the same config as policyfileurl?  Or do I have to use Flex (an not free tool) to create a stylesheet?

Terry Terry  says:

Sorry everyone, but there is NO index.jsp anywhere on my server, so I'm having to decompile sparkweb.swf to see if there's something in there that I can change to stop this error:-

 

Couldn't load config value for the policy file url; values are: , password:, port:5222, autoLogin:false, connectiontype:socket, autologin:false, red:1, username:, blue:1, connectionType:socket, green:1, server:localhost, location:

 

Before anyone suggest I change the openfire server name, I can't do that otherwise sparkweb won't work.

 

There is an html file but all that has is a redirect to 'index.jsp' which doesn't exist, so, how can a url get redirected to a none existent page?

Jason L Jason L  says in response to Terry:

usalabs, check this link http://www.igniterealtime.org/community/thread/32224?tstart=0

it has the reason and a workaround

David Smith David Smith  says in response to Jason L:

It's also less important with it being open source now, since it can run outside of enterprise and avoid having the jsp get compiled in.

info info  says:

I don't know why but autologin don't work (normal login does).

If autologin can work is there any possibility to have a md5 password in place of the uncrypted one ?

itbsole itbsole  says:

Good job,

 

But i changed server to "localhost" in javascript. but still display default server name " igniterealtime.org". I looked into source and trace "tempConifg":

 

      // First, we will attempt to load from a javascript function called jive_sparkweb_getConfig
      var tempConfig:Object = ExternalInterface.call("jive_sparkweb_getConfig");
      trace(tempConfig);

 

I get "null". it seems nerver got to "jive_sparkweb_getConfig" function.

Daniel Henninger Daniel Henninger  says in response to itbsole:

SparkWeb stores the last server you connected to in a cookie and auto-fills it next time you go to the login page.  That might be what you are seeing.

More Like This

  • Retrieving data ...