[Seaside] Generating an callback URL for third-party use

jtuchel at objektfabrik.de jtuchel at objektfabrik.de
Wed May 28 06:46:47 UTC 2014


Not sure if it is exactly what you want, but we needed to add some 
"landing pages" for our seaside app, where you can have parameters 
coming in from other applications.

For this, we used initialRequest: in our registered main component. 
There you can access parameters of the request and react to them using 
request at:ifPresent: for example.

To "call" into your app would then look like this: 
http://yourApp?Parameter1=value1&Parameter2=value2

Please be aware that this is out of session context. But I guess this is 
clear anyways.

Joachim



Am 28.05.14 00:46, schrieb Esteban A. Maringolo:
> I'm struggling to find a clean way of generating an url to be used for
> external reference from a javascript library/plugin, such as
> crossfilter or DataTables.
>
> E.g the constructor configuration object has a dataUrl parameter,
> which will be used by the plugin to retrieve the data.
>
> $('element').plugin({dataUrl: "..."});
>
> I can generate the expression to retrieve it from anywhere, but what I
> want is to associate an url with a callback that will answer the data
> requested.
>
> Today I'm assigning results to a local variable using a predefined
> callback function, and then initializing my data dependent function
> assuming there is going to be data in that variable.
>
> Ej:
> html document addLoadScript: (
>    ((html jQuery getJson
>       json: [ :json | self renderItemsOnJson: json ];
>       onSuccess: (JSStream on: 'myCallbackFunction(arguments[0]);')
> asFunction) asFunction assignTo: 'loadCrossfilterData')).
>
> html document addLoadScript: (JSStream on: 'loadCrossfilterData()').
>
> I want some way to create a url callback in the way of:
>
> callbackUrl :=  html magicalCallbackRegister: [ :json | self
> renderItemsOnJson: json ]. "answers a url"
>
> JSStream on: '$(''#element'').plugin({dataUrl:"', callbackUrl, '"})'.
>
> which once rendered as JS would be:
>
> $('#element').plugin({dataUrl:"/app/_s=...&_k=...&n"});
>
> I know this must be possible, because Seaside does it for all the
> callbacks, but I don't know how to create a simple callback and then
> get it's url to pass it around.
>
> I hope all I wrote is intelligible. Otherwise I can rephrase it in
> other unintelligible way. :)
>
> Esteban A. Maringolo
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>


-- 
-----------------------------------------------------------------------
Objektfabrik Joachim Tuchel          mailto:jtuchel at objektfabrik.de
Fliederweg 1                         http://www.objektfabrik.de
D-71640 Ludwigsburg                  http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0         Fax: +49 7141 56 10 86 1



More information about the seaside mailing list