Re: [Zope-CMF] Proposal: MemberDataFactory

2009-03-31 Thread Miles
Hi,

This is now checked in on the "miwa-adapterise-memberdata" branch of 
CMFCore.

I'll merge it in next week.

Miles


Miles wrote:
> Hi,
> 
> We have quite a lot of copy-and-paste code here in order to support 
> using a custom MemberData class for members in particular sites.
> 
> The reason for this is that the only way to use a different MemberData 
> class is to provide a custom wrapUser method.
> 
> I'd like to propose that this is changed to use a factory registered 
> through the CA to create new MemberData objects, in order that this is 
> pluggable without requiring a custom MemberDataTool.
> 
> Any thoughts?
> 
> Miles
> 
> ___
> Zope-CMF maillist  -  Zope-CMF@lists.zope.org
> http://mail.zope.org/mailman/listinfo/zope-cmf
> 
> See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests
> 

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] Proposal: MemberDataFactory

2009-03-19 Thread Jens Vagelpohl
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On Mar 19, 2009, at 12:50 , Wichert Akkerman wrote:

> Previously Jens Vagelpohl wrote:
>> One use case I have: I need a different Member Data object (and thus
>> the whole overridden tool) for Products.CMFLDAP in order to have
>> custom overridden methods on those MemberData objects that call non-
>> standard methods on the user folder.
>
> Personally I would rather find a way to get rid of the Member Data
> object and rely PAS to provide all the required features. Is there
> a reason, other than not wanting to add a dependency on PAS, to use a
> Member Data object?

There's also the fact that I want to do it the way it's done in the  
CMF, which means by way of a member data object. Should the CMF itself  
get rid of that construct I'll adjust my software as well. I believe  
I'd have to write more custom code in my software if I tried to do it  
through PAS alone.

jens


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAknCOg4ACgkQRAx5nvEhZLJk8wCdGm10hfWACj+dVRaEy0xm5FJt
85EAoLSmZkOFLFmp6YBkbAuKRYgYQwhY
=uTbE
-END PGP SIGNATURE-
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] Proposal: MemberDataFactory

2009-03-19 Thread Wichert Akkerman
Previously Jens Vagelpohl wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> 
> On Mar 18, 2009, at 16:12 , Wichert Akkerman wrote:
> 
> > Previously Miles wrote:
> >> We have quite a lot of copy-and-paste code here in order to support
> >> using a custom MemberData class for members in particular sites.
> >>
> >> The reason for this is that the only way to use a different  
> >> MemberData
> >> class is to provide a custom wrapUser method.
> >>
> >> I'd like to propose that this is changed to use a factory registered
> >> through the CA to create new MemberData objects, in order that this  
> >> is
> >> pluggable without requiring a custom MemberDataTool.
> >
> > Can you explain the use case? I suspect you can also solve this with  
> > PAS
> > and a custom user factory PAS plugin.
> 
> One use case I have: I need a different Member Data object (and thus  
> the whole overridden tool) for Products.CMFLDAP in order to have  
> custom overridden methods on those MemberData objects that call non- 
> standard methods on the user folder.

Personally I would rather find a way to get rid of the Member Data
object and rely PAS to provide all the required features. Is there
a reason, other than not wanting to add a dependency on PAS, to use a
Member Data object?

Wichert.

-- 
Wichert Akkerman It is simple to make things.
http://www.wiggy.net/   It is hard to make things simple.
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] Proposal: MemberDataFactory

2009-03-19 Thread Charlie Clark

Am 18.03.2009 um 18:02 schrieb Miles:

>
> Sure.  Example use cases are fairly simple things like:
>
>  - I set members to have first_name, last_name, job_title attributes
> and
>I want to give them an attribute "proper_name" that returns
> '%s %s (%s)' % (first_name, last_name, job_title);
>
>  - I want to provide a standardised sortable name for ordering rows,
> e.g. (last_name + ' ' + first_name).lower()
>
>  - I want to adjust the setProperties method to add a 'modified'
>attribute that's adjusted on every change of details
>
> For sites with integration we use PAS.  But for small sites with very
> simple member requirements, the MemberDataTool generally does most of
> what's required out of the box.


A good explanation.

+1 from me.

Charlie
--
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226



___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] Proposal: MemberDataFactory

2009-03-18 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Wichert Akkerman wrote:
> Previously Miles wrote:
>> We have quite a lot of copy-and-paste code here in order to support 
>> using a custom MemberData class for members in particular sites.
>>
>> The reason for this is that the only way to use a different MemberData 
>> class is to provide a custom wrapUser method.
>>
>> I'd like to propose that this is changed to use a factory registered 
>> through the CA to create new MemberData objects, in order that this is 
>> pluggable without requiring a custom MemberDataTool.
> 
> Can you explain the use case? I suspect you can also solve this with PAS
> and a custom user factory PAS plugin.

"Member data" is wildly different from "user properties":  memberdata is
about stuff local to a site, which is not required to have its own PAS.
 Think of "member data" as being local annotations keyed by user ID, not
as being tightly coupled to the user from PAS.

(The fact that Plone forces the site to have its own PAS instance blurs
this distinction).



Tres.
- --
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJwSSQ+gerLs4ltQ4RAlaLAJ48okhOgktBSaeeyp/yKwWwvewt4QCguhly
n0uef4ZPnUcAaJfonjjxzDg=
=2vyp
-END PGP SIGNATURE-

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] Proposal: MemberDataFactory

2009-03-18 Thread Miles
Hi,

>> We have quite a lot of copy-and-paste code here in order to support 
>> using a custom MemberData class for members in particular sites.
>>
>> The reason for this is that the only way to use a different MemberData 
>> class is to provide a custom wrapUser method.
>>
>> I'd like to propose that this is changed to use a factory registered 
>> through the CA to create new MemberData objects, in order that this is 
>> pluggable without requiring a custom MemberDataTool.
> 
> Can you explain the use case? I suspect you can also solve this with PAS
> and a custom user factory PAS plugin.

Sure.  Example use cases are fairly simple things like:

  - I set members to have first_name, last_name, job_title attributes 
and
I want to give them an attribute "proper_name" that returns
 '%s %s (%s)' % (first_name, last_name, job_title);

  - I want to provide a standardised sortable name for ordering rows,
 e.g. (last_name + ' ' + first_name).lower()

  - I want to adjust the setProperties method to add a 'modified'
attribute that's adjusted on every change of details

For sites with integration we use PAS.  But for small sites with very 
simple member requirements, the MemberDataTool generally does most of 
what's required out of the box.

Miles


___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] Proposal: MemberDataFactory

2009-03-18 Thread Jens Vagelpohl
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On Mar 18, 2009, at 16:12 , Wichert Akkerman wrote:

> Previously Miles wrote:
>> We have quite a lot of copy-and-paste code here in order to support
>> using a custom MemberData class for members in particular sites.
>>
>> The reason for this is that the only way to use a different  
>> MemberData
>> class is to provide a custom wrapUser method.
>>
>> I'd like to propose that this is changed to use a factory registered
>> through the CA to create new MemberData objects, in order that this  
>> is
>> pluggable without requiring a custom MemberDataTool.
>
> Can you explain the use case? I suspect you can also solve this with  
> PAS
> and a custom user factory PAS plugin.

One use case I have: I need a different Member Data object (and thus  
the whole overridden tool) for Products.CMFLDAP in order to have  
custom overridden methods on those MemberData objects that call non- 
standard methods on the user folder.

jens


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAknBEW8ACgkQRAx5nvEhZLJdXgCdF7XYKGyVQ1pTyPlLckpdXy2Z
0hIAn2loLaw6WY9CyiLAa+hqwu8V6QMI
=15IO
-END PGP SIGNATURE-
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] Proposal: MemberDataFactory

2009-03-18 Thread Wichert Akkerman
Previously Miles wrote:
> We have quite a lot of copy-and-paste code here in order to support 
> using a custom MemberData class for members in particular sites.
> 
> The reason for this is that the only way to use a different MemberData 
> class is to provide a custom wrapUser method.
> 
> I'd like to propose that this is changed to use a factory registered 
> through the CA to create new MemberData objects, in order that this is 
> pluggable without requiring a custom MemberDataTool.

Can you explain the use case? I suspect you can also solve this with PAS
and a custom user factory PAS plugin.

Wichert.

-- 
Wichert Akkerman It is simple to make things.
http://www.wiggy.net/   It is hard to make things simple.
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] Proposal: MemberDataFactory

2009-03-18 Thread Jens Vagelpohl
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On Mar 18, 2009, at 16:23 , Miles wrote:

> Hi,
>
> We have quite a lot of copy-and-paste code here in order to support
> using a custom MemberData class for members in particular sites.
>
> The reason for this is that the only way to use a different MemberData
> class is to provide a custom wrapUser method.
>
> I'd like to propose that this is changed to use a factory registered
> through the CA to create new MemberData objects, in order that this is
> pluggable without requiring a custom MemberDataTool.
>
> Any thoughts?

Not really thoughts, but definitely +1 from me as well.

jens



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAknBD3IACgkQRAx5nvEhZLIPtQCfR+DD1to7o2Cdufow6uM/q41b
ziUAn2KvcP/Qp3+wRbuHWpl723PACrI4
=5YNp
-END PGP SIGNATURE-
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests