Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Mar 2007
    Location
    a
    Posts
    6

    Question Custom Connection Message

    Hi,

    Is it possible to inject code to have a UI similar to gmail gtalk ( or yahoo mail chat ) which can show "Connecting to chat server" and then if not present "not available" ?

    Right now, is the server is not avaliable, it throws up a prompt every X secs. It would be great if we have the flexiblity of handling such cases so that so we have custom error messages and their formatting

  2. #2
    Member
    Join Date
    Mar 2007
    Location
    a
    Posts
    6
    Quote Originally Posted by rakeshxp
    Hi,

    Is it possible to inject code to have a UI similar to gmail gtalk ( or yahoo mail chat ) which can show "Connecting to chat server" and then if not present "not available" ?

    Right now, is the server is not avaliable, it throws up a prompt every X secs. It would be great if we have the flexiblity of handling such cases so that so we have custom error messages and their formatting
    I think I hit the enter too quickly :P

    I am talking about LS + dojo integration ( and the wierd dialog prompts when the LS server is not available )

  3. #3
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Hi,

    The Dojo demo should not show "not connected" prompts but (if you're running it from LS internal web server) it could show debug messages.

    In any case your desidered behavior is feasible.

    Please take a look to these API:
    http://www.lightstreamer.com/docs/cl...onStatusChange
    http://www.lightstreamer.com/docs/cl...sOnClientError

    And to these threads:
    http://www.lightstreamer.com/vb/showthread.php?t=68
    http://www.lightstreamer.com/vb/showthread.php?t=112

    Hope that helps.

  4. #4
    Member
    Join Date
    Mar 2007
    Location
    a
    Posts
    6
    Mone, Thanks a lot!!!
    This is exactly I was looking for

    Please find the attached snippet and let me know if I have properly understood the api
    var lsPage = new PushPage();
    var e;
    lsPage.context.setDebugAlertsOnClientError(false);
    lsPage.context.setRemoteAlertsOnClientError(false) ;
    lsPage.context.setDomain(domain);

    lsPage.onEngineReady = function(engineRef) {
    dojo.debug("Lightstreamer onEngineReady" ) ;
    e = engineRef ;
    engineRef.context.setDebugAlertsOnClientError(fals e);
    engineRef.context.setRemoteAlertsOnClientError(fal se);
    engineRef.connection.setUserName("cookie");
    engineRef.connection.setPassword("password");
    engineRef.connection.setLSHost(host);
    engineRef.connection.setLSPort(port);
    engineRef.connection.setAdapterName("XYZ");
    engineRef.changeStatus("STREAMING");

    e.onClientAlert = function ( code, message ) {
    dojo.debug("WOW!!!! LightstreamerEngine onClientAlert code[" + code +"] message[" + message + "]" ) ;
    }
    e.onClientError = function ( message ) {
    dojo.debug("WOW!!!! LightstreamerEngine onClientError message[" + message + "]" ) ;
    }
    e.onServerError = function ( code, message ) {
    dojo.debug("WOW!!!! LightstreamerEngine onServerError code[" + code +"] message[" + message + "]" ) ;
    }
    e.onStatusChange = function ( chngStatus ) {
    dojo.debug("WOW!!!! LightstreamerEngine onStatusChange status[" + chngStatus + "]" ) ;
    }
    }

    lsPage.onEngineLost = function() { e = null; }

    lsPage.onClientAlert = function ( code, message ) {
    dojo.debug("WOW!!!! PushPage onClientAlert code[" + code +"] message[" + message + "]" ) ;
    }
    lsPage.onClientError = function ( message ) {
    dojo.debug("WOW!!!! PushPage onClientError message[" + message + "]" ) ;
    }
    lsPage.onServerDeny = function ( message ) {
    dojo.debug("WOW!!!! PushPage onServerDeny message[" + message + "]" ) ;
    }
    lsPage.bind();
    lsPage.loadEngineMinimal("../struts/lightstreamer-client/lsengine.html");

    Thanks,
    Rakesh

  5. #5
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Yes, it's ok

    Just move from the deprecated loadEngineMinimal to the newer createEngine:
    http://www.lightstreamer.com/docs/cl...l#createEngine

  6. #6
    Member
    Join Date
    Mar 2007
    Location
    a
    Posts
    6
    Thanks for the info. I will change to the new API.

    Could you explain the difference between PushPage and Engine interms of error handling ? More specificly, do I need to add onClientAlert ( e.g ) on both PushPage and Engine? What are the scenarios when either of them is called ?

    PS: I am already become a big fan of Lightstreamer! I couldn't find any page that tells me the pricing of the advanced version.

  7. #7
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Hi,

    If you'd like to handle every message rised by LS web client you should implement both PushPage and LightstreamerEngine callbacks. Please refer to the API docs for a full overview of the kind of messages you can get from the various callbacks: http://www.lightstreamer.com/docs/cl...doc/index.html
    and get back if something is unclear.

    Find below a list of "messages callbacks" for your convenience:
    http://www.lightstreamer.com/docs/cl...sOnClientError
    http://www.lightstreamer.com/docs/cl...sOnClientError

    http://www.lightstreamer.com/docs/cl...#onClientAlert
    http://www.lightstreamer.com/docs/cl...#onClientError
    http://www.lightstreamer.com/docs/cl...#onServerError
    http://www.lightstreamer.com/docs/cl...onStatusChange

    http://www.lightstreamer.com/docs/cl...#onClientAlert
    http://www.lightstreamer.com/docs/cl...#onClientError
    http://www.lightstreamer.com/docs/cl...l#onServerDeny



    About the pricing please write an e-mail to info@lightstreamer.com. ( http://www.lightstreamer.com/sales.htm )

 

 

Similar Threads

  1. Replies: 4
    Last Post: February 3rd, 2011, 11:33 AM
  2. get custom messages in web client
    By rd2008 in forum Client SDKs
    Replies: 3
    Last Post: October 30th, 2008, 11:25 AM
  3. Replies: 7
    Last Post: March 19th, 2008, 09:31 AM
  4. Custom error page
    By Waddy in forum General
    Replies: 3
    Last Post: March 6th, 2007, 10:43 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 12:38 PM.