Generating text with some magic anchor

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

Generating text with some magic anchor

dtrussardi@tiscali.it
Ciao,

        i need to rendering text based on fixed string but with some dynamic reference.

        For example a string with  anchor relative to href for email link :

                        'Send  a e-mail to: ',  ...................... ' for exception.'

                where ................. i think it's a dynamic code for rendering the <a href="mailto:[hidden email]</a> <p >info-mail </p>


        I can generate it with specific renderContentOn: html

                html text: 'Send  a e-mail to: '.

                (html anchor)
                        attributeAt: 'href' put: 'mailto:', [hidden email]; with: 'e-mail'.
                html text: 'for exception.'

        but because i have some different text with some  link scattered  into self

        i'm interested to solve it with some magic reference when generating the text.

        I think something similar to:    html withLineBreaks:  self text

        Anyone have any idea on how resolve, set  the question ?

        Thank,
               
                Dario

       

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Generating text with some magic anchor

Paul DeBruicker
Does this cover what you want to do?

http://book.seaside.st/book/fundamentals/anchors/mailto-anchor



On 05/07/2012 09:43 AM, [hidden email] wrote:

> Ciao,
>
> i need to rendering text based on fixed string but with some dynamic reference.
>
> For example a string with  anchor relative to href for email link :
>
> 'Send  a e-mail to: ',  ...................... ' for exception.'
>
> where ................. i think it's a dynamic code for rendering the <a href="mailto:[hidden email]</a>  <p>info-mail</p>
>
>
> I can generate it with specific renderContentOn: html
>
> html text: 'Send  a e-mail to: '.
>
> (html anchor)
> attributeAt: 'href' put: 'mailto:', [hidden email]; with: 'e-mail'.
> html text: 'for exception.'
>
> but because i have some different text with some  link scattered  into self
>
> i'm interested to solve it with some magic reference when generating the text.
>
> I think something similar to:    html withLineBreaks:  self text
>
> Anyone have any idea on how resolve, set  the question ?
>
> Thank,
>
> Dario
>
>
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Generating text with some magic anchor

dtrussardi@tiscali.it
Ciao Paul,

thank.

This is a standard method do create a mailto-anchor.

But i'm interest to create a dynamic  text  with  some mailto-anchor on it.

I think to generate a text with something like:

' This is my text with a master email link *[hidden email]
and some other e-mail link :

office e-mail *[hidden email]*
direction e-mail *[hidden email]* '

I think to use *...*  how in Pier links .

Now  in the text rendering phase, i'm  interested to create a specific  mailto-anchor when encounter *...... *

There is something that does it?

Some considerations?

Thank,
Dario





On 05/07/2012 09:43 AM, [hidden email] wrote:
Ciao,

i need to rendering text based on fixed string but with some dynamic reference.

For example a string with  anchor relative to href for email link :

'Send  a e-mail to: ',  ...................... ' for exception.'

where ................. i think it's a dynamic code for rendering the <a href="mailto:[hidden email]</a>  <p>info-mail</p>


I can generate it with specific renderContentOn: html

html text: 'Send  a e-mail to: '.

(html anchor)
attributeAt: 'href' put: 'mailto:', [hidden email]; with: 'e-mail'.
html text: 'for exception.'

but because i have some different text with some  link scattered  into self

i'm interested to solve it with some magic reference when generating the text.

I think something similar to:    html withLineBreaks:  self text

Anyone have any idea on how resolve, set  the question ?

Thank,

Dario



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Generating text with some magic anchor

jtuchel
Hi Dario,

are you looking for anything more advanced than String>>#bindWith: (and its variants) and if so, why?
Why should Seaside care about such dull tasks as replacing strings in html strings?

Maybe I simply don't understand your specific need, but I have the feeling what you'd like to do is misuse Seaside as a templating engine, and that would make both Seaside itself and its use much more complicated and bloated. Both Seaside and your code reside and run on the server, virtually at the same time, so I hardly see any added value in templating.

Joachim


Reply | Threaded
Open this post in threaded view
|

Setting up MixPanel and Seaside

Larry Kellogg
In reply to this post by dtrussardi@tiscali.it
Hello, 
  So, I want to use MixPanel (www.mixpanel.com) to monitor user actions in realtime. How do I 
configure this from within Seaside?

  I am told that I have to include this: 

html script: '<!-- start Mixpanel --><script type="text/javascript">(function(d,c){var a,b,g,e;a=d.createElement("script");a.type="text/javascript";a.async=!0;a.src=("https:"===d.location.protocol?"https:":"http:")+"//api.mixpanel.com/site_media/js/api/mixpanel.2.js";b=d.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b);c._i=[];c.init=function(a,d,f){var b=c;"undefined"!==typeof f?b=c[f]=[]:f="mixpanel";g="disable track track_pageview track_links track_forms register register_once unregister identify name_tag set_config".split(" ");
for(e=0;e<g.length;e++)(function(a){b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,0)))}})(g[e]);c._i.push([a,d,f])};window.mixpanel=c})(document,[]);
mixpanel.init("xxxxxxxxxxxxxxxxxxxxxx");</script><!-- end Mixpanel -->'.


and 

html script: 'mixpanel.track("User Login");'

The first call seems to work ok, but the second call crashes in: 

openTag
"Open the receiving and all associated attributes onto the document."

self document openTag: self tag attributes: attributes closed: self isClosed

with this walk back, as document seems to be nil: 

MessageNotUnderstood 2010: No method was found for the selector <#'openTag:attributes:closed:'> when sent to <nil> with arguments contained in <anArray( 'script', aWAHtmlAttributes('type'->'text/javascript'), false)>.


Any thoughts as to what I am doing wrong? 

Larry

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Setting up MixPanel and Seaside

Larry Kellogg
Any ideas? Perhaps, I just don't understand the Seaside Javascript interface. 

Larry


On May 10, 2012, at 10:32 AM, Lawrence Kellogg wrote:

Hello, 
  So, I want to use MixPanel (www.mixpanel.com) to monitor user actions in realtime. How do I 
configure this from within Seaside?

  I am told that I have to include this: 

html script: '<!-- start Mixpanel --><script type="text/javascript">(function(d,c){var a,b,g,e;a=d.createElement("script");a.type="text/javascript";a.async=!0;a.src=("https:"===d.location.protocol?"https:":"http:")+"//api.mixpanel.com/site_media/js/api/mixpanel.2.js";b=d.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b);c._i=[];c.init=function(a,d,f){var b=c;"undefined"!==typeof f?b=c[f]=[]:f="mixpanel";g="disable track track_pageview track_links track_forms register register_once unregister identify name_tag set_config".split(" ");
for(e=0;e<g.length;e++)(function(a){b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,0)))}})(g[e]);c._i.push([a,d,f])};window.mixpanel=c})(document,[]);
mixpanel.init("xxxxxxxxxxxxxxxxxxxxxx");</script><!-- end Mixpanel -->'.


and 

html script: 'mixpanel.track("User Login");'

The first call seems to work ok, but the second call crashes in: 

openTag
"Open the receiving and all associated attributes onto the document."

self document openTag: self tag attributes: attributes closed: self isClosed

with this walk back, as document seems to be nil: 

MessageNotUnderstood 2010: No method was found for the selector <#'openTag:attributes:closed:'> when sent to <nil> with arguments contained in <anArray( 'script', aWAHtmlAttributes('type'->'text/javascript'), false)>.


Any thoughts as to what I am doing wrong? 

Larry
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Setting up MixPanel and Seaside

Paul DeBruicker
Without being able to see whats actually rendered its not easy to guess
whats going wrong.  I'g guess that for the first bit you actuatlly want:

html html:'<!-- start Mixpanel --><script
type="text/javascript">(function(d,c){var
a,b,g,e;a=d.createElement("script");a.type="text/javascript";a.async=!0;a.src=("https:"===d.location.protocol?"https:":"http:")+"//api.mixpanel.com/site_media/js/api/mixpanel.2.js";b=d.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b);c._i=[];c.init=function(a,d,f){var
b=c;"undefined"!==typeof f?b=c[f]=[]:f="mixpanel";g="disable track
track_pageview track_links track_forms register register_once unregister
identify name_tag set_config".split(" ");
for(e=0;e<g.length;e++)(function(a){b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,0)))}})(g[e]);c._i.push([a,d,f])};window.mixpanel=c})(document,[]);
mixpanel.init("xxxxxxxxxxxxxxxxxxxxxx");</script><!-- end Mixpanel -->'.


And for the second you want:

html script (JSStream on: 'mixpanel.track("User Login");').


The 3 steps I would do are:
1. paste their code into a page and try to run mixpanel.track()
2. get seaside to insert their code into a page then manually run
mixpanel.track() from the browser console.
3. get seaside to insert the mixpanel.track() whereever you want it.


So first make sure its loaded into your browser by manually checking in
the page you want it to run in, then worry about getting Seaside to emit
the necessary JS.


