You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Massimo Lusetti <ml...@gmail.com> on 2012/11/18 12:17:47 UTC

Chenillekit source code moved to Github

Hi All,
  our source code has moved to github.

As some of you have asked (more the one time, sorry for that) our source
code has been moved to github.
The new repo url is:
https://github.com/chenillekit/chenillekit

Git will help us keep it move forward and make it easier to accept patches
and pull requests.

We will hope to have a new fresh release for the upcoming 5.4 release, and
we need your help to make it happen.

Cheers
-- 
Massimo

Re: smart menu links

Posted by Ivan Khalopik <ik...@gmail.com>.
You can extract li items with content to separate component, e.g MenuItem
with parameter 'page'. Inside this component you can get this parameter
value, check whether this page is allowed for current user and if yes then
render li with inner PageLink component. If no then render nothing. So it
will look like this:
...
<ul>
<t:menuitem page="users">Manage Users</t:menuitem>
<t:menuitem page="organisations">Manage Organisations</t:menuitem>
...
</ul>

MenuItem.java:

@Property
@Parameter(required=true, allowNull=false,
defaultPrefix=BindingConstants.LITERAL)
private String page;

@BeforeRenderTemplate
boolean beforeRenderTemplate() {
  return isAllowed(page);
}

private boolean isAllowed(String page) {
   // some security logic
}

MenuItem.tml:

<li>
  <t:pagelink page="prop:page"><t:body></t:pagelink>
</li>


On Mon, Nov 19, 2012 at 8:46 PM, John <jo...@quivinco.com> wrote:

> I've got my superfish menu going, but I'd like menu items to not show if
> the user isn't permitted to use the page because of their role.
>
> The menu code is of the form
>
>    <ul t:type="jquery/superfish" t:clientId="menu1"  t:classe="ep-menu"
> t:supersubs="true" t:supersubsParams="supersubsParams">
>     <li class="current">
>      <a href="#">Users</a>
>      <ul>
>       <li>
>        <a t:type="pageLink" t:page="Users">Manage Users</a>
>       </li>
>       <li>
>        <a t:type="pageLink" t:page="Organsiations">Manage Organisations</a>
>       </li>...
>
> The page classes use the javax security @RolesAllowed annotation.
>
> I'd like to be able to make it so the <li> blocks are conditional upon the
> @RoleAnnotation state. Then when I change page permissions using the
> annotations the menu will adjust accordingly. How can this be achieved?
>
>  I'm thinking my Layout could have a Page type property or boolean
> property that I set according to logged in role matching what is in the
> Page classes annotation. This seems unduley clunky though!
>
>       <li t:type="if" t:test="Users">
>        <a t:type="pageLink" t:page="Users">Manage Users</a>
>       </li>
>
> John




-- 
BR
Ivan

smart menu links

Posted by John <jo...@quivinco.com>.
I've got my superfish menu going, but I'd like menu items to not show if the user isn't permitted to use the page because of their role.

The menu code is of the form

   <ul t:type="jquery/superfish" t:clientId="menu1"  t:classe="ep-menu" t:supersubs="true" t:supersubsParams="supersubsParams">
    <li class="current">
     <a href="#">Users</a>
     <ul>
      <li>
       <a t:type="pageLink" t:page="Users">Manage Users</a>
      </li>
      <li>
       <a t:type="pageLink" t:page="Organsiations">Manage Organisations</a>
      </li>...

The page classes use the javax security @RolesAllowed annotation.

I'd like to be able to make it so the <li> blocks are conditional upon the @RoleAnnotation state. Then when I change page permissions using the annotations the menu will adjust accordingly. How can this be achieved?

 I'm thinking my Layout could have a Page type property or boolean property that I set according to logged in role matching what is in the Page classes annotation. This seems unduley clunky though!

      <li t:type="if" t:test="Users">
       <a t:type="pageLink" t:page="Users">Manage Users</a>
      </li>

John

Re: Tapestry jpa transactions - JIRA TAP5-2029

