Re: Datatables warning when using

2013-10-22 Thread lidijaldo .
I figured out the difference:

when the if condition is met, the datatable isn't displayed.

The HTML source has the following libraries included:





When the if condition is NOT met, the datatable is displayed and ALSO the
tapestry libraries for datatables are included:




These 2 libraries are not included when the if condition is met and that's
why the javascript error occurs.

Is there a way to conditionally import the below javascript libraries?

@Import(stylesheet = {
"context:layout/datatables/css/jquery.dataTables.css",
"context:layout/datatables/css/dataTables.editor.css",
"context:layout/tabletools/css/TableTools.css"
},
library = {
"context:js/jquery-ui-1.8.19.custom.min.js",
"context:js/TableTools.js",
"context:js/dataTables.editor.min.js",
"context:js/dataTables.editor.commons.js"
})

I don't want these libraries to be included when I'm not displaying the
datatable.
The second option is to include Tapestry's jquery.dataTables.js and
dataTables.js even in case when I'm not displaying the datatable.

How can this be easily achieved?

Regards,
Lidija


On Wed, Oct 23, 2013 at 7:29 AM, lidijaldo .  wrote:

> Hi,
>
> I stumbled upon the next warning a couple of times already and I still
> don't understand why I'm getting it. In our tapestry application we're
> using jquery datatables and it works ok. But in some cases the application
> starts giving me a javascript alert: *"Warning: TableTools 2 requires
> DataTables 1.9.0 or newer - www.datatables.net/download"*.
>
> In the Javascript console I see the following errors:
>
> TypeError: f.fn.DataTable is undefined
>
> ...ools:{});TableTools._aInstances.push(a);return 
> a.dom.container},cFeature:"T",sFe...
>
> TableTools.js (line 76)
> TypeError: j is undefined
>
> ...(){},open:function(){},close:function(){}};f.models.field={className:"",name:nul...
>
> dataTamin.js (line 13)
> TypeError: $.fn.dataTable is undefined
>
> editor = new $.fn.dataTable.Editor(options);// editor
>
>
>
> This is my tml file:
>
>title="Modules"
>   xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd";
>   xmlns:h="tapestry-library:jquery"
>   xmlns:p="tapestry:parameter">
>
> 
> 
>
> 
> Choose module:
>  t:id="selectModule"
> t:model="moduleSelectModel"
> encoder="moduleSelectEncoder"
> t:value="module"
> />
> 
> 
>
> 
> 
>
> 
>  t:source="datasource"
>t:row="dataTableRow" t:rowIndex="index"
> t:model="sourcemodel"
>t:rowsPerPage="10" t:options="dataTableOptions"
> t:mode="true" />
> 
>
> 
>
>
> ... Notice the section 
> I'm trying not to display the datatable if there is no option selected via
> the dropdown menu.
> If I remove the , there is no warning and the datatable is always
> displayed. If there is no option selected in the dropdown menu, it is
> empty, which is fine.
>
> So why the javascript error? What does the  have to do with it?
>
> Thanks in advance,
> Lidija
>
>


Datatables warning when using

2013-10-22 Thread lidijaldo .
Hi,

I stumbled upon the next warning a couple of times already and I still
don't understand why I'm getting it. In our tapestry application we're
using jquery datatables and it works ok. But in some cases the application
starts giving me a javascript alert: *"Warning: TableTools 2 requires
DataTables 1.9.0 or newer - www.datatables.net/download"*.

In the Javascript console I see the following errors:

TypeError: f.fn.DataTable is undefined

...ools:{});TableTools._aInstances.push(a);return
a.dom.container},cFeature:"T",sFe...

TableTools.js (line 76)
TypeError: j is undefined