And its easier to help when you provide both the Smalltalk code and the
resulting HTML that's generated in a page.




On 05/12/2012 08:49 AM, Lawrence Kellogg wrote:

> Any ideas? Perhaps, I just don't understand the Seaside Javascript
> interface.
>
> Larry
>
>
> On May 10, 2012, at 10:32 AM, Lawrence Kellogg wrote:
>
>> Hello,
>> So, I want to use MixPanel (www.mixpanel.com
>> <http://www.mixpanel.com/>) to monitor user actions in realtime. How do I
>> configure this from within Seaside?
>>
>> I am told that I have to include this:
>>
>> html script: '<!-- start Mixpanel --><script
>> type="text/javascript">(function(d,c){var
>> a,b,g,e;a=d.createElement("script");a.type="text/javascript";a.async=!0;a.src=("https:"===d.location.protocol?"https:":"http:")+"//api.mixpanel.com/site_media/js/api/mixpanel.2.js";b=d.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b);c._i=[];c.init=function(a,d,f){var
>> b=c;"undefined"!==typeof f?b=c[f]=[]:f="mixpanel";g="disable track
>> track_pageview track_links track_forms register register_once
>> unregister identify name_tag set_config".split(" ");
>> for(e=0;e<g.length;e++)(function(a){b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,0)))}})(g[e]);c._i.push([a,d,f])};window.mixpanel=c})(document,[]);
>> mixpanel.init("xxxxxxxxxxxxxxxxxxxxxx");</script><!-- end Mixpanel -->'.
>>
>>
>> and
>>
>> html script: 'mixpanel.track("User Login");'
>>
>> The first call seems to work ok, but the second call crashes in:
>>
>> openTag
>> "Open the receiving and all associated attributes onto the document."
>>
>> self document openTag: self tag attributes: attributes closed: self
>> isClosed
>>
>> with this walk back, as document seems to be nil:
>>
>> MessageNotUnderstood 2010: No method was found for the selector
>> <#'openTag:attributes:closed:'> when sent to <nil> with arguments
>> contained in <anArray( 'script',
>> aWAHtmlAttributes('type'->'text/javascript'), false)>.
>>
>>
>> Any thoughts as to what I am doing wrong?
>>
>> Larry
>> _______________________________________________
>> seaside mailing list
>> [hidden email]
>> <mailto:[hidden email]>
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Setting up MixPanel and Seaside

Larry Kellogg
Thanks, Paul! I think my problem was that I wasn't rendering the first Mixpanel declaration on every single page, thereby
causing a crash. Now, I think I have it working.

  Regards,

  Larry



On May 12, 2012, at 12:24 PM, Paul DeBruicker wrote:

> Without being able to see whats actually rendered its not easy to guess whats going wrong.  I'g guess that for the first bit you actuatlly want:
>
> html html:'<!-- start Mixpanel --><script type="text/javascript">(function(d,c){var a,b,g,e;a=d.createElement("script");a.type="text/javascript";a.async=!0;a.src=("https:"===d.location.protocol?"https:":"http:")+"//api.mixpanel.com/site_media/js/api/mixpanel.2.js";b=d.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b);c._i=[];c.init=function(a,d,f){var b=c;"undefined"!==typeof f?b=c[f]=[]:f="mixpanel";g="disable track track_pageview track_links track_forms register register_once unregister identify name_tag set_config".split(" ");
> for(e=0;e<g.length;e++)(function(a){b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,0)))}})(g[e]);c._i.push([a,d,f])};window.mixpanel=c})(document,[]);
> mixpanel.init("xxxxxxxxxxxxxxxxxxxxxx");</script><!-- end Mixpanel -->'.
>
>
> And for the second you want:
>
> html script (JSStream on: 'mixpanel.track("User Login");').
>
>
> The 3 steps I would do are:
> 1. paste their code into a page and try to run mixpanel.track()
> 2. get seaside to insert their code into a page then manually run mixpanel.track() from the browser console.
> 3. get seaside to insert the mixpanel.track() whereever you want it.
>
>
> So first make sure its loaded into your browser by manually checking in the page you want it to run in, then worry about getting Seaside to emit the necessary JS.
>
>
> And its easier to help when you provide both the Smalltalk code and the resulting HTML that's generated in a page.
>
>
>
>
> On 05/12/2012 08:49 AM, Lawrence Kellogg wrote:
>> Any ideas? Perhaps, I just don't understand the Seaside Javascript
>> interface.
>>
>> Larry
>>
>>
>> On May 10, 2012, at 10:32 AM, Lawrence Kellogg wrote:
>>
>>> Hello,
>>> So, I want to use MixPanel (www.mixpanel.com
>>> <http://www.mixpanel.com/>) to monitor user actions in realtime. How do I
>>> configure this from within Seaside?
>>>
>>> I am told that I have to include this:
>>>
>>> html script: '<!-- start Mixpanel --><script
>>> type="text/javascript">(function(d,c){var
>>> a,b,g,e;a=d.createElement("script");a.type="text/javascript";a.async=!0;a.src=("https:"===d.location.protocol?"https:":"http:")+"//api.mixpanel.com/site_media/js/api/mixpanel.2.js";b=d.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b);c._i=[];c.init=function(a,d,f){var
>>> b=c;"undefined"!==typeof f?b=c[f]=[]:f="mixpanel";g="disable track
>>> track_pageview track_links track_forms register register_once
>>> unregister identify name_tag set_config".split(" ");
>>> for(e=0;e<g.length;e++)(function(a){b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,0)))}})(g[e]);c._i.push([a,d,f])};window.mixpanel=c})(document,[]);
>>> mixpanel.init("xxxxxxxxxxxxxxxxxxxxxx");</script><!-- end Mixpanel -->'.
>>>
>>>
>>> and
>>>
>>> html script: 'mixpanel.track("User Login");'
>>>
>>> The first call seems to work ok, but the second call crashes in:
>>>
>>> openTag
>>> "Open the receiving and all associated attributes onto the document."
>>>
>>> self document openTag: self tag attributes: attributes closed: self
>>> isClosed
>>>
>>> with this walk back, as document seems to be nil:
>>>
>>> MessageNotUnderstood 2010: No method was found for the selector
>>> <#'openTag:attributes:closed:'> when sent to <nil> with arguments
>>> contained in <anArray( 'script',
>>> aWAHtmlAttributes('type'->'text/javascript'), false)>.
>>>
>>>
>>> Any thoughts as to what I am doing wrong?
>>>
>>> Larry
>>> _______________________________________________
>>> seaside mailing list
>>> [hidden email]
>>> <mailto:[hidden email]>
>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>>
>>
>> _______________________________________________
>> seaside mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Sending data through POST or PUT, with nginx

Larry Kellogg
Hello, 
  Do I need to do anything special to enable sending data for POST or PUT 
requests to a WARequestHandler in Seaside? Something in nginx.conf?
GETs have been working fine for me. 

  My client app is sending a POST, with data, but nginx shows no 
data and the value in the dictionary fields shows nil for that entry. 
Perhaps the POST should be a PUT, but still, I don't get any data.

  Also, is there some way to put a halt in a subclass of WARequestHandler 
so that I can get a continuation that I can debug? Halts just seem to 
throw a message to the log, but not pop up a continuation. 

  Regards, 

  Larry

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Sending data through POST or PUT, with nginx

Philippe Marschall
On Mon, May 14, 2012 at 1:03 PM, Lawrence Kellogg <[hidden email]> wrote:

> Hello,
>   Do I need to do anything special to enable sending data for POST or PUT
> requests to a WARequestHandler in Seaside? Something in nginx.conf?
> GETs have been working fine for me.
>
>   My client app is sending a POST, with data, but nginx shows no
> data and the value in the dictionary fields shows nil for that entry.
> Perhaps the POST should be a PUT, but still, I don't get any data.
>
>   Also, is there some way to put a halt in a subclass of WARequestHandler
> so that I can get a continuation that I can debug? Halts just seem to
> throw a message to the log, but not pop up a continuation.

Can you provide a bit more context? Are you on GemStone with FastCGI?

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Sending data through POST or PUT, with nginx

Larry Kellogg

On May 14, 2012, at 8:38 AM, Philippe Marschall wrote:

> On Mon, May 14, 2012 at 1:03 PM, Lawrence Kellogg <[hidden email]> wrote:
>> Hello,
>>   Do I need to do anything special to enable sending data for POST or PUT
>> requests to a WARequestHandler in Seaside? Something in nginx.conf?
>> GETs have been working fine for me.
>>
>>   My client app is sending a POST, with data, but nginx shows no
>> data and the value in the dictionary fields shows nil for that entry.
>> Perhaps the POST should be a PUT, but still, I don't get any data.
>>
>>   Also, is there some way to put a halt in a subclass of WARequestHandler
>> so that I can get a continuation that I can debug? Halts just seem to
>> throw a message to the log, but not pop up a continuation.
>
> Can you provide a bit more context? Are you on GemStone with FastCGI?
>

  Yes, I am on Gemstone using FastCGI.



