[Zope3-checkins] CVS: Zope3/src/zope/app/schema - fieldforms.zcml:1.2 fields.zcml:1.3

Stephan Richter srichter at cosmos.phy.tufts.edu
Fri Aug 15 21:45:02 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/schema
In directory cvs.zope.org:/tmp/cvs-serv20171/app/schema

Modified Files:
	fields.zcml 
Added Files:
	fieldforms.zcml 
Log Message:
Merging dreamcatcher's TTW Schema branch:

1. Fixed Bug in adding that would cause infinite loops when the menu items
   action was not a valif view or factory id.

2. Extended adding to support more complex views. Until now we only 
   supported constructions like "+/AddView=id". Now you are able to say
   "+/AddView/More=id", which means that more information can be carried 
   in the URL. This can be used in many ways, including multi-page adding
   wizards. In my case I needed it to pass in the type of the TTW Schema-
   based Content Component.

3. Added Local Menus. This was a pain in the butt, but I think I got a 
   fairly nice model, where you can create local Menu Services, and Menus
   are simply named utilities. When active they are menus in the menu 
   service. This is very similar to the local interface service and TTW 
   Schema. 

4. Made some modifications to TTW Schema, cleaned up the code and moved
   the browser code and interfaces to the places they belong.

5. Added a Content Component Definition utility component, which takes a
   Schema and creates a content component for it, including permission
   settings and a menu entry. Currently the menu entry is always made to
   a local 'add_content' menu. I will change this and make it actually a
   screen, where the menu and title of the menu item can be chosen by the
   developer. Mmmh, should I add a factory for the definition as well, so
   that the content component is also available via python?

6. Added a Content Component Instance component that represents an 
   instance od a Content Component Definition. You will never directly 
   encounter this component, since it is automatically used by the adding
   code of the Content Component Definition.

7. Cleanups by both dreamcatcher and myself.

That's it. For more details see the branch checkin messages. I now consider
the dreamcatcher-ttwschema-branch closed.


=== Zope3/src/zope/app/schema/fieldforms.zcml 1.1 => 1.2 ===
--- /dev/null	Fri Aug 15 20:45:02 2003
+++ Zope3/src/zope/app/schema/fieldforms.zcml	Fri Aug 15 20:43:57 2003
@@ -0,0 +1,160 @@
+<configure xmlns="http://namespaces.zope.org/zope"
+           xmlns:browser="http://namespaces.zope.org/browser">
+
+  <browser:addform
+      label="Add Text Field"
+      name="Text Field"
+      menu="add_schema_field"
+      title="Text Field"
+      description="A Text Field"
+      content_factory="zope.schema.Text"
+      for="zope.app.interfaces.utilities.schema.ISchemaAdding"
+      schema="zope.schema.interfaces.IText"
+      permission="zope.ManageContent"
+      fields="title description required readonly
+              default min_length max_length allowed_values"
+    />
+
+  <browser:editform
+      label="Edit Text Field"
+      name="edit.html"
+      menu="zmi_views"
+      title="Edit"
+      for="zope.schema.interfaces.IText"
+      schema="zope.schema.interfaces.IText"
+      permission="zope.ManageContent"
+      fields="title description required readonly
+              default min_length max_length allowed_values"
+    />
+
+  <browser:addform
+      label="Add TextLine Field"
+      name="TextLine Field"
+      menu="add_schema_field"
+      title="TextLine Field"
+      description="A TextLine Field"
+      content_factory="zope.schema.TextLine"
+      for="zope.app.interfaces.utilities.schema.ISchemaAdding"
+      schema="zope.schema.interfaces.ITextLine"
+      permission="zope.ManageContent"
+      fields="title description required readonly
+              default min_length max_length allowed_values"
+    />
+
+  <browser:editform
+      label="Edit Text Line Field"
+      name="edit.html"
+      menu="zmi_views"
+      title="Edit"
+      for="zope.schema.interfaces.ITextLine"
+      schema="zope.schema.interfaces.ITextLine"
+      permission="zope.ManageContent"
+      fields="title description required readonly
+              default min_length max_length allowed_values"
+    />
+
+  <browser:addform
+      label="Add Boolean Field"
+      name="Boolean Field"
+      menu="add_schema_field"
+      title="Boolean Field"
+      description="A Boolean Field"
+      content_factory="zope.schema.Bool"
+      for="zope.app.interfaces.utilities.schema.ISchemaAdding"
+      schema="zope.schema.interfaces.IBool"
+      permission="zope.ManageContent"
+      fields="title description required readonly
+              default"
+    />
+
+  <browser:editform
+      label="Edit Boolean Field"
+      name="edit.html"
+      menu="zmi_views"
+      title="Edit"
+      for="zope.schema.interfaces.IBool"
+      schema="zope.schema.interfaces.IBool"
+      permission="zope.ManageContent"
+      fields="title description required readonly
+              default"
+    />
+
+  <browser:addform
+      label="Add Integer Field"
+      name="Integer Field"
+      menu="add_schema_field"
+      title="Integer Field"
+      description="An Integer Field"
+      content_factory="zope.schema.Int"
+      for="zope.app.interfaces.utilities.schema.ISchemaAdding"
+      schema="zope.schema.interfaces.IInt"
+      permission="zope.ManageContent"
+      fields="title description required readonly
+              default max min allowed_values"
+    />
+
+  <browser:editform
+      label="Edit Integer Field"
+      name="edit.html"
+      menu="zmi_views"
+      title="Edit"
+      for="zope.schema.interfaces.IInt"
+      schema="zope.schema.interfaces.IInt"
+      permission="zope.ManageContent"
+      fields="title description required readonly
+              default max min allowed_values"
+    />
+
+  <browser:addform
+      label="Add Float Field"
+      name="Float Field"
+      menu="add_schema_field"
+      title="Float Field"
+      description="A Float Field"
+      content_factory="zope.schema.Float"
+      for="zope.app.interfaces.utilities.schema.ISchemaAdding"
+      schema="zope.schema.interfaces.IFloat"
+      permission="zope.ManageContent"
+      fields="title description required readonly
+              default max min allowed_values"
+    />
+
+  <browser:editform
+      label="Edit Float Field"
+      name="edit.html"
+      menu="zmi_views"
+      title="Edit"
+      for="zope.schema.interfaces.IFloat"
+      schema="zope.schema.interfaces.IFloat"
+      permission="zope.ManageContent"
+      fields="title description required readonly
+              default max min allowed_values"
+    />
+
+  <browser:addform
+      label="Add Datetime Field"
+      name="Datetime Field"
+      menu="add_schema_field"
+      title="Datetime Field"
+      description="A Datetime Field"
+      content_factory="zope.schema.Datetime"
+      for="zope.app.interfaces.utilities.schema.ISchemaAdding"
+      schema="zope.schema.interfaces.IDatetime"
+      permission="zope.ManageContent"
+      fields="title description required readonly
+              default max min allowed_values"
+    />
+
+  <browser:editform
+      label="Edit Datetime Field"
+      name="edit.html"
+      menu="zmi_views"
+      title="Edit"
+      for="zope.schema.interfaces.IDatetime"
+      schema="zope.schema.interfaces.IDatetime"
+      permission="zope.ManageContent"
+      fields="title description required readonly
+              default max min allowed_values"
+    />
+
+</configure>
\ No newline at end of file


