[Question] Learning Pier .... working with the wiki model

hhs@lexdb.net hhs at lexdb.net
Wed Oct 8 15:43:05 MEST 2008


Thank you Lukas and Tudor 
for your helpful answers. First I used the current version of Pier in Squeak
3.10.2 from the Universe but now I use the Pier 1.0.17 download from
http://www.piercms.com/.

My interest is to construct a Pier kernel with code through a model
transformation (visit another model and construct a pier model).

I could construct a 
   MyPierModel2    "code see below"
and register it as an application to be accessed as
  http://localhost:8080/seaside/mypier2

I works nicely. Do you have any further suggestions/hints how to construct these
wiki models?
How are the name of a PRPage and the title related? Should a PRDocument object
which is hold by the PRPage object be without a title, because the title is in
the PRPage object? I assume that only the name of the PRPage object is used as
the reference for links and the title text might differ.

Kind regards
Hannes Hirzel

"-------------------------------------------------------------------------------
--------"

| p2 |
p2 := PRPage named: 'anotherPage'.  "This just creates a default page, which
serves as a link target"


MyPierModel2 :=  

(PRPage named: 'ThePageNameOfTheFirstPageOfMyWiki')
addChild: p2; 
document: (

PRDocument new 
            add: (PRParagraph new 
                add: (PRText content: 'some text');
                yourself);
            add: ((PRHeader new)
                        level: 2;
                    add: (PRText content: 'The heading level 2');
                    yourself);
            add: (PRUnorderedList new
                    add: (PRListItem new add: (PRText content: 'aaa'));
                    add: (PRListItem new add: (PRText content: 'bbb'));
                    add: (PRListItem new add: (PRText content: 'ccc'));
                    yourself);
            add: (PRPreformatted new
                add: (PRText content: '   A line with 3 spaces');
                add: (PRText content: '    A line with a tab');
                yourself);    
            add: (PRInternalLink reference: 'anotherPage')        
        yourself
).


PRPierFrame registerAsApplication: 'mypier2' kernel: (
    (PRKernel named: 'mypierkernel2' 
    root: MyPierModel2)
)


"Access the application with:"
http://localhost:8080/seaside/mypier2


    
(I put a somewhat simple example at http://wiki.squeak.org/squeak/6084)

"-------------------------------------------------------------------------------
--------"


Tudor Girba <girba at iam.unibe.ch> hat am 4. Oktober 2008 um 17:40 geschrieben:

> For a detailed example of setting up a Pier instance, take a look at  
> PRDistribution from the Pier-Setup package. This class is the one that  
> creates the Pier that comes with the distribution.
> 
> To create the Pier distribution you should call:
> PRDistribution new register.
> 
> Cheers,
> Doru
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iam.unibe.ch/pipermail/smallwiki/attachments/20081008/d9da0b25/attachment-0001.html


More information about the smallwiki mailing list