Re: Canceling Periodic Job

2016-06-17 Thread abangkis
Hi Barry and Dmitry, thanks for the link. I'll look in to it.

On Fri, Jun 17, 2016 at 7:11 PM, Dmitry Gusev 
wrote:

> We use quartz for background jobs:
>
>
> https://github.com/anjlab/anjlab-tapestry-commons/tree/master/anjlab-tapestry-quartz
>
> There you have fine control on both scheduled and currently executing jobs,
> i.e. scheduler.getCurrenlyExecutingJobs() and then
> scheduler.interrupt(jobKey)
>
>
> On Fri, Jun 17, 2016 at 2:54 PM, Barry Books  wrote:
>
> > see
> >
> >
> >
> https://github.com/trsvax/Jacquard/blob/master/src/main/java/com/trsvax/jacquard/services/JobRunnerTapestry.java
> >
> >
> >
> https://github.com/trsvax/Jacquard/blob/master/src/main/java/com/trsvax/jacquard/pages/job/JobIndex.java
> >
> > Jobs are started in the JobRunnerTapestry service and the set of jobs is
> > made available via getJobs(). I have not implemented cancel but I think
> all
> > that's needed would be to call the cancel method on the job
> >
> > On Friday, June 17, 2016, abangkis  wrote:
> >
> > > Hai, I'm creating a periodic job on startup from this link.
> > >
> > >
> > >
> >
> http://blog.tapestry5.de/index.php/2011/09/18/scheduling-jobs-with-tapestry/
> > >
> > > So i wonder how can i stop the job using a button? Since the periodic
> job
> > > is created on startup so the returned PeriodicJob is inaccessible from
> a
> > > page?
> > >
> > > --
> > > http://www.mreunionlabs.net/ 
> > > twitter : @mreunionlabs @abangkis
> > > page : https://plus.google.com/104168782385184990771
> > >
> >
>
>
>
> --
> Dmitry Gusev
>
> AnjLab Team
> http://anjlab.com
>



-- 
http://www.mreunionlabs.net/ 
twitter : @mreunionlabs @abangkis
page : https://plus.google.com/104168782385184990771


Re: Page must be specified before initializing for partial page render.

2016-06-17 Thread Qbyte Consulting
updating to tapestry5-jquery to 3.4.2 version seems to resolve this issue :)

On Fri, Jun 17, 2016 at 11:57 AM, Qbyte Consulting <
qbyteconsult...@gmail.com> wrote:

> Thanks Cezary,
>
> What I found is that making COMBINE_SCRIPTS=false resolves the issue.
>
> configuration.add(JQuerySymbolConstants.SUPPRESS_PROTOTYPE,
> "false");
> configuration.add(JQuerySymbolConstants.JQUERY_ALIAS, "$J");
> configuration.add(SymbolConstants.COMBINE_SCRIPTS, "false");
>
> This will be an acceptable work-around for now, but not ideal.
>
>
>
> On Thu, Jun 16, 2016 at 6:54 PM, Cezary Biernacki 
> wrote:
>
>> Hi John,
>> it is hard to answer your question without any source code or details
>> about
>> your application. My guess your application is using tapestry-jquery and
>> something is incorrectly initialised in production-mode. I would check if
>> you do not encounter problems with your browser caching some old version
>> of
>> JavaScript libraries (IIRC, in Tapestry 5.3 you need to change application
>> version every time asset changes - I recommend ensuring that your build
>> process does that for you). Probably because of failure on JavaScript
>> side,
>> your link clicks with JS, are not actually rewritten to be AJAX links, but
>> normal links, and your event handlers do not check if requests are AJAX
>> (us
>> Request.isXHR method to check that), and blindly try to prepare AJAX
>> rendering, which causes this exception.
>>
>> My recommendations:
>>
>>- See if your links are actually sent as AJAX requests from the
>> browser.
>>
>>- Find and fix the cause of problems reported for JavaScript in the
>>browser. First ensure that your browser does not cached some incorrect
>>version of assets. If it does, ensure that you change application
>> version
>>setting when assets changes. Preferably make your build process to set
>>application version in Tapestry in some automatic way.
>>
>>- In Java, event handlers should check if request is AJAX or not, and
>>use appropriate processing paths for preparing output. Even if you fix
>> your
>>JavaScript problems, your application will be more user friendly and
>> robust
>>by not assuming that these events are always sent via AJAX (e.g. user
>> can
>>have JavaScript disabled, or middle-click on the link, etc.).
>>
>>
>> As I said before, I can only guess what is wrong. If my recommendation
>> would not help, try providing more details and narrow down the problem.
>>
>> Best regards,
>> Cezary
>>
>>
>>
>> On Thu, Jun 16, 2016 at 5:14 PM, Qbyte Consulting <
>> qbyteconsult...@gmail.com
>> > wrote:
>>
>> > Hi,
>> >
>> > My T5.3.6 application works fine with production mode=false. However
>> when
>> > production-mode = true then some linkclicks with JS return:
>> >
>> > An unexpected application exception has occurred.
>> >
>> > Page must be specified before initializing for partial page render.
>> >
>> > This is on the browser console:
>> >
>> > core.js:6947 Uncaught TypeError: element.attachEvent is not a function
>> > SuperfishStack.js:383 Uncaught TypeError: Cannot read property
>> > 'extendInitializers' of undefined
>> > dialog.js:3 Uncaught TypeError: Cannot read property
>> 'extendInitializers'
>> > of undefined
>> > bind.js:3 Uncaught TypeError: Cannot read property 'extendInitializers'
>> of
>> > undefined
>> > jGrowl_init.js:2 Uncaught TypeError: Cannot read property
>> > 'extendInitializers' of undefined
>> > manageusers:17 Uncaught TypeError: Cannot set property 'JQUERY' of
>> > undefined
>> > core.js:7028 Uncaught TypeError: element.dispatchEvent is not a function
>> >
>> > Why is that happening?
>> >
>> > regards,
>> > John
>> >
>> >
>> >
>> > [ERROR] ioc.Registry Page must be specified before initializing for
>> partial
>> > page
>> >  render.
>> > [ERROR] ioc.Registry Operations trace:
>> > [ERROR] ioc.Registry [ 1] Triggering event 'alphabetfilter' on
>> > ManageUsers:users
>> > component
>> > [ERROR] TapestryModule.RequestExceptionHandler Processing of request
>> failed
>> > with
>> >  uncaught exception: Page must be specified before initializing for
>> partial
>> > page
>> >  render.
>> > org.apache.tapestry5.ioc.internal.OperationException: Page must be
>> > specified bef
>> > ore initializing for partial page render. [at
>> > classpath:xx/audit/manager/pag
>> > es/ManageUsers.tml, line 38]
>> > at
>> > org.apache.tapestry5.ioc.internal.OperationTrackerImpl.logAndRethrow(
>> > OperationTrackerImpl.java:121)
>> > at
>> > org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(Operati
>> > onTrackerImpl.java:88)
>> > at
>> > org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(Pe
>> > rThreadOperationTracker.java:87)
>> > at
>> > org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.ja
>> > va:1124)
>> > at
>> > org.apache.tapestry5.internal.structure.ComponentPageElementResources
>> > 

Re: Canceling Periodic Job

2016-06-17 Thread Dmitry Gusev
We use quartz for background jobs:

https://github.com/anjlab/anjlab-tapestry-commons/tree/master/anjlab-tapestry-quartz

There you have fine control on both scheduled and currently executing jobs,
i.e. scheduler.getCurrenlyExecutingJobs() and then
scheduler.interrupt(jobKey)


On Fri, Jun 17, 2016 at 2:54 PM, Barry Books  wrote:

> see
>
>
> https://github.com/trsvax/Jacquard/blob/master/src/main/java/com/trsvax/jacquard/services/JobRunnerTapestry.java
>
>
> https://github.com/trsvax/Jacquard/blob/master/src/main/java/com/trsvax/jacquard/pages/job/JobIndex.java
>
> Jobs are started in the JobRunnerTapestry service and the set of jobs is
> made available via getJobs(). I have not implemented cancel but I think all
> that's needed would be to call the cancel method on the job
>
> On Friday, June 17, 2016, abangkis  wrote:
>
> > Hai, I'm creating a periodic job on startup from this link.
> >
> >
> >
> http://blog.tapestry5.de/index.php/2011/09/18/scheduling-jobs-with-tapestry/
> >
> > So i wonder how can i stop the job using a button? Since the periodic job
> > is created on startup so the returned PeriodicJob is inaccessible from a
> > page?
> >
> > --
> > http://www.mreunionlabs.net/ 
> > twitter : @mreunionlabs @abangkis
> > page : https://plus.google.com/104168782385184990771
> >
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Canceling Periodic Job

2016-06-17 Thread Barry Books
see

https://github.com/trsvax/Jacquard/blob/master/src/main/java/com/trsvax/jacquard/services/JobRunnerTapestry.java

https://github.com/trsvax/Jacquard/blob/master/src/main/java/com/trsvax/jacquard/pages/job/JobIndex.java

Jobs are started in the JobRunnerTapestry service and the set of jobs is
made available via getJobs(). I have not implemented cancel but I think all
that's needed would be to call the cancel method on the job

On Friday, June 17, 2016, abangkis  wrote:

> Hai, I'm creating a periodic job on startup from this link.
>
>
> http://blog.tapestry5.de/index.php/2011/09/18/scheduling-jobs-with-tapestry/
>
> So i wonder how can i stop the job using a button? Since the periodic job
> is created on startup so the returned PeriodicJob is inaccessible from a
> page?
>
> --
> http://www.mreunionlabs.net/ 
> twitter : @mreunionlabs @abangkis
> page : https://plus.google.com/104168782385184990771
>


Re: Page must be specified before initializing for partial page render.

2016-06-17 Thread Qbyte Consulting
Thanks Cezary,

What I found is that making COMBINE_SCRIPTS=false resolves the issue.

configuration.add(JQuerySymbolConstants.SUPPRESS_PROTOTYPE,
"false");
configuration.add(JQuerySymbolConstants.JQUERY_ALIAS, "$J");
configuration.add(SymbolConstants.COMBINE_SCRIPTS, "false");

This will be an acceptable work-around for now, but not ideal.



On Thu, Jun 16, 2016 at 6:54 PM, Cezary Biernacki 
wrote:

> Hi John,
> it is hard to answer your question without any source code or details about
> your application. My guess your application is using tapestry-jquery and
> something is incorrectly initialised in production-mode. I would check if
> you do not encounter problems with your browser caching some old version of
> JavaScript libraries (IIRC, in Tapestry 5.3 you need to change application
> version every time asset changes - I recommend ensuring that your build
> process does that for you). Probably because of failure on JavaScript side,
> your link clicks with JS, are not actually rewritten to be AJAX links, but
> normal links, and your event handlers do not check if requests are AJAX (us
> Request.isXHR method to check that), and blindly try to prepare AJAX
> rendering, which causes this exception.
>
> My recommendations:
>
>- See if your links are actually sent as AJAX requests from the browser.
>
>- Find and fix the cause of problems reported for JavaScript in the
>browser. First ensure that your browser does not cached some incorrect
>version of assets. If it does, ensure that you change application
> version
>setting when assets changes. Preferably make your build process to set
>application version in Tapestry in some automatic way.
>
>- In Java, event handlers should check if request is AJAX or not, and
>use appropriate processing paths for preparing output. Even if you fix
> your
>JavaScript problems, your application will be more user friendly and
> robust
>by not assuming that these events are always sent via AJAX (e.g. user
> can
>have JavaScript disabled, or middle-click on the link, etc.).
>
>
> As I said before, I can only guess what is wrong. If my recommendation
> would not help, try providing more details and narrow down the problem.
>
> Best regards,
> Cezary
>
>
>
> On Thu, Jun 16, 2016 at 5:14 PM, Qbyte Consulting <
> qbyteconsult...@gmail.com
> > wrote:
>
> > Hi,
> >
> > My T5.3.6 application works fine with production mode=false. However when
> > production-mode = true then some linkclicks with JS return:
> >
> > An unexpected application exception has occurred.
> >
> > Page must be specified before initializing for partial page render.
> >
> > This is on the browser console:
> >
> > core.js:6947 Uncaught TypeError: element.attachEvent is not a function
> > SuperfishStack.js:383 Uncaught TypeError: Cannot read property
> > 'extendInitializers' of undefined
> > dialog.js:3 Uncaught TypeError: Cannot read property 'extendInitializers'
> > of undefined
> > bind.js:3 Uncaught TypeError: Cannot read property 'extendInitializers'
> of
> > undefined
> > jGrowl_init.js:2 Uncaught TypeError: Cannot read property
> > 'extendInitializers' of undefined
> > manageusers:17 Uncaught TypeError: Cannot set property 'JQUERY' of
> > undefined
> > core.js:7028 Uncaught TypeError: element.dispatchEvent is not a function
> >
> > Why is that happening?
> >
> > regards,
> > John
> >
> >
> >
> > [ERROR] ioc.Registry Page must be specified before initializing for
> partial
> > page
> >  render.
> > [ERROR] ioc.Registry Operations trace:
> > [ERROR] ioc.Registry [ 1] Triggering event 'alphabetfilter' on
> > ManageUsers:users
> > component
> > [ERROR] TapestryModule.RequestExceptionHandler Processing of request
> failed
> > with
> >  uncaught exception: Page must be specified before initializing for
> partial
> > page
> >  render.
> > org.apache.tapestry5.ioc.internal.OperationException: Page must be
> > specified bef
> > ore initializing for partial page render. [at
> > classpath:xx/audit/manager/pag
> > es/ManageUsers.tml, line 38]
> > at
> > org.apache.tapestry5.ioc.internal.OperationTrackerImpl.logAndRethrow(
> > OperationTrackerImpl.java:121)
> > at
> > org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(Operati
> > onTrackerImpl.java:88)
> > at
> > org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(Pe
> > rThreadOperationTracker.java:87)
> > at
> > org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.ja
> > va:1124)
> > at
> > org.apache.tapestry5.internal.structure.ComponentPageElementResources
> > Impl.invoke(ComponentPageElementResourcesImpl.java:146)
> > at
> > org.apache.tapestry5.internal.structure.ComponentPageElementImpl.trig
> > gerContextEvent(ComponentPageElementImpl.java:1053)
> > at
> > org.apache.tapestry5.internal.services.ComponentEventRequestHandlerIm
> > 

Re: Webhook example

2016-06-17 Thread abangkis
Hi geoff, yes I believe it is. So i guess I can just create a regular
tapestry rest-full page that can handle POST/GET request. Thanks.

I don't know why I kept thinking about websocket instead of regular page
for webhook, there's too much to read :D

Thanks again geoff

On Fri, Jun 17, 2016 at 3:10 PM, JumpStart <
geoff.callender.jumpst...@gmail.com> wrote:

> Do you mean where Tapestry provides webhooks to be called by an external
> party (perhaps a bot)? If yes, can it be RESTful?
>
> > On 17 Jun 2016, at 10:09 AM, abangkis  wrote:
> >
> > Hi, does anyone have an example of creating a webhook in Tapestry?
> >
> > I'm trying to create a telegram bot with tapestry backend.
> >
> > Thanks
> >
> > --
> > http://www.mreunionlabs.net/ 
> > twitter : @mreunionlabs @abangkis
> > page : https://plus.google.com/104168782385184990771
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
http://www.mreunionlabs.net/ 
twitter : @mreunionlabs @abangkis
page : https://plus.google.com/104168782385184990771


Re: Webhook example

2016-06-17 Thread JumpStart
Do you mean where Tapestry provides webhooks to be called by an external party 
(perhaps a bot)? If yes, can it be RESTful?

> On 17 Jun 2016, at 10:09 AM, abangkis  wrote:
> 
> Hi, does anyone have an example of creating a webhook in Tapestry?
> 
> I'm trying to create a telegram bot with tapestry backend.
> 
> Thanks
> 
> -- 
> http://www.mreunionlabs.net/ 
> twitter : @mreunionlabs @abangkis
> page : https://plus.google.com/104168782385184990771


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



Canceling Periodic Job

2016-06-17 Thread abangkis
Hai, I'm creating a periodic job on startup from this link.

http://blog.tapestry5.de/index.php/2011/09/18/scheduling-jobs-with-tapestry/

So i wonder how can i stop the job using a button? Since the periodic job
is created on startup so the returned PeriodicJob is inaccessible from a
page?

-- 
http://www.mreunionlabs.net/ 
twitter : @mreunionlabs @abangkis
page : https://plus.google.com/104168782385184990771