=== Zope3/src/zope/app/schema/fields.zcml 1.2 => 1.3 ===
--- Zope3/src/zope/app/schema/fields.zcml:1.2	Tue Aug  5 10:25:03 2003
+++ Zope3/src/zope/app/schema/fields.zcml	Fri Aug 15 20:43:57 2003
@@ -7,6 +7,8 @@
 	title="Basic Field"
 	description="Basic Field" />
 
+    <implements interface="zope.interface.interfaces.IAttribute" />
+
     <!--
     <require
 	permission="zope.View"
@@ -19,10 +21,13 @@
 	/>
     -->
 
+    <allow attributes="__name__" />
+
     <!-- XXX put the whole interface under one permission for now -->
     <require
 	permission="zope.ManageContent"
 	interface="zope.schema.interfaces.IField"
+	set_schema="zope.schema.interfaces.IField"
 	/>
 
   </content>
@@ -56,7 +61,11 @@
 	title="Orderable Field"
 	description="Orderable Field" />
 
-    <require like_class="zope.schema.Field" />
+    <require
+	permission="zope.ManageContent"
+	interface="zope.schema.interfaces.IMinMax"
+	set_schema="zope.schema.interfaces.IMinMax"
+	/>
 
   </content>
 
@@ -67,7 +76,11 @@
 	title="MinMaxLen Field"
 	description="MinMaxLen Field" />
 
-    <require like_class="zope.schema.Field" />
+    <require
+	permission="zope.ManageContent"
+	interface="zope.schema.interfaces.IMinMaxLen"
+	set_schema="zope.schema.interfaces.IMinMaxLen"
+	/>
 
   </content>
 
@@ -78,7 +91,11 @@
 	title="Enumerated Field"
 	description="Enumerated Field" />
 
-    <require like_class="zope.schema.Field" />
+    <require
+	permission="zope.ManageContent"
+	interface="zope.schema.interfaces.IEnumerated"
+	set_schema="zope.schema.interfaces.IEnumerated"
+	/>
 
   </content>
 
@@ -100,6 +117,8 @@
 	title="Bytes Field"
 	description="Bytes Field" />
 
+    <require like_class="zope.schema.Enumerated" />
+    <require like_class="zope.schema.MinMaxLen" />
     <require like_class="zope.schema.Field" />
 
   </content>
@@ -111,6 +130,8 @@
 	title="BytesLine Field"
 	description="BytesLine Field" />
 
+    <require like_class="zope.schema.Enumerated" />
+    <require like_class="zope.schema.MinMaxLen" />
     <require like_class="zope.schema.Field" />
 
   </content>
@@ -122,6 +143,10 @@
 	title="Text Field"
 	description="Text Field" />
 
+    <implements interface="zope.schema.interfaces.IFromUnicode" />
+
+    <require like_class="zope.schema.Enumerated" />
+    <require like_class="zope.schema.MinMaxLen" />
     <require like_class="zope.schema.Field" />
 
   </content>
@@ -133,6 +158,8 @@
 	title="Text Line Field"
 	description="Text Line Field" />
 
+    <require like_class="zope.schema.Enumerated" />
+    <require like_class="zope.schema.MinMaxLen" />
     <require like_class="zope.schema.Field" />
 
   </content>
@@ -155,6 +182,8 @@
 	title="Integer Field"
 	description="Integer Field" />
 
+    <require like_class="zope.schema.Enumerated" />
+    <require like_class="zope.schema.Orderable" />
     <require like_class="zope.schema.Field" />
 
   </content>
@@ -166,6 +195,8 @@
 	title="Float Field"
 	description="Float Field" />
 
+    <require like_class="zope.schema.Enumerated" />
+    <require like_class="zope.schema.Orderable" />
     <require like_class="zope.schema.Field" />
 
   </content>
@@ -199,6 +230,8 @@
 	title="Password Field"
 	description="Password Field" />
 
+    <require like_class="zope.schema.Enumerated" />
+    <require like_class="zope.schema.MinMaxLen" />
     <require like_class="zope.schema.Field" />
 
   </content>
@@ -210,6 +243,7 @@
 	title="Dict Field"
 	description="Dict Field" />
 
+    <require like_class="zope.schema.MinMaxLen" />
     <require like_class="zope.schema.Field" />
 
   </content>
@@ -221,6 +255,8 @@
 	title="Datetime Field"
 	description="Datetime Field" />
 
+    <require like_class="zope.schema.Enumerated" />
+    <require like_class="zope.schema.Orderable" />
     <require like_class="zope.schema.Field" />
 
   </content>
@@ -232,6 +268,8 @@
 	title="SourceText Field"
 	description="SourceText Field" />
 
+    <require like_class="zope.schema.Enumerated" />
+    <require like_class="zope.schema.MinMaxLen" />
     <require like_class="zope.schema.Field" />
 
   </content>
@@ -243,7 +281,9 @@
 	title="Object Field"
 	description="Object Field" />
 
-    <require like_class="zope.schema.Field" />
+    <require
+       permission="zope.ManageContent"
+       interface="zope.schema.interfaces.IObject" />
 
   </content>
 
@@ -254,6 +294,8 @@
 	title="URI Field"
 	description="URI Field" />
 
+    <require like_class="zope.schema.Enumerated" />
+    <require like_class="zope.schema.MinMaxLen" />
     <require like_class="zope.schema.Field" />
 
   </content>
@@ -265,6 +307,8 @@
 	title="Id Field"
 	description="Id Field" />
 
+    <require like_class="zope.schema.Enumerated" />
+    <require like_class="zope.schema.MinMaxLen" />
     <require like_class="zope.schema.Field" />
 
   </content>
@@ -276,6 +320,8 @@
 	title="EnumeratedTextLine Field"
 	description="EnumeratedTextLine Field" />
 
+    <require like_class="zope.schema.Enumerated" />
+    <require like_class="zope.schema.MinMaxLen" />
     <require like_class="zope.schema.Field" />
 
   </content>
@@ -287,6 +333,8 @@
 	title="EnumeratedInt Field"
 	description="EnumeratedInt Field" />
 
+    <require like_class="zope.schema.Enumerated" />
+    <require like_class="zope.schema.MinMaxLen" />
     <require like_class="zope.schema.Field" />
 
   </content>
@@ -298,6 +346,8 @@
 	title="EnumeratedFloat Field"
 	description="EnumeratedFloat Field" />
 
+    <require like_class="zope.schema.Enumerated" />
+    <require like_class="zope.schema.MinMaxLen" />
     <require like_class="zope.schema.Field" />
 
   </content>




More information about the Zope3-Checkins mailing list