Command Link

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

Command Link

keith1y
I wrote PRCommandLink to enable a link to a command to be inserted into
a document like so:

*Logout>command:PULogout*

I remember seeing something in more recent pier's that would/may provide
this functionality, but I cant remember what it was.

I have just found PRCommandWidget (which I wrote, but was hiding in the
Pier-Seaside category) I have exported it to pieraddons, and offer it as
a potentially useful addition to Pier-Seaside.

Keith


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

Re: Command Link

Lukas Renggli
> I remember seeing something in more recent pier's that would/may provide
> this functionality, but I cant remember what it was.

To logout put a link like this in your environment or into any other page:

    *Logout>.|command=PULogout*

To browse the contents of the news page add a linke like this:

   *Browse Parent>/news|view=PUBrowseComponent*

To add a link to edit the root page (if you have the necessary permissions) use:

   *Edit Root Page>/|command=PREditCommand*

etc.

> I have just found PRCommandWidget (which I wrote, but was hiding in the
> Pier-Seaside category) I have exported it to pieraddons, and offer it as
> a potentially useful addition to Pier-Seaside.

I don't see how this is different to the PRCommandsWidget, except that
it is only able to display a single command?

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: Command Link

keith1y
Lukas Renggli wrote:

>> I remember seeing something in more recent pier's that would/may provide
>> this functionality, but I cant remember what it was.
>>    
>
> To logout put a link like this in your environment or into any other page:
>
>     *Logout>.|command=PULogout*
>
> To browse the contents of the news page add a linke like this:
>
>    *Browse Parent>/news|view=PUBrowseComponent*
>
> To add a link to edit the root page (if you have the necessary permissions) use:
>
>    *Edit Root Page>/|command=PREditCommand*
>
> etc.
>
>  
>> I have just found PRCommandWidget (which I wrote, but was hiding in the
>> Pier-Seaside category) I have exported it to pieraddons, and offer it as
>> a potentially useful addition to Pier-Seaside.
>>    
>
> I don't see how this is different to the PRCommandsWidget, except that
> it is only able to display a single command?
>
> Lukas
>  
You cant display the command with a different name with PRCommandsWidget

Whats the | syntax mean? Who implements it?

Keith


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

Re: Command Link

Lukas Renggli
> You cant display the command with a different name with PRCommandsWidget

That's true, indeed. But you can with the links.

> Whats the | syntax mean? Who implements it?

The links. It is a long existing and under-documented feature. It has
recently seen new popularity with the the value-links:

    http://www.piercms.com/doc/syntax#221565672

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: Command Link

keith1y
Lukas Renggli wrote:

>> You cant display the command with a different name with PRCommandsWidget
>>    
>
> That's true, indeed. But you can with the links.
>
>  
>> Whats the | syntax mean? Who implements it?
>>    
>
> The links. It is a long existing and under-documented feature. It has
> recently seen new popularity with the the value-links:
>
>     http://www.piercms.com/doc/syntax#221565672
>
> Lukas
>  
Some documentation of the | command= feature could be added there. It
looks like that will do the job for me.

It might be an idea to re-architect commands to work on a #model, rather
than themselves. The majority of commands could return #model ^ self ,
but this would allow a command to work on an externally supplied model.
For example "Edit User Account", could be applied to some custom defined
user account model as described by magritte.

Is there a value link option to display structure settings?

For example, I have a PRPierFrameAdmin, which displays using the
original pier look, but it is themable, you can set the color and icon
of the header. Currently these settings are accesed through a special
component for the task.

Keith



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

Re: Command Link

keith1y
In reply to this post by keith1y

>>>    
>>>      
>> I don't see how this is different to the PRCommandsWidget, except that
>> it is only able to display a single command?
>>
>> Lukas
>>  
>>    
> You cant display the command with a different name with PRCommandsWidget
>
>  
And it has the option to display the link to the command as a button.

perhaps we could add | display=button for links in general.

Keith
>  



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

Re: Command Link

Lukas Renggli
In reply to this post by keith1y
> Is there a value link option to display structure settings?

Any description that has #displayName: set can be used as a display
setting. See the senders of #displayName: in PRStructure and
PRContext.

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: Command Link

Lukas Renggli
In reply to this post by keith1y
> And it has the option to display the link to the command as a button.
>
> perhaps we could add | display=button for links in general.

The parameter 'display' should be only used to define the display
string, but we could add another parameter to render as a button.
However I think this is rather problematic, because we would need to
put a form around it. I prefer to keep it as a link and define the
look using CSS, as this is normally done with all parts of Pier. Btw,
there is also the paraemter 'class' that allows you to set a specific
CSS class on the generated anchor tag.

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: Command Link

keith1y
Lukas Renggli wrote:

>> And it has the option to display the link to the command as a button.
>>
>> perhaps we could add | display=button for links in general.
>>    
>
> The parameter 'display' should be only used to define the display
> string, but we could add another parameter to render as a button.
> However I think this is rather problematic, because we would need to
> put a form around it. I prefer to keep it as a link and define the
> look using CSS, as this is normally done with all parts of Pier. Btw,
> there is also the paraemter 'class' that allows you to set a specific
> CSS class on the generated anchor tag.
>
> Lukas
>  
Ah! Cool, ok that will do nicely!

Another mini addition - I also define

MAPluggableAccessor>>#dummy

    ^ self read: [:model | ] write: [ :model :value | ]

Keith



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

Re: Command Link

keith1y
In reply to this post by keith1y
Keith Hodges wrote:

> Lukas Renggli wrote:
>  
>>> I remember seeing something in more recent pier's that would/may provide
>>> this functionality, but I cant remember what it was.
>>>    
>>>      
>> To logout put a link like this in your environment or into any other page:
>>
>>     *Logout>.|command=PULogout*
>>
>>    
When I put this into my header, it works well:

*My Accounts>.|command=PRMyAccountViewToEditCommand*

Until the command returns, it returns to the header context, not the
original one. Is there a workaround, or is it back to PRCommandWidget

Keith


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

Re: Command Link

Lukas Renggli
> When I put this into my header, it works well:
>
> *My Accounts>.|command=PRMyAccountViewToEditCommand*
>
> Until the command returns, it returns to the header context, not the
> original one. Is there a workaround, or is it back to PRCommandWidget

Yeah, that's a problem. The '.' refers to the containing structure of
the link. In most cases this is what you want, but not in this case.
I'll think about this one.

   http://code.google.com/p/pier/issues/detail?id=84

As a workaround use '.' instead of '/'.

Lukas

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

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