Re: [Product-Developers] Folder constraints not applicable to custom content-types

2011-02-28 Thread Raphael Ritz

On 2/28/11 1:35 PM, Andreas Jung wrote:

Plone 4.0.3

I have a custom content-types AuthoringPublishedContent (derived from
ATDocument).

Instances of this type should be created as content of some folder
generated by some backend
logic (and only there). That's why the content-types is not implictly
addable.

On the destination folder I enabled folder restrictions

 # ensure folder restrictions on destination folder
 dest_folder.setConstrainTypesMode(constraintypes.ENABLED)
 dest_folder.setLocallyAllowedTypes(['Folder',
'AuthoringPublishedDocument', 'File', 'Image', 'Document'])
 dest_folder.setImmediatelyAddableTypes(['Folder',
'AuthoringPublishedDocument', 'File', 'Image', 'Document'])

Creating a new AuthoringPublishedDocument instance inside this folder
fails badly:

Traceback (innermost last):
   Module ZPublisher.Publish, line 127, in publish
   Module ZPublisher.mapply, line 77, in mapply
   Module ZPublisher.Publish, line 47, in call_object
   Module zopyx.authoring.browser.conversionsfolder, line 228, in
generate_html_pdf
   Module Products.ATContentTypes.lib.constraintypes, line 261, in
invokeFactory
Unauthorized: Disallowed subobject type: AuthoringPublishedDocument

getAllowedContentTypes() for this particular folder returns only the types
of standard Plone but not my own type? Why this?


Not sure I get the full picture but you can only blacklist locally,
not white list. Meaning, you can't Allow this type here if it is
not allowed in the FTI for the container type. Only the other way
around works.

This has annoyed me to no end more than once.

Or I didn't get your question,

Raphael



Andreas

 
/home/ajung/.buildout/eggs/Products.ATContentTypes-2.0.7-py2.6.egg/Products/ATContentTypes/lib/constraintypes.py(260)invokeFactory()
- if not type_name in [fti.getId() for fti in self.allowedContentTypes()]:
(Pdb) print self.allowedContentTypes()
[DynamicViewTypeInformation at /Plone/portal_types/Document,
DynamicViewTypeInformation at /Plone/portal_types/File,
DynamicViewTypeInformation at /Plone/portal_types/Folder,
DynamicViewTypeInformation at /Plone/portal_types/Image]






___
Product-Developers mailing list
Product-Developers@lists.plone.org
https://lists.plone.org/mailman/listinfo/product-developers



___
Product-Developers mailing list
Product-Developers@lists.plone.org
https://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Folder constraints not applicable to custom content-types

2011-02-28 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Raphael Ritz wrote:

 Not sure I get the full picture but you can only blacklist locally,
 not white list. Meaning, you can't Allow this type here if it is
 not allowed in the FTI for the container type. Only the other way
 around works.

You got it right. Perhaps rephrasing my question in a different way:
is there some option to make a content-type implicitly addable but
hiding it from the add dropdown menu?

Andreas
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQGUBAEBAgAGBQJNa6/rAAoJEADcfz7u4AZjhrMLwJasvBR6gkzjxrBghWya6+ZH
znEtoM3I0M6XjublbPIGjXJLGjQG08r6YJups0anfzE/spbFMdC0evLEhoj8du7Y
UWJfKhpNCexYTE6Fkmjq1zKaUSdPhYW5O/NFxWJ/bm9ZAovfBlWhghbGuUAGZUh5
d1rvOvpZoWWDtD+avJ8DAy3muCvpkJDqrMvKsYL9hCJw7jcVqAZA8T562osnSwo8
TBBgaObPWNKEvBxk4FS6F+xx6ySldXdwRwkZid/BT3sHQuF5P00hcKvUg9u3XsF5
k61mTSmKLEvdn8JlRvx7R96rSB9SYOEwibYqm10Huig/fIHZSQ34+AAtvQPgDJ3S
ZCsZKLHXVkchWdsp2+z1Q4GjJIJTZ9nMP02v4AS72Cr1hhZ6GD7JxswyWprfrMd5
aWHy0C0Id4g7yMMVDcOnXSsxOoEPPsf0laD0GR417AT3FZSFyiMxfDNjXymAJl/5
Ky9+2HTcJKkbG1/ZpydnTy+BztXbEg0=
=o6ad
-END PGP SIGNATURE-
attachment: lists.vcf___
Product-Developers mailing list
Product-Developers@lists.plone.org
https://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Folder constraints not applicable to custom content-types

2011-02-28 Thread Yuri

Il 28/02/2011 15:23, Andreas Jung ha scritto:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Raphael Ritz wrote:

   

Not sure I get the full picture but you can only blacklist locally,
not white list. Meaning, you can't Allow this type here if it is
not allowed in the FTI for the container type. Only the other way
around works.
 

You got it right. Perhaps rephrasing my question in a different way:
is there some option to make a content-type implicitly addable but
hiding it from the add dropdown menu?
   


 isn't the menu an adapter, like the views menu?
___
Product-Developers mailing list
Product-Developers@lists.plone.org
https://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Folder constraints not applicable to custom content-types

2011-02-28 Thread Raphael Ritz

On 2/28/11 3:23 PM, Andreas Jung wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Raphael Ritz wrote:


Not sure I get the full picture but you can only blacklist locally,
not white list. Meaning, you can't Allow this type here if it is
not allowed in the FTI for the container type. Only the other way
around works.


You got it right. Perhaps rephrasing my question in a different way:
is there some option to make a content-type implicitly addable but
hiding it from the add dropdown menu?


We used to have this option via the 'getNotAddableTypes (or similar
spelling) Python Script but I don't think that's supported these days.

Raphael



Andreas
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQGUBAEBAgAGBQJNa6/rAAoJEADcfz7u4AZjhrMLwJasvBR6gkzjxrBghWya6+ZH
znEtoM3I0M6XjublbPIGjXJLGjQG08r6YJups0anfzE/spbFMdC0evLEhoj8du7Y
UWJfKhpNCexYTE6Fkmjq1zKaUSdPhYW5O/NFxWJ/bm9ZAovfBlWhghbGuUAGZUh5
d1rvOvpZoWWDtD+avJ8DAy3muCvpkJDqrMvKsYL9hCJw7jcVqAZA8T562osnSwo8
TBBgaObPWNKEvBxk4FS6F+xx6ySldXdwRwkZid/BT3sHQuF5P00hcKvUg9u3XsF5
k61mTSmKLEvdn8JlRvx7R96rSB9SYOEwibYqm10Huig/fIHZSQ34+AAtvQPgDJ3S
ZCsZKLHXVkchWdsp2+z1Q4GjJIJTZ9nMP02v4AS72Cr1hhZ6GD7JxswyWprfrMd5
aWHy0C0Id4g7yMMVDcOnXSsxOoEPPsf0laD0GR417AT3FZSFyiMxfDNjXymAJl/5
Ky9+2HTcJKkbG1/ZpydnTy+BztXbEg0=
=o6ad
-END PGP SIGNATURE-



___
Product-Developers mailing list
Product-Developers@lists.plone.org
https://lists.plone.org/mailman/listinfo/product-developers



___
Product-Developers mailing list
Product-Developers@lists.plone.org
https://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Folder constraints not applicable to custom content-types

2011-02-28 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Two possible workaround:

- - hiding the entry from the dropdown menu through CSS (I failed
  overriding an !important statement)
- - monkey-patching _allowedTypes() in
plone.app.content.browser.folderfactories which actually did the job for me

Hedley pointed me to a different solution using an adapters overriding
the available() method for IContentMenuItem but the adapter never got
used.

- -aj

Andreas Jung wrote:
 Plone 4.0.3
 
 I have a custom content-types AuthoringPublishedContent (derived from
 ATDocument).
 
 Instances of this type should be created as content of some folder
 generated by some backend
 logic (and only there). That's why the content-types is not implictly
 addable.
 
 On the destination folder I enabled folder restrictions
 
 # ensure folder restrictions on destination folder
 dest_folder.setConstrainTypesMode(constraintypes.ENABLED)
 dest_folder.setLocallyAllowedTypes(['Folder',
 'AuthoringPublishedDocument', 'File', 'Image', 'Document'])
 dest_folder.setImmediatelyAddableTypes(['Folder',
 'AuthoringPublishedDocument', 'File', 'Image', 'Document'])
 
 Creating a new AuthoringPublishedDocument instance inside this folder
 fails badly:
 
 Traceback (innermost last):
   Module ZPublisher.Publish, line 127, in publish
   Module ZPublisher.mapply, line 77, in mapply
   Module ZPublisher.Publish, line 47, in call_object
   Module zopyx.authoring.browser.conversionsfolder, line 228, in
 generate_html_pdf
   Module Products.ATContentTypes.lib.constraintypes, line 261, in
 invokeFactory
 Unauthorized: Disallowed subobject type: AuthoringPublishedDocument
 
 getAllowedContentTypes() for this particular folder returns only the types
 of standard Plone but not my own type? Why this?
 
 Andreas
 

 /home/ajung/.buildout/eggs/Products.ATContentTypes-2.0.7-py2.6.egg/Products/ATContentTypes/lib/constraintypes.py(260)invokeFactory()
 - if not type_name in [fti.getId() for fti in self.allowedContentTypes()]:
 (Pdb) print self.allowedContentTypes() 
 [DynamicViewTypeInformation at /Plone/portal_types/Document,
 DynamicViewTypeInformation at /Plone/portal_types/File,
 DynamicViewTypeInformation at /Plone/portal_types/Folder,
 DynamicViewTypeInformation at /Plone/portal_types/Image]
 
 
 
 
 ___
 Product-Developers mailing list
 Product-Developers@lists.plone.org
 https://lists.plone.org/mailman/listinfo/product-developers


- -- 
ZOPYX Limited   | zopyx group
Charlottenstr. 37/1 | The full-service network for Zope  Plone
D-72070 Tübingen| Produce  Publish
www.zopyx.com   | www.produce-and-publish.com
- 
E-Publishing, Python, Zope  Plone development, Consulting


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQGUBAEBAgAGBQJNa+fDAAoJEADcfz7u4AZjIawLv2Cuk7uVcg3p/D+tuyzIdWaw
fja8QzSjZSgDmsPz85PwgkvOuwZ25ett4j1IXe0w2V1+gcujW2LetrkHhtyToEQ9
tLLlriq5Dh5x/K0Hhg62T8PKsIR15Lxl8Uoo13gk2ZZ5OmoakJFt34SDY7W4gVf4
R91UfI28R8wWLzBtuxhGojr78taqKBdZHq3oi7Du3bijDR0SaZDHdDSFWveRuZuN
uVCfni0Z4LUHJ+5YV8MmNGcjS+I87wPYPXGopJ4CTylniPfl3eJ1loOpH5rd15oF
AUrKXAFaDqEACz4llU0+J985LQmCyJ/PYxWN8x4yMN5+KQFqS1sytIqbAKBNQfDC
2gQ7jjo71tFiAZDKJ7O89O2+tkF1F3v7D3PRb45TgdASyUSRZmPHFhJO6AFjXZWj
IGwJ0780VYs5wZOP+yQ7crrokbagCyDE9giDvO9Jwt89xYn+HwVpXu/4iAAvcRGJ
Ori4rZkBopmY8E94cMORmXrYkSfb9CY=
=Amt7
-END PGP SIGNATURE-
attachment: lists.vcf___
Product-Developers mailing list
Product-Developers@lists.plone.org
https://lists.plone.org/mailman/listinfo/product-developers