Altitude form example

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

Altitude form example

Colin Putney-3
Chris and Hannes,

I've added a form example to the examples application. Besides only
working with text inputs, I also noticed that it only works with POST
form submissions, because I haven't implemented parsing of query
parameters yet. Also, the example exposed a couple of bugs, so you'll
have to update several other packages as well. The perils of living on
the bleeding edge! ;-)

Colin

Reply | Threaded
Open this post in threaded view
|

Re: Altitude form example

Hannes Hirzel
Colin

Thank you very much indeed for this example.
I will take a pristine image and load everything from scratch.

Is the load sequence still what you had attached here
http://lists.squeakfoundation.org/pipermail/squeak-dev/2012-July/164881.html

Copied in below as the attachement was removed in the Squeak list archive.

--Hannes



Load script for Altitude
================

| oldPref oldAuth|


oldPref := Scanner prefAllowUnderscoreSelectors.
oldAuth := Utilities authorInitialsPerSe.

Scanner prefAllowUnderscoreSelectors: true.
Utilities setAuthorInitials: 'al-loader'.
$_ tokenish ifFalse: [
  Character
    compile: 'tokenish
  "Answer whether the receiver is a valid token-character--letter, digit, or
  colon."

  ^self == $_ or: [self == $: or: [self isLetter or: [self isDigit]]]'
    classified: 'testing'.
  String initialize ].

(Installer repository: 'http://source.squeak.org/FFI')
  install: 'FFI-Pools';
  install: 'FFI-Kernel';
  install: 'FFI-Tests';
  install: 'FFI-Win32';
  install: 'FFI-MacOS';
  install: 'FFI-Unix'.

(Installer wiresong project: 'al')
  addPackage: 'Xtreams-Support';
  addPackage: 'Xtreams-CoreTests';
  addPackage: 'Xtreams-Core';
  addPackage: 'Xtreams-Substreams';
  addPackage: 'Xtreams-Terminals';
  addPackage: 'Xtreams-Parsing';
  addPackage: 'Xtreams-Http';
  addPackage: 'Xtreams-Xtras';
  addPackage: 'Xtreams-ParsingTests';
  addPackage: 'Xtreams-TerminalsTests';
  addPackage: 'Xtreams-XtrasTests';
  addPackage: 'Xtreams-SubstreamsTests';
  addPackage: 'Xtreams-TransformsTests';
  addPackage: 'Xtreams-Transforms';
  addPackage: 'Xtreams-HttpTests';
  install.

Scanner prefAllowUnderscoreSelectors: oldPref.
Utilities setAuthorInitials: oldAuth.

(Installer wiresong project: 'mc')
  addPackage: 'FS-Core';
  addPackage: 'FS-Disk';
  addPackage: 'FS-Memory';
  addPackage: 'FS-AnsiStreams';
  addPackage: 'FS-Zip';
  addPackage: 'FS-Xtreams';
  addPackage: 'FS-FileStream';
  addPackage: 'FS-Tests-Core';
  addPackage: 'FS-Tests-AnsiStreams';
  addPackage: 'FS-Tests-Xtreams';
  addPackage: 'FS-Tests-Zip';
  addPackage: 'FS-Tests-Disk';
  addPackage: 'FS-Tests-FileStream';
  install.

(Installer wiresong project: 'al')
  addPackage: 'AL-Rendering';
  addPackage: 'AL-Http';
  addPackage: 'AL-Application';
  addPackage: 'AL-Serialization';
  addPackage: 'AL-Json';
  addPackage: 'AL-Html5';
  addPackage: 'AL-HtmlApp';
  addPackage: 'AL-User';
  addPackage: 'AL-Tests-Json';
  addPackage: 'AL-Tests-Html5';
  addPackage: 'AL-Tests-User';
  addPackage: 'AL-Tests-Serialization';
  addPackage: 'AL-Tests-Http';
  addPackage: 'AL-Tests-Application';
  install.



On 9/13/12, Colin Putney <[hidden email]> wrote:

> Chris and Hannes,
>
> I've added a form example to the examples application. Besides only
> working with text inputs, I also noticed that it only works with POST
> form submissions, because I haven't implemented parsing of query
> parameters yet. Also, the example exposed a couple of bugs, so you'll
> have to update several other packages as well. The perils of living on
> the bleeding edge! ;-)
>
> Colin
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Altitude form example

Colin Putney-3
On Thu, Sep 13, 2012 at 2:39 PM, H. Hirzel <[hidden email]> wrote:
> Colin
>
> Thank you very much indeed for this example.
> I will take a pristine image and load everything from scratch.
>
> Is the load sequence still what you had attached here
> http://lists.squeakfoundation.org/pipermail/squeak-dev/2012-July/164881.html

Yup. That script should still work fine, although you'll have to load
the examples package afterwards.

Colin

Reply | Threaded
Open this post in threaded view
|

Re: Altitude form example

Chris Cunnington
In reply to this post by Colin Putney-3
On 12-09-13 5:09 PM, Colin Putney wrote:

