Discussion:
Aida Single-Page component library
(too old to reply)
Jaroslav Havlín
2009-06-24 18:41:59 UTC
Permalink
Hello Janko,

Jan told me that you are going to inspect some classes that I have
used in my project.

The most important is class CSWebApplication, that extends
WebApplication and includes methods for invoking callback blocks and
detecting changes in the element tree.
Other classes for page elements are in category CellStore-Web-Elements.


I'm thinking about porting some of these classes to Squeak and about
creating a library with Aida elements for single-page web
applications.

As the single-page components are very similar to original components,
there should be special categories
for them, and they should be named in compliance with a naming convention.
For example, category Aida-SP-Components could contain class SPWebApplication.

Do you think it is a good idea? What naming convention for classes and
categories would you prefer?

Best regards,
Jarda
Jan Vrany
2009-06-24 18:53:42 UTC
Permalink
Hello,

to complete Jarda, all the code could be found
at our SVN
http://smalltalk.felk.cvut.cz/svn/cvut/fel/cellstore/service_http/trunk/

However, it's quite hard to load it into the image.

Jarda, can you extract all the single-page functionality
from the service_http and move it to package
stx:goodies/aida together with very simple demo app?

Then Janko and others may load it without need to load whole
CellStore (which is bit complicated to load because of
myriads of more-or-less broken branches :-)

Jan
Post by Jaroslav Havlín
Hello Janko,
Jan told me that you are going to inspect some classes that I have
used in my project.
The most important is class CSWebApplication, that extends
WebApplication and includes methods for invoking callback blocks and
detecting changes in the element tree.
Other classes for page elements are in category CellStore-Web-Elements.
I'm thinking about porting some of these classes to Squeak and about
creating a library with Aida elements for single-page web
applications.
As the single-page components are very similar to original components,
there should be special categories
for them, and they should be named in compliance with a naming convention.
For example, category Aida-SP-Components could contain class SPWebApplication.
Do you think it is a good idea? What naming convention for classes and
categories would you prefer?
Best regards,
Jarda
_______________________________________________
Aida mailing list
http://lists.aidaweb.si/mailman/listinfo/aida
Jaroslav Havlín
2009-06-24 19:09:02 UTC
Permalink
Hello Jan,

of course, I can :-)
I'm sorry, I can't start working on it right now. I hope it will be done
before the weekend.

Jarda
Post by Jan Vrany
Hello,
to complete Jarda, all the code could be found
at our SVN
http://smalltalk.felk.cvut.cz/svn/cvut/fel/cellstore/service_http/trunk/
However, it's quite hard to load it into the image.
Jarda, can you extract all the single-page functionality
from the service_http and move it to package
stx:goodies/aida together with very simple demo app?
Then Janko and others may load it without need to load whole
CellStore (which is bit complicated to load because of
myriads of more-or-less broken branches :-)
Jan
Post by Jaroslav Havlín
Hello Janko,
Jan told me that you are going to inspect some classes that I have
used in my project.
The most important is class CSWebApplication, that extends
WebApplication and includes methods for invoking callback blocks and
detecting changes in the element tree.
Other classes for page elements are in category CellStore-Web-Elements.
I'm thinking about porting some of these classes to Squeak and about
creating a library with Aida elements for single-page web
applications.
As the single-page components are very similar to original components,
there should be special categories
for them, and they should be named in compliance with a naming
convention.
Post by Jaroslav Havlín
For example, category Aida-SP-Components could contain class
SPWebApplication.
Post by Jaroslav Havlín
Do you think it is a good idea? What naming convention for classes and
categories would you prefer?
Best regards,
Jarda
_______________________________________________
Aida mailing list
http://lists.aidaweb.si/mailman/listinfo/aida
_______________________________________________
Aida mailing list
http://lists.aidaweb.si/mailman/listinfo/aida
Jaroslav Havlín
2009-06-28 10:24:26 UTC
Permalink
Hello,
Post by Jan Vrany
Jarda, can you extract all the single-page functionality
from the service_http and move it to package
stx:goodies/aida together with very simple demo app?
I'm sorry for being late. The general functionality has been extracted.
The example application can be started with this code -
Aida::AidaSPExample start.
Post by Jan Vrany
BTW your thesis has grown by ten pages since your first announcement.
I anticipate reading it again while trying the code in Squeak.
If you are not interested in the CellStore Web Client, there is no
need to read it again.
The new parts are focused on the CellStore details,
not on the general page processing.

Now I am going to port it to Squeak, so that it will be easier for
Squeak users to
read and test the source code.
I hope it won't take too long time.

Kind regards,
Jarda
Janko Mivšek
2009-06-28 12:47:17 UTC
Permalink
Post by Jaroslav Havlín
Now I am going to port it to Squeak, so that it will be easier for
Squeak users to
read and test the source code.
I hope it won't take too long time.
Jarda, this would be just perfect!

Best regards
Janko
--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
Jaroslav Havlín
2009-06-29 11:17:34 UTC
Permalink
Hello,

the first less-or-more functional port of the Aida Single-Page library
for Squeak is ready. At least the simple example application seems to
work.
It is still very experimental, just to see whether it is worth
continuing with it.

It can be found at SqueakSource - http://www.squeaksource.com/AidaSP/

The example application can be started by doing "AidaSPExample start",
the port is 8888.

The project is writeable by everyone, so feel free to commit your
changes. I hope I will be able to write a small tutorial soon.

Janko, could you please explain me briefly the ideas behind the
execution context support?

It seems that a context id must be specified every time a AJAX request is sent.
Is it possible to get the ID by a JavaScript method?

King regards,
Jarda
Post by Janko Mivšek
Post by Jaroslav Havlín
Now I am going to port it to Squeak, so that it will be easier for
Squeak users to
read and test the source code.
I hope it won't take too long time.
Jarda, this would be just perfect!
Best regards
Janko
--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
Aida mailing list
http://lists.aidaweb.si/mailman/listinfo/aida
Janko Mivšek
2009-06-29 19:37:37 UTC
Permalink
Hi Jarda,

I made it work on top of beta2 and the counter demo is now on front of
me. Thanks a lot, now I can start studying your approach.... From the
first sight it looks pretty similar to Iliad :)

Janko
Post by Jan Vrany
Hello,
the first less-or-more functional port of the Aida Single-Page library
for Squeak is ready. At least the simple example application seems to
work.
It is still very experimental, just to see whether it is worth
continuing with it.
It can be found at SqueakSource - http://www.squeaksource.com/AidaSP/
The example application can be started by doing "AidaSPExample start",
the port is 8888.
The project is writeable by everyone, so feel free to commit your
changes. I hope I will be able to write a small tutorial soon.
Janko, could you please explain me briefly the ideas behind the
execution context support?
It seems that a context id must be specified every time a AJAX request is sent.
Is it possible to get the ID by a JavaScript method?
King regards,
Jarda
Post by Janko Mivšek
Post by Jaroslav Havlín
Now I am going to port it to Squeak, so that it will be easier for
Squeak users to
read and test the source code.
I hope it won't take too long time.
Jarda, this would be just perfect!
Best regards
Janko
--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
Nicolas Petton
2009-06-29 19:55:27 UTC
Permalink
Post by Herbert König
Hi Jarda,
I made it work on top of beta2 and the counter demo is now on front of
me. Thanks a lot, now I can start studying your approach.... From the
first sight it looks pretty similar to Iliad :)
I just quickly browsed the code, but I didn't see any stateful widget,
or did I miss something?

Cheers!

Nico
Jaroslav Havlín
2009-06-29 20:17:03 UTC
Permalink
Hello Nicolas,
Post by Nicolas Petton
I just quickly browsed the code, but I didn't see any stateful widget,
or did I miss something?
No, you didn't. There are no widgets yet. The whole tree of
page elements is stored between requests, so every element is stateful.

This can be sometimes costly, but it was easier to implement.

Best regards,
Jarda

P.S. What version of GNU Smalltalk is required to run Iliad?
Nicolas Petton
2009-06-29 21:23:14 UTC
Permalink
Post by Jaroslav Havlín
Hello Nicolas,
Post by Nicolas Petton
I just quickly browsed the code, but I didn't see any stateful widget,
or did I miss something?
No, you didn't. There are no widgets yet. The whole tree of
page elements is stored between requests, so every element is stateful.
This can be sometimes costly, but it was easier to implement.
Especially because elements are used from html tags to pages, so you
quickly end up with hundreds of elements, right?

Also, how do you manage actions with your stateful elements? Are they
reusable? (do they have actions, or is it like other Aida applications
in WebApp?)
Post by Jaroslav Havlín
What version of GNU Smalltalk is required to run Iliad?
The latest version Iliad needs git version of gst since Swazoo2.2 was
just ported to gst a few days ago.

However the revision 1367 should work with gst 3.1.

Cheers!

Nico
Jaroslav Havlín
2009-06-29 21:38:56 UTC
Permalink
Hello Nicolas,
Post by Nicolas Petton
Also, how do you manage actions with your stateful elements? Are they
reusable? (do they have actions, or is it like other Aida applications
in WebApp?)
Some elements contain action blocks, that are invoked when needed
(e.g. links has blocks that are invoked after a link was clicked,
this is probably similar in Seaside and Iliad too, but more
sophisticated). Each block has simply an ID, and if a link is clicked,
this ID
is sent to the server.
The action block can modify the element tree. Then, updated parts of
the tree are detected and send to the client.
Post by Nicolas Petton
The latest version Iliad needs git version of gst since Swazoo2.2 was
just ported to gst a few days ago.
However the revision 1367 should work with gst 3.1.
Thank you. I have used an older version of gst. I'm looking forward to
trying Iliad.

Cheers,
Jarda
Nicolas Petton
2009-06-29 21:45:07 UTC
Permalink
Post by Jaroslav Havlín
Hello Nicolas,
Post by Nicolas Petton
Also, how do you manage actions with your stateful elements? Are they
reusable? (do they have actions, or is it like other Aida applications
in WebApp?)
Some elements contain action blocks, that are invoked when needed
(e.g. links has blocks that are invoked after a link was clicked,
this is probably similar in Seaside and Iliad too, but more
sophisticated)
Could you explain how it is more sophisticated? Do you see limits in
Iliad or Seaside way of doing it?
Post by Jaroslav Havlín
. Each block has simply an ID, and if a link is clicked,
this ID
is sent to the server.
The action block can modify the element tree. Then, updated parts of
the tree are detected and send to the client
So, only modified elements are sent to the client? How do you detect
modified elements?

Also, do you use AJAX requests? and if so what will happen if js is
disable?
Post by Jaroslav Havlín
Post by Nicolas Petton
The latest version Iliad needs git version of gst since Swazoo2.2 was
just ported to gst a few days ago.
However the revision 1367 should work with gst 3.1.
Thank you. I have used an older version of gst. I'm looking forward to
trying Iliad.
You're welcome. I'm working on a squeak port, so Iliad could people not
familiar with gst will be able to give Iliad a try.

Cheers!

Nico
Jaroslav Havlín
2009-06-29 22:10:44 UTC
Permalink
Hello Nicolas,
Post by Nicolas Petton
Could you explain how it is more sophisticated? Do you see limits in
Iliad or Seaside way of doing it?
No, I meant that Iliad's and Seaside's way is more sophisticated :-)
AidaSP implementation
is very simple and it can bring problems when the user uses more than
one browser window.
I hope we will solve this with Janko's contexts.
Post by Nicolas Petton
So, only modified elements are sent to the client? How do you detect
modified elements?
There is a simple algorithm for that.
1) Before a request is handled, a snapshot of current state of element
tree is taken. We call this the shadow-tree. It is a structure that
holds only
the hashes of the elements in the real tree.
2) An action is invoked. This can lead to changes in the element tree,
or changes in the model (but this can propagate as change in the
element tree as well).
3) The updated tree is compared to the shadow-tree, and elements that
should be sent to the client via AJAX are detected.
This is quite complicated, because only elements with ID attribute can
be updated. So it is needed to find the deepest possible ancestor with
ID.

The code can than look like this:

e := SPWebElement newDiv.
e id: 'counterControls'.

