Re: Neo4J 2.0 transactions on domain objects with T5.3.x

2014-01-13 Thread Daniel Jue
Thanks Thiago!

I have it working for my tests in my DAOModule (no classes, just services
that are explicitly advised via @Match("prefix*")


Now I want to apply it to all my pages and components in my web module
using @Match("*").  It causes a recursion error since it sees the services
in the DAO module which are needed to create the transaction!

I could do this for all my pages and components:
@Match({ "Page1", "Page2", "Page3",...
"Component1","Component2","Component3"... })

But that smells bad.  Would that be your choice?

I could also do @Advise(serviceInterface = Page1.class) , but that's even
worse because @Advise only takes one class at a time.

What I kind of want is to advise all my pages and components.


One more thing:  When I have one of these Neo4J-backed domain objects
(let's say User.class), I might have something like this in a page:

@Property
private User theUser;

In my template, if I do ${theUser.firstName}, will the transactional advise
be applied to the automatically constructed getters and setters for that
property?





BTW My annotation looks like this:

package org.apache.tapestry5.neo4j.annotation;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import static
org.apache.tapestry5.ioc.annotations.AnnotationUseContext.BEAN;
import static
org.apache.tapestry5.ioc.annotations.AnnotationUseContext.COMPONENT;
import static
org.apache.tapestry5.ioc.annotations.AnnotationUseContext.MIXIN;
import static
org.apache.tapestry5.ioc.annotations.AnnotationUseContext.PAGE;
import static
org.apache.tapestry5.ioc.annotations.AnnotationUseContext.SERVICE;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import org.apache.tapestry5.ioc.annotations.UseWith;

/**
 * Marks a method of a service (or a component method) as transactional: the
 * call will create a tx, invoke the method, and then should call
tx.success()
 * after invoking the method. Failure through exception will cause Neo4J to
abort the commit.
 *
 * @author djue
 *
 */
@Target({METHOD})
@Retention(RUNTIME)
@Documented
@UseWith({ COMPONENT, MIXIN, PAGE, SERVICE, BEAN })
public @interface Neo4JTransactional {

}








On Mon, Jan 13, 2014 at 6:35 AM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Fri, 10 Jan 2014 23:01:50 -0200, Daniel Jue  wrote:
>
>  Hello friends,
>>
>
>  The Question:
>> So does a custom Advise annotation seem like the right way to go?
>>
>
> Yes! Just remember that Tapestry-IoC 5.3 doesn't copy the annotations from
> service implementation and its methods to the service proxy, but that
> limitation was already fixed in 5.4. For 5.3, you'll need to put your
> annotation in the service interface.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Tapestry 5.4-beta-2 GoogleClosureCompiler

2014-01-13 Thread Kristian Marinkovic
Hi all,

how do i set additional GoogleClosureMinimizer options? The current
implementation in tapestry-webresources doesn't seem to offer any
configuration possibilities besides replacing the whole service.

cheers,
Kris


Tapestry 5.4 require.js modules

2014-01-13 Thread Kristian Marinkovic
Hi all,

why are tapestry's requirejs modules nested in an anonymous javascript
function:

(function() {
   define(['jquery'], function($) {
   })
}).call(this);

isn't it enough to just write define(, function() {})? Is there a
reason for this additional scope?

cheers,
Kris



BTW, i just migrated an existing T5.3.7 application to T5.4-beta-2 with
almost no hassle. i'm really impressed.


RESTEasy XML byte order marker

2014-01-13 Thread gregor stopar



Hi

I have RESTEasy client which is constructed like this:

ResteasyClient client = new 
ResteasyClientBuilder().httpEngine(httpEngine).build();

ResteasyWebTarget snowConditionTarget = client.target(host);
SnowConditionClient snowConditionClient = 
snowConditionTarget.proxy(SnowConditionClient.class);


(SnowConditionClient is interface)

When I try to read entity: response.readEntity(SnowConditionResponse.class);
I get Unmarshall exception: "Content is not allowed in prolog".

This is because XML has byte order marker (BOM).

Question:
How can I skip BOM ?


I implemented custom MessageBodyReader but Tapestry refuses to use it 
(or I'm doing something wrong).
I put this class in services package and even try with manual 
registration, with no success:


ResteasyProviderFactory instance = ResteasyProviderFactory.getInstance();
RegisterBuiltin.register(instance);
instance.registerProvider(SnowConditionProvider.class);



Thanks,
Regards

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



Re: Neo4J 2.0 transactions on domain objects with T5.3.x

2014-01-13 Thread Thiago H de Paula Figueiredo

On Fri, 10 Jan 2014 23:01:50 -0200, Daniel Jue  wrote:


Hello friends,



The Question:
So does a custom Advise annotation seem like the right way to go?


Yes! Just remember that Tapestry-IoC 5.3 doesn't copy the annotations from  
service implementation and its methods to the service proxy, but that  
limitation was already fixed in 5.4. For 5.3, you'll need to put your  
annotation in the service interface.


--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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



Re: Loving the eclipse-tapestry5-plugin

2014-01-13 Thread Dmitry Gusev
Hi Michael!

it would be better if you create a github issue so we could discuss your
use case there and maybe work out some solution:
https://github.com/anjlab/eclipse-tapestry5-plugin/issues



On Mon, Jan 13, 2014 at 2:30 PM, Michael Dukaczewski  wrote:

> Maybe a special configuration for the plugin is not necessary. It would
> probably be enough to read the .classpath file to use the classpath of the
> eclipse project?
>
>
>
>
> Am 16.12.13 10:45, schrieb Michael Dukaczewski:
>
>  It depends on the project I'm working on. I have projects in maven
>> layout as well as projects that did not use the maven layout, for one or
>> the other reason. Therefore, it would be great if you could configure it
>> per project and perhaps could set a default for eclipse.
>> Many projects I'm working on have a src folder at the top level which it
>> is not further subdivided (Java code and templates are together in the
>> same folder). Another top level folder is webapp (or sometimes
>> WebContent) with the WEB-INF folder (and all its content, like web.xml,
>> libs, classes, ...) inside. I think this is the default Eclipse WTP
>> project layout.
>>
>> Regards,
>> Michael
>>
>>
>>
>> Am 03.12.13 18:30, schrieb Dmitry Gusev:
>>
>>> What is the directory structure you use? Are you using multi-project
>>> structure?
>>> Do you think it would be enough to configure default locations on the
>>> Eclipse workspace level?
>>> Or should it be per Eclipse project?
>>>
>>>
>>> On Tue, Dec 3, 2013 at 5:26 PM, Michael Dukaczewski
>>> wrote:
>>>
>>>  I love the plugin also. But a way to configure the file locations
 would be
 great. We use a different project layout from Maven.

 Regards,
 Michael



 Am 02.12.13 20:37, schrieb Lance Java:

   I've just started using the new(ish) eclipse-tapestry5-plugin and I
 must

> say it's great!!
>
> The killer feature for me is the '+' button to create a .tml, .css, .js
> file from a java class in a maven friendly location pre-filled with
> useful
> templates.
>
> Kudos to Dmitry Gusev for a great plugin.
>
> If you haven't tried it yet... go get it!!
>
> https://github.com/anjlab/eclipse-tapestry5-plugin
>
>
>  -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org



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


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Loving the eclipse-tapestry5-plugin

2014-01-13 Thread Michael Dukaczewski
Maybe a special configuration for the plugin is not necessary. It would 
probably be enough to read the .classpath file to use the classpath of 
the eclipse project?





Am 16.12.13 10:45, schrieb Michael Dukaczewski:

It depends on the project I'm working on. I have projects in maven
layout as well as projects that did not use the maven layout, for one or
the other reason. Therefore, it would be great if you could configure it
per project and perhaps could set a default for eclipse.
Many projects I'm working on have a src folder at the top level which it
is not further subdivided (Java code and templates are together in the
same folder). Another top level folder is webapp (or sometimes
WebContent) with the WEB-INF folder (and all its content, like web.xml,
libs, classes, ...) inside. I think this is the default Eclipse WTP
project layout.

Regards,
Michael



Am 03.12.13 18:30, schrieb Dmitry Gusev:

What is the directory structure you use? Are you using multi-project
structure?
Do you think it would be enough to configure default locations on the
Eclipse workspace level?
Or should it be per Eclipse project?


On Tue, Dec 3, 2013 at 5:26 PM, Michael Dukaczewski
wrote:


I love the plugin also. But a way to configure the file locations
would be
great. We use a different project layout from Maven.

Regards,
Michael



Am 02.12.13 20:37, schrieb Lance Java:

  I've just started using the new(ish) eclipse-tapestry5-plugin and I
must

say it's great!!

The killer feature for me is the '+' button to create a .tml, .css, .js
file from a java class in a maven friendly location pre-filled with
useful
templates.

Kudos to Dmitry Gusev for a great plugin.

If you haven't tried it yet... go get it!!

https://github.com/anjlab/eclipse-tapestry5-plugin



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







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



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



Re: [ANN] Tapestry-genetify

2014-01-13 Thread Emmanuel DEMEY
Great Job Nourredine ;)
And you use Kawwa (https://kawwa.atosworldline.com/) !!! Thanks


2014/1/13 Nourredine K. 

> Hi there,
>
> tapestry-genetify[1] for tapestry 5.3.7 is available on maven
> central[2]. It's a tapestry contribution for Genetify[3] (an amazing
> opensource website testing and optimization tool based on a
> multi-armed bandit algorithm).
> More details on how to use it here :
> https://github.com/adaptivui/tapestry-genetify
> A demo site has been developed [4]. See it in action here :
> http://www.adaptivui.com/tapestry-genetify-demo
>
> [1] https://github.com/adaptivui/tapestry-genetify
> [2] http://search.maven.org/#search|ga|1|tapestry-genetify
> [3] https://github.com/gregdingle/genetify/wiki
> [4] https://github.com/adaptivui/tapestry-genetify-demo/
>
> Nourredine K.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Emmanuel DEMEY
Ingénieur Etude et Développement
Worldline, an atos company
+33 (0)6 47 47 42 02
demey.emman...@gmail.com


Twitter : @EmmanuelDemey