Create temporary context - PIER

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

Create temporary context - PIER

Pierre-Emmanuel QUEYREL
Hi all,

I would like to create a Widget for PIER which will generate a HTML page
by using the tree structure of PIER with a visitor. Currently I have
created a test by creating a visitor who overloads PRViewRenderer (PIER
-SEASIDE). Unfortunately I encounter a problem of context when I launch
my app. Can you help me to understand how to create a temporary context?

Sample of my code:

kernel := PRKernel instances anyOne.
                myVisitor := SPGHTMLVisitor new.
                myVisitor renderer: WAStaticHtmlCanvas new.
                page := kernel root.
                PRCurrentContext
                    use: (PRContext kernel: kernel)
            during: [myVisitor start: page.].

Thanks in advance

Pe

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Create temporary context - PIER

Lukas Renggli-2
Hi Pierre-Emmanue,

> I would like to create a Widget for PIER which will generate a HTML  
> page
> by using the tree structure of PIER with a visitor. Currently I have
> created a test by creating a visitor who overloads PRViewRenderer  
> (PIER
> -SEASIDE). Unfortunately I encounter a problem of context when I  
> launch
> my app. Can you help me to understand how to create a temporary  
> context?

I wonder why you need a new context for that?

If you subclass PRWidget you have the current context in 'self  
context' and you can find out about the kernel by evaluating 'self  
context kernel'.

Have a look at PRTreeWidget that does something like that already. It  
doesn't use a visitor, but it queries all the information you need to  
start your visitor.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch



_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Create temporary context - PIER

Pierre-Emmanuel QUEYREL
Thank you for your answer. In fact, at the beginning I wanted just to
test my code directly under squeak without using a Widget.


Pe

Lukas Renggli a écrit :

> Hi Pierre-Emmanue,
>
>  
>> I would like to create a Widget for PIER which will generate a HTML  
>> page
>> by using the tree structure of PIER with a visitor. Currently I have
>> created a test by creating a visitor who overloads PRViewRenderer  
>> (PIER
>> -SEASIDE). Unfortunately I encounter a problem of context when I  
>> launch
>> my app. Can you help me to understand how to create a temporary  
>> context?
>>    
>
> I wonder why you need a new context for that?
>
> If you subclass PRWidget you have the current context in 'self  
> context' and you can find out about the kernel by evaluating 'self  
> context kernel'.
>
> Have a look at PRTreeWidget that does something like that already. It  
> doesn't use a visitor, but it queries all the information you need to  
> start your visitor.
>
> Cheers,
> Lukas
>
>  

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Create temporary context - PIER

Lukas Renggli-2
> Thank you for your answer. In fact, at the beginning I wanted just to
> test my code directly under squeak without using a Widget.

Ok. Your code for that looks fairly good. You properly define a new  
browsing context looking at the root page . Was there a specific  
problem with the code?

Cheers,
Lukas


>
>
> Pe
>
> Lukas Renggli a écrit :
>> Hi Pierre-Emmanue,
>>
>>
>>> I would like to create a Widget for PIER which will generate a HTML
>>> page
>>> by using the tree structure of PIER with a visitor. Currently I have
>>> created a test by creating a visitor who overloads PRViewRenderer
>>> (PIER
>>> -SEASIDE). Unfortunately I encounter a problem of context when I
>>> launch
>>> my app. Can you help me to understand how to create a temporary
>>> context?
>>>
>>
>> I wonder why you need a new context for that?
>>
>> If you subclass PRWidget you have the current context in 'self
>> context' and you can find out about the kernel by evaluating 'self
>> context kernel'.
>>
>> Have a look at PRTreeWidget that does something like that already. It
>> doesn't use a visitor, but it queries all the information you need to
>> start your visitor.
>>
>> Cheers,
>> Lukas
>>
>>
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>

--
Lukas Renggli
http://www.lukas-renggli.ch




_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Create temporary context - PIER

Pierre-Emmanuel QUEYREL

We have a problem of context when we explore the tree structure of pier
with our visitor and when we visit an internal link. We perhaps found a
solution by creating a static PRContext and by redefining the UrlOn method.

(sorry for my bad english :) )

Pe

Lukas Renggli a écrit :

>> Thank you for your answer. In fact, at the beginning I wanted just to
>> test my code directly under squeak without using a Widget.
>>    
>
> Ok. Your code for that looks fairly good. You properly define a new  
> browsing context looking at the root page . Was there a specific  
> problem with the code?
>
> Cheers,
> Lukas
>
>
>  
>> Pe
>>
>> Lukas Renggli a écrit :
>>    
>>> Hi Pierre-Emmanue,
>>>
>>>
>>>      
>>>> I would like to create a Widget for PIER which will generate a HTML
>>>> page
>>>> by using the tree structure of PIER with a visitor. Currently I have
>>>> created a test by creating a visitor who overloads PRViewRenderer
>>>> (PIER
>>>> -SEASIDE). Unfortunately I encounter a problem of context when I
>>>> launch
>>>> my app. Can you help me to understand how to create a temporary
>>>> context?
>>>>
>>>>        
>>> I wonder why you need a new context for that?
>>>
>>> If you subclass PRWidget you have the current context in 'self
>>> context' and you can find out about the kernel by evaluating 'self
>>> context kernel'.
>>>
>>> Have a look at PRTreeWidget that does something like that already. It
>>> doesn't use a visitor, but it queries all the information you need to
>>> start your visitor.
>>>
>>> Cheers,
>>> Lukas
>>>
>>>
>>>      
>> _______________________________________________
>> SmallWiki, Magritte, Pier and Related Tools ...
>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>>
>>    
>
>  

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki