[Zope3-checkins] CVS: Zope3/src/zope/app/browser/content - xmldocument.py:1.1 configure.zcml:1.19

Philipp von Weitershausen philikon@philikon.de
Wed, 9 Apr 2003 07:48:22 -0400


Update of /cvs-repository/Zope3/src/zope/app/browser/content
In directory cvs.zope.org:/tmp/cvs-serv20312/browser/content

Modified Files:
	configure.zcml 
Added Files:
	xmldocument.py 
Log Message:
Added XML document content object. It uses the new XML field.


=== Added File Zope3/src/zope/app/browser/content/xmldocument.py ===
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""
$Id: xmldocument.py,v 1.1 2003/04/09 11:47:52 philikon Exp $
"""

from zope.publisher.browser import BrowserView

class XMLDocumentView(BrowserView):

    def show(self):
        """Show the XML text"""
        request = self.request
        request.response.setHeader('Content-Type', 'text/xml')
        return self.context.source


=== Zope3/src/zope/app/browser/content/configure.zcml 1.18 => 1.19 ===
--- Zope3/src/zope/app/browser/content/configure.zcml:1.18	Wed Apr  9 05:38:49 2003
+++ Zope3/src/zope/app/browser/content/configure.zcml	Wed Apr  9 07:47:52 2003
@@ -393,4 +393,35 @@
       description="An object for dynamic content based on Document Templates." 
       />
 
+
+<!-- XML Document View Directives -->
+
+  <browser:page
+      name="index.html" 
+      for="zope.app.content.xmldocument.IXMLDocument"
+      class="zope.app.browser.content.xmldocument.XMLDocumentView"
+      attribute="show" 
+      permission="zope.View"
+      />
+
+  <browser:editform
+      schema="zope.app.content.xmldocument.IXMLDocument"
+      name="edit.html"
+      menu="zmi_views" 
+      label="Edit an XML document"
+      permission="zope.ManageContent"
+      />
+
+  <!-- XXX we don't have an icon for this yet
+  <browser:icon name="zmi_icon"
+           for="zope.app.content.xmldocument.IXMLDocument" file="xml.gif" />
+  -->
+
+  <browser:menuItem
+      menu="add_content"
+      for="zope.app.interfaces.container.IAdding"
+      title="XML Document" action="XMLDocument"
+      description="An object storing XML text." 
+      />
+
 </zopeConfigure>