Monday, September 21, 2009

smartphone market 5/2009

- The iPhone OS had 8% of the smartphone market, but generated 43% of mobile Web requests and 65 percent of HTML usage.

- The Android OS share of the smartphone market was less than 1%, but generated 3% of mobile Web requests and 9% of HTML usage.

- The Symbian OS had 52% of the smartphone market, but generated only 36% of mobile Web usage and 7% of HTML usage.

- Usage of mobile Web sites greatly out paces usage of HTML sites on smartphones running the Symbian and RIM Operating System (OS).

- 24% of US requests were made over a Wi-Fi network. The top five Wi-Fi devices in terms of usage were the iPhone, iPod touch, Sony PSP, HTC Dream (G1), and HTC Dash.

Saturday, September 19, 2009

Bayeux protocol data structure

/**/
/* Bayeux protocol definition version 1.01, in language- */
/* independent JSON form. */
/* */
/* GloriaJW 2008-01-03 */
/* */
/* This is a JSON dictionary of all Bayeux structures and their */
/* possible values, vtypes and rtypes. */
/* */
/* The four value types (vtypes) are: */
/* (1) Single Value from a Fixed list of values (SVF), */
/* (2) Single Value which is Variable (SVV), */
/* (3) Multiple Values from a Fixed list of values (MVF), */
/* (4) Multiple Values which are Variable (MVV) */
/* */
/* These vtype fields begin with 'vtype_' and can be used as */
/* visual aids, or assert() fixed and single/multiple value */
/* checking. These fields are "advice" fields, not to be passed */
/* in the bayeux protocol, but ONLY to be used for either */
/* automated or manual evaluation of field values. */
/* */
/* The seven (optional) restriction types (rtypes) are: */
/* (1) Sent from Client only (CZ) */
/* (2) Sent from Server only (SZ) */
/* (3) Sent from Client only, and only upon failure: (CE) */
/* (4) Sent from Server only, and only upon failure: (SE) */
/* (5) Sent from Client only, optional: (CO) */
/* (6) Sent from Server only, optional: (SO) */
/* (7) Optional in both directions: (BO) */
/* */
/* These rtype fields are optional, and only appear when there */
/* is an applicable restriction on a field. They begin with */
/* 'rtype_' and can be used as visual aids, or assert() */
/* client/server and error checking. These fields are "advice" */
/* fields, not to be passed in the bayeux protocol, but ONLY to */
/* be used for either automated or manual evaluation of field */
/* values. */
/* */
/**/
{
"handshake":{"channel":"/meta/handshake",
"vtype_channel":"SVF",

"version":"1.0.1",
"vtype_version":"SVF",

"supportedConnectionTypes":["iframe", "flash","callback-polling","long-polling"],
"vtype_supportedConnectionTypes":"MVF",

/* response only */
"clientId":"alphanumeric1234",
"vtype_clientId":"SVV",
"rtype_clientId":"SZ",

/* response only */
"successful":["true","false"],
"vtype_successful":"SVF",
"rtype_successful":"SZ",

/* failure only, response only */
"error":[000,"optional error arguments","Some Error String"],
"vtype_error":"MVV",
"rtype_error":"SE",

/* optional */
"minimumVersion":"1.0",
"vtype_version":"SVF",
"rtype_version":"BO",

/* optional */
"id":"alphanumeric1234",
"vtype_id":"SVV",
"rtype_id":"BO",

/* optional, response only */
"authSuccessful":["true","false"],
"vtype_authSuccessful":"SVF",
"rtype_authSuccessful":"SO",

/* optional, response only */
"advice":{"reconnect":["retry","handshake","none"],
"vtype_reconect":"SVF",
"rtype_reconect":"SO",

"interval":[1000,-1000],
"vtype_interval":"SVV",
"rtype_interval":"SO",

"multipleClients":["true","false"],
"vtype_multipleClients":"SVF",
"rtype_multipleClients":"SO",

"hosts":["SomeHostname","192.168.1.1","localhost","127.0.0.1"],
"vtype_hosts":"MVV"
"rtype_hosts":"SO"

"authenticate":{"authtype":["htpasswd","OpenId"],
"vtype_authtype":"MVF",
"rtype_authtype":"SO"
},

"guaranteedDelivery":["true","false"],
"vtype_guaranteedDelivery":"MVF",
"rtype_guaranteedDelivery":"SO"

}

/* optional, client (initiator) only */
"ext":{"authenticate":{"authtype":["htpasswd","OpenId"],
"vtype_authtype":"SVF",
"rtype_authtype":"CO",

"user":"some user id",
"vtype_user":"SVV",
"rtype_user":"CO",

"password":"youch if clear text!",
"vtype_password":"SVV",
"rtype_password":"CO"
},

"guaranteedDelivery":["true","false"],
"vtype_guaranteedDelivery":"SVF",
"rtype_guaranteedDelivery":"CO"
}
},

"connect":{"channel":"/meta/connect",
"vtype_channel":"SVF",

"connectionType":["iframe", "flash","callback-polling","long-polling"],
"vtype_connectionType":"SVF",

"clientId":"alphanumeric1234",
"vtype_clientId":"SVV",

/* response only */
"successful":["true","false"],
"vtype_successful":"SVF",
"rtype_successful":"SZ",

/* failure only, response only */
"error":[000,"optional error arguments","Some Error String"],
"vtype_error":"MVV",
"rtype_error":"SE",

/* optional */
"id":"alphanumeric1234",
"vtype_id":"SVV",
"rtype_id":"BO",

/* optional, response only */
"timestamp":"YYYY-MM-DD\thh:mm:ss.ss",
"vtype_timestamp":"SVV",
"rtype_timestamp":"SO",

/* optional, server response only */
"advice":{"reconnect":["retry","handshake","none"],
"vtype_reconect":"SVF",
"rtype_reconect":"SO",

"interval":[1000,-1000],
"vtype_interval":"SVV",
"rtype_inderval":"SO",

"multipleClients":["true","false"],
"vtype_multipleClients":"SVF",
"rtype_multipleClients":"SO",

"hosts":["SomeHostname","192.168.1.1","localhost","127.0.0.1"],
"vtype_hosts":"MVV",
"rtype_hosts":"SO"

"authenticate":{"authtype":["htpasswd","OpenId"],
"vtype_authtype":"MVF",
"rtype_authtype":"SO"
},

"guaranteedDelivery":["true","false"],
"vtype_guaranteedDelivery":"MVF",
"rtype_guaranteedDelivery":"SO"

}

/* optional, client (initiator) only */
"ext":{"authenticate":{"authtype":["htpasswd","OpenId"],
"vtype_authtype":"SVF",
"rtype_authtype":"CO",

"user":"some user id",
"vtype_user":"SVV",
"rtype_user":"CO",

"password":"youch if clear text!",
"vtype_password":"SVV",
"rtype_password":"CO"
}
},
"guaranteedDelivery":["true","false"],
"vtype_guaranteedDelivery":"SVF",
"rtype_guaranteedDelivery":"CO"
},

"disconnect":{"channel":"/meta/disconnect",
"vtype_channel":"SVF",

"clientId":"alphanumeric1234",
"vtype_clientId":"SVV",

/* response only */
"successful":["true","false"],
"vtype_successful":"SVF",
"rtype_successful":"SZ",

/* failure only, response only */
"error":[000,"optional error arguments","Some Error String"],
"vtype_error":"MVV",
"rtype_error":"SE",

/* optional */
"id":"alphanumeric1234",
"vtype_id":"SVV",
"rtype_id":"BO"

},

"subscribe":{"channel":"/meta/subscribe",
"vtype_channel":"SVF",

"clientId":"alphanumeric1234",
"vtype_clientId":"SVV",

"subscription":["/foo/**","/channel_b","/channel_c/x"],
"vtype_subscription":"MVV",

/* optional, response only */
"timestamp":"YYYY-MM-DD\thh:mm:ss.ss",
"vtype_timestamp":"SVV",
"vtype_timestamp":"SO",

/* response only */
"successful":["true","false"],
"vtype_successful":"SVF",
"rtype_successful":"SZ",

/* failure only, response only */
"error":[000,"optional error arguments","Some Error String"],
"vtype_error":"MVV",
"rtype_error":"SE",

/* optional */
"id":"alphanumeric1234",
"vtype_id":"SVV",
"rtype_id":"BO",

/* optional, server response only */
"advice":{"reconnect":["retry","handshake","none"],
"vtype_reconect":"SVF",
"rtype_reconect":"SO",

"interval":[1000,-1000],
"vtype_interval":"SVV",
"rtype_interval":"SO",

"multipleClients":["true","false"],
"vtype_multipleClients":"SVF",
"rtype_multipleClients":"SO",

"hosts":["SomeHostname","192.168.1.1","localhost","127.0.0.1"],
"vtype_hosts":"MVV",
"rtype_hosts":"SO",


"authenticate":{"authtype":["htpasswd","OpenId"],
"vtype_authtype":"MVF"
"rtype_authtype":"SO"
},

"guaranteedDelivery":["true","false"],
"vtype_guaranteedDelivery":"MVF",
"rtype_guaranteedDelivery":"SO"
}

/* optional, client (initiator) only */
"ext":{"authenticate":{"authtype":["htpasswd","OpenId"],
"vtype_authtype":"SVF",
"rtype_authtype":"CO",

"user":"some user id",
"vtype_user":"SVV",
"rtype_user":"CO",

"password":"youch if clear text!",
"vtype_password":"SVV",
"rtype_password":"CO"
}
},
"guaranteedDelivery":["true","false"],
"vtype_guaranteedDelivery":"SVF",
"rtype_guaranteedDelivery":"CO"
},

"unsubscribe":{"channel":"/meta/unsubscribe",
"vtype_channel":"SVF",

"clientId":"alphanumeric1234",
"vtype_clientId":"SVV",

"subscription":["/foo/**","/channel_b","/channel_c/x"],
"vtype_subscription":"MVV"

/* response only */
"successful":["true","false"],
"vtype_successful":"SVF",
"rtype_successful":"SZ",

/* failure only, response only */
"error":[000,"optional error arguments","Some Error String"],
"vtype_error":"MVV",
"rtype_error":"SE",

/* optional */
"id":"alphanumeric1234",
"vtype_id":"SVV",
"rtype_id":"BO",

/* optional, server response only */
"advice":{"reconnect":["retry","handshake","none"],
"vtype_reconect":"SVF",
"rtype_reconect":"SO",

"interval":[1000,-1000],
"vtype_interval":"SVV",
"rtype_interval":"SO",

"multipleClients":["true","false"],
"vtype_multipleClients":"SVF",
"rtype_multipleClients":"SO",

"hosts":["SomeHostname","192.168.1.1","localhost","127.0.0.1"],
"vtype_hosts":"MVV",
"rtype_hosts":"SO",

"authenticate":{"authtype":["htpasswd","OpenId"],
"vtype_authtype":"MVF",
"rtype_authtype":"SO"
},

"guaranteedDelivery":["true","false"],
"vtype_guaranteedDelivery":"MVF",
"rtype_guaranteedDelivery":"SO"

}

/* optional, client (initiator) only */
"ext":{"authenticate":{"authtype":["htpasswd","OpenId"],
"vtype_authtype":"SVF",
"rtype_authtype":"CO",

"user":"some user id",
"vtype_user":"SVV",
"rtype_user":"CO",

"password":"youch if clear text!",
"vtype_password":"SVV",
"rtype_password":"CO"
}
"guaranteedDelivery":["true","false"],
"vtype_guaranteedDelivery":"SVF",
"rtype_guaranteedDelivery":"CO"
}
},

"publish":{"channel":"/some/channel",
"vtype_channel":"SVV",

"data":"some JSON dict or raw string",
"vtype_data":"SVV",

/* optional */
"clientId":"alphanumeric1234",
"vtype_clientId":"SVV",
"rtype_clientId":"BO",

/* optional */
"id":"alphanumeric1234",
"vtype_id":"SVV",
"rtype_id":"BO",

/* optional */
"ext":{"authenticate":{"authtype":["htpasswd","OpenId"],
"vtype_authtype":"SVF",
"rtype_authtype":"BO",

"user":"some user id",
"vtype_user":"SVV",
"rtype_user":"BO",

"password":"youch if clear text!",
"vtype_password":"SVV",
"rtype_password":"BO"
}

"guaranteedDelivery":["true","false"],
"vtype_guaranteedDelivery":"SVF",
"rtype_guaranteedDelivery":"BO"
}

/* response only */
"successful":["true","false"],
"vtype_successful":"SVF",
"rtype_successful":"SZ",

/* failure only, response only */
"error":[000,"optional error arguments","Some Error String"],
"vtype_error":"MVV",
"rtype_error":"SE"
},

"deliver":{"channel":"/some/channel",
"vtype_channel":"SVV",

"data":"some JSON dict or raw string",
"vtype_data":"SVV",

/* optional */
"clientId":"alphanumeric1234",
"vtype_clientId":"SVV",
"rtype_clientId":"BO",

/* optional */
"id":"alphanumeric1234",
"vtype_id":"SVV",
"rtype_id":"BO",

/* optional */
"advice":{"reconnect":["retry","handshake","none"],
"vtype_reconect":"SVF",
"rtype_reconect":"BO",

"interval":[1000,-1000],
"vtype_interval":"SVV",
"rtype_interval":"BO",

"multipleClients":["true","false"],
"vtype_multipleClients":"SVF",
"rtype_multipleClients":"BO",

"hosts":["SomeHostname","192.168.1.1","localhost","127.0.0.1"],
"vtype_hosts":"MVV",
"rtype_hosts":"BO",


"authenticate":{"authtype":["htpasswd","OpenId"],
"vtype_authtype":"MVF",
"rtype_authtype":"BO"
},

"guaranteedDelivery":["true","false"],
"vtype_guaranteedDelivery":"MVF",
"rtype_guaranteedDelivery":"BO"
}

/* optional, client (initiator) only */
"ext":{"authenticate":{"authtype":["htpasswd","OpenId"],
"vtype_authtype":"SVF",
"rtype_authtype":"CO",

"user":"some user id",
"vtype_user":"SVV",
"rtype_user":"CO",

"password":"youch if clear text!",
"vtype_password":"SVV",
"rtype_password":"CO"
}

"guaranteedDelivery":["true","false"],
"vtype_guaranteedDelivery":"SVF",
"rtype_guaranteedDelivery":"CO"
},

/* response only */
"successful":["true","false"],
"vtype_successful":"SVF",
"rtype_successful":"SZ",

/* failure only, response only */
"error":[000,"optional error arguments","Some Error String"],
"vtype_error":"MVV",
"rtype_error":"SE"
},

"lsService":{"channel":"/service/local/ls_tmp", /* an example of a local service */
"vtype_channel":"SVF",

"clientId":"alphanumeric1234",
"vtype_clientId":"SVV",

/* response only */
"response":"some potentially long string",
"vtype_response":"SVV",
"rtype_response":"SZ",

/* response only */
"successful":["true","false"],
"vtype_successful":"SVF",
"rtype_successful":"SZ",

/* failure only, response only */
"error":[000,"optional error arguments","Some Error String"],
"vtype_error":"MVV",
"rtype_error":"SE"

},

"urlService":{"channel":"/service/url", /* bayeux_config file endpoints are attached here. */
"vtype_channel":"SVF",

"clientId":"alphanumeric1234",
"vtype_clientId":"SVV",

/* response only */
"response":"some potentially long string",
"vtype_response":"SVV",
"rtype_response":"SZ",

/* response only */
"successful":["true","false"],
"vtype_successful":"SVF",
"rtype_successful":"SZ",

/* failure only, response only */
"error":[000,"optional error arguments","Some Error String"],
"vtype_error":"MVV",
"rtype_error":"SE"

}
}

Monday, September 14, 2009

wls pubsub server

 IT trends 2010 series (2)
com.bea.httppubsub.BayeuxMessage

Develop steps
  1. weblogic.xml library-ref
  2. weblogic-pubsub.xml  (weblogic-pubsub.xsd)

  3. PubSub API for publish, filter, dynamic channel (optional)
    lookup pubsub server & create local client
            publish to channel
            subscribe (listener register)
            filter chain (filter class, config chain)
    APIS:
            com.bea.httppubsub.PubSubServer
            LocalClient
            ClientManager
            MessageFilter
            DeliveredMessageListener
            BayeuxMessage

  4. Add Dojo to jsp/html for publish/subscribe msg.
    //Initialize the Dojo cometd environment
    dojo.io.cometd.init({}, "/context/cometd");
        cometd - matching default pubsub war web.xml

    //Publish a message to a channel
    dojo.io.cometd.publish("/a/channel", "message content");   //publish text msg
    dojo.io.cometd.publish("/a/channel", {"data": "content"}); // JSON object

    //Subscribe to a channe
    dojo.io.cometd.subscribe("/a/channel", null, "onUpdate");

            //JS function for call back
            function onUpdate(message) {
              if (!message.data) {
                alert("bad message format "+message);
                  return;
              }
              // fetch the data published by other clients
              var data = message.data;
            }
  5. Deploy web-app; pubsub war library  WL_HOME/common/deployable-libraries
  6. Other aspects

    • Persistent Channelsweblogic-pubsub.xml  persistent-client-timeout-secs
    • JMS as provider for cluster support weblogic-pubsub.xml

             t3://localhost:7001
             ConnectionFactoryJNDI
             TopicJNDI
    • Requiring SSL for pub-sub Via web.xml INTEGRAL
    • AuthCookieEnabled to Access SSL resources
      _WL_AUTHCOOKIE_JSESSIONID created (cookie or URL rewrite). This is default behavior
    •  Locking Down the Pub-Sub Server (5-*)
    *Configure SSL for pub-sub.
    *Require authentication (BASIC, FORM, and so forth.)
    *Ensure auth-cookie is enabled.
    *Ensure that all the channels are constrained in the weblogic-pubsub.xml file.
    *Lock subscribe operations, which are allowed by default.

AJAX - technology

 IT trends 2010 series (1)

AJAX - Async-JavaScripts and XML

Web development that uses JSON or XML for data exchange,  DOM.XMLHttpRequest for protocol access,  JavaScript for operations, and HTML/CSS for display.

Competing technologies: Java Applet / Web start,  Flash,  ActiveX

Technology selection:
framework: DOJO, GWT, ADF
push: CometD, IceFace
server support: GWT, WLS pub/sub server


Usability
      Use Ajax, a page can be created by tiles, and reload only the part that's changing. This and async interaction with server also enhances usability. Meanwhile, page states is maintained within js.
  1. suggestion while typing
  2. loading partial changed tile
  3. responsive - e.g: pre-factch data
  4. ajax push
  5. offline(?)
  6. visual - virtual reality

Drawback
      There may be more frequent requests to server. Dynamic page updates causes browser bookmar, history buttons and search engine difficulties. Other issues including security and development efforts.

  • Scripting language - language augment a system/GUI to achieve automation by non-experts.
  •  Client side enabling for RIA application
  • JSON - javascript and ECMA scripts
Ajax Push
       Push framework using Ajax, has a set of technologies supporting it. Bayeux protocol, implemented as CometD, from DOJO.
 

Ajax Framework includes: DOJO, ADF, Google web toolkit, iceFace, MooTools/Ape, Yahoo UI library, jQuery