...(){},open:function(){},close:function(){}};f.models.field={className:"",name:nul...

dataTamin.js (line 13)
TypeError: $.fn.dataTable is undefined

editor = new $.fn.dataTable.Editor(options);// editor



This is my tml file:

http://tapestry.apache.org/schema/tapestry_5_3.xsd";
  xmlns:h="tapestry-library:jquery"
  xmlns:p="tapestry:parameter">





Choose module:














... Notice the section 
I'm trying not to display the datatable if there is no option selected via
the dropdown menu.
If I remove the , there is no warning and the datatable is always
displayed. If there is no option selected in the dropdown menu, it is
empty, which is fine.

So why the javascript error? What does the  have to do with it?

Thanks in advance,
Lidija


Show Form Button Only to Logged in Users

2013-10-22 Thread Net Dawg
Want to show form button only if the user is already logged in.  


Using HTTP BASIC Authentication provided by Tomcat host
http://docs.oracle.com/cd/E11035_01/wls100/security/thin_client.html#wp1033295


Does Tapestry have out-of-box solution for this?  

Re: tapestry-cometd && tynamo-security

2013-10-22 Thread Boris Horvat
I use both tynamo security and cometd and they work fine for me (no tricks
needed)


On Tue, Oct 22, 2013 at 9:29 PM, Lance Java wrote:

> Hi Jarda, I'm not familiar with tynamo security but I'm the author of
> tapestry-cometd. I think your analysis of the problem is spot on.
>
> Just because SecurityComponentRequestFilter is ordered before:* doesn't
> mean your filter can't be ordered before it. Just find out the name/id of
> the SecurityComponentRequestFilter and configure your filter before: it and
> tapestry will do the right thing.
>  On 22 Oct 2013 18:13, "Jarda Sedmy"  wrote:
>
> > Hi all,
> >
> > I'm trying to use tapestry-cometd with my testing project. It works
> > perfectly!
> > Then I added tynamo-security for page security and authentication and my
> > troubles started.
> >
> > For request which should be pushed to client application throws error:
> >
> > "org.apache.shiro.UnavailableSecurityManagerException: No SecurityManager
> > accessible to the calling code, either bound to the
> > org.apache.shiro.util.ThreadContext or as a vm static singleton. This is
> an
> > invalid application configuration."
> >
> > Caused by: org.apache.shiro.UnavailableSecurityManagerException: No
> > SecurityManager accessible to the calling code, either bound to the
> > org.apache.shiro.util.ThreadContext or as a vm static singleton.  This is
> > an invalid application configuration.
> > at
> > org.apache.shiro.SecurityUtils.getSecurityManager(SecurityUtils.java:123)
> > at org.apache.shiro.subject.Subject$Builder.(Subject.java:627)
> > at org.apache.shiro.SecurityUtils.getSubject(SecurityUtils.java:56)
> > at
> >
> >
> org.apache.shiro.aop.AnnotationHandler.getSubject(AnnotationHandler.java:57)
> > at
> >
> >
> org.apache.shiro.authz.aop.AuthenticatedAnnotationHandler.assertAuthorized(AuthenticatedAnnotationHandler.java:52)
> > at
> >
> >
> org.tynamo.shiro.extension.authz.aop.DefaultSecurityInterceptor.intercept(DefaultSecurityInterceptor.java:81)
> > at
> >
> >
> org.tynamo.security.SecurityComponentRequestFilter.checkInternal(SecurityComponentRequestFilter.java:67)
> > at
> >
> >
> org.tynamo.security.SecurityComponentRequestFilter.handleComponentEvent(SecurityComponentRequestFilter.java:40)
> > at $ComponentRequestFilter_b241dcde059.handleComponentEvent(Unknown
> Source)
> > at $ComponentRequestHandler_b241dcde05d.handleComponentEvent(Unknown
> > Source)
> > at
> >
> >
> org.lazan.t5.cometd.services.internal.PageGlobalsComponentRequestFilter.handleComponentEvent(PageGlobalsComponentRequestFilter.java:22)
> > at $ComponentRequestHandler_b241dcde05d.handleComponentEvent(Unknown
> > Source)
> > at $ComponentRequestHandler_b241dcde027.handleComponentEvent(Unknown
> > Source)
> > at
> >
> >
> org.lazan.t5.offline.services.internal.OfflineComponentRendererImpl$1.invoke(OfflineComponentRendererImpl.java:112)
> > at
> >
> >
> org.lazan.t5.offline.services.internal.OfflineComponentRendererImpl$1.invoke(OfflineComponentRendererImpl.java:100)
> > at
> >
> >
> org.apache.tapestry5.ioc.internal.services.ParallelExecutorImpl$1.call(ParallelExecutorImpl.java:58)
> > at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
> > at java.util.concurrent.FutureTask.run(FutureTask.java:138)
> > at
> >
> >
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> > at
> >
> >
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> >
> > I'm using:
> > tapestry 5.3.7
> > tapestry-security  0.5.1
> > tapestry-cometd 0.9.18
> >
> > I think that it is because offline renderer is working in a new thread
> > which is not initialized through
> > org.tynamo.security.services.impl.SecurityConfiguration. I've tried to
> > contribute my custom ComponentRequestFilter which would make the
> > initialization but I'm not able to contribute it before
> > SecurityComponentRequestFilter because SecurityComponentRequestFilter is
> > contributed with constraint "before:*".
> >
> > Do you have any idea how to solve it and how to use tapestry-cometd and
> > tynamo-security together? Any help or advice would be appreciate :-)
> >
> > Thanks,
> >
> > Jarda
> >
>



-- 
Sincerely
*Boris Horvat*


Re: tapestry-cometd && tynamo-security

2013-10-22 Thread Kalle Korhonen
I haven't tried using tapestry-security together with tapestry-cometd but
if initialization is the only problem, I think you could make the order
right by configuring your filter with constraint "before:SecurityFilter".
Let us know how it goes, it certainly a use case worth supporting.

Kalle


On Tue, Oct 22, 2013 at 10:13 AM, Jarda Sedmy  wrote:

> Hi all,
>
> I'm trying to use tapestry-cometd with my testing project. It works
> perfectly!
> Then I added tynamo-security for page security and authentication and my
> troubles started.
>
> For request which should be pushed to client application throws error:
>
> "org.apache.shiro.UnavailableSecurityManagerException: No SecurityManager
> accessible to the calling code, either bound to the
> org.apache.shiro.util.ThreadContext or as a vm static singleton. This is an
> invalid application configuration."
>
> Caused by: org.apache.shiro.UnavailableSecurityManagerException: No
> SecurityManager accessible to the calling code, either bound to the
> org.apache.shiro.util.ThreadContext or as a vm static singleton.  This is
> an invalid application configuration.
> at
> org.apache.shiro.SecurityUtils.getSecurityManager(SecurityUtils.java:123)
> at org.apache.shiro.subject.Subject$Builder.(Subject.java:627)
> at org.apache.shiro.SecurityUtils.getSubject(SecurityUtils.java:56)
> at
>
> org.apache.shiro.aop.AnnotationHandler.getSubject(AnnotationHandler.java:57)
> at
>
> org.apache.shiro.authz.aop.AuthenticatedAnnotationHandler.assertAuthorized(AuthenticatedAnnotationHandler.java:52)
> at
>
> org.tynamo.shiro.extension.authz.aop.DefaultSecurityInterceptor.intercept(DefaultSecurityInterceptor.java:81)
> at
>
> org.tynamo.security.SecurityComponentRequestFilter.checkInternal(SecurityComponentRequestFilter.java:67)
> at
>
> org.tynamo.security.SecurityComponentRequestFilter.handleComponentEvent(SecurityComponentRequestFilter.java:40)
> at $ComponentRequestFilter_b241dcde059.handleComponentEvent(Unknown Source)
> at $ComponentRequestHandler_b241dcde05d.handleComponentEvent(Unknown
> Source)
> at
>
> org.lazan.t5.cometd.services.internal.PageGlobalsComponentRequestFilter.handleComponentEvent(PageGlobalsComponentRequestFilter.java:22)
> at $ComponentRequestHandler_b241dcde05d.handleComponentEvent(Unknown
> Source)
> at $ComponentRequestHandler_b241dcde027.handleComponentEvent(Unknown
> Source)
> at
>
> org.lazan.t5.offline.services.internal.OfflineComponentRendererImpl$1.invoke(OfflineComponentRendererImpl.java:112)
> at
>
> org.lazan.t5.offline.services.internal.OfflineComponentRendererImpl$1.invoke(OfflineComponentRendererImpl.java:100)
> at
>
> org.apache.tapestry5.ioc.internal.services.ParallelExecutorImpl$1.call(ParallelExecutorImpl.java:58)
> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
> at java.util.concurrent.FutureTask.run(FutureTask.java:138)
> at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>
> I'm using:
> tapestry 5.3.7
> tapestry-security  0.5.1
> tapestry-cometd 0.9.18
>
> I think that it is because offline renderer is working in a new thread
> which is not initialized through
> org.tynamo.security.services.impl.SecurityConfiguration. I've tried to
> contribute my custom ComponentRequestFilter which would make the
> initialization but I'm not able to contribute it before
> SecurityComponentRequestFilter because SecurityComponentRequestFilter is
> contributed with constraint "before:*".
>
> Do you have any idea how to solve it and how to use tapestry-cometd and
> tynamo-security together? Any help or advice would be appreciate :-)
>
> Thanks,
>
> Jarda
>


Re: tapestry-cometd && tynamo-security

2013-10-22 Thread Lance Java
Hi Jarda, I'm not familiar with tynamo security but I'm the author of
tapestry-cometd. I think your analysis of the problem is spot on.

Just because SecurityComponentRequestFilter is ordered before:* doesn't
mean your filter can't be ordered before it. Just find out the name/id of
the SecurityComponentRequestFilter and configure your filter before: it and
tapestry will do the right thing.
 On 22 Oct 2013 18:13, "Jarda Sedmy"  wrote:

> Hi all,
>
> I'm trying to use tapestry-cometd with my testing project. It works
> perfectly!
> Then I added tynamo-security for page security and authentication and my
> troubles started.
>
> For request which should be pushed to client application throws error:
>
> "org.apache.shiro.UnavailableSecurityManagerException: No SecurityManager
> accessible to the calling code, either bound to the
> org.apache.shiro.util.ThreadContext or as a vm static singleton. This is an
> invalid application configuration."
>
> Caused by: org.apache.shiro.UnavailableSecurityManagerException: No
> SecurityManager accessible to the calling code, either bound to the
> org.apache.shiro.util.ThreadContext or as a vm static singleton.  This is
> an invalid application configuration.
> at
> org.apache.shiro.SecurityUtils.getSecurityManager(SecurityUtils.java:123)
> at org.apache.shiro.subject.Subject$Builder.(Subject.java:627)
> at org.apache.shiro.SecurityUtils.getSubject(SecurityUtils.java:56)
> at
>
> org.apache.shiro.aop.AnnotationHandler.getSubject(AnnotationHandler.java:57)
> at
>
> org.apache.shiro.authz.aop.AuthenticatedAnnotationHandler.assertAuthorized(AuthenticatedAnnotationHandler.java:52)
> at
>
> org.tynamo.shiro.extension.authz.aop.DefaultSecurityInterceptor.intercept(DefaultSecurityInterceptor.java:81)
> at
>
> org.tynamo.security.SecurityComponentRequestFilter.checkInternal(SecurityComponentRequestFilter.java:67)
> at
>
> org.tynamo.security.SecurityComponentRequestFilter.handleComponentEvent(SecurityComponentRequestFilter.java:40)
> at $ComponentRequestFilter_b241dcde059.handleComponentEvent(Unknown Source)
> at $ComponentRequestHandler_b241dcde05d.handleComponentEvent(Unknown
> Source)
> at
>
> org.lazan.t5.cometd.services.internal.PageGlobalsComponentRequestFilter.handleComponentEvent(PageGlobalsComponentRequestFilter.java:22)
> at $ComponentRequestHandler_b241dcde05d.handleComponentEvent(Unknown
> Source)
> at $ComponentRequestHandler_b241dcde027.handleComponentEvent(Unknown
> Source)
> at
>
> org.lazan.t5.offline.services.internal.OfflineComponentRendererImpl$1.invoke(OfflineComponentRendererImpl.java:112)
> at
>
> org.lazan.t5.offline.services.internal.OfflineComponentRendererImpl$1.invoke(OfflineComponentRendererImpl.java:100)
> at
>
> org.apache.tapestry5.ioc.internal.services.ParallelExecutorImpl$1.call(ParallelExecutorImpl.java:58)
> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
> at java.util.concurrent.FutureTask.run(FutureTask.java:138)
> at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>
> I'm using:
> tapestry 5.3.7
> tapestry-security  0.5.1
> tapestry-cometd 0.9.18
>
> I think that it is because offline renderer is working in a new thread
> which is not initialized through
> org.tynamo.security.services.impl.SecurityConfiguration. I've tried to
> contribute my custom ComponentRequestFilter which would make the
> initialization but I'm not able to contribute it before
> SecurityComponentRequestFilter because SecurityComponentRequestFilter is
> contributed with constraint "before:*".
>
> Do you have any idea how to solve it and how to use tapestry-cometd and
> tynamo-security together? Any help or advice would be appreciate :-)
>
> Thanks,
>
> Jarda
>


