[Zope3-checkins] SVN: Zope3/trunk/ Bring the hello world demo up-to-date so that it works again and add a

Philipp von Weitershausen philikon at philikon.de
Wed Aug 11 14:09:37 EDT 2004


Log message for revision 27008:
  
  Bring the hello world demo up-to-date so that it works again and add a
  ZCML slug so we notice when it breaks again. Apart from that, clean it
  up a little.
  
  


Changed:
  A   Zope3/trunk/package-includes/helloworld-configure.zcml
  U   Zope3/trunk/src/zope/app/demo/hellopackage/configure.zcml
  U   Zope3/trunk/src/zope/app/demo/hellopackage/configure_bare.zcml
  U   Zope3/trunk/src/zope/app/demo/hellopackage/hellomodule.py
  A   Zope3/trunk/src/zope/app/demo/hellopackage/helloworld-configure.zcml


-=-
Added: Zope3/trunk/package-includes/helloworld-configure.zcml
===================================================================
--- Zope3/trunk/package-includes/helloworld-configure.zcml	2004-08-11 18:09:32 UTC (rev 27007)
+++ Zope3/trunk/package-includes/helloworld-configure.zcml	2004-08-11 18:09:37 UTC (rev 27008)
@@ -0,0 +1 @@
+<include package="zope.app.demo.hellopackage" />

Modified: Zope3/trunk/src/zope/app/demo/hellopackage/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/demo/hellopackage/configure.zcml	2004-08-11 18:09:32 UTC (rev 27007)
+++ Zope3/trunk/src/zope/app/demo/hellopackage/configure.zcml	2004-08-11 18:09:37 UTC (rev 27008)
@@ -8,11 +8,11 @@
 Besides enclosing the rest of the directive, you define some
 namespaces on it in the standard XML namespaces way.
 
-xmlns="uri" defines the default namespace elements are in (when they don't
-use the 'foo:bar' notation).
+xmlns="uri" defines the default namespace elements are in (when they
+don't use the 'foo:bar' notation).
 
-xmlns:foo="uri" defines another namespace. You can put elements in that
-namespace by using the defined prefix ('foo:bar').
+xmlns:foo="uri" defines another namespace. You can put elements in
+that namespace by using the defined prefix ('foo:bar').
 
 i18n_domain="hellopackage" defines the internationalization (i18n)
 domain for this package
@@ -31,8 +31,8 @@
 -->
 <content class=".hellomodule.HelloClass">
   <implements 
-	    interface="zope.app.annotation.interfaces.IAttributeAnnotatable"
-	    />
+      interface="zope.app.annotation.interfaces.IAttributeAnnotatable"
+      />
 
   <!--
   More information about making new Hello objects.
@@ -41,10 +41,10 @@
   used to restrict who is allowed to add Hello objects.
   -->
   <factory
-      id="Hello"
-      permission="zope.ManageContent"
+      id="hellopackage.Hello"
       title="Hello world"
-      description="A simple hello world object." />
+      description="A simple hello world object."
+      />
 
   <!--
   Permissions on using Hello objects.
@@ -54,42 +54,41 @@
   -->
   <require
       permission="zope.View"
-      attributes="getHello" />
+      attributes="getHello"
+      />
 </content>
 
 <!--
 Create a hello.html view for Hello object.
 
-The view has a name (index.html),it applies to ZMI tab called (View) and it applies to an interface
-(interfaces.IHello). The view is made from a page template called
-hello.pt. Only people with the 'Zope.View' permission may use this
-view.
+The view has a name (index.html), it applies to ZMI tab called (View)
+and it applies to an interface (interfaces.IHello). The view is made
+from a page template called hello.pt. Only people with the 'Zope.View'
+permission may use this view.
 -->
-<browser:page for=".interfaces.IHello"
-	name="index.html"
-	menu="zmi_views"
-	title="View"
-	template="hello.pt"
-	permission="zope.View"
-        />
+<browser:page
+    for=".interfaces.IHello"
+    name="index.html"
+    menu="zmi_views"
+    title="View"
+    template="hello.pt"
+    permission="zope.View"
+    />
 
 <!--
 Add the Hello object to the add menu.
 
-The add menu is called 'add_content'. It's always a special kind of
-view on the Zope.App.OFS.Container.IAdding interface.
+'factory' refers to the id of the factory that creates new hello world
+objects.
 
-'action' refers to the id of the content object to add.
-
 'title' is what will show up in the add menu as the name of the
 object. 'description' will show up as a description in the add menu as
 well.
 -->
-<browser:menuItem
-    menu="add_content"
-    for="zope.app.container.interfaces.IAdding"
-    action="Hello"
+<browser:addMenuItem
+    factory="hellopackage.Hello"
     title="Hello world"
-    description="An object for hello worlding." />
+    description="An object for hello worlding."
+    />
 
 </configure>

Modified: Zope3/trunk/src/zope/app/demo/hellopackage/configure_bare.zcml
===================================================================
--- Zope3/trunk/src/zope/app/demo/hellopackage/configure_bare.zcml	2004-08-11 18:09:32 UTC (rev 27007)
+++ Zope3/trunk/src/zope/app/demo/hellopackage/configure_bare.zcml	2004-08-11 18:09:37 UTC (rev 27008)
@@ -8,30 +8,32 @@
 
 <content class=".hellomodule.HelloClass">
   <factory
-      id="Hello"
-      permission="zope.ManageContent"
+      id="hellopackage.Hello"
       title="Hello world"
-      description="A simple hello world object." />
+      description="A simple hello world object."
+      />
   <require
       permission="zope.View"
-      attributes="getHello" />
+      attributes="getHello"
+      />
 </content>
 
 <browser:page
     name="hello.html"
     for=".interfaces.IHello"
     template="hello.pt"
-    permission="zope.View" />
+    permission="zope.View"
+    />
 
 <browser:defaultView
     name="hello.html"
-    for=".interfaces.IHello" />
+    for=".interfaces.IHello"
+    />
 
-<browser:menuItem
-    menu="add_content"
-    for="zope.app.container.interfaces.IAdding."
-    action="Hello"
+<browser:addMenuItem
+    factory="hellopackage.Hello"
     title="Hello world"
-    description="An object for hello worlding." />
+    description="An object for hello worlding."
+    />
 
 </configure>

Modified: Zope3/trunk/src/zope/app/demo/hellopackage/hellomodule.py
===================================================================
--- Zope3/trunk/src/zope/app/demo/hellopackage/hellomodule.py	2004-08-11 18:09:32 UTC (rev 27007)
+++ Zope3/trunk/src/zope/app/demo/hellopackage/hellomodule.py	2004-08-11 18:09:37 UTC (rev 27008)
@@ -17,14 +17,12 @@
 """
 __docformat__ = 'restructuredtext'
 
-from interfaces import IHello
 from persistent import Persistent
 from zope.interface import implements
+from zope.app.demo.hellopackage.interfaces import IHello
 
-
 class HelloClass(Persistent):
     implements(IHello)
-
     
     def getHello(self):
         return "Hello world"

Added: Zope3/trunk/src/zope/app/demo/hellopackage/helloworld-configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/demo/hellopackage/helloworld-configure.zcml	2004-08-11 18:09:32 UTC (rev 27007)
+++ Zope3/trunk/src/zope/app/demo/hellopackage/helloworld-configure.zcml	2004-08-11 18:09:37 UTC (rev 27008)
@@ -0,0 +1 @@
+<include package="zope.app.demo.hellopackage" />



More information about the Zope3-Checkins mailing list