e addLinkText: '-- ' thatDoes: [self observee decCounter].
valueContainer := SPWebValueWrapper with: [self observee counter asString].
e add: valueContainer.
e addLinkText: ' ++' thatDoes: [self observee incCounter].
Post by Nicolas Petton
Also, do you use AJAX requests? and if so what will happen if js is
disable?
AJAX request are used by default. If the browser doesn't support AJAX,
standard requests are used automatically. But this only works in
Firefox now :-(
Post by Nicolas Petton
You're welcome. I'm working on a squeak port, so Iliad could people not
familiar with gst will be able to give Iliad a try.
That are really good news. Thank you!

Kind regards,
Jarda
Nicolas Petton
2009-06-29 22:34:45 UTC
Permalink
Post by Jaroslav Havlín
Hello Nicolas,
Post by Nicolas Petton
Could you explain how it is more sophisticated? Do you see limits in
Iliad or Seaside way of doing it?
No, I meant that Iliad's and Seaside's way is more sophisticated :-)
ah, ok :)
Post by Jaroslav Havlín
AJAX request are used by default. If the browser doesn't support AJAX,
standard requests are used automatically. But this only works in
Firefox now :-(
Is there a reason? If you had said that AJAX requests only work with
firefox, I would have understood...

Anyway, you could have a look at Iliad's js code. I just saw that, like
Iliad, dirty elements are sent in JSON (with Iliad it's dirty widgets,
but still, it's similar).

http://bioskop.fr/svn/gst/iliad/trunk/Public/javascripts/iliad.js

Cheers!

Nico
Jaroslav Havlín
2009-06-30 11:26:51 UTC
Permalink
Hello,
Post by Nicolas Petton
Post by Jaroslav Havlín
AJAX request are used by default. If the browser doesn't support AJAX,
standard requests are used automatically. But this only works in
Firefox now :-(
Is there a reason? If you had said that AJAX requests only work with
firefox, I would have understood...
There is a problem with parsing responses. There is a JavaScript
method that works
only in Firefox so far, but I hope I will be able to fix it.
If the browser doesn't support JavaScript at all, it works.
Post by Nicolas Petton
Anyway, you could have a look at Iliad's js code. I just saw that, like
Iliad, dirty elements are sent in JSON (with Iliad it's dirty widgets,
but still, it's similar).
http://bioskop.fr/svn/gst/iliad/trunk/Public/javascripts/iliad.js
No, actually JSON is not used. A set of fragments of HTML code is sent
back as a result of
AJAX requests.

But I will look at it, anyway :-) It is a good idea, as JSON responses
are much smaller.

Cheers,
Jarda

Herbert König
2009-06-24 20:43:16 UTC
Permalink
Hi Jarda,

JH> I'm thinking about porting some of these classes to Squeak and about
JH> creating a library with Aida elements for single-page web
JH> applications.

please keep us informed. Everything I do qualifies as single page for
the reasons you discuss in your thesis. I'm building apps with a
web interface and not websites.

BTW your thesis has grown by ten pages since your first announcement.
I anticipate reading it again while trying the code in Squeak.


Cheers,

Herbert mailto:***@gmx.net
Janko Mivšek
2009-06-24 22:01:14 UTC
Permalink
Post by Herbert König
JH> I'm thinking about porting some of these classes to Squeak and about
JH> creating a library with Aida elements for single-page web
JH> applications.
please keep us informed. Everything I do qualifies as single page for
the reasons you discuss in your thesis. I'm building apps with a
web interface and not websites.
Another one to study is also Nico's Iliad and his approach here. Quite
interesting, but more in a separate post.
Post by Herbert König
BTW your thesis has grown by ten pages since your first announcement.
I anticipate reading it again while trying the code in Squeak.
So I need to reread it again :)

Janko
--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
Janko Mivšek
2009-06-24 22:22:08 UTC
Permalink
Hi Jarda,
Post by Jaroslav Havlín
Jan told me that you are going to inspect some classes that I have
used in my project.
Yes, finally I got some time. Sorry that so late!
Post by Jaroslav Havlín
The most important is class CSWebApplication, that extends
WebApplication and includes methods for invoking callback blocks and
detecting changes in the element tree.
Other classes for page elements are in category CellStore-Web-Elements.
I'm thinking about porting some of these classes to Squeak and about
creating a library with Aida elements for single-page web
applications.
This would be great!
Post by Jaroslav Havlín
As the single-page components are very similar to original components,
there should be special categories
for them, and they should be named in compliance with a naming convention.
For example, category Aida-SP-Components could contain class SPWebApplication.
Do you think it is a good idea? What naming convention for classes and
categories would you prefer?
This can be good for now I think. We need to get the code ASAP to study
and maybe can later improve main Aida to incorporate single page
functionality in it. Here I also have some ideas, Herbert also, then
there is Iliad approach...

My current idea is to gradually go from usual website like pages to more
single page apps, but without need for a separate support for them. Just
the extension of the current WebApp support. Well, we'll see if this is
achievable, otherwise we'll go with your approach.

Best regards
Janko
--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
Loading...