html+js+css resources in a discovered module

2013-09-23 Thread Daniel Jue
Hi, I was reading over this older blog link http://blog.tapestry5.de/index.php/2010/01/19/tapestry-ioc-modularization-of-web-applications-without-osgi/ now that I have to architect our app to work for other customers. We want to keep the core parts together and refactor out the customer specific

Re: [T5.4] BeanEditor and Friends don't look as good as in Tap 5.3

2013-09-23 Thread Barry Books
I'm certain you can do it with a mixin but you might be able to do this with the css display:table and friends. If you can get the right css you could make the form a table with the form-group a tr and the label and input td's On Mon, Sep 23, 2013 at 7:51 PM, Lenny Primak wrote: > Is there a sol

Re: [T5.4] BeanEditor and Friends don't look as good as in Tap 5.3

2013-09-23 Thread Lenny Primak
Is there a solution for this that's easier than writing a mixin? Seems like the mixin solution is an overkill. I remember in the past there was a discussion of CSS styles being too specific by default. Any way just to make it a simple CSS rule somewhere? > For BeanEditor you would have to do thi

Re: Testing Tapestry

2013-09-23 Thread Thiago H de Paula Figueiredo
On Mon, 23 Sep 2013 17:07:54 -0300, Martin Kersten wrote: Yeah thats what I was thinking about exactly. This way I can get rid of the pesti constructor injection. Pesti? What is that? If you were talking Brazilian Portuguese, I'd knew. :D Does anyone knows if the autobuild / build proces

RE: Encoding a template as a valid JSON String

2013-09-23 Thread Ben Titmarsh
This looks like an ideal solution. Thanks! > Date: Mon, 23 Sep 2013 09:54:34 +0100 > Subject: Re: Encoding a template as a valid JSON String > From: lance.j...@googlemail.com > To: users@tapestry.apache.org > > Since colorbox supports 'inline' option you can solve this problem without > ever nee

Re: Testing Tapestry

2013-09-23 Thread Martin Kersten
Well I knew that with the constructor it is exactly what the internal method createMethodInvocationPlan is doing. The sad thing is I have to recreate it since its internal. This ignore Inject works for me since I use autobild method of the regitry. PS: Everyone is aware of the @Autobuild method?

Re: Testing Tapestry

2013-09-23 Thread Daniel Jue
You can still use a constructor/constructor injection when registering your service in your module, if you want. (In fact the auto binding looks for the constructor with the most parameters, if none are marked with @Inject.) Or, you can use Field Injection. Not sure if you can use both, probably

Re: How to best construct and express this service?

2013-09-23 Thread Martin Kersten
Hi Dmitry, Thanks for the info, i will check it out. My service is just for mail delivery. It use a simple timestamp for task aquire and timeout. Exceptions are stored in the task entity and that it. The task itself Speed the Name oft the message template and a json model to process it. In that

Re: Testing Tapestry

2013-09-23 Thread Martin Kersten
Thanks daniel. I will check the testify stuff in a real example. 2013/9/23 Daniel Jue > I don't have spare minutes at the moment, I just want to drop these links > for you to look at (if you haven't seen them already). Hope it helps. > > http://blog.tapestry5.de/index.php/2010/11/16/improved-t

Re: Testing Tapestry

2013-09-23 Thread Daniel Jue
I don't have spare minutes at the moment, I just want to drop these links for you to look at (if you haven't seen them already). Hope it helps. http://blog.tapestry5.de/index.php/2010/11/16/improved-testing-facilities/ and then this one http://blog.tapestry5.de/index.php/2010/11/18/find-your-el

Re: MethodInvocationPlan?

2013-09-23 Thread Thiago H de Paula Figueiredo
I ended up answering your original message before reading this message, which explains better what you want to do. It seems to me the only thing you've missing is how to look up a service dynamically: you can inject ObjectLocator to do that. On Mon, 23 Sep 2013 11:55:30 -0300, Martin Kerste

Re: Testing Tapestry

2013-09-23 Thread Martin Kersten
Yeah thats what I was thinking about exactly. This way I can get rid of the pesti constructor injection. Does anyone knows if the autobuild / build process fails if a property annotated @inject could not be injected? Kind of should be but I am quite not sure... . 2013/9/23 Daniel Jue > You'll

Re: MethodInvocationPlan?

2013-09-23 Thread Thiago H de Paula Figueiredo
On Mon, 23 Sep 2013 07:35:07 -0300, Martin Kersten wrote: Hi there, Hi! myMethod(@Inject Session session, @Inject SomeOtherService service, String myParameter); IocMethodInvoker.invoke(object, "myMethod", "string parameter"); -> So the ioc looks for the longest method that can resolve

Re: MethodInvocationPlan?

2013-09-23 Thread Martin Kersten
I am currently using the registry and reflection right now. I just wondered why the internal method createMethodInvocationPlan is not exposed. I just ended up to process invocation by iterating to all methods with the certain name or annotation and look what objects i can inject and also use the pr

Re: Testing Tapestry

2013-09-23 Thread Daniel Jue
You'll probably find better examples online, but in my Test classes I usually have a method like this: private MyDAO dao; @BeforeClass public void beforeClass() { // TODO Auto-generated constructor stub System.out.println("MyDAOTest"); Registry registry; RegistryBuilder builder = new RegistryBui

[ANN[ FlowLogix Tapestry Library 1.2.6 and -SNAPSHOT for T5.4

2013-09-23 Thread Lenny Primak
Current Stable Version: 1.2.6 (for Tapestry 5.3.x) -SNAPSHOT version for T5.4 with JQuery The project can be found here (Google Code) http://code.google.com/p/flowlogix/wiki/TapestryLibrary http://code.google.com/p/flowlogix/ Documentation: http://code.google.com/p/flowlogix/wiki/TLDocIndex Examp

Re: Testing Tapestry

2013-09-23 Thread Martin Kersten
Is there anything to aid me with the usual service test. Currently I use constructors to ease setup of the services. I will try out providing a test module setting up the services and use tapestry IOC to create those. Should have done so more early on, but wanted it simple first. But now when I hav

Re: Testing Tapestry

2013-09-23 Thread Thiago H de Paula Figueiredo
http://tapestryxpath.sourceforge.net/ implements XPath over Tapestry Element objects. On Mon, 23 Sep 2013 14:34:34 -0300, Daniel Jue wrote: I don't have spare minutes at the moment, I just want to drop these links for you to look at (if you haven't seen them already). Hope it helps. http:/

Re: T5.4 migration discussions

2013-09-23 Thread Thiago H de Paula Figueiredo
On Mon, 23 Sep 2013 09:27:46 -0300, Bård Magnus Kvalheim wrote: Hi guys and Howard :) Hi! So I've been taking 5.4 out for a testdrive (alpha 22). The application is fairly large 150+ pages, 250+ components and mixins. *Plugins:* Is using tapestry-jquery, t5conduit (less & coffieescript),

Re: MethodInvocationPlan?

2013-09-23 Thread Martin Kersten
That proxy is not what i want. I just want a way to build and invoke objects and Methode by also using this to setup and run runnables or invokables or callabels. In the end i will be able to setup and run certain processors and commands without dealing with any special setup stuff. The whole mode

Re: Testing Tapestry

2013-09-23 Thread Martin Kersten
Problems nope. I just habe to overhowle the system and wonder what people nicht use. I will check your base clase out. Thanks for sharing. Am 23.09.2013 18:12 schrieb "Dmitry Gusev" : > I use JUnit for unit testing with T5 services, and TestNG for (smoke) > integration testing my apps with URLs. >

Re: Testing Tapestry

2013-09-23 Thread Dmitry Gusev
I use JUnit for unit testing with T5 services, and TestNG for (smoke) integration testing my apps with URLs. All my JUnit test classes inherited from BaseIntegrationTest ( https://gist.github.com/dmitrygusev/6672859), all TestNG classes inherited from a copy of SeleniumTestCase with with this patc

Re: MethodInvocationPlan?

2013-09-23 Thread Lance Java
> I know exactly how it works. So please correct your opinion about the session source. Ok, noted ;) I'm guessing that want to create some form of dynamic proxy using plastic (or java.lang.reflect.Proxy) to invoke a method. The proxy will inject in the method arguments based on type / annotation

Re: MethodInvocationPlan?

2013-09-23 Thread Martin Kersten
This is design by contract Tapestry itself is all about :). And sure it is OOP and typesafe (the invoker ensures this). The only thing that it wont be is compile time safe and refactoring safe (well yes it is safe to a good extend). It will be used for internal use so it is quite good. The values

Testing Tapestry

2013-09-23 Thread Martin Kersten
I want some real hands on experiences. So please if you have any please provide. I am currently reworking the testing settup since the maven stuff is to slow for my program test cycle. Since I wont use testng I need to rewrite some test code. I need to do unit testing in java since I program in j

Re: MethodInvocationPlan?

2013-09-23 Thread Martin Kersten
>I get the feeling you don't understand how the hibernate session works in tapestry. Please re-read my comment from the other thread describing the singleton proxy and per-thread instance.< The SessionSource is all about hibernate. SessionSource.createSession -> new Session everytime. (Singleton)

Re: MethodInvocationPlan?

2013-09-23 Thread Dmitry Gusev
This is very strange approach... not object-oriented and not type-safe, refactoring-safe also. Where would a caller take values for those arguments? On Mon, Sep 23, 2013 at 3:57 PM, Martin Kersten wrote: > Hi Lance, > >I saw this in the user guide lately. What I want is something like > @Af

T5.4 migration discussions

2013-09-23 Thread Bård Magnus Kvalheim
Hi guys and Howard :) So I've been taking 5.4 out for a testdrive (alpha 22). The application is fairly large 150+ pages, 250+ components and mixins. *Plugins:* Is using tapestry-jquery, t5conduit (less & coffieescript), tapestry-yuicompressor (with Lenny's workaround) The plugins are omitted for

Re: MethodInvocationPlan?

2013-09-23 Thread Lance Java
I'm not sure I see the point. ALL services in the tapestry registry are singletons (including the hibernate session). So all services can be constructor injected. I get the feeling you don't understand how the hibernate session works in tapestry. Please re-read my comment from the other thread des

Re: MethodInvocationPlan?

2013-09-23 Thread Martin Kersten
Hi Lance, I saw this in the user guide lately. What I want is something like @AfterRender, @BeforeRender etc. I want to invoke a method (per name constraints for example) and provide some objects to inject on top of the registery and the dependencies the registery is able to inject itself shoul

Re: BaseURLSource with access to current request

2013-09-23 Thread Andy Pahne
Thanks. I used configuration.addInstance(…, …) I also had to change the constructor of my overriding service, the injected constructor parameter needed an explicit @InjectService("Request") annotation. Both changes together and there wasn't an Exception anymore. Andy Am 23.09.2013 um

Re: MethodInvocationPlan?

2013-09-23 Thread Dmitry Gusev
Didn't know about @PostInjecton, thanks for sharing. On Mon, Sep 23, 2013 at 3:19 PM, Lance Java wrote: > Methods marked with @PostInjection will be called after your constructor. > The method params will be injected. > > > http://tapestry.apache.org/tapestry5/apidocs//org/apache/tapestry5/ioc/a

Re: How to best construct and express this service?

2013-09-23 Thread Dmitry Gusev
I did something similar some time before. https://gist.github.com/dmitrygusev/6669065 My idea was based on multiple Workers and a single Task entity. Every worker can perform its own kind of tasks. Tasks stored in a single database table, they all have the same attributes like status, start date,

Re: MethodInvocationPlan?

2013-09-23 Thread Lance Java
Methods marked with @PostInjection will be called after your constructor. The method params will be injected. http://tapestry.apache.org/tapestry5/apidocs//org/apache/tapestry5/ioc/annotations/PostInjection.html Eg public class MyServiceImpl implements MyService { public MyServiceImpl(Dependen

Re: How to best construct and express this service?

2013-09-23 Thread Lance Java
Assuming MyTask implements Runnable and takes a Session in it's constructor: Either @Startup public static void scheduleMyJob(PeriodicExecutor executor, Session hibernateSession) { Runnable mytask = new MyTask(hibernateSession); executor.addJob(new IntervalSchedule(100L), "

VS: BaseURLSource with access to current request

2013-09-23 Thread Ville Virtanen
Thanks! Multiple simple an efficient options, just what Tapestry is all about ;) Ville -Alkuperäinen viesti- Lähettäjä: Lance Java [mailto:lance.j...@googlemail.com] Lähetetty: 23. syyskuuta 2013 12:21 Vastaanottaja: Tapestry users Aihe: Re: BaseURLSource with access to current request

MethodInvocationPlan?

2013-09-23 Thread Martin Kersten
Hi there, tapestry supports a constructor invocation depdending on Inject annotation. There is a constructor plan creation method in the ioc (Util) and there is also a method invocation plan. From the call trace it looks like the constructor plan is using the method invocation plan but I saw no

Re: How to best construct and express this service?

2013-09-23 Thread Martin Kersten
I have seen no magic in the parallelExecutor. It just passes a runnable / Callable / Invokable to the worker queue and the worker simply calls its run method. So there is nothing like dependency injection going on here. I might use parallelExecutor to execute my processor, I am not sure. I can cre

Re: BaseURLSource with access to current request

2013-09-23 Thread Lance Java
Your ClassCastException is caused by using configuration.add(…, …) instead of configuration.addInstance(…, …) If you find that contribution to ServiceOverride fails causes circular dependency you can decorate instead of override: static BaseURLSource decorateBaseURLSource(BaseUrlSource default, @

VS: BaseURLSource with access to current request

2013-09-23 Thread Ville Virtanen
Hi, this is unfortunate and I have a fix for it, but a hackish one. The injected Request is a proxy, so you can do this: create empty container service, and inject it to the baseurlresource (just like the request earlier.) Add setter to your container service for the request, and contribute start

Re: Encoding a template as a valid JSON String

2013-09-23 Thread Lance Java
Since colorbox supports 'inline' option you can solve this problem without ever needing the HTML of the element you want to display. Just render the colorbox content in a hidden div and use $("#link").colorbox({inline:true, href:$("#showMe")}

Re: How to best construct and express this service?

2013-09-23 Thread Lance Java
Is there any reason why you can't just @Inject Session and start using it like a normal tapestry page or service? The only difference being that you need to @Inject PerThreadManager and call cleanup() in the rare case that you are NOT inside a tapestry request / response AND NOT using ParallelExec

Re: How to best construct and express this service?

2013-09-23 Thread Martin Kersten
It was appearently easy. Registry + PerThreadManager. The only thing I need to learn now is how to invoke a method using the IOC. 2013/9/23 Martin Kersten > @Lance > SessionSource is not perThread but HibernateManager is. And on > instanciation the HibernateManager creates the session object. A

Re: How to best construct and express this service?

2013-09-23 Thread Martin Kersten
@Lance SessionSource is not perThread but HibernateManager is. And on instanciation the HibernateManager creates the session object. And the Session is retrieved by calling HibernateManager.getSession(). So SessionSource is global and you can create many sessions per thread but HibernateManager is