> Chris and Hannes,
>
> I've added a form example to the examples application. Besides only
> working with text inputs, I also noticed that it only works with POST
> form submissions, because I haven't implemented parsing of query
> parameters yet. Also, the example exposed a couple of bugs, so you'll
> have to update several other packages as well. The perils of living on
> the bleeding edge! ;-)
>
> Colin
>
Excellent. The timing is great. I'm looking at something and this is
just what it needs.

I kept getting AnObsoleteALFormResource errors, which were odd. I take
it they are addressed by that terminal #with:[]. Closing over stuff can
be a pain.

I've been hacking on ReflectCore. I've been converting it to an Ajax
app, which I think it needs to be. The problem is its input and its
output. The input is a URL the output is pure JSON. The input needs to
be a form asking for a selector and the output needs to be formatted
HTML. I've got the second part. I'll add the form tomorrow.

Wordpress has ways of offering JSON based RSS instead of XML, so The
Weekly Squeak box on a future squeak.org homepage could be switched over
easily. Strange to say, but Altitude has opened my eyes to JSON APIs and
mashups. Serving your own data exclusively has become passé. That's not
exactly news, I guess,  but it does snap a few things together.

Thanks,
Chris


Reply | Threaded
Open this post in threaded view
|

Re: Altitude form example

Frank Shearar-3
On 14 September 2012 00:02, Chris Cunnington
<[hidden email]> wrote:

> On 12-09-13 5:09 PM, Colin Putney wrote:
>>
>> Chris and Hannes,
>>
>> I've added a form example to the examples application. Besides only
>> working with text inputs, I also noticed that it only works with POST
>> form submissions, because I haven't implemented parsing of query
>> parameters yet. Also, the example exposed a couple of bugs, so you'll
>> have to update several other packages as well. The perils of living on
>> the bleeding edge! ;-)
>>
>> Colin
>>
> Excellent. The timing is great. I'm looking at something and this is just
> what it needs.
>
> I kept getting AnObsoleteALFormResource errors, which were odd. I take it
> they are addressed by that terminal #with:[]. Closing over stuff can be a
> pain.
>
> I've been hacking on ReflectCore. I've been converting it to an Ajax app,
> which I think it needs to be. The problem is its input and its output. The
> input is a URL the output is pure JSON. The input needs to be a form asking
> for a selector and the output needs to be formatted HTML. I've got the
> second part. I'll add the form tomorrow.

Not that I've actually touched Reflect-Core in a while, but my
intention was to have a RESTful JSON-in-JSON-out API: POST /something/
{"stuff":"here"} to add something, and so on. I hadn't thought about
forms in the slightest, mainly because I don't care about HTML. Unless
I've misread, and "form" here means "something in Altitude's domain"
rather than "an HTML form tag".

frank

> Wordpress has ways of offering JSON based RSS instead of XML, so The Weekly
> Squeak box on a future squeak.org homepage could be switched over easily.
> Strange to say, but Altitude has opened my eyes to JSON APIs and mashups.
> Serving your own data exclusively has become passé. That's not exactly news,
> I guess,  but it does snap a few things together.
>
> Thanks,
> Chris
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Altitude form example

Colin Putney-3
On Thu, Sep 13, 2012 at 11:41 PM, Frank Shearar <[hidden email]> wrote:


> Not that I've actually touched Reflect-Core in a while, but my
> intention was to have a RESTful JSON-in-JSON-out API: POST /something/
> {"stuff":"here"} to add something, and so on. I hadn't thought about
> forms in the slightest, mainly because I don't care about HTML. Unless
> I've misread, and "form" here means "something in Altitude's domain"
> rather than "an HTML form tag".

What sort of client do you imagine connecting to Reflect-Core, if not
a web page?

Colin

Reply | Threaded
Open this post in threaded view
|

Re: Altitude form example

Frank Shearar-3
On 14 September 2012 08:24, Colin Putney <[hidden email]> wrote:

> On Thu, Sep 13, 2012 at 11:41 PM, Frank Shearar <[hidden email]> wrote:
>
>
>> Not that I've actually touched Reflect-Core in a while, but my
>> intention was to have a RESTful JSON-in-JSON-out API: POST /something/
>> {"stuff":"here"} to add something, and so on. I hadn't thought about
>> forms in the slightest, mainly because I don't care about HTML. Unless
>> I've misread, and "form" here means "something in Altitude's domain"
>> rather than "an HTML form tag".
>
> What sort of client do you imagine connecting to Reflect-Core, if not
> a web page?

I started writing Reflect-Core to serve initially as a means of
externally reflecting on an image with no prior assumptions about a
client other than something that could issue HTTP requests and parse
JSON. That means I could have a shell script or an in-browser IDE and
Reflect-Core would neither know nor care.

Anything _beyond_ that - the HTML wiring necessary for such an
in-browser IDE, for example - is (or should be) beyond the scope of
Reflect-Core itself. But I guess Chris is playing around with
something just like this.

frank

> Colin
>