Iliad submissions

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

Iliad submissions

Eli Green-3
Hi everyone,

I've been playing with Iliad for a few days now and am very impressed  
with what I've been able to accomplish so far. I've implemented a  
relatively simple data grid / table view which seems like a fairly  
basic thing to want to include in the stock Iliad distribution. As  
such, I've given it the IL prefix but obviously will change that if it  
doesn't interest anybody. This is a sample use of the table to  
display / edit a list of companies:

                e build: (ILPagedDataGrid new
                        items: (self model companies);
                        columnNames: #('Name' '' '');
                        column: 1 renderWith: [:el :company | el html: company companyName];
                        column: 2 renderWith: [:el :company | el a text: 'edit'; action:  
[self editCompany: company]];
                        column: 3 renderWith: [:el :company | el a text: 'delete'; action:  
[self model companies remove: company]];
                        rowsPerPage: 5).

ILPagedDataGrid is a subclass of ILDataGrid so you don't need the  
pagination controls if you don't want them.

I envision this as a first step towards getting something similar to  
Django's administration web pages, but powered by Iliad and Magritte  
and maybe a handful of special class messages.

A few questions:
        1. Is anybody interested in this? I have no problems with whatever  
licensing it needs to be under.
        2. Is this the correct mailing list for this sort of thing? Should I  
be on an Iliad-specific list?
        3. Can this really be this easy? It seems like it ought to be harder.

Thanks,
Eli


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Iliad submissions

Stefan Schmiedl
Hi Eli,

your datagrid sounds very interesting.

On Sun, 11 Oct 2009 16:38:16 +0200
Eli Green <[hidden email]> wrote:

> basic thing to want to include in the stock Iliad distribution. As  
> such, I've given it the IL prefix but obviously will change that if it  
> doesn't interest anybody.

If not in the base, then definitely as contribution included.

> This is a sample use of the table to  
> display / edit a list of companies:
>
> e build: (ILPagedDataGrid new
> items: (self model companies);
> columnNames: #('Name' '' '');
> column: 1 renderWith: [:el :company | el html: company companyName];
> column: 2 renderWith: [:el :company | el a text: 'edit'; action:  
> [self editCompany: company]];
> column: 3 renderWith: [:el :company | el a text: 'delete'; action:  
> [self model companies remove: company]];
> rowsPerPage: 5).
>
> ILPagedDataGrid is a subclass of ILDataGrid so you don't need the  
> pagination controls if you don't want them.

nice. Can you add some code in there to provide in-place editing?
I've currently forgotten most of the bits I knew about jquery...

> A few questions:
> 1. Is anybody interested in this? I have no problems with whatever  
> licensing it needs to be under.

I see a direct application in the next project I'm going to tackle with Iliad.

> 2. Is this the correct mailing list for this sort of thing? Should I  
> be on an Iliad-specific list?
> 3. Can this really be this easy? It seems like it ought to be harder.

I wondered about that too ... :-)

s.


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Iliad submissions

Eli Green-3
In reply to this post by Eli Green-3


On Oct 11, 2009, at 18:06, nicolas petton wrote:

>
> The IL prefix is only for the Squeak version since Squeak doesn't  
> have namespaces.
>

Well, I'm doing this in Pharo so unfortunately my submissions will by  
in ugly, namespace-free format.

Has anybody tried to get Iliad working in VisualWorks?

Alternatively, can anybody point me in the right direction of a good  
persistence solution for GNU smalltalk? Something like Magma (squeak-
based object database) or SqueakSave (zero-configuration object-
relational mapper) would be perfect. If GNU smalltalk had a good  
persistence layer, I would be willing to put the time in to getting  
VisualGST compiled on my Mac...

>
> Yes, definitely. It would fit prefectly in the UI package. Where is  
> the code, I really want to see it! :p

Included here. There's a few things missing that I can think of already:
- when an ILPagedDataGrid is on the last page, it would be visually  
appealing if empty rows were created so that each page has the same  
height
- there's no sorting. On the other hand, the table itself may be the  
wrong place for this since you can just pass it a sorted collection  
and it will mark itself dirty
- currently the header row only supports a collection of strings - if  
it allowed people to use builders, they could do things like put  
search boxes for sorting

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

