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

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


Update of /cvs-repository/Zope3/src/zope/app/content
In directory cvs.zope.org:/tmp/cvs-serv20312/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/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 persistence import Persistent

from zope.schema.fieldproperty import FieldProperty
from zope.app.interfaces.annotation import IAnnotatable
from zope.app.interfaces.content.xmldocument import IXMLDocument

class XMLDocument(Persistent):

    __implements__ = IXMLDocument, IAnnotatable

    source = FieldProperty(IXMLDocument['source'])
 
    def __init__(self, source='<doc/>'):
        self.source = source


=== Zope3/src/zope/app/content/configure.zcml 1.11 => 1.12 ===
--- Zope3/src/zope/app/content/configure.zcml:1.11	Mon Feb  3 10:08:32 2003
+++ Zope3/src/zope/app/content/configure.zcml	Wed Apr  9 07:47:52 2003
@@ -330,7 +330,29 @@
 </content>
 
 
-<!-- Further Directives -->
+<!-- XML Document Directives-->
+
+<content class="zope.app.content.xmldocument.XMLDocument">
+  <factory
+      id="XMLDocument"
+      permission="zope.ManageContent"
+      title="XML Document"
+      description="A simple XML Document" />
+
+  <require
+      permission="zope.View"
+      attributes="source" />
+
+  <require
+      permission="zope.ManageContent"
+      set_attributes="source" />
 
+  <implements
+      interface="zope.app.interfaces.annotation.IAttributeAnnotatable" />
+
+</content>
+
+
+<!-- Further Directives -->
 
 </zopeConfigure>