Dear All,
Pier (or any other seaside application) no longer needs a specialized
root component in order to use ShoreComponents. The Seaside28Jetsam
package now includes a ShoreHelperHelper which can be enabled in your
pier app configuration.
The "Helper" portion of Jetsam is entirely self contained, so could be
distributed separately.
The goal of the helpers concept is to avoid having to use specialized
root classes for generic additions which results in combinatorial
problems for multiple such additions.
Helpers are Decorations which are automatically added to the root
component of any application subject to configuration options. They work
similarly to other Plugins in Seaside 2.8, as in, you can provide
additional Helpers by subclassing WAHelper.
So far, in addition to the "Shore Components Helper", Jetsam implements
a "Keep Alive Helper" for keeping the session alive while the users
browser is open. I find the later totally indispensable.
Next I am looking to see how a similar mechanism can be used to avoid
needing to subclass WASession. I aim to support Magma as a helper so
that all of the different options for shared or pooled magma sessions
can be orthogonal to the choice of seaside session class. If Comet could
be added as a helper as well then that would also be great.
best regards
Keith
Some folks may find this useful
Keith
-=-=-
Name: Pier-Commands-RemoveChildren-kph.1
Author: kph
Time: 26 October 2007, 6:26:35 pm
UUID: 9a0279a6-83e8-11dc-a340-000a95edb42a
Ancestors:
Original Author: Damien Cassou <damien.cassou(a)gmail.com>
Remove Children, presents a list of the current structures children for
you to select those you wish to remove.
This command is particularly useful for removing components whose
display becomes broken during development.
- update of what was Pier-UsefullComands for the latest Pier (circa
Pier-Model-lr.175)
Hi Lukas,
I am struggling to see how components can register sub-components as
children.
One of my components has a header/footer fields which are rendered using
wiki format.
Unfortunately embedding components in this format does not work and I am
trying to find a way to fix it.
any thoughts?
Keith
I have a traditional "gather information over 10 pages" app in Perl that I'm
rewriting using Seaside and Magritte. The current app stashes everything in a
giant Perl hash (saving and loading from hidden vars) at each step.
Sometimes, the presence or absence of (or even repetitions of) a field depends
on previous questions answered on previous pages. When I started to model
this with Magaritte, I quickly hit some roadblocks trying to implement the
dynamic "descriptionFoo" since these are (a) cached and (b) have no access to
"self" since they are class-side. So I've managed to come up with something
that sorta works instance-side, but I'm not very happy with it, as I wonder
for example how many times "myModel description" will be called during a
render, and whether I should try to cache that. I also am ending up with a
series of subclasses of a parent class that holds the entire collected values,
but has only the items of interest. None of this seems very clean, and it
seems like I'm reinventing some wheels.
Does anyone have some examples of how to do things like a basic "gather info
from a multipage query, some of which depends on earlier answers" task would
work and look like?
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn(a)stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
I found this fix in my code which is another intended to preserve the
command-context integrity
Keith
---
PRCommand-context: aContext
context: aContext
(self isValidIn: aContext)
ifFalse: [ self error: self name , ' is not useable in the given
context.' ].
^ (aContext command: self new) command
Hello Lukas,
It appears that embedding a PRChildren component is broken. This is a
little tricky to explain.
At the point of visiting the embedded component visitInternalLinkEmbed:
anObject
the context's structure is correct, namely the parent structure being
displayed. ie. PRCurrentContext value structure.
By the time it obtains the structure from which to collect the
child-items, this structure may be something else entirely.
So it appears that the PRChildren component being used is one that was
cached, and this cached widget has itself cached the #context. I.e. the
old context that it had when it was origianlly cached, not the current
one in which it is being displayed.
I have posted my solution for this...
Name: Pier-Seaside-kph.213
Author: kph
Time: 20 October 2007, 9:24:28 pm
UUID: 75264720-7f4a-11dc-a343-000a95edb42a
Ancestors: Pier-Seaside-lr.212
- fixed typo 'Highlight' labels
- components obtained from a contexts componentDictionary cache have an
obsolete context cached in their #context
cheers
Keith
All,
Pier certainly has a lot of features that the previous version was
lacking, however sometimes plain is more appealing. Has anyone setup
pier to look like Smallwiki? Using the same style sheets didn't fill
the bill, and I could probably figure out how to change
PRPierLibrary>>styleCss to make it look similar; but if someone has
already done this, I'll appreciate the help.
Thanks,
John
Hello all,
In Ramon's blog [1] he mentions:
"When creating a description for that collection, I can specify my
custom #accessor: rather than using the default #selectorAccessor:
which then writes to my domain object with #addUser: and
#removeUser:."
Looking at the code, I don't see how this is done. Isn't the write
accessor going to get a complete collection? Is the idea to just diff
the received collection from the one the object had and make calls to
#add and #remove as appropriate, or is there a way to only be told
about the new objects in the collection?
Thanks,
Jason
[1] http://onsmalltalk.com/programming/smalltalk/using-magritte-with-seaside/
Hi all,
I have a situation that brings up a couple of questions.
I have 2 classes which have a class side variable which keeps track of
the instances created (much like how Pier's PRKernel works). As a
consequence, I need these objects to be instantiated, not with #new,
but with a special message (e.g. #named:).
The second part of the equation is that, while these two classes have
their own Magritte definitions and can display themselves, there is a
"main site" component that displays all the instances from these two
classes, as options for the user. So this puts me in a situation
where the main site class needs to have descriptions
(MAToManyDescription I believe) that reference the other two objects
(i.e. the main site class wont have any instVars for these). And for
added fun, this class has a class side method named #description for
the Seaside framework.
Now, I think the issue with the main site is not so bad, I would just
define my #description methods as normal, right? Since #description
is taken already I guess I have to override it on the instance side
and call MANamedBuilder for: myself?
And the other question is, how do I enforce that when Magritte wants
to make a new instance of these other two classes that it uses my
custom constructor, not #new? Since the custom constructor is going
to expect a portion of the data already, I'm guessing I need some kind
of Memento? I suppose I could just let it create the object with new,
and then have the accessor create the "real" object from this, but
that seems very cheesy.
Thanks for any help you can provide,
Jason
hi -
I'm trying to embed a pier-blog in a vanilla pier page, using
variations of +myblog+, but that only embeds the description of the
blog -- not a view of the latest blog entries. Any simple trick?
thanks,
ts