Hi,
I added a scheduled job to my Tapestry application, where I want to
daily check if there are new tickets and send a mail to people assigned
to these tickets.
So I've added it in AppModule as following:
@Startup
public static void scheduleJobs(
PeriodicExecutor executor,
final MailService mailService) {
executor.addJob(
new CronSchedule("* 8 * * * ?"),
"Cleanup Job",
new Runnable() {
@Override
public void run() {
mailService.mailNewTickets(now().minusHours(24));
}
});
}
This works perfect. Only I want to add links to the ticket detail page
in these mails.
So I injected PageRenderLinkSource in my MailService class to create
links with context:
pageRenderLinkSource.createPageRenderLinkWithContext(TicketDetails.class,
ticket.getId()).toAbsoluteURI(true);
But this is not working as the scheduled job stops there. I don't see
the exception thrown, probably because it's in another thread?
Maybe this is expected behaviour (Request not available?), but I don't
know how to create the links otherwise besides using a hard coded string
and concatenating the context.
Nathan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org