[Question] How do I use Pier as a Seaside component?

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

[Question] How do I use Pier as a Seaside component?

hhs@lexdb.net
Dear all

I would like to use a Pier wiki as a Seaside component as Lukas Renggli suggested in

http://lists.squeakfoundation.org/pipermail/squeak-dev/2008-October/131787.html


> 
I suggest that you use Pier. I do that for many of my projects. Pier
> can be easily embedded into any application, as well as you can embed
> any application into Pier. For simple wikis it might be a bit overkill
> to have to load the whole code-base that is more a CMS, so it would
> probably be worthwhile to have a simple Seaside component that just
> reuses the document model.

The code I would like to use (Pseudo class and method names):


myModel := PierStructure on: (AFileDirectory on: 'S:\wikiDirectoryWithACollectionOfTextFilesInWikiSyntax'.

myPierComponent := PierSubclassOfWAComponent on: myModel.



May I ask for help replacing this pseudo-code with actual code which does the job.

In addition I would like to have as well


myModel exportContentAsTextFileInWikiSyntaxToDirectory: aDirectorySpecification
myModel exportContentAsStaticHTMLToDirectory: anotherDirectorySpecification


and to create the model in the first place

myModel := PierStructure on: (AFileDirectory on: 'S:\wikiDirectoryWithACollectionOfStaticHTMLfiles'.


Thank you in advance for all hints and contributions


Hannes Hirzel


P.S. I have installed Pier-Seaside version 1.0.16.272 (it is the latest version available in the Squeak 3.10.2 "Universe" repository as of today).

Utilities classCategoriesStartingWith: 'Pier'

gives

#(#'Pier-Model-Core' #'Pier-Model-Magritte' #'Pier-Model-Kernel' #'Pier-Model-Persistence' #'Pier-Model-Structure' #'Pier-Model-Command' #'Pier-Model-Document' #'Pier-Model-Exception' #'Pier-Model-Visitor' #'Pier-Model-Utilities' #'Pier-Seaside-Core' #'Pier-Seaside-Libraries' #'Pier-Seaside-Magritte' #'Pier-Seaside-Model' #'Pier-Seaside-View' #'Pier-Seaside-Widgets' #'Pier-Seaside-Visitors')


For me it is not easy to find the entry points. Pier-Seaside-Model for example seems to be a good candiate for creating a model. However there are only two classes there: PRComponent and PRSettingsCommand. The first one has no class documentation at all and the second one only a terse comment. So this seems to be a dead end.

Then there is the class category Pier-Model-Document whith quite a number of classes: On particular class jumps into the eye: PierDocument. The documentation says 'I am the root of a document composite.' On the class side there are no examples. However browsing the class references leradis to

PRpage>>defaultDocument

with the code

defaultDocument
^ super defaultDocument
add: (PRParagraph new
add: (PRText content: 'Edit this page ...');
yourself);
yourself

A possible useful track .......




P.S.2
I have loaded Pier 1.0.16 through the Squea 3.10.2 package "Universe". I am ready to update to 1.0.17 as it was announced on
http://lists.squeakfoundation.org/pipermail/squeak-dev/2008-September/131633.html
How is this easily possible (as it is not yet in the Universe?)



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: [Question] How do I use Pier as a Seaside component?

Lukas Renggli
>  I would like to use a Pier wiki as a Seaside component as Lukas Renggli
> suggested in

PRPierFrame is the entry point of a Pier application. There are
examples on the class-side of PRPierFrame in the protocol called
'examples'. You can have a look at these examples in the Seaside
Example Browser at
<http://localhost:8080/seaside/examples/examplebrowser>.

Your mail is very hard to read, because of excessive amounts of empty
lines. I can't see what is quote or what is new, and what belongs
together. Maybe you want to repost those questions?

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: [Question] How do I use Pier as a Seaside component?

hhs@lexdb.net
Thank you for your answer, Lukas!

Lukas Renggli <[hidden email]> hat am 2. Oktober 2008 um 14:37 geschrieben:

> >  I would like to use a Pier wiki as a Seaside component as Lukas Renggli
> > suggested in
>
> PRPierFrame is the entry point of a Pier application. There are
> examples on the class-side of PRPierFrame in the protocol called
> 'examples'. You can have a look at these examples in the Seaside
> Example Browser at
> <http://localhost:8080/seaside/examples/examplebrowser>.


I loaded Pier into a pristine Squeak 3.10.2 image using the "Universe" - Install "Pier version current". The installation was smooth.


And I found your two examples on the class side of PRPpierFrame
exampleBasic
and
exampleDocumentation

They are very helpful.

And on
http://localhost:8080/seaside/pier
there is a pier wiki with some useful information and links. If I toggle the halos I see how the page is composed of widgets.


> Your mail is very hard to read, because of excessive amounts of empty
> lines. I can't see what is quote or what is new, and what belongs
> together. Maybe you want to repost those questions?
>
> Cheers,
> Lukas

For the time being I think I will just browse the code and experiment with creating "structures" as in

PRPpierFrame class>>
exampleBasic
    "Pier can be easily used as a component within any Seaside application, this is just an example of a dumb wiki. To see this example browse to /seaside/examples/examplebrowser and select the receiver class."

    ^ self on: (PRContext kernel: (PRKernel new
        name: 'Pier';
        root: (PRPage new
            title: 'Pier Example';
            contents: 'Pier can be easily used as a component within any Seaside application (maybe you should adapt the style-sheets), this is just an example of a dumb and non-persistent wiki.';
            yourself)))


As there is a Pier mailing list I will ask further questions on that list if they arise.


Kind regards

Hannes Hirzel
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside