Dynamic pages and something like WATask for pier

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

Dynamic pages and something like WATask for pier

NorbertHartl
Hi,

I'm experimenting at the moment with "dynamic pages". I just need to extend the static pages by one level. I did a subclass of PRPage that answers true on hasChildren call so that PRPathLookup does accept the path being requested. If the page is really requested the last path component is taken as query for an object. I then take a "template page" copy its document and set the parent to the right page. Beside having the need for returning a dummy page on a children call this works out pretty good. If you understand that rather cryptic description  :) you may have some hints about that.

The second approach is to have something like WATask in pier style. The pages shouldn't be directly accessible via URL. The task should work on editabel pier pages that pass/inject the right objects into page. Let's say there is a three steps task I want to solve. I would start by taking on template page (copying its document) and embedding the first form. On answer it will take the next template page and injects the results from the previous step into the new page. This would lead to a task where the textual decoration and such could be changed by editors and the task by programmers.

I'm sorry but I don't know how I can explain that in a more understandable fashion. But maybe you understand it and have some hints or pointers how to approach that use case.

Norbert




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

Re: Dynamic pages and something like WATask for pier

Lukas Renggli
> I'm sorry but I don't know how I can explain that in a more understandable fashion. But maybe you understand it and have some hints or pointers how to approach that use case.

What about creating a WATask or WAComponent and embedding it directly
as a PRComponent so that you have the complete logic in Seaside code?

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic pages and something like WATask for pier

NorbertHartl

On 19.03.2010, at 17:46, Lukas Renggli wrote:

>> I'm sorry but I don't know how I can explain that in a more understandable fashion. But maybe you understand it and have some hints or pointers how to approach that use case.
>
> What about creating a WATask or WAComponent and embedding it directly
> as a PRComponent so that you have the complete logic in Seaside code?
>
The problem I like to solve is to have an editable page for every single step of the task. Users have to be guided through the process a WATask might fulfill. The help text and description around the component isn't done by a developer and should be accesible by "normal" editors of the CMS. So I would need a series of pier pages were a the logic (each step of a task) is embedded.

Or did I misunderstand what you were saying?

Norbert


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

Re: Dynamic pages and something like WATask for pier

Lukas Renggli
>> What about creating a WATask or WAComponent and embedding it directly
>> as a PRComponent so that you have the complete logic in Seaside code?
>>
> The problem I like to solve is to have an editable page for every single step of the task. Users have to be guided through the process a WATask might fulfill. The help text and description around the component isn't done by a developer and should be accesible by "normal" editors of the CMS. So I would need a series of pier pages were a the logic (each step of a task) is embedded.
>
> Or did I misunderstand what you were saying?

No, I did not fully understand what you tried to do.

Another idea: Have a look at the Pier Randomizer plugin. Instead of
displaying a set of pages at random, you could implement a similar
widget that displayed the pages in sequence.

Lukas

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

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

Re: Dynamic pages and something like WATask for pier

NorbertHartl

On 20.03.2010, at 11:20, Lukas Renggli wrote:

>>> What about creating a WATask or WAComponent and embedding it directly
>>> as a PRComponent so that you have the complete logic in Seaside code?
>>>
>> The problem I like to solve is to have an editable page for every single step of the task. Users have to be guided through the process a WATask might fulfill. The help text and description around the component isn't done by a developer and should be accesible by "normal" editors of the CMS. So I would need a series of pier pages were a the logic (each step of a task) is embedded.
>>
>> Or did I misunderstand what you were saying?
>
> No, I did not fully understand what you tried to do.
>
> Another idea: Have a look at the Pier Randomizer plugin. Instead of
> displaying a set of pages at random, you could implement a similar
> widget that displayed the pages in sequence.
>
Thanks, that is a good example how a set of pages can be rendered. Inside of each of this pages there needs to be a component that has been initialized already. I would do:

- lookup template page
- make a copy of the page
- add a PRComponent as a child that has the same name as the link on that page
- add a component with state to PRComponent

My problem is that PRComponent only takes componentClass and creates a new component each time. So I need a good way to add an existing component to PRComponent or something similar. Maybe there is another good approach how to inject state into a PRComponent component.


Norbert


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

Re: Dynamic pages and something like WATask for pier

Lukas Renggli
> My problem is that PRComponent only takes componentClass and creates a new component each time. So I need a good way to add an existing component to PRComponent or something similar. Maybe there is another good approach how to inject state into a PRComponent component.

A new Seaside component is instantiated per embedded-link and per
session. That means, if you re-render the same link you get the same
component instance with the same state.

Furthermore, each PRComponent has a unique link that displays itself.
So if you want to reuse the same component instance throughout a
session you simply display the default #document that the PRComponent
returns.

Lukas

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

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

Re: Dynamic pages and something like WATask for pier

NorbertHartl

On 26.03.2010, at 17:16, Lukas Renggli wrote:

>> My problem is that PRComponent only takes componentClass and creates a new component each time. So I need a good way to add an existing component to PRComponent or something similar. Maybe there is another good approach how to inject state into a PRComponent component.
>
> A new Seaside component is instantiated per embedded-link and per
> session. That means, if you re-render the same link you get the same
> component instance with the same state.
>
Ah... good to know. I'm more after the initial state. I have a component that has a certain object. If I want to link to this PRComponent and want to let it know about this particular object which way would you go? Is there way to do this with pier functionality?

> Furthermore, each PRComponent has a unique link that displays itself.
> So if you want to reuse the same component instance throughout a
> session you simply display the default #document that the PRComponent
> returns.
>
Sounds great. I think I'm going to need this soon.

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

Re: Dynamic pages and something like WATask for pier

Lukas Renggli
>>> My problem is that PRComponent only takes componentClass and creates a new component each time. So I need a good way to add an existing component to PRComponent or something similar. Maybe there is another good approach how to inject state into a PRComponent component.
>>
>> A new Seaside component is instantiated per embedded-link and per
>> session. That means, if you re-render the same link you get the same
>> component instance with the same state.
>>
> Ah... good to know. I'm more after the initial state. I have a component that has a certain object. If I want to link to this PRComponent and want to let it know about this particular object which way would you go? Is there way to do this with pier functionality?

If your component is described and the attribute descriptions have
their #parameterName: set, then you can initialize these attributes
from the link: +comp|param1=value1|param2=value2+

Lukas

>> Furthermore, each PRComponent has a unique link that displays itself.
>> So if you want to reuse the same component instance throughout a
>> session you simply display the default #document that the PRComponent
>> returns.
>>
> Sounds great. I think I'm going to need this soon.
>
> Norbert
> _______________________________________________
> Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>

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

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

Re: Dynamic pages and something like WATask for pier

NorbertHartl

On 26.03.2010, at 19:14, Lukas Renggli wrote:

>>>> My problem is that PRComponent only takes componentClass and creates a new component each time. So I need a good way to add an existing component to PRComponent or something similar. Maybe there is another good approach how to inject state into a PRComponent component.
>>>
>>> A new Seaside component is instantiated per embedded-link and per
>>> session. That means, if you re-render the same link you get the same
>>> component instance with the same state.
>>>
>> Ah... good to know. I'm more after the initial state. I have a component that has a certain object. If I want to link to this PRComponent and want to let it know about this particular object which way would you go? Is there way to do this with pier functionality?
>
> If your component is described and the attribute descriptions have
> their #parameterName: set, then you can initialize these attributes
> from the link: +comp|param1=value1|param2=value2+
>
Well, it is hard to tell what I mean. Ok, let's assume you have user object and that object can hold an instance of another object, let's say a company object that has an address. The editor on the web page has a select list of the available companies and a link to create a new one. That link should be a guided tour to create a new company with three steps. Let us further assume that a new company object has been created and somewhat preconfigured . Now I want to be able to give this comany object to the first page in the set to be edited further. From step1 page to step2 and so on. If everything went well I would add the company object to the user.

I hope this is more clear what I meant.

Norbert

> Lukas
>
>>> Furthermore, each PRComponent has a unique link that displays itself.
>>> So if you want to reuse the same component instance throughout a
>>> session you simply display the default #document that the PRComponent
>>> returns.
>>>
>> Sounds great. I think I'm going to need this soon.
>>
>> Norbert
>> _______________________________________________
>> Magritte, Pier and Related Tools ...
>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>>
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
>
> _______________________________________________
> Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki


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