Re: Quick ERXEnterpriseObject newly inserted Question --

2010-12-23 Thread Ramsey Gurley
On Dec 23, 2010, at 10:59 AM, Ramsey Gurley wrote: On Dec 17, 2010, at 4:26 PM, Jesse Tayler wrote: Oh thanks - ! On Dec 17, 2010, at 3:53 PM, Ramsey Gurley wrote: I didn't replicate the ERCore templates identically. I don't have the static variables wrapped in the Key interface. You s

Re: Quick ERXEnterpriseObject newly inserted Question --

2010-12-23 Thread Ramsey Gurley
On Dec 17, 2010, at 4:26 PM, Jesse Tayler wrote: Oh thanks - ! On Dec 17, 2010, at 3:53 PM, Ramsey Gurley wrote: I didn't replicate the ERCore templates identically. I don't have the static variables wrapped in the Key interface. You should not need to regenerate anything under ERCore.

Re: Quick ERXEnterpriseObject newly inserted Question --

2010-12-17 Thread Jesse Tayler
On Dec 17, 2010, at 4:56 PM, Ricardo J. Parada wrote: > I like this stuff. I wished I known this before. > which is I why I wish I knew it now! seriously, seems like there's some very nice template action going around here - maybe a consolidation into...well, yet another standard template m

Re: Quick ERXEnterpriseObject newly inserted Question --

2010-12-17 Thread Jesse Tayler
Oh thanks - ! On Dec 17, 2010, at 3:53 PM, Ramsey Gurley wrote: > I didn't replicate the ERCore templates identically. I don't have the static > variables wrapped in the Key interface. You should not need to regenerate > anything under ERCore. To init() an object nicely, I thought I might s

Re: Quick ERXEnterpriseObject newly inserted Question --

2010-12-17 Thread Jesse Tayler
Right - so, I'm using the template from that link called: "Consolidated WOnder Templates with "Clazz" pattern (Ramsey Gurley)" I downloaded the two java template files and put them in a folder in my project, and set that folder in the eogen -- the templates actually do have some of the clazz st

Re: Quick ERXEnterpriseObject newly inserted Question --

2010-12-17 Thread David Holt
I linked to the templates earlier in the thread. On 2010-12-17, at 11:24 AM, Jesse Tayler wrote: > What template are you generating your EOs from? > > I'm using _WonderEntity and I don't see clazz stuff in my _Classes > > I look at BugTracker's eogen and I see it using _Entity from CorBusiness

Re: Quick ERXEnterpriseObject newly inserted Question --

2010-12-17 Thread Jesse Tayler
What template are you generating your EOs from? I'm using _WonderEntity and I don't see clazz stuff in my _Classes I look at BugTracker's eogen and I see it using _Entity from CorBusiness but that template seems to be a regular old EO template. On Dec 16, 2010, at 9:25 AM, Ricardo J. Parada

Re: Quick ERXEnterpriseObject newly inserted Question --

2010-12-16 Thread Ricardo J. Parada
Oh... I just tried this with a Foo.java class: public static class Util extends ERXGenericRecordClazz { } public static final Util util = new Util(); Then I can do stuff like this: Foo aFoo = Foo.util.objectWithPrimaryKeyValue(anEditingContext, 5); EOEntity entity = Foo.util.en

Re: Quick ERXEnterpriseObject newly inserted Question --

2010-12-15 Thread Ricardo J. Parada
I see that the root EOEnterpriseObjectClazz has a bunch of utility methods. For example, createAndInsertObject(), allObjects(), objectFromRawRow(), objectWithPrimaryKeyValue(), entityName(), entity(), createFetchSpecification(), objectCountWithQualifier(), etc. And they are only defined once

Re: Quick ERXEnterpriseObject newly inserted Question --

2010-12-15 Thread David Holt
On 2010-12-15, at 1:43 PM, Ricardo J. Parada wrote: > Thanks David. > > I noticed those __Clazz classes are then declared in the EOs as "public > static class". I read the article below to figure what that meant. I'm > still learning java I guess :-) > > http://www.javaworld.com/javaworld

Re: Quick ERXEnterpriseObject newly inserted Question --

2010-12-15 Thread Ricardo J. Parada
Thanks David. I noticed those __Clazz classes are then declared in the EOs as "public static class". I read the article below to figure what that meant. I'm still learning java I guess :-) http://www.javaworld.com/javaworld/javaqa/2001-08/01-qa-0817-static.html?page=1 So I'm trying to put

Re: Quick ERXEnterpriseObject newly inserted Question --

2010-12-14 Thread Jesse Tayler
oh - of course, you sent the link - I guess my eogen is working since some APIs changed? setAuthor would now be setAuthorRelationship eh? but now there's no init() constructor? maybe I just need to hack around with this a bit more, or maybe I'm misunderstanding. On Dec 14, 2010, at 6:19 PM,

Re: Quick ERXEnterpriseObject newly inserted Question --

2010-12-14 Thread David Holt
The EOGenerator template I linked to earlier: public static class ${entity.classNameWithoutPackage}Clazz extends ${entity.prefixClassNameWithOptionalPackage}.${entity.prefixClassNameWithoutPackage}Clazz { /* more clazz methods here */ } On 2010-12-14, at 3:16 PM, Jesse Tayler w

Re: Quick ERXEnterpriseObject newly inserted Question --

2010-12-14 Thread Jesse Tayler
well, this sounds great, but how are you even getting this _DocumentClazz into your EO template? On Dec 14, 2010, at 5:57 PM, David Holt wrote: > public static class DocumentClazz extends _Document._DocumentClazz { > ___ Do not post admin reque

Re: Quick ERXEnterpriseObject newly inserted Question --

2010-12-14 Thread David Holt
On 2010-12-14, at 2:20 PM, Ricardo J. Parada wrote: > > I've always wondered what that clazz thingy is. I'm still not sure. I read > the javadoc on EOEnterpriseObjectClazz but still I don't quite get it. > What is it? Maybe a little example will go a long way in understanding. :-) Hi Ricard

Re: Quick ERXEnterpriseObject newly inserted Question --

2010-12-14 Thread Anjo Krank
Clazz pattern is simply a way to limit static methods and make them override-able. ERC can be mostly thought of as an example imp. My case was that this stuff belongs in the logic and not in the session. The session shouldn't care that the current user is in thread storage or whereever. It's s

Re: Quick ERXEnterpriseObject newly inserted Question --

2010-12-14 Thread Ricardo J. Parada
I've always wondered what that clazz thingy is. I'm still not sure. I read the javadoc on EOEnterpriseObjectClazz but still I don't quite get it. What is it? Maybe a little example will go a long way in understanding. :-) On Dec 14, 2010, at 5:15 PM, David Holt wrote: > Hi Anjo, > > On 201

Re: Quick ERXEnterpriseObject newly inserted Question --

2010-12-14 Thread David Holt
Hi Anjo, On 2010-12-14, at 1:34 PM, Anjo Krank wrote: > There is a reason why stuff in BT is done as it is. > > I.e. there is a People.class.setCurrentUser(People user) and > People.class.currentUser(EOEditingContext ec). Basically it puts all the > thread storage code (including the key) in

Re: Quick ERXEnterpriseObject newly inserted Question --

2010-12-14 Thread Jesse Tayler
I still don't completely understand the clazz > >> setOriginator(People.clazz.currentUser(editingContext())); >> Is there a reason I shouldn't say something like this inside init() setAuthor((User) ((User)ERCoreBusinessLogic.actor()).localInstanceIn(editingContext())); ___

Re: Quick ERXEnterpriseObject newly inserted Question --

2010-12-14 Thread Jesse Tayler
oooh! works great! I had already wanted to try out the preference system - double plus good! thanks! On Dec 14, 2010, at 3:31 PM, David Holt wrote: > setOriginator(People.clazz.currentUser(editingContext())); > ___ Do not post admin requests

Re: Quick ERXEnterpriseObject newly inserted Question --

2010-12-14 Thread Anjo Krank
There is a reason why stuff in BT is done as it is. I.e. there is a People.class.setCurrentUser(People user) and People.class.currentUser(EOEditingContext ec). Basically it puts all the thread storage code (including the key) in People, which is, like, good style? Also, ERXThreadStorage alread

Re: Quick ERXEnterpriseObject newly inserted Question --

2010-12-14 Thread David Holt
On 2010-12-14, at 12:25 PM, Jesse Tayler wrote: > Makes sense, to use init() but how to safely handle the authenticated user? > > I see there's a clazz setup used in BugTracker which seems to set a > currentUser() which I'm guessing is a safe way to access the authenticated > user (if I set it

Re: Quick ERXEnterpriseObject newly inserted Question --

2010-12-14 Thread Ramsey Gurley
On Dec 14, 2010, at 3:25 PM, Jesse Tayler wrote: Makes sense, to use init() but how to safely handle the authenticated user? I see there's a clazz setup used in BugTracker which seems to set a currentUser() which I'm guessing is a safe way to access the authenticated user (if I set it so

Re: Quick ERXEnterpriseObject newly inserted Question --

2010-12-14 Thread David Holt
On 2010-12-14, at 11:28 AM, Ramsey Gurley wrote: > Hi Jesse, > > On Dec 14, 2010, at 1:16 PM, Jesse Tayler wrote: > >> >> I'm implementing a method to populate new EOs with default values before >> save. >> >> I see lots of ERXEnterpriseObject methods beyond awakeFromInsertion, > > I would

Re: Quick ERXEnterpriseObject newly inserted Question --

2010-12-14 Thread Jesse Tayler
Makes sense, to use init() but how to safely handle the authenticated user? I see there's a clazz setup used in BugTracker which seems to set a currentUser() which I'm guessing is a safe way to access the authenticated user (if I set it somewhere) and locally set an author or assignee relationsh

Re: Quick ERXEnterpriseObject newly inserted Question --

2010-12-14 Thread Ramsey Gurley
Hi Jesse, On Dec 14, 2010, at 1:16 PM, Jesse Tayler wrote: I'm implementing a method to populate new EOs with default values before save. I see lots of ERXEnterpriseObject methods beyond awakeFromInsertion, I would recommend init() instead of awakeFromInsertion. init() was added to fix

Quick ERXEnterpriseObject newly inserted Question --

2010-12-14 Thread Jesse Tayler
I'm implementing a method to populate new EOs with default values before save. I see lots of ERXEnterpriseObject methods beyond awakeFromInsertion, including nice looking things like DidInsertProcessor and so forth. I'd like to use the D2W rules to set values like "active" = "true" or "author"