> Cheers
> Philippe
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Sending data through POST or PUT, with nginx

Philippe Marschall
On Mon, May 14, 2012 at 2:43 PM, Lawrence Kellogg <[hidden email]> wrote:

>
> On May 14, 2012, at 8:38 AM, Philippe Marschall wrote:
>
>> On Mon, May 14, 2012 at 1:03 PM, Lawrence Kellogg <[hidden email]> wrote:
>>> Hello,
>>>   Do I need to do anything special to enable sending data for POST or PUT
>>> requests to a WARequestHandler in Seaside? Something in nginx.conf?
>>> GETs have been working fine for me.
>>>
>>>   My client app is sending a POST, with data, but nginx shows no
>>> data and the value in the dictionary fields shows nil for that entry.
>>> Perhaps the POST should be a PUT, but still, I don't get any data.
>>>
>>>   Also, is there some way to put a halt in a subclass of WARequestHandler
>>> so that I can get a continuation that I can debug? Halts just seem to
>>> throw a message to the log, but not pop up a continuation.
>>
>> Can you provide a bit more context? Are you on GemStone with FastCGI?
>>
>
>  Yes, I am on Gemstone using FastCGI.

Hmm, I can remember some posts (pun) from Norbert about this.

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Sending data through POST or PUT, with nginx

Larry Kellogg

On May 14, 2012, at 3:22 PM, Philippe Marschall wrote:

> On Mon, May 14, 2012 at 2:43 PM, Lawrence Kellogg <[hidden email]> wrote:
>>
>> On May 14, 2012, at 8:38 AM, Philippe Marschall wrote:
>>
>>> On Mon, May 14, 2012 at 1:03 PM, Lawrence Kellogg <[hidden email]> wrote:
>>>> Hello,
>>>>   Do I need to do anything special to enable sending data for POST or PUT
>>>> requests to a WARequestHandler in Seaside? Something in nginx.conf?
>>>> GETs have been working fine for me.
>>>>
>>>>   My client app is sending a POST, with data, but nginx shows no
>>>> data and the value in the dictionary fields shows nil for that entry.
>>>> Perhaps the POST should be a PUT, but still, I don't get any data.
>>>>
>>>>   Also, is there some way to put a halt in a subclass of WARequestHandler
>>>> so that I can get a continuation that I can debug? Halts just seem to
>>>> throw a message to the log, but not pop up a continuation.
>>>
>>> Can you provide a bit more context? Are you on GemStone with FastCGI?
>>>
>>
>>  Yes, I am on Gemstone using FastCGI.
>
> Hmm, I can remember some posts (pun) from Norbert about this.


;-) This one: http://forum.world.st/About-Zinc-to-replace-HTTPClient-td3453621.html

?



>
> Cheers
> Philippe
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Sending data through POST or PUT, with nginx

NorbertHartl

Am 14.05.2012 um 21:45 schrieb Lawrence Kellogg:

>
> On May 14, 2012, at 3:22 PM, Philippe Marschall wrote:
>
>> On Mon, May 14, 2012 at 2:43 PM, Lawrence Kellogg <[hidden email]> wrote:
>>>
>>> On May 14, 2012, at 8:38 AM, Philippe Marschall wrote:
>>>
>>>> On Mon, May 14, 2012 at 1:03 PM, Lawrence Kellogg <[hidden email]> wrote:
>>>>> Hello,
>>>>>  Do I need to do anything special to enable sending data for POST or PUT
>>>>> requests to a WARequestHandler in Seaside? Something in nginx.conf?
>>>>> GETs have been working fine for me.
>>>>>
>>>>>  My client app is sending a POST, with data, but nginx shows no
>>>>> data and the value in the dictionary fields shows nil for that entry.
>>>>> Perhaps the POST should be a PUT, but still, I don't get any data.
>>>>>
>>>>>  Also, is there some way to put a halt in a subclass of WARequestHandler
>>>>> so that I can get a continuation that I can debug? Halts just seem to
>>>>> throw a message to the log, but not pop up a continuation.
>>>>
>>>> Can you provide a bit more context? Are you on GemStone with FastCGI?
>>>>
>>>
>>> Yes, I am on Gemstone using FastCGI.
>>
>> Hmm, I can remember some posts (pun) from Norbert about this.
>
>
> ;-) This one: http://forum.world.st/About-Zinc-to-replace-HTTPClient-td3453621.html
>
> ?
>
:) Yes, it is a unfortunate postion at the moment. There is Kom, Swazoo and Hyper. Kom is really basic (and not existent in gemstone, but pharo). Swazoo and Hyper are more into "the real thing". But even swazoo and Hyper seriously lack support for most of the stuff. They support GET and also POST in a urlencoded fashion. That is everything seaside needs. If your needs are beyond that you're out of luck. To repeat my rant I would call it that they are overengineered for what they support working. There was good thinking in both of them as far as I can see but probably they are just unfinished. Zinc is different because it has full support for most things you really need. Zinc should be working in gemstone but I wasn't lucky to get it running reliably. Some more effort needs to be done.
If you want to do POST then you should think if you can live with urlencoded data. That should work in any of the mentioned adaptors. Of course you want to just use the body but that's a no-go as far as I can tell.
I don't like the situation and I don't like my free time only leaves enough space to complain (instead of just fixing it) but anyhow we need to get zinc running on gemstone. In pharo the situation is just wonderful and I did newer projects in pharo instead of gemstone because of that (and SSL).

