[AG-TECH] more shared app questions.

Ivan R. Judson judson at mcs.anl.gov
Thu Aug 28 10:16:47 CDT 2003


Hi Dave, 

Ok, I'm still delirious, but I'm mostly coming out of the haze.

> Does an application get registered with a single venue server? If the
> server goes down do you
> have to register again ( I am thinking not)? 

A shared application is created in a single venue, and it is persistent
between server restarts.

> When I look at
> the shared 
> presentation application
> I see code in the "main" routine that worries about 
> application and venue 
> urls. If the app is
> started with a venue url and no app url then something 
> special happens. A 
> VenueProxy is
> obtained and the CreateApplication method is called on that 
> object. 

This is the creation of the shared application. Remember every shared
applicatoin has some state that is kept in the venue the shared application
is part of, this CreateApplication initializes that state, exposing some
interfaces to directly use it from the shared application, for example Join,
Leave, GetData, SetData are methods on the application object that results
from the CreateApplication call.

> Is this
> the magic registration
> process happening before our eyes? If it is not I would like 
> an explanation 
> of what this section
> of the code is doing. The comments say that when the app is 
> integrated into 
> the venueclient
> this will never happen and the application will only be given 
> an app url. 

Yes it is the magic registration...

> So my next question
> is what happens when I start the shared presentation
> application from the 
> venue client? 

This happens one of two ways, first, you can go to the Venues->Applications
menu, and if your venue client is configured to know about an application it
shows up there (we'll get to what that means in a second). You can choose it
and it does a CreateApplication in the venueclient, then launches the shared
application at the application object the venue client created. Very similar
to what we saw above.

> How
> is it started and what arguments are passed? I know I could
> crawl through 
> the code to find this
> out but I am a lazy slug and you guys know the answer to 
> these things. 

How it's started is specified when you configure the venueclient to know
about the application. The two cases we have are Linux and Windows, things
are almost the same, but slightly cock-eyed so I'll describe the general
stuff (that's the same) then point out the details (so you can make it
work):

General Stuff:

The venueclient looks for an accessgrid specific mailcap file that it loads.
This file 'enables' the venueclient to know about shared apps (both for
starting and for just using).  The mail cap file looks like a standard
mailcap file with the syntax like:

<mimetype>; <command>; description=<description>; nametemplate=<extension>

An example (from windows) of one of our mailcap lines is:

application/x-ag-shared-presentation; C:\Documents and Settings\All
Users\Application
Data\AccessGrid\applications\SharedPresentation\SharedPresentation.py -a %s;
description=This is the shared presentation viewer.;
nametemplate=sharedpresentation

Windows and linux behave the same way, but the location of the mailcap file
and the location that the shared app files are stored is a bit different.
Here're the details:

Windows Mailcap:	\Documents and Settings\<user>\Application
Data\AccessGrid\mailcap			
Windows App Files: \Documents and Settings\All Users\Application
Data\AccessGrid\applications\<appname>\<files>

On windows, there is an extraneous mailcap file in the directory:
\Documents and Settings\All Users\Application Data\AccessGrid\mailcap

Linux shared app support wasn't completely finished, since the shared*.py
apps were windows only.

The command line arguments are parsed and used just like standard mime
types, from the mailcap man page:

 	 The "command" field is any UNIX command ("cat %s"  in  the
       above example), and is used to specify the interpreter for
       the given type of message.  It will be passed to the shell
       via  the  system(3)  facility.  Semicolons and backslashes
       within the command must be quoted  with  backslashes.   If
       the  command  contains  "%s", those two characters will be
       replaced by the name of a file that contains the  body  of
       the  message.  If  it  contains "%t', those two characters
       will be replaced by the content-type field, including  the
       subtype,  if  any.   (That  is,  if  the  content-type was
       "image/pbm;  opt1=something-else",  then  "%t"  would   be
       replaced  by "image/pbm".)   If the command field contains
       "%{" followed by a parameter name and a closing "}",  then
       all  those characters will be replaced by the value of the
       named parameter, if any,  from  the  Content-type  header.
       Thus,  in the previous example, "%{opt1}" will be replaced
       by "something-else".  Finally, if the command contains "",
       those two characters will be replaced by a single % 
       character.  (In fact, the backslash can be used to quote 
       any character, including itself.)

<snip wife story, trying to save dave's weekend>


> Anyway, those are my questions. I had more but cant remember
> them. If you 
> are still with me
> I would like to have them answered in the context of AG 2.0. 
> I know there 
> is a new version out but
> based on the traffic I see on this list I think the path of least 
> resistance is to wait until you all have
> debugged it a bit more before I dive in. Besides, Enquiring 
> minds want to 
> know. I want to go
> through the 2.0 registration process before I install 2.1 so I can 
> appreciate the true beauty of the
> new release...

No problem, I've answered with respect to 2.0, and believe me, once you go
through this you'll be happier with 2.1.1 :-). But, keep good notes, and try
to give us some feedback on the interfaces. We've built these from our own
requirements, it'd be nice to hear some from you guys.

--Ivan




More information about the ag-tech mailing list