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");
}
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.
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.
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.
I can't seem to find the index.jps file, either. Any help would be appreciated.
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?
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.
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?
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?
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?
usalabs, check this link http://www.igniterealtime.org/community/thread/32224?tstart=0
it has the reason and a workaround
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.
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 ?
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.
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.
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