provide external editor usage for files, e.g. word documents

git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@1590 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2007-02-19 13:00:31 +00:00
parent 315076a575
commit 947bdf851f

View file

@ -23,21 +23,27 @@ $Id$
""" """
from zope.app import zapi from zope.app import zapi
from zope.event import notify from zope.app.pagetemplate import ViewPageTemplateFile
from zope.app.event.objectevent import ObjectModifiedEvent
from zope.cachedescriptors.property import Lazy from zope.cachedescriptors.property import Lazy
from zope.event import notify
from zope.lifecycleevent import ObjectModifiedEvent
from zope.security.proxy import removeSecurityProxy from zope.security.proxy import removeSecurityProxy
class ExternalEditorView(object): class ExternalEditorView(object):
def __init__(self, context, request):
self.context = context
self.request = request
# TODO: don't access context.data directly but via an IReadFile adapter # TODO: don't access context.data directly but via an IReadFile adapter
def load(self): def load(self, url=None):
context = removeSecurityProxy(self.context) context = removeSecurityProxy(self.context)
data = context.data data = context.data
r = [] r = []
r.append('url:' + zapi.absoluteURL(context, self.request)) r.append('url:' + (url or zapi.absoluteURL(context, self.request)))
r.append('content_type:' + str(context.contentType))
r.append('meta_type:' + '.'.join((context.__module__, context.__class__.__name__))) r.append('meta_type:' + '.'.join((context.__module__, context.__class__.__name__)))
auth = self.request.get('_auth') auth = self.request.get('_auth')
if auth: if auth: