[Zope-CMF] Re: GenericSetup ATContentTypes global_allow

2006-09-22 Thread yuppie

Hi Tres!


Tres Seaver wrote:

Raphael Ritz wrote:

In the old days this would have been something like this (pseudo code):

  typesTool['File'].manage_changeProperties(global_allow=False)

in the custom product's install.

The question is: how would you do that from an extension profile
without replicating the entire 'File' fti for just this little change?


Then you aren't making an extension:  it is really a base profile in
disguise, as you want to control types outside your profile's scope.
I don't want to make it easy for add-ons to scribble on other people's
types (although yuppie's suggestion would work):  the model here is that
either you are configuring the site *as a whole*, or you are extending
it by making well-behaved extensions to it.


Maybe he isn't making an add-on. But add-ons are not the only use case 
for extension profiles.


http://svn.zope.org/CMF/branches/2.0/CMFDefault/profiles/views_support/ 
is an example of what you call a base profile in disguise. It 
describes a variation of the default profile. I think this is a 
legitimate use case that helps to avoid redundancies and makes 
maintaining customizations easier.



Cheers,

Yuppie

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

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] Re: GenericSetup ATContentTypes global_allow

2006-09-21 Thread yuppie

Hi!


Raphael Ritz wrote:

That's not the point. The question is, say, you want (some of) the
default types *only* be addable to your custom type, so you want to
replicate what you do in ZMI by ticking one check box: the 'implicitly
addable' flag on a default type.

In the old days this would have been something like this (pseudo code):

  typesTool['File'].manage_changeProperties(global_allow=False)

in the custom product's install.

The question is: how would you do that from an extension profile
without replicating the entire 'File' fti for just this little change?


An XML file with this content should work:

?xml version=1.0?
object name=File
 property name=global_allowFalse/property
/object


This is the easy part. But the original question was how to do that in a 
loop based on a condition:



for type in types:
if type in NOT_IMPLICITLY_ADDABLE:


That doesn't work in GenericSetup. You have to add a small XML file for 
each content type as in this example:


http://svn.zope.org/CMF/branches/2.0/CMFDefault/profiles/views_support/


HTH

Yuppie

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

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] Re: GenericSetup ATContentTypes global_allow

2006-09-21 Thread Raphael Ritz

Tres Seaver schrieb:
[..]

The question is: how would you do that from an extension profile
without replicating the entire 'File' fti for just this little change?


Then you aren't making an extension:  it is really a base profile in
disguise, as you want to control types outside your profile's scope.
I don't want to make it easy for add-ons to scribble on other people's
types (although yuppie's suggestion would work):  the model here is that
either you are configuring the site *as a whole*, or you are extending
it by making well-behaved extensions to it.



Fair enough; and I didn't want to imply that GS should support that
the old way or make it easy; all I was trying was to explain
Katja's question to Suresh - and missing the main point as yuppie
pointed out. ;-)

On the other hand I think Katja's question nicely illustrates that
many of us (including myself) don't have a very clear cut picture
yet as to when provide and use a base versus an extension profiles.
It might seem trivial at first glance but given what people sometimes
do in 3rd-party add-on installs today together with Hanno's work on
the quickinstaller for Plone with respect to GS support and me
currently fixing/reviving installTypes from Archetypes (we just
cannot possibly break about 400 Plone add-ons in Plone-3.0 because
of moving to CMF-2.x) ...

People, at least in the Plone community, are used to the
download - install - test - uninstall pattern when it comes
to third-party extensions which isn't quite what GS has been
designed for - I know. So there might be more questions ahead.
That's all.

Raphael



Tres.


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

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] Re: GenericSetup ATContentTypes global_allow

2006-09-19 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Katja Süss wrote:
 Hi *
 How can I dofor type in types:if type in
 NOT_IMPLICITLY_ADDABLE:
t = pttool.getTypeInfo(type)
t.global_allow = 0
 for standard ATContentTypes
 when using GenericSetup for a product?
 Thanks for any hints,

You shouldn't need to post-process the type information objects,
because they have the 'global_allow' attribute stored in the profile
data:  just arrange to have that value be False

E.g., instead of::

 property name=global_allowTrue/property

change it to::

 property name=global_allowFalse/property



Tres.
- --
===
Tres Seaver  +1 202-558-7113  [EMAIL PROTECTED]
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFEBtA+gerLs4ltQ4RAkSaAJ44I9Hj3otYNF32CAYR3SBPtFg91wCcD2vI
nipGWj9HQKWsThVU3457Zhk=
=2nGg
-END PGP SIGNATURE-

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

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] Re: GenericSetup ATContentTypes global_allow

2006-09-19 Thread Katja Süss

..

How can I dofor type in types:if type in
NOT_IMPLICITLY_ADDABLE:
   t = pttool.getTypeInfo(type)
   t.global_allow = 0
for standard ATContentTypes
when using GenericSetup for a product?
Thanks for any hints,


You shouldn't need to post-process the type information objects,
because they have the 'global_allow' attribute stored in the profile
data:  just arrange to have that value be False

E.g., instead of::

 property name=global_allowTrue/property

change it to::

 property name=global_allowFalse/property



Tres.
- --


Ok, I do it like this for my custom types. But what to do with ATDocument, etc?
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] Re: GenericSetup ATContentTypes global_allow

2006-09-19 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Katja Süss wrote:
 ..
 How can I dofor type in types:if type in
 NOT_IMPLICITLY_ADDABLE:
t = pttool.getTypeInfo(type)
t.global_allow = 0
 for standard ATContentTypes
 when using GenericSetup for a product?
 Thanks for any hints,

 You shouldn't need to post-process the type information objects,
 because they have the 'global_allow' attribute stored in the profile
 data:  just arrange to have that value be False

 E.g., instead of::

  property name=global_allowTrue/property

 change it to::

  property name=global_allowFalse/property

 Ok, I do it like this for my custom types. But what to do with
 ATDocument, etc?

If you are creating a base profile (one which controls the *entire*
site), then you will have 'types/ATDocument.xml' inside it, and can
modify that flag yourself.  If you *aren't* creating a base profile,
then why would you want to modify the types created in the base?
Extension profiles are normally additive to the site.


Tres.
- --
===
Tres Seaver  +1 202-558-7113  [EMAIL PROTECTED]
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFECfe+gerLs4ltQ4RAsudAKCJwexOzYfwU+Ah4r5ehio1POSlbACgjhbl
edYUbGmJn4yrz3cqOTthxEk=
=B/nQ
-END PGP SIGNATURE-

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

See http://collector.zope.org/CMF for bug reports and feature requests