[Plone-IT] Nuovo oggetto aggiungibile solo se in presenza di una data interface: come?

Vito Falco vitofalco a gmail.com
Dom 18 Gen 2009 21:25:53 UTC


Grazie Massimo!
Domani mattina do uno sguardo al codice che hai consigliato, ma nel
frattempo navigando ho trovato questo mini how-to:
http://plone.org/documentation/how-to/applying-a-custom-view-to-a-specific-folder

La parte chiamata "Attempt 3" mi sfruguglia, ma non sono riuscito a mettere
a fuoco (sarà per via dell'orario? :-S)

V.

2009/1/18 Massimo Azzolini <massimo.azzolini a gmail.com>

> ciao vito,
>
> non so come puoi farlo con genericsetup.
> però mi hai incuriosito, mi son messo lo zaino e son partito in gita dentro
> al codice.
> ravanando un po' ho trovato che per disegnare i menu si basa su
> _allowedTypes (in plone.app.contentmenu.menu.py)
> l'import è da:
> from plone.app.content.browser.folderfactories import _allowedTypes
>
> che poi è definito:
> def _allowedTypes(request, context):
>     return context.allowedContentTypes()
>
> per cui è tutto definito nel AT.
> potresti ridefinire il metodo "patchandolo". fa un po' schifo.. ma magari..
>
> ho anche trovato:
> Products.Archetypes.AllowedTypesByIface.py
> che non conoscevo e sembra tanto bellino, mi sembra di capire che non è
> utilizzato, ma in example c'è, appunto,  un esempio.
> magari partendo da li..
>
> ciao ciao
>
> max
>
> E. B. White  - "Genius is more often found in a cracked pot than in a whole
> one."
>
> On Sun, Jan 18, 2009 at 8:19 PM, Vito Falco <vitofalco a gmail.com> wrote:
>
>> mhmmm.. mi aspettavo una cosa più "alla zope3", tramite direttiva xml.
>>
>> Non ricordi proprio niente su questo notAllowedTypes?
>>
>> Vito
>>
>> 2009/1/18 Fabrizio Reale <fabrizio.reale a redomino.com>
>>
>>>
>>> > credo che la questione sia abbastanza banale ma al momento non mi
>>> sovviene
>>> > il codice adatto :-)
>>> >
>>> > Ho creato un nuovo mio tipo e voglio che sia "aggiungibile" nelle
>>> folder del
>>> > portale solo quando queste sono markate con una data interface (ad
>>> esempio
>>> > IQuiPuoi).
>>> > Credo sia un codicillo da inserire in configure.zcml, vero?
>>>
>>> Non ricordo se anche nel Plone 3 sia così, ma nelle versioni precedenti
>>> c'era un bellissimo script python tipo notAllowedTypes o qualcosa del
>>> genere
>>> che faceva il filtro di cosa si poteva aggiungere.
>>> Lì puoi mettere la tua condizione.
>>>
>>> Fabry
>>>
>>> --
>>> Fabrizio Reale
>>>
>>> Redomino S.r.l.
>>> Largo Valgioie 14,
>>> 10146 Torino Italy
>>> Tel: +39 0117499875
>>> http://redomino.com
>>>
>>>
>>> _______________________________________________
>>> Plone-IT mailing list
>>> Plone-IT a lists.plone.org
>>> http://lists.plone.org/mailman/listinfo/plone-it
>>> http://www.nabble.com/Plone---Italy-f21728.html
>>>
>>
>>
>>
>> --
>> "Design is the method of putting form and content together. Design, just
>> as art, has multiple definitions; there is no single definition. Design can
>> be art. Design can be aesthetics. Design is so simple, that's why it is so
>> complicated." by Paul Rand
>>
>> _______________________________________________
>> Plone-IT mailing list
>> Plone-IT a lists.plone.org
>> http://lists.plone.org/mailman/listinfo/plone-it
>> http://www.nabble.com/Plone---Italy-f21728.html
>>
>
>
> _______________________________________________
> Plone-IT mailing list
> Plone-IT a lists.plone.org
> http://lists.plone.org/mailman/listinfo/plone-it
> http://www.nabble.com/Plone---Italy-f21728.html
>



-- 
"Design is the method of putting form and content together. Design, just as
art, has multiple definitions; there is no single definition. Design can be
art. Design can be aesthetics. Design is so simple, that's why it is so
complicated." by Paul Rand
-------------- parte successiva --------------
Un allegato HTML è stato rimosso...
URL: <http://lists.plone.org/pipermail/plone-plone-it/attachments/20090118/6bde9222/attachment.html>


Maggiori informazioni sulla lista Plone-IT