[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xmlblaster] Re: REGEX/XPATH subscriptions - newbie requests assistance



Schuhmacher, Bret wrote:

Thanks Marcel. I found the zvon.org XPath tutorial and found the contains()
function. I'm new to XPath - I didn't realize you could do all that with
XPath.


I definitely need IE 5.5+ support or I'll have to find another alternative.
More and more people are going to zero-install, completely thin clients like
IE.  Maybe I can look into why it's stopped working...  Is there a How-To on
getting the servlet working?  Looks like I'll need Tomcat and a web server
(Apache, probably).  I've had all that working in the past and it wasn't
terribly difficult.  A little documentation on the stuff (like what goes
where, what to set up to get it all working, etc.) would give me a
jump-start, though.

-----------------------------------------------------------------------------------
Have a look into:

http://www.xmlblaster.org/xmlBlaster/doc/howto/http/http_tutorial.html
http://www.xmlblaster.org/xmlBlaster/doc/requirements/client.browser.html

You can try the persistent http online demo with:

http://www.xmlblaster.org:8080/xmlBlaster/dhtml/systemInfo/systemInfo.html?ActionType=login&xmlBlaster.loginName=joe&xmlBlaster.passwd=secret

it will work with mozilla and netscape.
With Opera and IE i think there are problems.
-----------------------------------------------------------------------------------


------------------------------------------------------------------------------------ You can try it with tomcat locally (no apache is necessary, i had tomcat 3.2.4 to test it, others should work as well):

1. Create a war file:

 cd xmlBlaster

 build.sh all      (assure xmlBlaster is compiled)

 build.sh  -DTOMCAT_HOME=/opt/jakarta_tomcat   deploy_war

Set TOMCAT_HOME to point to your installation and the xmlBlaster.war
and xmlBlaster.jar will be automatically deployed.

2. Start it

 java org.xmlBlaster.Main -admin.remoteconsole.port 0 -cluster false

 java  http.dhtml.systemInfo.SystemInfoPublisher

cd /opt/jakarta-tomcat/bin
export TOMCAT_OPTS="-Xms18M -Xmx64M"
startup.sh

3. Start your browser:

http://YOURHOST:8080/xmlBlaster/dhtml/systemInfo/systemInfo.html?ActionType=login&xmlBlaster.loginName=joe&xmlBlaster.passwd=secret
------------------------------------------------------------------------------------



NOTE:

o Another task is to repaint the HTML page in the browser with Javascript.
You can update the DOM or you can try to use SVG in your browser (see Micheles online chess
demo in xmlBlaster/demo/javaclients/svg/rhino/README).


o A good resource for this topic is the pushlet framework, see
   http://www.pushlets.com/
   One possibility is to use pushlets with xmlBlaster, if you try
   this it would be nice to get feedback about your success.

o Your probably need to port our demo to XTHML for IE or for
  using it in frameworks like cocoon.

o The demo tunnels firewalls and proxies, but note that
   if one proxy decides to drop the http connection you
   are lost (playing with minimal data rate and pings helps here).

regards,

Marcel


Thanks for the response! :-)

Rgds,

Bret



-----Original Message-----
From: Marcel Ruff [mailto:mr at marcelruff.info] Sent: Monday, June 16, 2003 4:36 PM
To: xmlblaster at server.xmlBlaster.org
Subject: [xmlblaster] Re: REGEX/XPATH subscriptions - newbie requests
assistance



Hi Bret,



First - thanks for the wonderful work on xmlBlaster! I haven't yet figured it all out, but it looks like it'll be _enormously_ useful. I've been looking for a MoM/JMS options that can do HTTP
to a browser as well as standard PtP and Pub/Sub messaging and the
infrastructure for
xmlBlaster seems quite open and workable. :-)


My question is this... I need some guidance on how to implement the following using xmlBlaster to achieve optimal performance and usability. Here's the situation:

1) I have a hierarchy of people that looks like this: enterprise
  enterprise data
  sites
       site data
       groups
             data for groups
             individuals
                        data for individuals

2) I'd like to report real-time statistics to browsers, stand-alone applications, pagers, email, etc. I envision people opening their tool of choice (i.e. the stand-alone app), which would
subscribe them to a certain class of messages in the hierarchy.




The real-time callback to browsers is tricky.
The idea is that instant callbacks tunnel through all firewalls and internet proxies.
This works fine for mozilla, but the current IE and Opera don't work, we have not
investigated yet why (once upon a time IE 5 worked).


Other protocols can be plugged in to xmlBlaster.
But plan some days for each missing protocol, if you donate the plugins back
plan some additional days for automatic testing and documentation. See
http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.html  ff



3) I'd like people to get **ONLY** the information to which they're privileged to see. This means group managers can only see their subordinates' information. Individuals can only see their
information. Site administrators can see everything below them.


Enterprise


admins can see **
everything**.



Your specific authorization must be done by a plugin as well, see
http://www.xmlblaster.org/xmlBlaster/doc/requirements/security.development.s
erverPlugin.howto.html



4) I'd like to subscribe using this nomenclature: ent_companyname.site_siteid.grp_groupnumber.user_usernumber.data

In practice this would look like this: ent_foobar.site_123.grp_12.agt_2108.x=y (where x=y is the datapoint and value). The x=y could be the body of the message, I guess. I suppose the message would look like this:
<foobar> <site id = "123"> <grp id = "12"> <agt id="2108">
<datapoint = value/>
</agt>
</grp> </site> </foobar>



Group managers would subscribe to the information that includes their group number (e.g. regex = ".*grp_12.*". Agents would subscribe to only their agent information using a regex =
".* agt_2108", etc.


Ideally I think I'd subscribe using a regex on the user or groupnumber, but I don't see that option -- did I miss it? I see the ability to subscribe to an EXACT match on an oid, or to
use the REGEX on the *message body*, but not to subscribe using a regex on
the oid.




Sorry, regex is not supported in the core. The internal query interface is currently XPath
only. Changing this to be pluggable will be some days of work. You can use
XPath to filter the oid directly, so probably you don't need regex to do what you need,
try 'starts-with()', 'contains()' etc.




As I've only just started using xmlBlaster I'm sure I don't quite understand the paradigm, so I'd appreciate any suggestions or guidance you might have. :-) I have built working versions
of this subscription scheme using XPATH, but is it the most efficient way


of


doing this? Have I just described the "contains()" function of the XPATH? Should I use this
for an XPATH subscription?
//agt [ at id='2108']




Why not. You can gain performance with absolute queries like

/xmlBlaster/key/foobar/site/grp/agt[ at id='2018']




Another quick question - is it possible to have different callback functions for each particular use? In a single program I might want to have some callbacks call the xyz() method,
while others call the abc() method. This would keep the update() method


from being just a


big case-oriented traffic-cop ;-).  No big deal if that's what update() is
supposed to do -
again, I'm just asking, trying to understand the architecture better :-).



Over the remote connection we only support update() and 'oneway update()'.
But the java client library has a dispatching possibility:

SubscribeReturnQos qos = con.subscribe(sk, sq, new I_Callback() {
public String update(String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) {
log.info(ME, "Receiving asynchronous message '" + updateKey.getOid() +
"' state=" + updateQos.getState() + " in HelloWorld4 handler");
return "";
}
}); // subscribe with our specific update handler



See xmlBlaster/demo/javaclients/HelloWorld4.java

enjoy

Marcel