Eli-Widgets.st (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Iliad submissions

Nicolas Petton
Le dimanche 11 octobre 2009 à 22:02 +0200, Eli Green a écrit :
>
> On Oct 11, 2009, at 18:06, nicolas petton wrote:
>
> >
> > The IL prefix is only for the Squeak version since Squeak doesn't  
> > have namespaces.

I'm going to port it and include it in Iliad-More-UI.
Thanks for this nice contribution :)


Just a few things:
- you use some of the deprecated XHTML api (for instance #tableData).
The new api follows XHTML tags and attributes, so #tableData becomes
#td, #bold become #b, etc. It may seem strange first, but at the end it
is shorter, and you don't have to learn a new api, just write your html
code in smalltalk :)

- Instead of adding comments like "e is a thead", you can write:
[:th | ....]
 
> >
>
> Well, I'm doing this in Pharo so unfortunately my submissions will by  
> in ugly, namespace-free format.

I created an iliad-dev repository on squeaksource, it has public write
access, to feel free to add more stuff! I can't garantee that everything
will be accepted in Iliad though.

http://www.squeaksource.com/IliadDev

>
> Has anybody tried to get Iliad working in VisualWorks?

Nop. If you want you can port it to VW :D

>
> Alternatively, can anybody point me in the right direction of a good  
> persistence solution for GNU smalltalk?

There is SandstoneDb in the git version of gst, there is also ROE and
GLORP (the glorp version is a bit old, I would use ROE instead).

>  Something like Magma (squeak-
> based object database) or SqueakSave (zero-configuration object-
> relational mapper) would be perfect. If GNU smalltalk had a good  
> persistence layer, I would be willing to put the time in to getting  
> VisualGST compiled on my Mac...
>
> >
> > Yes, definitely. It would fit prefectly in the UI package. Where is  
> > the code, I really want to see it! :p
>
> Included here. There's a few things missing that I can think of already:
> - when an ILPagedDataGrid is on the last page, it would be visually  
> appealing if empty rows were created so that each page has the same  
> height
> - there's no sorting. On the other hand, the table itself may be the  
> wrong place for this since you can just pass it a sorted collection  
> and it will mark itself dirty
> - currently the header row only supports a collection of strings - if  
> it allowed people to use builders, they could do things like put  
> search boxes for sorting
--
Nicolas Petton

Iliad Smalltalk web framework
http://iliad.bioskop.fr

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

signature.asc (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Iliad submissions

Nicolas Petton
In reply to this post by Eli Green-3
Hi again,

Just a question, why do you mark the widget as dirty in accessing
methods?

Cheers!

Nico
--
Nicolas Petton

Iliad Smalltalk web framework
http://iliad.bioskop.fr

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

signature.asc (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Iliad submissions

Eli Green-3

On Oct 12, 2009, at 10:55, Nicolas Petton wrote:

> Hi again,
>
> Just a question, why do you mark the widget as dirty in accessing
> methods?
>

I do so in the setters where the way the table is displayed is likely  
to change. Of course, this doesn't catch all the possibilities, since  
somebody could use the getter accessor on, for example, the column  
names and append new columns to the collection.



_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Iliad submissions

Eli Green-2
In reply to this post by Stefan Schmiedl

On Oct 11, 2009, at 16:47, Stefan Schmiedl wrote:

>> This is a sample use of the table to
>> display / edit a list of companies:
>>
>> e build: (ILPagedDataGrid new
>> items: (self model companies);
>> columnNames: #('Name' '' '');
>> column: 1 renderWith: [:el :company | el html: company  
>> companyName];
>> column: 2 renderWith: [:el :company | el a text: 'edit'; action:
>> [self editCompany: company]];
>> column: 3 renderWith: [:el :company | el a text: 'delete'; action:
>> [self model companies remove: company]];
>> rowsPerPage: 5).
>>
>> ILPagedDataGrid is a subclass of ILDataGrid so you don't need the
>> pagination controls if you don't want them.
>
> nice. Can you add some code in there to provide in-place editing?
> I've currently forgotten most of the bits I knew about jquery...

Well, the cells are built as any other Iliad widget would be, so it  
shouldn't be a problem to place edit-in-place widgets inside cells. I  
definitely don't think this should be part of the data grid itself  
since the widget could be useful in other contexts (like the Paginator  
that Nicolas suggested I factor out of the table control, which I did).


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Iliad submissions

Nicolas Petton
In reply to this post by Eli Green-3
I committed your contribution (on both squeaksource and github). I made
a few changes, I hope you don't mind :)

http://github.com/NicolasPetton/iliad/tree/71e801b055d801eced54c82d6f790af42fd470da/More/UI
http://squeaksource.com/IliadDev/Iliad-More-UI0.8-np.2.mcz


Cheers!

Nico



_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Iliad submissions

Paolo Bonzini-2
On 10/12/2009 07:22 PM, Nicolas Petton wrote:
> I committed your contribution (on both squeaksource and github). I made
> a few changes, I hope you don't mind:)

Sorry for the obvious question... does it make sense to strip (or to
add, depending on the point-of-view) the IL prefix under GNU Smalltalk?

Paolo


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Iliad submissions

Paolo Bonzini-2
>>> I committed your contribution (on both squeaksource and github). I made
>>> a few changes, I hope you don't mind:)
>>
>> Sorry for the obvious question... does it make sense to strip (or to add,
>> depending on the point-of-view) the IL prefix under GNU Smalltalk?
>
> The problem is that we started under gst, but squeak doesn't have
> namespaces, and we were afraid of name clashes so we decided to add a
> prefix, just for squeak...
>
> Would you have a better solution?

Adding the prefix for GST as well.

Paolo


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Iliad submissions

Eli Green-3
In reply to this post by Nicolas Petton

On Oct 12, 2009, at 19:22, Nicolas Petton wrote:

> I committed your contribution (on both squeaksource and github). I  
> made
> a few changes, I hope you don't mind :)
>
> http://github.com/NicolasPetton/iliad/tree/71e801b055d801eced54c82d6f790af42fd470da/More/UI
> http://squeaksource.com/IliadDev/Iliad-More-UI0.8-np.2.mcz
>
>

How do you go about generating the Squeak version? Do you have a gst-
convert scrip that you use? If this isn't automated, it seems like it  
ought to be. Are there major differences other than converting  
namespaces to a prefix?

Also, as an aside, what are people using to edit their GST code? I'm a  
vim-head from way back but I really like the traditional Smalltalk  
development environments -- although I think VisualWorks is far  
superior to Squeak, I'm concerned about the fact that I can't even  
find a price list for it!

So I'm very tempted to put all the effort required into getting  
VisualGST to compile under OS X. Does VisualGST do a good job of  
preserving unchanged portions of a file? If I use svn, git or  
mercurial to do version control, will the unchanged methods be  
identical between subsequent commits?


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Iliad submissions

Paolo Bonzini-2
> Also, as an aside, what are people using to edit their GST code? I'm a
> vim-head from way back but I really like the traditional Smalltalk
> development environments -- although I think VisualWorks is far superior
> to Squeak, I'm concerned about the fact that I can't even find a price
> list for it!

Yes, VW is gratis for non-commercial use, but otherwise the licensing is
a mess.  Personally I use vi.

> So I'm very tempted to put all the effort required into getting
> VisualGST to compile under OS X. Does VisualGST do a good job of
> preserving unchanged portions of a file? If I use svn, git or mercurial
> to do version control, will the unchanged methods be identical between
> subsequent commits?

After the first fileout, yes.

VisualGST should not be hard at all to compile under OS X if you install
gtk+ from fink (which gives an X11 executable).  It would be great if
you tried with the native Quartz packages which install in
/Library/Frameworks; in theory they are supported but I never tried.

Paolo


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Iliad submissions

Paolo Bonzini-2
In reply to this post by Paolo Bonzini-2
On 10/15/2009 01:16 PM, nicolas petton wrote:
> I feel sad about adding this prefix for gst, because it's completely
> useless and Iliad.ILWidget looks ugly redundant...

I totally agree with your sentiment.  The problem is that while
namespaces can be added and removed easily to the pool dictionaries,
prefixes would require one rewrite rule per class...

Paolo


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk