-----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