Nuxeo mailing list archives
[CPS-devel] Proxies and interfaces
Florent Guillaume
fg at nuxeo.com
Thu Jun 29 17:19:10 CEST 2006
Unfortunately the proxies rely on acquisition to get proper skins, so
zope 3 views can't be used directly.
On the other hand, you can create a specific view for ICPSProxy that
knows that it deals with a proxy and not a doc so can do getContent()
at the appropriate place. But this view will be for all proxies, not
just those of your docs.
This whole system was designed before anything like zope 3 views
existed, it's not easy to retrofit it now.
It's probably possible to make a proxy provide a specific interface
after it's been created, the have your view use that. You could try
prototyping it by adding the interface on one proxy from the ZMI
(Interface tab, you'll have to define a marker interface for your use
and bind the view to it) and check the view works.
Florent
On 29 Jun 2006, at 12:06, Santi Camps wrote:
> Hi all,
>
> I'm beginning to develop over CPS 3.4, and I'm trying to use Five when
> possible. I have a custom page, showing some specific content in the
> main slot. This page only has sense applied to one content type, so
> I register the page that way:
>
> <browser:page
> for=".interfaces.IMyInterface"
> template="www/myPage.zpt"
> name="myPage.html"
> permission="zope2.View"
> />
>
> But my content type is created using CPSSchema's, and it's proxied.
> So, when I call
> workspaces/resources/my-object/myPage.html, a Not Found is raised.
> But when I call
> portal_repository/2070145404__0001/myPage.html, works fine.
>
> The reason is obvious, the object in portal_repository is registered
> to really implement IMyInterface, when the other object is a Proxy,
> not registered to implement that interface. The question is, is there
> any workarround for this (other than registering the page for="*", of
> course) ? Could the CPSProxy object, in some way, register the
> interfaces of the objects it is proxying to ?
>
> Thanks in advance
> --
> Santi Camps
> Earcon S.L. - http://www.earcon.com
> - http://www.kmkey.com
> _______________________________________________
> cps-devel mailing list
> http://lists.nuxeo.com/mailman/listinfo/cps-devel
--
Florent Guillaume, Nuxeo (Paris, France) Director of R&D
+33 1 40 33 71 59 http://nuxeo.com fg at nuxeo.com
More information about the cps-devel
mailing list
This list archive provided by Nuxeo, the
leaders of open source ECM.
Check out the Nuxeo 5 open source,
standards-based ECM project.