• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Quick ERXEnterpriseObject newly inserted Question --
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quick ERXEnterpriseObject newly inserted Question --


  • Subject: Re: Quick ERXEnterpriseObject newly inserted Question --
  • From: Jesse Tayler <email@hidden>
  • Date: Tue, 14 Dec 2010 15:25:06 -0500

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 relationship and otherwise get info from the current user.

I see this clazz setup in the bug tracker eo templates, but I don't have those on my EREOs and don't know where they come from.

I'm try to follow that code through, but maybe if someone has a basic explanation that would be great.

On Dec 14, 2010, at 2:28 PM, 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 recommend init() instead of awakeFromInsertion. init() was added to fix a bug where awakeFromInsertion gets called twice after a cascade delete fails validation... or something (^_^)
>
>> 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" = "session.user"
>
> The d2wContext of your page is generally unavailable in your EO unless you use thread locals.
>
> If you DO find yourself using thread locals in your model, I would suggest you consider how you use them carefully so you don't end up with a model that is totally dependent on one application.
>
>> Does anyone have some overview advice for those new to the more modern ER frameworks in terms of how to implement this common concept I'm after?
>
> ERXEntityClassDescription has some stuff for initializing values. So does migrations.
>
> Ramsey
>
>>
>> thanks for thoughts or insights --
>>
>
>

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Quick ERXEnterpriseObject newly inserted Question --
      • From: David Holt <email@hidden>
    • Re: Quick ERXEnterpriseObject newly inserted Question --
      • From: Ramsey Gurley <email@hidden>
References: 
 >Quick ERXEnterpriseObject newly inserted Question -- (From: Jesse Tayler <email@hidden>)
 >Re: Quick ERXEnterpriseObject newly inserted Question -- (From: Ramsey Gurley <email@hidden>)

  • Prev by Date: Re: Primary Key Generation broken when using permanentGlobalID and horizontal inheritance?
  • Next by Date: Re: Quick ERXEnterpriseObject newly inserted Question --
  • Previous by thread: Re: Quick ERXEnterpriseObject newly inserted Question --
  • Next by thread: Re: Quick ERXEnterpriseObject newly inserted Question --
  • Index(es):
    • Date
    • Thread