URL handling in SAMP message parameters

Laurent Bourgès bourges.laurent at gmail.com
Fri Oct 7 01:45:40 PDT 2011


Dear Samp users,

In several standard MTypes, arguments can be url (string) giving the
URL of the document to load :
- table.load.votable
- table.load.fits
- table.highlight.row
- table.select.rowList
- image.load.fits
- spectrum.load.ssa-generic
- voresource.loadlist

Although SAMP is dedicated to desktop interoperability, such URL can
use any protocol (file://, http://, ftp://).
To be concrete, I am currently using JSAMP 1.3 and I must handle both
'file://' and 'http://' URL when I process one table.load.votable
message:
- 'file://' are provided by our JMMC applications: data are stored
into local files before sending their URL via SAMP
- 'http://' are provided by topcat because it embeds its own HTTP server

Two questions :
- Is it possible to describe which URL procotols must be supported by
SAMP clients (file, http at least) ? I do not want to support other
protocols (ftp ...) : the specification / MType wiki page should give
explanations / details
- Is it possible to provide in SAMP implementations (JSAMP, Sampy ...)
an easy API to deal with such URL like getDocument(URL url) ?

I think it is boring and error prone that every application developer
must handle all URL protocols on its own although he only needs to get
the document itself. I know it is not so difficult but error handling
can become tricky (http errors ...)

Best regards,
Laurent


More information about the apps-samp mailing list