Hi JoseLuis, This is a workaround easing the integration. It's worst integrating it.
Can you enter a ticket about this so that we can integrate your patch
within CPS-3.4 please ?
Thanks for your contribution.
Regards,
J.
JoseLuis de la Rosa Triviño wrote:
> Hello all!
>
>
>
> I've found this snippet in CommentTool.py inside CPSForum product:
>
>
>
> def getParentFolder(proxy):
>
> """Returns 'Section' or 'Workspace' parent folder."""
>
> parent = proxy.aq_inner.aq_parent
>
> while parent:
>
> if hasattr(parent, 'portal_type') and \
>
> (parent.portal_type == 'Section' or
>
> parent.portal_type == 'Workspace'):
>
> return parent
>
> parent = parent.aq_inner.aq_parent
>
> return proxy.aq_inner.aq_parent
>
>
>
> I had some problem with this as I have a new type of folder which type
> is "WorkspaceCustomized".
>
> What I propose to improve this code is to add a new attribute to the
> class, let's say:
>
>
>
> parentTypes = ['Section', 'Workspace',] ## This would be the
> initial value for a CPSDefault Site
>
>
>
> and modify the procedure as this:
>
>
>
> def getParentFolder(proxy):
>
> """Returns parent folder."""
>
> parent = proxy.aq_inner.aq_parent
>
> while parent:
>
> if hasattr(parent, 'portal_type') and
> (parent.portal_type in parentTypes):
>
> return parent
>
> parent = parent.aq_inner.aq_parent
>
> return proxy.aq_inner.aq_parent
>
>
>
> I implemented this for my own site, and I thought it would be useful for
> any site. Is this possible to apply it to the original code?
>
>
>
> On the other side, Is there a way to define a type of content as a
> subtype of another? I mean, is there any way of inheritance between
> content types?
>
>
>
> Thank you very much.
>
>
>
> Best regards, joseluis.
>
> *JoseLuis de la Rosa Triviño*
> *Becario Área de Sistemas de Información*
> FUNDACIÓN IAVANTE
> [EMAIL PROTECTED]
> Tel. 951 015 300
>
>
>
> Este correo electrónico y, en su caso, cualquier fichero anexo, contiene
> información confidencial exclusivamente dirigida a su(s)
> destinatario(s). Toda copia o divulgación deberá ser autorizada por IAVANTE.
>
> This e-mail and any attachments are confidential and exclusively
> directed to its adressee(s). Any copy or distribution will have to be
> authorized by IAVANTE.
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> cps-devel mailing list
> http://lists.nuxeo.com/mailman/listinfo/cps-devel
--
Julien Anguenot | Nuxeo R&D (Paris, France)
CPS Platform : http://www.cps-project.org
Zope3 / ECM : http://www.z3lab.org
mail: anguenot at nuxeo.com; tel: +33 (0) 6 72 57 57 66
signature.asc
Description: OpenPGP digital signature
_______________________________________________ cps-devel mailing list http://lists.nuxeo.com/mailman/listinfo/cps-devel
