Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: CMF

Proposal: MemberDataFactory

 

 

Zope cmf RSS feed   Index | Next | Previous | View Threaded


miles at jamkit

Mar 18, 2009, 8:20 AM

Post #1 of 10 (1841 views)
Permalink
Proposal: MemberDataFactory

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 [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

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


jens at dataflake

Mar 18, 2009, 8:12 AM

Post #2 of 10 (1772 views)
Permalink
Re: Proposal: MemberDataFactory [In reply to]

-----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 [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

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


wichert at wiggy

Mar 18, 2009, 8:12 AM

Post #3 of 10 (1783 views)
Permalink
Re: Proposal: MemberDataFactory [In reply to]

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 <wichert [at] wiggy> It is simple to make things.
http://www.wiggy.net/ It is hard to make things simple.
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

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


jens at dataflake

Mar 18, 2009, 8:21 AM

Post #4 of 10 (1790 views)
Permalink
Re: Proposal: MemberDataFactory [In reply to]

-----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 [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

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


tseaver at palladion

Mar 18, 2009, 9:42 AM

Post #5 of 10 (1779 views)
Permalink
Re: Proposal: MemberDataFactory [In reply to]

-----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 tseaver [at] palladion
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 [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

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


miles at jamkit

Mar 18, 2009, 10:02 AM

Post #6 of 10 (1787 views)
Permalink
Re: Proposal: MemberDataFactory [In reply to]

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 [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

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


charlie at begeistert

Mar 19, 2009, 1:48 AM

Post #7 of 10 (1789 views)
Permalink
Re: Proposal: MemberDataFactory [In reply to]

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 [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

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


wichert at wiggy

Mar 19, 2009, 4:50 AM

Post #8 of 10 (1772 views)
Permalink
Re: Proposal: MemberDataFactory [In reply to]

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 <wichert [at] wiggy> It is simple to make things.
http://www.wiggy.net/ It is hard to make things simple.
_______________________________________________
Zope-CMF maillist - Zope-CMF [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

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


jens at dataflake

Mar 19, 2009, 5:26 AM

Post #9 of 10 (1768 views)
Permalink
Re: Proposal: MemberDataFactory [In reply to]

-----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 [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

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


miles at jamkit

Mar 31, 2009, 1:57 AM

Post #10 of 10 (1707 views)
Permalink
Re: Proposal: MemberDataFactory [In reply to]

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 [at] lists
> 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 [at] lists
http://mail.zope.org/mailman/listinfo/zope-cmf

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

Zope cmf RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.