[Q] CMS/Swiki development

Chris Burkert christian.burkert at s2000.tu-chemnitz.de
Wed Mar 5 09:26:25 UTC 2003


Hi Göran

thanks for this really big answer :-)

Just for understanding. I want to build this for creating Homepages. 
Many people can work on this Homepage, but can only work on the part of 
the tree, where they have the right. Think of a newspaper. The man from 
the sports shouldn't change something in the finance section.

There's a page at http://www.rsv-sehmatal.de/. It has static (plain 
text) pages, and some dynamic stuff (guestbook, calendar, news, picture 
gallery). All this should be possible.

There should be some corporate design, so that the sports section is 
colored blue and the finance section red. Only the structure of the site 
should be the same.

All this works in my PHP-Implementation but it's fulsome to extend.

goran.hultgren at bluefish.se wrote:
> Hi Chris!
> 
> Just my 2 cents below. :-)

This is 10 Dollars or even more :-)

> Chris Burkert <christian.burkert at s2000.tu-chemnitz.de> wrote:
> 
>>Hi
>>
>>I plan to develop a kind of Swiki that is more what I want (nothing 
>>against swiki, but it's not really the thing I want :-) I think the best 
>>is with commanche.
>>
>>1) What would you say is the best starting point (It should be faster 
>>than swiki)?
>>- start from scratch
>>- change the existing swiki
>>- build with seaside
> 
> 
> Do not try to change the existing ComSwiki. We have done a lot of
> extensions to ComSwiki (sessions, better searching, smarter recent
> changes that marks unread pages as bold yadda yadda) but the
> architecture is a pain to work with. The authors tried to create a very
> dynamic malleable system but I think it got a bit out of hand. But it
> was probably explorative programming trying to see how stuff turned out
> so they are excused! :-) Just don't go there.

This convinces me.

> Don't go "from scratch". Comanche is a very nice bottom layer and it is
> "just a HTTP server" so you can't possibly go wrong with it, no point in
> not using it. And you can always (as we have done on many occasions) put
> Apache in front of it to get https, virtual hosts etc.

Just a misunderstanding. I want to use Comanche! (It's my english :-(

> Seaside is cool - I haven't used it yet, but Avi/Julian are bright guys
> and Seaside can do amazing stuff. You should look at it - at least to
> learn some new interesting ways to build web apps.

The last time I took a look at seaside, it was just to much for me. But 
I only heard good things about it. Avi, Julian, what are the classes I 
hav to work with?

> If you are leaning towards some form of "embed code in HTML
> templates"-solution then there are/have been a bunch of those, I would
> guess a few are on SqueakMap. Personally I don't like those solutions.

I'm thinking of using Templates ... is there a little powerfull 
templateclass like IT from PHP-Pear?

> And then of course we have my own little pet - HttpView. Think of it as
> a much simpler (and thus also less fancy) Seaside. It isn't well
> documented but on the other hand I have plenty of sample code and it is
> very small.
> 
> Some of the cool aspects of HttpView is that it is *all Squeak* (no file
> templates at all), urls map very easily and simply onto methods and web
> pages are built using an HtmlBuilder. It also does very cool things with
> Forms. (Seaside has similar mechanisms but IIRC doesn't have "nice
> simple bookmarkable urls". But that is a consequence of having other
> nice things.)

The problem is, that there are people working on this Homepage who don't 
know what Squeak is. The simplest would be to offer a form where they 
can put their template in. Squeak then uses this as it wants.

> Compared to Seaside I think HttpView is:
> - Much simpler (and thus less capable of the advanced stuff, on the
> other hand HttpView doesn't tie your hands so that you can't do things
> "your own way" when you want to.)
> - Much smaller (let me count - 22 classes of which you only need to
> learn 3. The other 19 are "internal")

What are these 3 classes?

> If HttpView sounds interesting I can dig up some sample code for you.
> NOTE: The HttpView on SM is not up to date. I need to scramble together
> my latest into a release.

This would be the greatest. Göran you _are_ great!

>>2) What do you say about regular expressions. Is the plugin build in in 
>>the default VM or does the admin has to compile a new VM? Then I had to 
>>use Streams.
>>
>>Here's what I want.
>>- (Commanche) sessions
> 
> 
> Ease pie. I think Diego's cookie support is included in the current
> Comanche on SM so sessions are easy. I have build 4 different webapps
> using HttpView with sessions in all of them.
> 
> 
>>- pages sit in a tree (swiki has a graph structure)
> 
> 
> Ok. Fair enough.
> 
> 
>>- userlogin
> 
> 
> Simple. I just use a normal Form together with cookies. You can get
> basic auth to work too - Jonas added that for our internal ComSwiki, but
> who cares.

I've built my own login class in PHP. It works quite good. (logout after 
idle time, logout after expired, some more things). I want to use the 
same scheme for this.

>>- permissions (from user to admin)
>>- permissions are bound to a user/page combination and are
>>   inherited down the tree.
>>- Squeakcode in <squeak> ^'Hello World!' </squeak>
> 
> 
> Personally I would instead use some form of HtmlBuilder (like in
> HttpView or Seaside). Cleaner. And yeah, btw - I do have a Swiki syntax
> single class that transforms the Swiki syntax (a bit extended) into
> HTML. It is a very simple to use reimplementation of the syntax in
> ComSwiki - I use it in another project called "Homepage Builder". You
> don't want to try to extract that code from ComSwiki...

I think it would be better to forget about the Swiki systanx, or make it 
a additional feature. But it would be nice if I could take a look.

> So in short - go with Comance + Seaside/HttpView and build it from
> there. The Swiki syntax class you can get from me or Avi (he may have
> improved it). I also have lots of other code around like an "upload
> documents" facility etc.

I will ask for this, when the time is right :-) For now I will mainly 
think of design.

> Btw, just to give you a little taste of HttpView, here is a little
> "hello world" I just typed into one of my running webapps (I did
> *nothing more* than to add the method seen below), you can see it in
> action at:
> 
> http://hb.bluefish.se/hello
> 
> WBServerView>>hello
> 	"WBServerView inherits from HVHttpView. To get a new 'page' in your app
> 	simply add a method - that is it. Here we added #hello which means
> 	an url like http://localhost/myappbase/hello would suddenly work.
> 
> 	Note that the method returns the builder which Comanche later will
> 	send a message to in order to get some HTML. That is when the actual
> 	rendering takes place. The builder creates standard XHTML."
> 
> 	| b name age |
> 	b _ self builder.							"Inherited, get ourselves a builder object"
> 	b start; h1: 'My little app'.				"Start the page and add a heading"
> 	b p: 'Hello brave new world!'.			"And a paragraph"
> 	b postForm. 								"Start a form, the action url will by default go to
> this page"
> 	
> 	"Add a text field, hold the field widget in a local var, give the field
> a default value"
> 	name _ b html: 'Name: ', inputTextValue: 'Joe Schmoe'. 
> 
> 	"Add a drop down select box of objects. If they respond to name, show
> that - otherwise printString.
> 	Tell the select box to add nil first and to show that as Will not
> tell."
> 	age _ b br; html: 'Older than :';
> 		selectObjectsNilFirst: #(10 20 30 40 50 60 70 80 90)
> asOrderedCollection
> 		nilLabel: 'WIll not tell'.
> 
> 	"Add a break, a submit button with text Go, and end the form"	
> 	b br; submit: 'Go'; endForm.
> 
> 	"Check if this was a post, in that case look at the values in the
> widgets and add some stuff to the page.
> 	Note that the value of age is not an id or string - it is the selected
> object in the collection."
> 	b ifPost: [
> 		b p: 'Hi ', name value, '!'.
> 		age value
> 			ifNil: [b p: 'You are a chicken, confess!']
> 			ifNotNil: [age value > 30
> 						ifTrue: [b p: 'You are older than me!']
> 						ifFalse: [p p: 'You are younger than me!']]].
> 
> 	"Close the page and return the builder"
> 	b end.
> 	^b

This looks great for using it for my danymic pages (guestbook, calendar, 
news, picture gallery), so I can edit a page that looks like:

foo
<squeak> printGuestbook </squeak>
bar

> regards, Göran

Again ... thanks a lot for this long answer! It helps more than any 
documentation. I think of putting together a page, which describes the 
possibilitys for creating webapps in squeak. Just for an overview.

Regards
            Chris Burkert
-- 
------------------------------------------------------------------------
Student of applied Computer Science at Chemnitz University of Technology
      http://www.chrisburkert.de/            chris at chrisburkert.de
------------------------------------------------------------------------
"I invented the term Object-Oriented, and I can tell you I did not have
  C++ in mind." - Alan Kay --> http://www.whysmalltalk.com/



More information about the Squeak-dev mailing list