SAMP TOOL MAKER 1.0: TOOL MAKER 2.0: NO CANAL.
sampjs is a small JavaScript library for using the SAMP Web Profile from within web pages.The project is hosted on github athttp://github.com/astrojs/sampjs/. Unity web player.
SAMP is the Simple Application Messaging Protocol,a platform- and language-neutral protocolused for communicating between applications.It was developed within the IVOAfor use with astronomy tools, but the protocol is not specificto astronomy.See the SAMP Standardand additional material.
SAMP is defined in layers, and the Profile layerdefines how tools perform the actual communications.Two profiles are currently defined: the Standard Profile,which is suitable for desktop clients, and the Web Profile Sls english riding leg wrapssugars legacy stables colorado springs. ,which is suitable for web clients running within a browsersandbox.The Web Profile is defined as part of version 1.3 of SAMP;seeSection 5 of the standard for the details.
For a view of what the protocol looks like in action at the byte levelyou can see an HTTP log of a short examplesession(generated using '-web:log http
' option of the JSAMP hub).
A talk on SAMP and the Web Profile was presented at ADASS XXI (Paris, 2011).This will be published asM.B.Taylor, T.Boch, J.Fay, M.Fitzpatrick and L.Paioro,'SAMP: Application Messaging for Desktop and Web Applications',ASP Conf. Ser. 461, ADASS XXI, ed. Pascal Ballester, 279(2012ASPC.461.279T.).You can see thesubmitted paper orpresentation.
Putting these things together allows you to write a web pagewhich can communicate with other desktop applications running onthe same machine as the browser displaying it(or even with other unrelated web pages in the same browser).A simple example is a web page with a button you can click tosend an image or table (perhaps generated dynamically by the server)to a desktop image or table viewer application.But more complicated scenarios, including two-way communication,are possible too.
The technical details of how that can happen and theassociated security implications arediscussed in exhaustive detail in the SAMP standard reference above.
Autocad 2010 crack free download. All SAMP communications (Standard and Web) are via a Hub,a daemon process that brokers messages between clients.So for SAMP tools to be able to communicate, a Hub must be running.For web clients, this must be a Web Profile-capable hub,which currently meanseither JSAMP version >=1.3-1(Java)orSAMPy version >=1.2.1(Python).There are (at least?) three ways to make this happen:
Use the samp.jslibrary and write your own code around it.You can write a minimal SAMP application (often, all that is required)with very little work.Usually you will start by importing samp.js (and flXHR.js?see the section on flXHR):
You can either supply a full path to the js libs or copy them intothe same directory as the web page.
If you want a more compact version of the samp javascript,you can use a minifying tool. One possibility is Google'sclosure-compiler.Here is an example invocation using curl
:
Here are some working examples:
broadcaster.js
helper scriptDon't forget you need to be running a hub for these to work.Running other SAMP clients will make it more interesting too -here is a WebStart link for, e.g.,TOPCAT.
Some known science uses of this library are:
Note some of these may be experimental.Feel free to add your own site if you are using sampjs.
flXHRis a clever external library for faking a JavaScriptXmlHttpRequest Level 2 object by use of Flash.
The SAMP Web Profile has to play some tricks to communicate outsideof the browser sandbox. By preference it uses a W3C standard calledCross-Origin Resource Sharing (CORS)to do this.However, some browsers do not support CORS, and in these cases it is(usually) possible to fall back to using a Flash-based workaround.Since Flash is installed very widely in browsers, that makes sampjswork almost everywhere (see the compatibility section).
Sampjs does not implement the Flash magic on its own, that's doneby an external library called flXHR
. This containsboth JavaScript and Flash components. To get it workingyou need to put all the relevant flXHR files in the same directoryas the web client page (or something like that) and import theflXHR script:
flXHR is hosted athttp://flxhr.flensed.com/,which now redirects to a github site; the project is no longeractively maintained, since the recommendation is to use javascript instead.You can grab the library files from there; for convenience you canfind what you need on this site under in the lib/flxhr
directory.
You don't need to use flXHR with samp.js, but if you don't,your SAMP client will not run in browsers which lack support for CORS(see the compatibility section).Does that matter? IE6 and Firefox 3.0 are probably pretty unusual bynow, so maybe it's not worth the effort. You decide.
Please do! The sampjs project was originally contributed by Mark Taylor,but I'm not a very competent or enthusiasticJavaScript programmer (or git user), so please improve it(javascript, documentation, examples, whatever).The project is hosted on github athttp://github.com/astrojs/sampjs/If you want write privileges, let me or somebody else know.If somebody else wants to take over looking after the project,that suits me too.
Note that these documentation pages are part of the github project,on the gh-pages
branch(that's the way that github hosts web pages).
There is no mailing list specifically for sampjs, but the IVOAapps-samp@ivoa.netlist may be suitable, or you could try asking Mark(m.b.taylor@bristol.ac.uk).
Browsers so far tested:
Any other reports welcome.
This library was originally written byMark Tayloras a proof of concept when defining the SAMP Web Profile;it was not intended for public use.As is the way of these things, some people used and adapted it anyway.
It was moved onto the www.astrojs.orgsite in October 2012.
The original work was supported by Microsoft Research, GAVO and STFC.