Sorry, for not being of any help here,

Norbert

> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Sending data through POST or PUT, with nginx

Larry Kellogg

On May 14, 2012, at 5:57 PM, Norbert Hartl wrote:

>
> Am 14.05.2012 um 21:45 schrieb Lawrence Kellogg:
>
>>
>> On May 14, 2012, at 3:22 PM, Philippe Marschall wrote:
>>
>>> On Mon, May 14, 2012 at 2:43 PM, Lawrence Kellogg <[hidden email]> wrote:
>>>>
>>>> On May 14, 2012, at 8:38 AM, Philippe Marschall wrote:
>>>>
>>>>> On Mon, May 14, 2012 at 1:03 PM, Lawrence Kellogg <[hidden email]> wrote:
>>>>>> Hello,
>>>>>> Do I need to do anything special to enable sending data for POST or PUT
>>>>>> requests to a WARequestHandler in Seaside? Something in nginx.conf?
>>>>>> GETs have been working fine for me.
>>>>>>
>>>>>> My client app is sending a POST, with data, but nginx shows no
>>>>>> data and the value in the dictionary fields shows nil for that entry.
>>>>>> Perhaps the POST should be a PUT, but still, I don't get any data.
>>>>>>
>>>>>> Also, is there some way to put a halt in a subclass of WARequestHandler
>>>>>> so that I can get a continuation that I can debug? Halts just seem to
>>>>>> throw a message to the log, but not pop up a continuation.
>>>>>
>>>>> Can you provide a bit more context? Are you on GemStone with FastCGI?
>>>>>
>>>>
>>>> Yes, I am on Gemstone using FastCGI.
>>>
>>> Hmm, I can remember some posts (pun) from Norbert about this.
>>
>>
>> ;-) This one: http://forum.world.st/About-Zinc-to-replace-HTTPClient-td3453621.html
>>
>> ?
>>
> :) Yes, it is a unfortunate postion at the moment. There is Kom, Swazoo and Hyper. Kom is really basic (and not existent in gemstone, but pharo). Swazoo and Hyper are more into "the real thing". But even swazoo and Hyper seriously lack support for most of the stuff. They support GET and also POST in a urlencoded fashion. That is everything seaside needs. If your needs are beyond that you're out of luck. To repeat my rant I would call it that they are overengineered for what they support working. There was good thinking in both of them as far as I can see but probably they are just unfinished. Zinc is different because it has full support for most things you really need. Zinc should be working in gemstone but I wasn't lucky to get it running reliably. Some more effort needs to be done.
> If you want to do POST then you should think if you can live with urlencoded data. That should work in any of the mentioned adaptors. Of course you want to just use the body but that's a no-go as far as I can tell.
> I don't like the situation and I don't like my free time only leaves enough space to complain (instead of just fixing it) but anyhow we need to get zinc running on gemstone. In pharo the situation is just wonderful and I did newer projects in pharo instead of gemstone because of that (and SSL).
>
> Sorry, for not being of any help here,
>


Norbert,
  Thanks for your perspective. Well, we got it working this afternoon so that we could pass in a JSON string and parse it.
I was just a little confused with how to access the fields in the WARequest, but I finally figured it out. It's too bad that
putting a halt in the handleFIltered: method does not pop a continuation. Is there some way to make that happen?
Subclasses of WAComponent spin off a continuation when they hit a halt,

  So, I think I have what I need to go forward, unless I'm missing something.

  Regards,

  Larry


> Norbert
>
>> _______________________________________________
>> seaside mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Sending data through POST or PUT, with nginx

NorbertHartl

Am 15.05.2012 um 01:22 schrieb Lawrence Kellogg:

>
> On May 14, 2012, at 5:57 PM, Norbert Hartl wrote:
>
>>
>> Am 14.05.2012 um 21:45 schrieb Lawrence Kellogg:
>>
>>>
>>> On May 14, 2012, at 3:22 PM, Philippe Marschall wrote:
>>>
>>>> On Mon, May 14, 2012 at 2:43 PM, Lawrence Kellogg <[hidden email]> wrote:
>>>>>
>>>>> On May 14, 2012, at 8:38 AM, Philippe Marschall wrote:
>>>>>
>>>>>> On Mon, May 14, 2012 at 1:03 PM, Lawrence Kellogg <[hidden email]> wrote:
>>>>>>> Hello,
>>>>>>> Do I need to do anything special to enable sending data for POST or PUT
>>>>>>> requests to a WARequestHandler in Seaside? Something in nginx.conf?
>>>>>>> GETs have been working fine for me.
>>>>>>>
>>>>>>> My client app is sending a POST, with data, but nginx shows no
>>>>>>> data and the value in the dictionary fields shows nil for that entry.
>>>>>>> Perhaps the POST should be a PUT, but still, I don't get any data.
>>>>>>>
>>>>>>> Also, is there some way to put a halt in a subclass of WARequestHandler
>>>>>>> so that I can get a continuation that I can debug? Halts just seem to
>>>>>>> throw a message to the log, but not pop up a continuation.
>>>>>>
>>>>>> Can you provide a bit more context? Are you on GemStone with FastCGI?
>>>>>>
>>>>>
>>>>> Yes, I am on Gemstone using FastCGI.
>>>>
>>>> Hmm, I can remember some posts (pun) from Norbert about this.
>>>
>>>
>>> ;-) This one: http://forum.world.st/About-Zinc-to-replace-HTTPClient-td3453621.html
>>>
>>> ?
>>>
>> :) Yes, it is a unfortunate postion at the moment. There is Kom, Swazoo and Hyper. Kom is really basic (and not existent in gemstone, but pharo). Swazoo and Hyper are more into "the real thing". But even swazoo and Hyper seriously lack support for most of the stuff. They support GET and also POST in a urlencoded fashion. That is everything seaside needs. If your needs are beyond that you're out of luck. To repeat my rant I would call it that they are overengineered for what they support working. There was good thinking in both of them as far as I can see but probably they are just unfinished. Zinc is different because it has full support for most things you really need. Zinc should be working in gemstone but I wasn't lucky to get it running reliably. Some more effort needs to be done.
>> If you want to do POST then you should think if you can live with urlencoded data. That should work in any of the mentioned adaptors. Of course you want to just use the body but that's a no-go as far as I can tell.
>> I don't like the situation and I don't like my free time only leaves enough space to complain (instead of just fixing it) but anyhow we need to get zinc running on gemstone. In pharo the situation is just wonderful and I did newer projects in pharo instead of gemstone because of that (and SSL).
>>
>> Sorry, for not being of any help here,
>>
>
>
> Norbert,
>  Thanks for your perspective. Well, we got it working this afternoon so that we could pass in a JSON string and parse it.
> I was just a little confused with how to access the fields in the WARequest, but I finally figured it out. It's too bad that
> putting a halt in the handleFIltered: method does not pop a continuation. Is there some way to make that happen?
> Subclasses of WAComponent spin off a continuation when they hit a halt,
>
>  So, I think I have what I need to go forward, unless I'm missing something.
>
Uhh, I need to roll back a bit. I shouldn't write mails when I'm coming from the Biergarten being extremely tired.:) Basically it is true what I said about the usability of most of the adaptors. But there is certainly more possible then I said. I'm using fastcgi on gemstone and I'm also using the body and multipart data for uploads.

The body I request via

self requestContext request bodyDecoded

and multipart files via

self requestContext request postFields at: aString

in the latter you need to check if you get a string or a WAFile. And you need to decode manually

Norbert

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Sending data through POST or PUT, with nginx

Larry Kellogg

On May 15, 2012, at 4:31 AM, Norbert Hartl wrote:

>
> Am 15.05.2012 um 01:22 schrieb Lawrence Kellogg:
>
>>
>> On May 14, 2012, at 5:57 PM, Norbert Hartl wrote:
>>
>>>
>>> Am 14.05.2012 um 21:45 schrieb Lawrence Kellogg:
>>>
>>>>
>>>> On May 14, 2012, at 3:22 PM, Philippe Marschall wrote:
>>>>
>>>>> On Mon, May 14, 2012 at 2:43 PM, Lawrence Kellogg <[hidden email]> wrote:
>>>>>>
>>>>>> On May 14, 2012, at 8:38 AM, Philippe Marschall wrote:
>>>>>>
>>>>>>> On Mon, May 14, 2012 at 1:03 PM, Lawrence Kellogg <[hidden email]> wrote:
>>>>>>>> Hello,
>>>>>>>> Do I need to do anything special to enable sending data for POST or PUT
>>>>>>>> requests to a WARequestHandler in Seaside? Something in nginx.conf?
>>>>>>>> GETs have been working fine for me.
>>>>>>>>
>>>>>>>> My client app is sending a POST, with data, but nginx shows no
>>>>>>>> data and the value in the dictionary fields shows nil for that entry.
>>>>>>>> Perhaps the POST should be a PUT, but still, I don't get any data.
>>>>>>>>
>>>>>>>> Also, is there some way to put a halt in a subclass of WARequestHandler
>>>>>>>> so that I can get a continuation that I can debug? Halts just seem to
>>>>>>>> throw a message to the log, but not pop up a continuation.
>>>>>>>
>>>>>>> Can you provide a bit more context? Are you on GemStone with FastCGI?
>>>>>>>
>>>>>>
>>>>>> Yes, I am on Gemstone using FastCGI.
>>>>>
>>>>> Hmm, I can remember some posts (pun) from Norbert about this.
>>>>
>>>>
>>>> ;-) This one: http://forum.world.st/About-Zinc-to-replace-HTTPClient-td3453621.html
>>>>
>>>> ?
>>>>
>>> :) Yes, it is a unfortunate postion at the moment. There is Kom, Swazoo and Hyper. Kom is really basic (and not existent in gemstone, but pharo). Swazoo and Hyper are more into "the real thing". But even swazoo and Hyper seriously lack support for most of the stuff. They support GET and also POST in a urlencoded fashion. That is everything seaside needs. If your needs are beyond that you're out of luck. To repeat my rant I would call it that they are overengineered for what they support working. There was good thinking in both of them as far as I can see but probably they are just unfinished. Zinc is different because it has full support for most things you really need. Zinc should be working in gemstone but I wasn't lucky to get it running reliably. Some more effort needs to be done.
>>> If you want to do POST then you should think if you can live with urlencoded data. That should work in any of the mentioned adaptors. Of course you want to just use the body but that's a no-go as far as I can tell.
>>> I don't like the situation and I don't like my free time only leaves enough space to complain (instead of just fixing it) but anyhow we need to get zinc running on gemstone. In pharo the situation is just wonderful and I did newer projects in pharo instead of gemstone because of that (and SSL).
>>>
>>> Sorry, for not being of any help here,
>>>
>>
>>
>> Norbert,
>> Thanks for your perspective. Well, we got it working this afternoon so that we could pass in a JSON string and parse it.
>> I was just a little confused with how to access the fields in the WARequest, but I finally figured it out. It's too bad that
>> putting a halt in the handleFIltered: method does not pop a continuation. Is there some way to make that happen?
>> Subclasses of WAComponent spin off a continuation when they hit a halt,
>>
>> So, I think I have what I need to go forward, unless I'm missing something.
>>
> Uhh, I need to roll back a bit. I shouldn't write mails when I'm coming from the Biergarten being extremely tired.:) Basically it is true what I said about the usability of most of the adaptors. But there is certainly more possible then I said. I'm using fastcgi on gemstone and I'm also using the body and multipart data for uploads.
>
> The body I request via
>
> self requestContext request bodyDecoded
>
> and multipart files via
>
> self requestContext request postFields at: aString
>
> in the latter you need to check if you get a string or a WAFile. And you need to decode manually
>

  Ah, body decoded, I'll try that. Right now, I am using

aRequestContext request fields at: 'key' to get the JSON string. Works ok.

  I realize that the fields is a WAMergedFields object so I should probably just use postFields.

  Any idea why I can't debug a subclass of a WARequestHandler? That problem is slowing me down.

  I used to work in Germany. Every Friday, all of us would go out to the Biergarten. If the boss had just one beer,
we would too, and would then go back and work for a few more hours. If the boss had two beers, we were pretty much
done for the day. ;-)

  Larry



> Norbert
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside