Fwd: RE: [AG-TECH] adding shared apps

Dave Semeraro semeraro at ncsa.uiuc.edu
Mon Aug 25 15:01:42 CDT 2003


Ivan,

Thanks for the response. My immediate question is: does the AG2.0 app 
registration work
the same way as the 2.1.1? If not how does the 2.0 registration work? Also 
what is meant by
the comment "There is no longer support for shared application 
installations.."? Feel free to
heal before you respond to this message. I dont want any drug induced 
responses :).



Dave
>X-Envelope-From: judson at mcs.anl.gov
>X-Envelope-To: <semeraro at ncsa.uiuc.edu>
>Reply-To: <judson at mcs.anl.gov>
>From: "Ivan R. Judson" <judson at mcs.anl.gov>
>To: "'Dave Semeraro'" <semeraro at ncsa.uiuc.edu>, <ag-tech at mcs.anl.gov>
>Subject: RE: [AG-TECH] adding shared apps
>Date: Mon, 25 Aug 2003 14:20:10 -0500
>Organization: Futures Laboratory
>X-Mailer: Microsoft Outlook, Build 10.0.4510
>Importance: Normal
>X-MIME-Autoconverted: from quoted-printable to 8bit by mail.ncsa.uiuc.edu 
>id h7PJKKN01397
>X-MD5SUM: b30dd756656cb235529ff5befe8a33cb
>
>
>
>Hey Dave,
>
>Sorry this took so long. I'm actually at home sick today, but I wanted to
>let you know how "new" (aka 2.1.1) applications register themselves with the
>user environment.
>
>Here's an example from the SharedPresentation.py:
>
># This function registers the application with the users environment
># There is no longer support for shared application installations
># that might be reintroduced later.
>
>def registerApp(fileName):
>     import AccessGrid.Toolkit as Toolkit
>     app = Toolkit.CmdlineApplication()
>     appdb = app.GetAppDatabase()
>
>     # Get just the filename
>     fn = os.path.split(fileName)[1]
>
>     # Find the app dir
>     uad = Platform.GetUserAppPath()
>
>     # Get the absolute path for copying the file
>     src = os.path.abspath(fn)
>
>     # Get the destination filename
>     dest = os.path.join(uad, fn)
>
>     exeCmd = sys.executable + " \"" + dest + "\" -a %(appUrl)s"
>
>     print "SRC: %s DST: %s CMD: %s" % (src, dest, exeCmd)
>
>     # Copy the file
>     try:
>         shutil.copyfile(src, dest)
>     except IOError:
>         print "Couldn't copy app into place, bailing."
>         sys.exit(1)
>
>     # Call the registration method on the applications database
>     appdb.RegisterApplication("Shared Presentation",
>                               "application/x-ag-shared-presentation",
>                               "sharedpresentation",
>                               {"Open" : exeCmd })
>
>
>I'm not going to say this is the final solution for registering
>applications, but it is closer. It provides far more flexibility in what a
>shared app can be. The developer is responsible for writing this register
>function, and briefly the way it works is to:
>
>1) Query the toolkit for the user's application path (where to install ag
>specific apps)
>2) Copy the files there (in some application specific method)
>         the shared presentation viewer just copies the
>SharedPresentation.py to the apps dir
>3) Calls the application database register application function
>         This function takes the application name (e.g. "Shared
>Presentation"), the application mimetype
>("application/x-ag-shared-presentation"), the application extension
>("sharedpresentation"), and then a python dictionary of commands to register
>the shared presentation only registers the "Open" command.
>
>Some of the grungy details for this include, using sys.executable (the
>invoking python interpreter) as the command, taking the copied script
>"\Documents and Settings\judson\Application
>Data\AccessGrid\SharedApplications\SharedPresentation.py" as the first
>argument. It also makes use of pythons named arguments, so it says "-a"
>(shared app option for the application url), "%(appUrl)s" which will get the
>applicatoin url substituted in when invoked.
>
>There are a number of named arguments that are available, some are context
>(data, app, service) dependant, and some are not intended to be permanent.
>I'll be working on documentation that describes all of this in the very near
>future.
> >From down in the "if __name__ == "__main__":" section:
>
>This is just used to make it so that if you run
> > SharedPresentation.py -r
>
>It'll register the application for you into your client environment. It
>calls the above method.
>
>         elif o in ("-r", "--register"):
>             registerApp(sys.argv[0])
>             sys.exit(0)
>
>I'm a bit delirious from being sick (and medicated) so if there are any
>questions feel free to send them to the list.
>
>--Ivan
>
> > -----Original Message-----
> > From: Dave Semeraro [mailto:semeraro at ncsa.uiuc.edu]
> > Sent: Monday, August 25, 2003 8:48 AM
> > To: judson at mcs.anl.gov; ag-tech at mcs.anl.gov
> > Subject: RE: [AG-TECH] adding shared apps
> >
> >
> >
> > OK Ivan,
> >
> > I see the 2.1 release note on AG-TECH. Now how about telling
> > me how to
> > register a shared
> > application? First let me say I dont want to upgrade to 2.1
> > yet. I have a
> > local server running and
> > upgrading would mean changing several machines. I also want
> > to know the
> > details of  the
> > process of getting a shared app to work. I dont want to just turn the
> > crank. So lets have it...
> > Enquiring minds want to know!
> >
> > Dave
> > At 11:04 AM 8/22/2003 -0500, Ivan R. Judson wrote:
> >
> > >Hi Dave,
> > >
> > >The good news is here, but let me start with this:
> > >
> > >COOL WORK.
> > >
> > >First, let me tell you, we're about to release 2.1.1 which will
> > >significantly rework the application registration process.
> > HOWEVER, 1)
> > >that won't change your application, and 2) it should be A LOT EASIER.
> > >
> > >2.1.1 is in the pipe, metaphors aside, it should see the
> > light of day
> > >sometime today, later.  We're testing and squishing the last bugs.
> > >
> > >--Ivan
> > >
> > >PS -- As soon as I finish what I'm doing right now (which is
> > making the
> > >current shared apps register the new way, I'll send along a
> > snippet of
> > >code that shows how to do this)
> > >
> > > > -----Original Message-----
> > > > From: owner-ag-tech at mcs.anl.gov
> > [mailto:owner-ag-tech at mcs.anl.gov]
> > > > On Behalf Of Dave Semeraro
> > > > Sent: Friday, August 22, 2003 10:34 AM
> > > > To: ag-tech at mcs.anl.gov
> > > > Subject: [AG-TECH] adding shared apps
> > > >
> > > >
> > > >
> > > > OK guys and gals,
> > > >
> > > > I have written a shared application for the AG. I want to
> > know how
> > > > to "register" it so it will work. I have done the following:
> > > >
> > > > Wrote a shared chat program based loosely on the shared
> > browser. ( I
> > > > know the venue client has
> > > > one)
> > > >
> > > > I added the application to the mailcap file in C:\Documents and
> > > > Settings\All Users\Application Data\AccessGrid.
> > > >
> > > > I then put the application python script in the directory
> > > > C:\Documents and Settings\All Users\Application
> > > > Data\AccessGrid\applications\SharedBlather
> > > >
> > > > When I fire up the VenueClient and right click on the
> > applications
> > > > button I am presented with
> > > > three options, shared presentation, shared browser, and
> > > > shared blather.
> > > >
> > > > I select shared blather and get:
> > > >
> > > > "No client registered for the selected application"
> > > >
> > > > So what does a guy have to do to get the application to start. It
> > > > may be starting and crashing
> > > > for all I know. Cant debug it until I get it to start...
> > > >
> > > > As usual any help will be greatly appreciated.
> > > >
> > > > Dave Semeraro Ph.D.
> > > > Visualization and Virtual Environments Group
> > > > NCSA University of Illinois
> > > > 605 E. Springfield Ave.
> > > > Champaign, IL 61820
> > > > Semeraro at ncsa.uiuc.edu
> > > > (217) 244-1852
> > > >
> >
> > Dave Semeraro Ph.D.
> > Visualization and Virtual Environments Group
> > NCSA University of Illinois
> > 605 E. Springfield Ave.
> > Champaign, IL 61820
> > Semeraro at ncsa.uiuc.edu
> > (217) 244-1852
> >

Dave Semeraro Ph.D.
Visualization and Virtual Environments Group
NCSA University of Illinois
605 E. Springfield Ave.
Champaign, IL 61820
Semeraro at ncsa.uiuc.edu
(217) 244-1852




More information about the ag-tech mailing list