Posted by John <jo...@quivinco.com>.
please see/feedback https://issues.apache.org/jira/browse/TAP5-2029
  ----- Original Message ----- 
  From: Thiago H de Paula Figueiredo 
  To: Tapestry users 
  Sent: Monday, November 19, 2012 5:48 PM
  Subject: Re: Tapestry jpa transactions


  On Mon, 19 Nov 2012 14:45:48 -0200, John <jo...@quivinco.com> wrote:

  > In the tapestry jpa docs we are instructed to provide annotations to  
  > manage transaction commitment into the DAO interface classes, e.g.
  >
  >   @CommitAfter
  >    @PersistenceContext(unitName = "DemoUnit")
  >    void add(User user);
  > I'm not liking this much as I don't want to explose details of the  
  > implementation in my service interfaces.

  I don't like that either.

  > Is there a workaround?

  I don't think so.

  > Can I just put the annotaions on my DAO Impl classes for example?

  Not now. Please post a JIRA for that. I'd love to see this Tapestry-IoC  
  problem fixed too.

  -- 
  Thiago H. de Paula Figueiredo

  ---------------------------------------------------------------------
  To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
  For additional commands, e-mail: users-help@tapestry.apache.org

Re: Tapestry jpa transactions

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Mon, 19 Nov 2012 14:45:48 -0200, John <jo...@quivinco.com> wrote:

> In the tapestry jpa docs we are instructed to provide annotations to  
> manage transaction commitment into the DAO interface classes, e.g.
>
>   @CommitAfter
>    @PersistenceContext(unitName = "DemoUnit")
>    void add(User user);
> I'm not liking this much as I don't want to explose details of the  
> implementation in my service interfaces.

I don't like that either.

> Is there a workaround?

I don't think so.

> Can I just put the annotaions on my DAO Impl classes for example?

Not now. Please post a JIRA for that. I'd love to see this Tapestry-IoC  
problem fixed too.

-- 
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry jpa transactions

Posted by Lenny Primak <lp...@hope.nyc.ny.us>.
Sounds like you should be using the full JEE stack. We use it along with Shiro security
And we have custom menu components ( was very easy to create ) that do what you are trying to do. 

On Nov 19, 2012, at 11:45 AM, "John" <jo...@quivinco.com> wrote:

> In the tapestry jpa docs we are instructed to provide annotations to manage transaction commitment into the DAO interface classes, e.g.
> 
>  @CommitAfter
>   @PersistenceContext(unitName = "DemoUnit")
>   void add(User user);
> I'm not liking this much as I don't want to explose details of the implementation in my service interfaces. Is there a workaround? Can I just put the annotaions on my DAO Impl classes for example?
> 
> John

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Tapestry jpa transactions

Posted by John <jo...@quivinco.com>.
In the tapestry jpa docs we are instructed to provide annotations to manage transaction commitment into the DAO interface classes, e.g.

  @CommitAfter
   @PersistenceContext(unitName = "DemoUnit")
   void add(User user);
I'm not liking this much as I don't want to explose details of the implementation in my service interfaces. Is there a workaround? Can I just put the annotaions on my DAO Impl classes for example?

John

Re: superfish comp

Posted by John <jo...@quivinco.com>.
Now that makes sense, thanks Bob!
  ----- Original Message ----- 
  From: Bob Harner 
  To: Tapestry users 
  Sent: Sunday, November 18, 2012 1:31 PM
  Subject: Re: superfish comp


  Actually, you're right, looking at the source (
  https://github.com/got5/tapestry5-jquery/blob/master/src/main/java/org/got5/tapestry5/jquery/components/Superfish.java),
  it *is* a boolean. Docs may be out of date.

  There's a Google Group --
  https://groups.google.com/forum/#!forum/tapestry5-jquery -- that might be
  the best avenue for an authoritative answer.


  On Sun, Nov 18, 2012 at 8:01 AM, John <jo...@quivinco.com> wrote:

  > That's the component I'm talking about yes. I understand the
  > supersubsParams that takes the config but not the supersubs  paramter
  > itself. To me it should be a boolean?
  >
  > John
  >   ----- Original Message -----
  >   From: Bob Harner
  >   To: Tapestry users
  >   Sent: Sunday, November 18, 2012 12:14 PM
  >   Subject: Re: superfish comp
  >
  >
  >   I guess you're referring to the supersubs parameter of the superfish
  >   component in the Tapestry5-jquery module, right?
  >
  >   Just a wild guess (haven't used it), but upon looking at the "with
  >   Supersubs" tab at http://users.tpg.com.au/j_birch/plugins/superfish/ I
  >   would guess the supersubs parameter is how you pass the supersubs
  >   configuration settings. So it would be a JSON string containing something
  >   like this:
  >
  >   {
  >       minWidth:    12, // minimum width of sub-menus in em units
  >       maxWidth:    27, // maximum width of sub-menus in em units
  >       extraWidth:  1   // extra width can ensure lines don't sometimes
  > turn or
  >                        // due to slight rounding differences and
  > font-family
  >   }
  >
  >
  >
  >   On Sun, Nov 18, 2012 at 6:29 AM, John <jo...@quivinco.com> wrote:
  >
  >   > Has anyone got an example of the JSONObject provided by the supersubs
  > prop
  >   > for the superfish component please? I expected this to be a Boolean
  >   > literal, not a JSONObject property?
  >   >
  >   > John
  >

Re: superfish comp

Posted by Bob Harner <bo...@gmail.com>.
Actually, you're right, looking at the source (
https://github.com/got5/tapestry5-jquery/blob/master/src/main/java/org/got5/tapestry5/jquery/components/Superfish.java),
it *is* a boolean. Docs may be out of date.

There's a Google Group --
https://groups.google.com/forum/#!forum/tapestry5-jquery -- that might be
the best avenue for an authoritative answer.


On Sun, Nov 18, 2012 at 8:01 AM, John <jo...@quivinco.com> wrote:

> That's the component I'm talking about yes. I understand the
> supersubsParams that takes the config but not the supersubs  paramter
> itself. To me it should be a boolean?
>
> John
>   ----- Original Message -----
>   From: Bob Harner
>   To: Tapestry users
>   Sent: Sunday, November 18, 2012 12:14 PM
>   Subject: Re: superfish comp
>
>
>   I guess you're referring to the supersubs parameter of the superfish
>   component in the Tapestry5-jquery module, right?
>
>   Just a wild guess (haven't used it), but upon looking at the "with
>   Supersubs" tab at http://users.tpg.com.au/j_birch/plugins/superfish/ I
>   would guess the supersubs parameter is how you pass the supersubs
>   configuration settings. So it would be a JSON string containing something
>   like this:
>
>   {
>       minWidth:    12, // minimum width of sub-menus in em units
>       maxWidth:    27, // maximum width of sub-menus in em units
>       extraWidth:  1   // extra width can ensure lines don't sometimes
> turn or
>                        // due to slight rounding differences and
> font-family
>   }
>
>
>
>   On Sun, Nov 18, 2012 at 6:29 AM, John <jo...@quivinco.com> wrote:
>
>   > Has anyone got an example of the JSONObject provided by the supersubs
> prop
>   > for the superfish component please? I expected this to be a Boolean
>   > literal, not a JSONObject property?
>   >
>   > John
>

Re: superfish comp

Posted by John <jo...@quivinco.com>.
That's the component I'm talking about yes. I understand the supersubsParams that takes the config but not the supersubs  paramter itself. To me it should be a boolean?

John
  ----- Original Message ----- 
  From: Bob Harner 
  To: Tapestry users 
  Sent: Sunday, November 18, 2012 12:14 PM
  Subject: Re: superfish comp


  I guess you're referring to the supersubs parameter of the superfish
  component in the Tapestry5-jquery module, right?

  Just a wild guess (haven't used it), but upon looking at the "with
  Supersubs" tab at http://users.tpg.com.au/j_birch/plugins/superfish/ I
  would guess the supersubs parameter is how you pass the supersubs
  configuration settings. So it would be a JSON string containing something
  like this:

  {
      minWidth:    12, // minimum width of sub-menus in em units
      maxWidth:    27, // maximum width of sub-menus in em units
      extraWidth:  1   // extra width can ensure lines don't sometimes turn or
                       // due to slight rounding differences and font-family
  }



  On Sun, Nov 18, 2012 at 6:29 AM, John <jo...@quivinco.com> wrote:

  > Has anyone got an example of the JSONObject provided by the supersubs prop
  > for the superfish component please? I expected this to be a Boolean
  > literal, not a JSONObject property?
  >
  > John

Re: superfish comp

Posted by Bob Harner <bo...@gmail.com>.
I guess you're referring to the supersubs parameter of the superfish
component in the Tapestry5-jquery module, right?

Just a wild guess (haven't used it), but upon looking at the "with
Supersubs" tab at http://users.tpg.com.au/j_birch/plugins/superfish/ I
would guess the supersubs parameter is how you pass the supersubs
configuration settings. So it would be a JSON string containing something
like this:

{
    minWidth:    12, // minimum width of sub-menus in em units
    maxWidth:    27, // maximum width of sub-menus in em units
    extraWidth:  1   // extra width can ensure lines don't sometimes turn or
                     // due to slight rounding differences and font-family
}



On Sun, Nov 18, 2012 at 6:29 AM, John <jo...@quivinco.com> wrote:

> Has anyone got an example of the JSONObject provided by the supersubs prop
> for the superfish component please? I expected this to be a Boolean
> literal, not a JSONObject property?
>
> John

superfish comp

Posted by John <jo...@quivinco.com>.
Has anyone got an example of the JSONObject provided by the supersubs prop for the superfish component please? I expected this to be a Boolean literal, not a JSONObject property?

John

Re: Chenillekit source code moved to Github

Posted by Kalle Korhonen <ka...@gmail.com>.
On Sun, Nov 18, 2012 at 3:51 AM, Massimo Lusetti <ml...@gmail.com> wrote:

> On Sun, Nov 18, 2012 at 12:39 PM, Bob Harner <bo...@gmail.com> wrote:
> Massimo,
> > Is there (or will there be) a demo site to replace the previous one?
> > Without an online demo, or at least screen shots, most users are unlikely
> > to consider a component library.
> >I fully understand your  point.
> My plan are to put it back on heroku but now it's still missing
>

Cloudbees also has a free tier for small apps (
http://www.cloudbees.com/platform/pricing/runcloud-multi.cb).

Kalle

Re: Chenillekit source code moved to Github

Posted by Massimo Lusetti <ml...@gmail.com>.
On Sun, Nov 18, 2012 at 12:39 PM, Bob Harner <bo...@gmail.com> wrote:

Massimo,
>
> Is there (or will there be) a demo site to replace the previous one?
> Without an online demo, or at least screen shots, most users are unlikely
> to consider a component library.
>
>
I fully understand your  point.

My plan are to put it back on heroku but now it's still missing

-- 
Massimo

Re: Chenillekit source code moved to Github

Posted by Bob Harner <bo...@gmail.com>.
Massimo,

Is there (or will there be) a demo site to replace the previous one?
Without an online demo, or at least screen shots, most users are unlikely
to consider a component library.


On Sun, Nov 18, 2012 at 6:17 AM, Massimo Lusetti <ml...@gmail.com> wrote:

> Hi All,
>   our source code has moved to github.
>
> As some of you have asked (more the one time, sorry for that) our source
> code has been moved to github.
> The new repo url is:
> https://github.com/chenillekit/chenillekit
>
> Git will help us keep it move forward and make it easier to accept patches
> and pull requests.
>
> We will hope to have a new fresh release for the upcoming 5.4 release, and
> we need your help to make it happen.
>
> Cheers
> --
> Massimo
>