tapestry-cometd && tynamo-security

2013-10-22 Thread Jarda Sedmy
Hi all,

I'm trying to use tapestry-cometd with my testing project. It works
perfectly!
Then I added tynamo-security for page security and authentication and my
troubles started.

For request which should be pushed to client application throws error:

"org.apache.shiro.UnavailableSecurityManagerException: No SecurityManager
accessible to the calling code, either bound to the
org.apache.shiro.util.ThreadContext or as a vm static singleton. This is an
invalid application configuration."

Caused by: org.apache.shiro.UnavailableSecurityManagerException: No
SecurityManager accessible to the calling code, either bound to the
org.apache.shiro.util.ThreadContext or as a vm static singleton.  This is
an invalid application configuration.
at org.apache.shiro.SecurityUtils.getSecurityManager(SecurityUtils.java:123)
at org.apache.shiro.subject.Subject$Builder.(Subject.java:627)
at org.apache.shiro.SecurityUtils.getSubject(SecurityUtils.java:56)
at
org.apache.shiro.aop.AnnotationHandler.getSubject(AnnotationHandler.java:57)
at
org.apache.shiro.authz.aop.AuthenticatedAnnotationHandler.assertAuthorized(AuthenticatedAnnotationHandler.java:52)
at
org.tynamo.shiro.extension.authz.aop.DefaultSecurityInterceptor.intercept(DefaultSecurityInterceptor.java:81)
at
org.tynamo.security.SecurityComponentRequestFilter.checkInternal(SecurityComponentRequestFilter.java:67)
at
org.tynamo.security.SecurityComponentRequestFilter.handleComponentEvent(SecurityComponentRequestFilter.java:40)
at $ComponentRequestFilter_b241dcde059.handleComponentEvent(Unknown Source)
at $ComponentRequestHandler_b241dcde05d.handleComponentEvent(Unknown Source)
at
org.lazan.t5.cometd.services.internal.PageGlobalsComponentRequestFilter.handleComponentEvent(PageGlobalsComponentRequestFilter.java:22)
at $ComponentRequestHandler_b241dcde05d.handleComponentEvent(Unknown Source)
at $ComponentRequestHandler_b241dcde027.handleComponentEvent(Unknown Source)
at
org.lazan.t5.offline.services.internal.OfflineComponentRendererImpl$1.invoke(OfflineComponentRendererImpl.java:112)
at
org.lazan.t5.offline.services.internal.OfflineComponentRendererImpl$1.invoke(OfflineComponentRendererImpl.java:100)
at
org.apache.tapestry5.ioc.internal.services.ParallelExecutorImpl$1.call(ParallelExecutorImpl.java:58)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

I'm using:
tapestry 5.3.7
tapestry-security  0.5.1
tapestry-cometd 0.9.18

I think that it is because offline renderer is working in a new thread
which is not initialized through
org.tynamo.security.services.impl.SecurityConfiguration. I've tried to
contribute my custom ComponentRequestFilter which would make the
initialization but I'm not able to contribute it before
SecurityComponentRequestFilter because SecurityComponentRequestFilter is
contributed with constraint "before:*".

Do you have any idea how to solve it and how to use tapestry-cometd and
tynamo-security together? Any help or advice would be appreciate :-)

Thanks,

Jarda