Okay sorry.
I am a kind of ashamed by this email. A real newbies mistake.
The correct way is to create a new Visitor inheriting from VisitorRenderer*
In short the responsability of adding a page in the PagesVisitedComponent belongs to the
visitor and __not__ to the page, as I first thought.
I will never make a such mistake, I promise :-)
Alexandre
On Thu, Mar 20, 2003 at 12:14:26PM +0100, Alexandre Bergel wrote:
[For Lukas and Steph] Last time with Gabriela we have
coded together the Page visited component. We get stuck because we put a method such as:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Page>>accept: aVisitor
aVisitor acceptPage: self.
(self template propertyAt: #visitedPages) addPage: self
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The result was the component reference all the pages of the wiki, even if we display it
or not.
I understood why. A page is not only visited by a rendered visitor, by also by
VisitorReferences.
So, a code something like works:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Page>>accept: aVisitor
aVisitor acceptPage: self.
(aVisitor isKindOf: VisitorRenderer) ifTrue: [
(self template propertyAt: #visitedPages) addPage: self]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Okay, now I have some questions:
1- What is the meaning of VisitorReferences,
2- What is the meaning of TemplateReferences
The both question are nearly the same, but I do not have so much time to dive in the
code.
My guess is it is needed for the saving mechanism...
and the last one:
3- A page should get a reference so the component for being referenced when visited. In
the previous code "self template" return the __root__ of the template structure.
So, our first idea was to add a property in the root for referencing the component. But,
we need to modify such method. And I admit it is not homogenous :-)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
defaultTemplate
| ans v |
ans := TemplateRoot
child: (TemplateContainerRows new
add: (TemplateStringTitleWiki new);
add: (TemplateContainerColumns new
add: (TemplateStructuresPath new);
add: (TemplateHeatBox new);
yourself);
add: (TemplateContainerColumns new
add: (TemplateContainerRows new
add: (TemplateActionsCustom new);
add: (TemplateStructuresReferences new);
add: (v := TemplateVisitedPages new);
yourself);
add: (TemplateContainerRows new
add: (TemplateStringTitleAction new);
add: (TemplateStringContent new);
yourself);
yourself);
add: (TemplateStringAbout new);
yourself).
ans propertyAt: #visitedPages put: v. "<=======Here a new line !!!!"
^ ans
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Lukas, tell me what do you think about this way for letting a page to access a
component...
I think it is not bad...
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel
http://www.iam.unibe.ch/~bergel
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel
http://www.iam.unibe.ch/~bergel
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.