Re: use symbol value in POJO

2012-11-01 Thread Michael Gentry
On Thu, Nov 1, 2012 at 6:46 AM, wrote: > public class Foo extends _Foo { > >@Inject @Symbol(value="baseDir") // not possible >String baseDir; > >public String getAbsoluteLocalFilepath() { > >return baseDir + "/" + toUser.getId() + "/" + getFilename(); > } > } > > The ret

Re: use symbol value in POJO

2012-11-01 Thread Michael Gentry
On Thu, Nov 1, 2012 at 6:06 AM, wrote: > I don't even know what CayenneService is ;) A typo on my part. I was trying to reference the previous TapestryCayenneService. > For deleting/committing I inject an ObjectContext (with annotation > @OCType(...) or ObjectContextProvider from tapestry5-ca

Re: use symbol value in POJO

2012-11-01 Thread Thiago H de Paula Figueiredo
On Thu, 01 Nov 2012 08:46:42 -0200, wrote: getAbsoluteLocalFilepath() is called in page classes, e. g. to store a file under this path. Another example for a method in Foo could be public InlineFileStreamResponse getImageAsStream() ... where we also need the baseDir. With the above informat

Re: use symbol value in POJO

2012-11-01 Thread Lance Java
27;ed wherever it's required. -- View this message in context: http://tapestry.1045711.n5.nabble.com/use-symbol-value-in-POJO-tp5717426p5717501.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To un

Re: use symbol value in POJO

2012-11-01 Thread devnull2000
I'm sorry, I inadvertently sent the mail, but I wasn't finished writing yet :( continued: > For example: public class Foo extends _Foo { @Inject @Symbol(value="baseDir") // not possible String baseDir; public String getAbsoluteLocalFilepath() { return baseDir + "/"

Re: use symbol value in POJO

2012-11-01 Thread devnull2000
> PS. Which version of Cayenne are you using? Cayenne 3.1B1, Tapestry 5.3.6 and tapestry5-cayenne-server 0.5-SNAPSHOT > PPS. Don't use CayenneService as a DAO for deleting/saving, either. I don't even know what CayenneService is ;) For deleting/committing I inject an ObjectContext (with annotati

Re: use symbol value in POJO

2012-10-31 Thread Michael Gentry
Hi Bjello, I think Lance was onto the best ideas. The easiest would be to create a Tapestry service for creating your Cayenne objects (pseudo-code): public class TapestryCayenneService { @Inject @Symbol(value="...") ... public Foo newFoo(ObjectContext oc) { Foo foo = oc.newO

Re: use symbol value in POJO

2012-10-31 Thread Lance Java
. -- View this message in context: http://tapestry.1045711.n5.nabble.com/use-symbol-value-in-POJO-tp5717426p5717450.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubsc

Re: use symbol value in POJO

2012-10-30 Thread devnull2000
Thanks for your replies. > Firstly, I'm not familiar with Cayenne. Well, I've been working with Tapestry and Cayenne for only a few months now, so I'm not that familiar with it, either. > Secondly, I'm not 100% sure that this is a good idea. You mean passing the value as a parameter is not a go

Re: use symbol value in POJO

2012-10-30 Thread Lance Java
stry.1045711.n5.nabble.com/use-symbol-value-in-POJO-tp5717426p5717428.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands,

Re: use symbol value in POJO

2012-10-30 Thread Thiago H de Paula Figueiredo
On Tue, 30 Oct 2012 13:48:42 -0200, wrote: Hi, Hi! I've got a properties file that gets added with contributeSymbolSource(...) in AppModule and injection of the values with @Inject @Symbol(value="myProperty") works well. Unfortunately, it doesn't work in classes that are subclasses of

use symbol value in POJO

2012-10-30 Thread devnull2000
Hi, I've got a properties file that gets added with contributeSymbolSource(...) in AppModule and injection of the values with @Inject @Symbol(value="myProperty") works well. Unfortunately, it doesn't work in classes that are subclasses of CayenneDataObject (I use cayenne as OR mapper), since th