r13405 - in Products.Archetypes/branches/plip11017-tag-selector-rmattb: . Products/Archetypes Products/Archetypes/Extensions Products/Archetypes/Schema Products/Archetypes/Storage Products/Archetypes/browser Products/Archetypes/docs Products/Archetypes/examples Products/Archetypes/interfaces Products/Archetypes/skins/archetypes Products/Archetypes/skins/archetypes/widgets Products/Archetypes/skins/archetypes/widgets/js Products/Archetypes/tests Products/Archetypes/www

"Eric Steele" <[email protected]>
Newsgroups gmane.comp.web.zope.plone.archetypes.cvs
Message-ID <[email protected]>
Author: esteele
Date: Tue Jan 11 14:41:39 2011
New Revision: 13405

Added:
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_reference_optimizations.py
      - copied unchanged from r13404, Products.Archetypes/trunk/Products/Archetypes/tests/test_reference_optimizations.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/uuid.py
      - copied unchanged from r13404, Products.Archetypes/trunk/Products/Archetypes/uuid.py
Modified:
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/   (props changed)
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/CHANGES.txt
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/   (props changed)
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/AllowedTypesByIface.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/ApeSupport.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/ArchetypeTool.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Extensions/migrations.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Extensions/utils.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Field.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Marshall.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/OrderedBaseFolder.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/ReferenceEngine.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Referenceable.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Renderer.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/SQLStorage.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/SQLStorageConfig.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Schema/__init__.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Schema/configure.zcml
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Schema/factory.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Storage/Facade.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Storage/annotation.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/UIDCatalog.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/VariableSchemaSupport.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/WebDAVSupport.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Widget.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/annotations.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/atapi.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/athistoryaware.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/bridge.zcml
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/browser/fields.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/browser/widgets.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/config.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/configure.zcml
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/debug.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/docs/sqlstorage-howto.rst
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/event.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/events.zcml
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/examples/ComplexType.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/examples/DDocument.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/examples/SimpleFile.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/implements.zcml
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/__init__.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/archetypetool.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/athistoryaware.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/event.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/field.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/orderedfolder.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/referenceable.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/schema.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/templatemixin.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/validator.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/vocabulary.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/mimetype_utils.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/add_reference.cpy
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/base_metadata.cpt
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/edit_macros.pt
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/unicodeTestIn.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/boolean.pt
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/calendar.pt
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/field.pt
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/image.pt
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/inandout.pt
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/js/textcount.js
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/keyword.pt
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/multiselection.pt
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/rich.pt
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/selection.pt
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/string.pt
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/textarea.pt
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/zid.pt
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/doctestcase.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/layer.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_annotation.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_athistoryaware.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_baseunit.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_default_mimetypes.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_event.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_extensions_utils.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_fields.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_file_upload.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_filename.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_functional.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_index.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_interfaces.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_metadata.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_referenceCatalog.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_referenceable.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_schemata.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_update_schema.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_utils.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_utils2.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_varschema.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_widgets.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/utils.py
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/addSchema.zpt
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/generateDebug.zpt
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/manageTemplates.zpt
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/manage_catalogs.zpt
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/migrationForm.zpt
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/registry_xml.zpt
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/schema.zpt
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/updateSchemaForm.zpt
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/validators_xml.zpt
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/README.txt
   Products.Archetypes/branches/plip11017-tag-selector-rmattb/setup.py
Log:
Merge changes from Archetypes trunk. Refs #11017.

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/CHANGES.txt
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/CHANGES.txt	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/CHANGES.txt	Tue Jan 11 14:41:39 2011
@@ -1,9 +1,78 @@
 Changelog
 =========
 
-1.6.2 - unreleased
+1.7.1 - Unreleased
 ------------------
 
+1.7 - 2011-01-03
+----------------
+
+- Merged optimizations from the `experimental.atrefspeedup` distribution into
+  the reference engine. We avoid intersections with the large relationship
+  index and loading the persistent reference objects where possible.
+  [hannosch]
+
+- Fix Referenceable, UIDCatalog to support references to non-Archetypes-based
+  content.
+  [toutpt]
+
+- Use the new `plone.uuid` package to generate UUIDs. The UID() method is now
+  an alias for ``IUUID(obj)``, which is the new preferred means of looking up
+  a UUID, since this can also work for non-Archetypes content. Archetypes
+  provides an IUUID() adapter that returns the value stored in the Archetypes
+  UID attribute. For new content, UUIDs are generated using
+  `plone.uuid.interfaces.IUUIDGenerator`, although old content will not (and
+  need not) be migrated.
+  [optilude]
+
+- Handle getCharset() returning None in Field.encode/decode.
+  [elro]
+
+- Avoid various deprecation warnings under Zope 2.13.
+  [hannosch]
+
+- Fixed a SyntaxWarning when using assert in the migrations module.
+  [deo]
+
+- Cleaned OrderedBaseFolder by using OFS implementation of OrderSupport.
+  [tom_gross]
+
+- Depend on Zope 2.13.1
+  [tom_gross]
+
+- Fixed textCounter JavaScript to work with fieldnames with hyphen.
+  API of textCounter-method changed. Second parameter takes now
+  the name of the counterfield, not the DOM object itself.
+  https://dev.plone.org/plone/ticket/11334
+  [tom_gross]
+
+1.6.4 - 2010-11-06
+------------------
+
+- Speed up the unicodeTestIn skin script.
+  [maurits]
+
+- Fixed chameleon incompatibilities.
+  [swampmonkey]
+
+1.6.3 - 2010-09-30
+------------------
+
+- Fixed TypeError introduced in the previous fix for the selection
+  widget when the passed value was None.
+  [maurits]
+
+1.6.2 - 2010-09-28
+------------------
+
+- Fixed error in the at_selection_widget view of a SelectionWidget if
+  the vocabulary has integer keys (usually with an IntDisplayList).
+  When a value has been filled in and the form is redisplayed
+  (e.g. due to missing required input on a different field) you would
+  loose the filled in value as it is submitted as a string, which is
+  not in the vocabulary.
+  (Fix forward ported from branch 1.5.)
+  [maurits]
 
 1.6.1 - 2010-07-18
 ------------------

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/AllowedTypesByIface.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/AllowedTypesByIface.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/AllowedTypesByIface.py	Tue Jan 11 14:41:39 2011
@@ -86,7 +86,7 @@
     ... except ValueError:
     ...     print 'Right'
     Right
-    
+
     """
 
     # XXX: This class depends heavily on implementation details in CMF's
@@ -110,7 +110,7 @@
             if t['portal_type'] == type_name:
                 fti = t
                 break
-        
+
         if fti is None:
             raise ValueError, "Type %r not available." % type_name
 

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/ApeSupport.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/ApeSupport.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/ApeSupport.py	Tue Jan 11 14:41:39 2011
@@ -27,7 +27,7 @@
  When you invoke ArchGenXML with the option --ape-support the outline_od.xmi
  sample works with APE correctly all ape_config and the serializer/gateway
  stuff is generated for you.
- 
+
 ApeSupport is tested with Ape 1.0 and PostgreSQL
 """
 

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/ArchetypeTool.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/ArchetypeTool.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/ArchetypeTool.py	Tue Jan 11 14:41:39 2011
@@ -214,7 +214,7 @@
             if action['id'] != 'folderlisting':
                 actions.append(action)
         fti[0]['actions'] = tuple(actions)
-        
+
     # CMF 1.5 method aliases
     if getattr(klass, 'aliases', None):
         aliases = klass.aliases
@@ -224,8 +224,8 @@
             if required not in aliases:
                 raise ValueError, "Alias %s is required but not provied by %s" % (
                                   required, klass)
-        fti[0]['aliases'] = aliases 
-        
+        fti[0]['aliases'] = aliases
+
     # Dynamic View FTI support
     if getattr(klass, 'default_view', False):
         default_view = klass.default_view
@@ -233,7 +233,7 @@
             raise TypeError, "Invalid type for default view in class %s" % klass
         fti[0]['default_view'] = default_view
         fti[0]['view_methods'] = (default_view, )
-        
+
         if getattr(klass, 'suppl_views', False):
             suppl_views = klass.suppl_views
             if not isinstance(suppl_views, (list, tuple)):
@@ -561,7 +561,7 @@
             # self._templates[instance] = ['base_view',]
             # templates = self._templates[instance]
         for t in templates:
-            results.append((t, self._registeredTemplates[t]))            
+            results.append((t, self._registeredTemplates[t]))
 
         return DisplayList(results).sortedByValue()
 
@@ -595,7 +595,7 @@
             self.registerTemplate(name)
 
         return REQUEST.RESPONSE.redirect(self.absolute_url() + '/manage_templateForm')
-    
+
     security.declareProtected(permissions.View, 'typeImplementsInterfaces')
     def typeImplementsInterfaces(self, type, interfaces):
         """Checks if an type uses one of the given interfaces.
@@ -607,19 +607,19 @@
             if res:
                 return True
         return False
-    
+
     security.declareProtected(permissions.View, 'isTemplateEnabled')
     def isTemplateEnabled(self, type):
         """Checks if an type uses ITemplateMixin.
         """
         return self.typeImplementsInterfaces(type, [ITemplateMixin])
-        
+
     security.declareProtected(permissions.View, 'listTemplateEnabledPortalTypes')
     def listTemplateEnabledPortalTypes(self):
         """Return a list of portal_types with ITemplateMixin
         """
         return self.listPortalTypesWithInterfaces([ITemplateMixin])
-        
+
     security.declareProtected(permissions.View, 'listPortalTypesWithInterfaces')
     def listPortalTypesWithInterfaces(self, ifaces):
         """Returns a list of ftis of which the types implement one of
@@ -629,7 +629,7 @@
         >>> tool = getToolByName(self.portal, TOOL_NAME)
         >>> meth = tool.listPortalTypesWithInterfaces
         >>> ftis = tool.listPortalTypesWithInterfaces([IReferenceable])
-        
+
         Sort the type ids and print them:
         >>> type_ids = [fti.getId() for fti in ftis]
         >>> type_ids.sort()
@@ -735,7 +735,7 @@
         typeDesc = getType(typeName, package)
         process_types([typeDesc], package)
         klass = typeDesc['klass']
-        
+
         # get the meta type of the FTI from the class, use the default FTI as default
         fti_meta_type = getattr(klass, '_at_fti_meta_type', None)
         if fti_meta_type in (None, 'simple item'):
@@ -837,7 +837,7 @@
         """Finds all object to check if they are 'referenceable'.
         """
         catalog = getToolByName(self, 'portal_catalog')
-        brains = catalog(id=[])
+        brains = catalog(dict(id=[]))
         for b in brains:
             o = b.getObject()
             if o is not None:
@@ -865,7 +865,7 @@
         """
         catalog = getToolByName(self, UID_CATALOG)
         keys = catalog.uniqueValuesFor('UID')
-        results = catalog(UID=keys)
+        results = catalog(dict(UID=keys))
         return results
 
 
@@ -1065,7 +1065,7 @@
                               'setCatalogsByType')
     def setCatalogsByType(self, portal_type, catalogList):
         """ associate catalogList with meta_type. (unfortunally not portal_type).
-        
+
             catalogList is a list of strings with the ids of the catalogs.
             Each catalog is has to be a tool, means unique in site root.
         """

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Extensions/migrations.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Extensions/migrations.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Extensions/migrations.py	Tue Jan 11 14:41:39 2011
@@ -20,7 +20,7 @@
 class StdoutStringIO(StringIO):
     """StringIO that also writes to stdout
     """
-    
+
     def write(self, s):
         print >> sys.stdout, str(s),
         StringIO.write(self, s)
@@ -39,7 +39,7 @@
             qi.installProducts([product])
             print >>out, '... installing %s' % product
     print >>out, 'Done\n'
-       
+
 def fixArchetypesTool(portal, out):
     at = portal.archetype_tool
 
@@ -57,13 +57,13 @@
 def migrateReferences(portal, out):
     # FIRST
     # a 1.2 -> 1.3 (new annotation style) migration path
-    
+
     at = getToolByName(portal, TOOL_NAME)
     rc = getToolByName(portal, REFERENCE_CATALOG)
     uc = getToolByName(portal, UID_CATALOG)
 
     count=0
-    
+
     # Old 1.2 style references are stored inside archetype_tool on the 'ref'
     # attribute
     refs = getattr(at, 'refs', None)
@@ -80,14 +80,14 @@
             for targetUID, relationship in refs.get(sourceUID, []):
                 # get target object
                 targetBrains = uc(**{olduididx:targetUID})
-                assert(len(targetBrains) == 1,'catalog query for OLD uid (%s) returned %d results instead of 1' % (targetUID,len(targetBrains)))
+                assert len(targetBrains) == 1, 'catalog query for OLD uid (%s) returned %d results instead of 1' % (targetUID,len(targetBrains))
                 targetObj=targetBrains[0].getObject()
                 # fix empty relationship
                 if not relationship:
                     relationship = EMPTY_RELATIONSHIP
                 # create new style reference
                 rc.addReference(sourceObj, targetObj, relationship)
-                count+=1        
+                count+=1
                 if not count % 10:
                     print >>out, '.',
                 # avoid eating up all RAM
@@ -102,13 +102,13 @@
             transaction.commit()
         else:
             transaction.savepoint(optimistic=True)
-    
+
     else:
         # SECOND
         # a 1.3.b2 -> 1.3 (new annotation style) migration path
         # We had a reference catalog, make sure its doing annotation
         # based references
-    
+
         # reference metadata cannot be restored since reference-catalog is no more
         # a btree and in AT 1.3.b2 reference_catalog was a btreefolder
 
@@ -154,27 +154,27 @@
 
 def migrateUIDs(portal, out):
     count=0
-    uc = getToolByName(portal, UID_CATALOG)    
+    uc = getToolByName(portal, UID_CATALOG)
     print >>out, 'Migrating uids\n'
-    
-    # temporary add a new index    
+
+    # temporary add a new index
     if olduididx not in uc.indexes():
         uc.addIndex(olduididx, 'FieldIndex', extra=None)
         if not olduididx in uc.schema():
             uc.addColumn(olduididx)
-    
-    # clear UID Catalog 
+
+    # clear UID Catalog
     uc.manage_catalogClear()
-    
+
     # rebuild UIDS on objects and in catalog
     allbrains = portal.portal_catalog()
     for brain in allbrains:
         # get a uid for each thingie
         obj = brain.getObject()
-        if not IBaseObject.providedBy(obj): 
+        if not IBaseObject.providedBy(obj):
             continue #its no Archetype instance, so leave it
-        
-        objUID = getattr(aq_base(obj), '_uid', None)        
+
+        objUID = getattr(aq_base(obj), '_uid', None)
         if objUID is not None: #continue    # not an old style AT?
             setattr(obj, olduididx, objUID) # this one can be part of the catalog
             delattr(obj, '_uid')
@@ -197,8 +197,8 @@
     print >>out, count, "UID's migrated."
 
 def removeOldUIDs(portal, out):
-    # remove temporary needed index 
-    uc = getToolByName(portal, UID_CATALOG)    
+    # remove temporary needed index
+    uc = getToolByName(portal, UID_CATALOG)
     print >>out, 'Removing old uids\n'
     if olduididx in uc.indexes():
         uc.delIndex(olduididx)
@@ -209,10 +209,10 @@
     for brain in allbrains:
         #Get a uid for each thingie
         obj = brain.getObject()
-        objUID = getattr(aq_base(obj), olduididx, None)        
+        objUID = getattr(aq_base(obj), olduididx, None)
         if objUID is None: continue # not an old style AT
         delattr(obj, olduididx)
-        obj._updateCatalog(portal) 
+        obj._updateCatalog(portal)
         count+=1
         if not count % 10:
             print >>out, '.',
@@ -250,11 +250,11 @@
                 catalog.addColumn(indexName)
         except:
             pass
-    
+
     rc = getToolByName(portal, REFERENCE_CATALOG)
     add_indexes = ('targetId', 'FieldIndex'),
     [addIndex(rc, n, t) for n, t in add_indexes]
-    
+
 def refreshCatalogs(portal, out):
     uc = getToolByName(portal, UID_CATALOG)
     rc = getToolByName(portal, REFERENCE_CATALOG)

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Extensions/utils.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Extensions/utils.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Extensions/utils.py	Tue Jan 11 14:41:39 2011
@@ -24,7 +24,7 @@
     """Registers additionals templates for TemplateMixin classes.
     """
     at = getToolByName(self, 'archetype_tool')
-    
+
     for t in types:
         klass = t['klass']
         if ITemplateMixin.implementedBy(klass):
@@ -126,7 +126,7 @@
             t.manage_changeProperties(**fti)
             if fti.has_key('aliases'):
                 t.setMethodAliases(fti['aliases'])
-        
+
         # Set the human readable title explicitly
         if t:
             t.title = klass.archetype_name
@@ -170,7 +170,7 @@
             fti['content_meta_type'] = fti['meta_type']
             return t, fti
     return t, None
-    
+
 
 def install_actions(self, out, types):
     typesTool = getToolByName(self, 'portal_types')
@@ -219,15 +219,15 @@
                     catalog = getToolByName(self, catalog_name)
                 else:
                     catalog = portal_catalog
-                
+
                 #####################
-                # add metadata column 
-                
+                # add metadata column
+
                 # lets see if the catalog is itself an Archetype:
                 isArchetype = IBaseObject.providedBy(catalog)
-                # archetypes based zcatalogs need to provide a different method 
-                # to list its schema-columns to not conflict with archetypes 
-                # schema                
+                # archetypes based zcatalogs need to provide a different method
+                # to list its schema-columns to not conflict with archetypes
+                # schema
                 hasNewWayMethod = hasattr(catalog, 'zcschema')
                 hasOldWayMethod = not isArchetype and hasattr(catalog, 'schema')
                 notInNewWayResults = hasNewWayMethod and accessor not in catalog.zcschema()
@@ -241,7 +241,7 @@
 
                 ###########
                 # add index
-                
+
                 # if you want to add a schema field without an index
                 #if not parts[0]:
                 #    continue
@@ -373,7 +373,7 @@
                 prepend.append(a.clone())
         if prepend:
             fti._actions = tuple(prepend + actions)
-    
+
 
 ## The master installer
 def installTypes(self, out, types, package_name,
@@ -396,7 +396,7 @@
 def refreshReferenceCatalog(self, out, types=None, package_name=None, ftypes=None):
     """refresh the reference catalog to reindex objects after reinstalling a
     AT based product.
-    
+
     This may take a very long time but it seems to be required under some
     circumstances.
     """
@@ -411,7 +411,7 @@
 
     rc = getToolByName(self, REFERENCE_CATALOG)
     mt = tuple([t.meta_type for t in ftypes])
-    
+
     # because manage_catalogFoundItems sucks we have to do it on our own ...
     func    = rc.catalog_object
     obj     = self

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Field.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Field.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Field.py	Tue Jan 11 14:41:39 2011
@@ -90,6 +90,8 @@
 
 from Products.Archetypes.interfaces import IFieldDefaultProvider
 
+from plone.uuid.interfaces import IUUID
+
 # Import conditionally, so we don't introduce a hard depdendency
 try:
     from plone.i18n.normalizer.interfaces import IUserPreferredFileNameNormalizer
@@ -128,6 +130,8 @@
                 # that occurs during object initialization
                 # (no acquisition wrapper)
                 encoding = 'UTF8'
+            if encoding is None:
+                encoding = 'UTF8'
         value = value.encode(encoding)
     return value
 
@@ -142,6 +146,8 @@
                 # that occurs during object initialization
                 # (no acquisition wrapper)
                 encoding = 'UTF8'
+            if encoding is None:
+                encoding = 'UTF8'
         value = unicode(value, encoding)
     return value
 
@@ -233,7 +239,7 @@
         name = name is not None and name or self.getName()
         return self.__class__(name, **properties)
 
-    
+
     def __repr__(self):
         """
         Return a string representation consisting of name, type and permissions.
@@ -438,17 +444,17 @@
                 the "getDisplayList" method of the class will be called.
 
         3) Zope 3 vocabulary factory vocabulary
-        
+
             - precondition: a content_instance is given
-            
+
             - self.vocabulary_factory is given
-            
-            - a named utility providing zope.schema.interfaces.IVocbularyFactory 
+
+            - a named utility providing zope.schema.interfaces.IVocbularyFactory
               exists for the name self.vocabulary_factory.
 
         """
         value = self.vocabulary
-        
+
         # Attempt to get the value from a a vocabulary factory if one was given
         # and no explicit vocabulary was set
         if not isinstance(value, DisplayList) and not value:
@@ -459,7 +465,7 @@
                 if factory_context is None:
                     factory_context = self
                 value = DisplayList([(t.value, t.title or t.token) for t in factory(factory_context)])
-                    
+
         if not isinstance(value, DisplayList):
 
             if content_instance is not None and isinstance(value, basestring):
@@ -593,7 +599,7 @@
             default_adapter = component.queryAdapter(instance, IFieldDefaultProvider, name=self.__name__)
             if default_adapter is not None:
                 return default_adapter()
-                
+
         return self.default
 
     security.declarePublic('getAccessor')
@@ -831,16 +837,16 @@
         'default': '',
         'default_content_type' : 'text/plain',
         })
-    
+
     implements(IStringField)
-    
+
     security  = ClassSecurityInfo()
 
     security.declarePrivate('get')
     def get(self, instance, **kwargs):
-        value = ObjectField.get(self, instance, **kwargs) 
-        if getattr(self, 'raw', False): 
-            return value 
+        value = ObjectField.get(self, instance, **kwargs)
+        if getattr(self, 'raw', False):
+            return value
         return encode(value, instance, **kwargs)
 
     security.declarePrivate('set')
@@ -874,7 +880,7 @@
         """Set mimetype in the base unit.
         """
         file = self.get(instance)
-        try: 
+        try:
             # file might be None or an empty string
             setattr(file, 'content_type', value)
         except AttributeError:
@@ -1227,7 +1233,7 @@
         'primary' : False,
         'content_class': BaseUnit,
         })
-        
+
     implements(ITextField)
 
     security  = ClassSecurityInfo()
@@ -1258,7 +1264,7 @@
         """
         act_attribute = getattr(self, 'allowable_content_types', None)
         if act_attribute is None:
-            return getAllowedContentTypesProperty(instance) 
+            return getAllowedContentTypesProperty(instance)
         else:
             return act_attribute
 
@@ -1416,11 +1422,11 @@
         'type' : 'datetime',
         'widget' : CalendarWidget,
         })
-    
+
     implements(IDateTimeField)
-    
+
     security  = ClassSecurityInfo()
-    
+
     security.declarePrivate('validate_required')
     def validate_required(self, instance, value, errors):
         try:
@@ -1464,9 +1470,9 @@
         'default' : (),
         'widget' : LinesWidget,
         })
-    
+
     implements(ILinesField)
-    
+
     security  = ClassSecurityInfo()
 
     security.declarePrivate('set')
@@ -1518,7 +1524,7 @@
         'widget' : IntegerWidget,
         'default' : None,
         })
-    
+
     implements(IIntegerField)
 
     security  = ClassSecurityInfo()
@@ -1551,7 +1557,7 @@
         'type' : 'float',
         'default': None
         })
-        
+
     implements(IFloatField)
 
     security  = ClassSecurityInfo()
@@ -1581,12 +1587,12 @@
         ObjectField.set(self, instance, value, **kwargs)
 
 class FixedPointField(ObjectField):
-    """A field for storing numerical data with fixed points 
-    
+    """A field for storing numerical data with fixed points
+
     Test for fix for Plone issue #9414: '0' and '0.0' should count as values
     when validating required fields.  (A return value of None means validation
     passed.)
-    
+
     >>> f = FixedPointField()
     >>> f.validate_required(None, '0', [])
     >>> f.validate_required(None, '0.0', [])
@@ -1600,7 +1606,7 @@
         'widget' : DecimalWidget,
         'validators' : ('isDecimal'),
         })
-    
+
     implements(IFixedPointField)
 
     security  = ClassSecurityInfo()
@@ -1683,7 +1689,7 @@
                 value[0] += '0'
             front = int(value[0])
             fra = int(fra)
-            # Handle values between -1 and 0. 
+            # Handle values between -1 and 0.
             if front == 0 and value[0].startswith('-'):
                 fra = -1 * fra
             value = (front, fra)
@@ -1711,7 +1717,7 @@
             sign = '-'
             fra = abs(fra)
         return template % (sign, front, fra)
-    
+
 
 class ReferenceField(ObjectField):
     """A field for creating references between objects.
@@ -1745,7 +1751,7 @@
         'callStorageOnSet': False,
         'index_method' : '_at_edit_accessor',
         })
-        
+
     implements(IReferenceField)
 
     security  = ClassSecurityInfo()
@@ -1760,7 +1766,7 @@
 
         # singlevalued ref fields return only the object, not a list,
         # unless explicitely specified by the aslist option
-   
+
         if not self.multiValued:
             if len(res) > 1:
                 log("%s references for non multivalued field %s of %s" % (len(res),
@@ -1776,7 +1782,7 @@
             return res
 
         rd = {}
-        [rd.__setitem__(r.UID(), r) for r in res]
+        [rd.__setitem__(IUUID(r, None), r) for r in res]
 
         refs = instance.at_ordered_refs
         order = refs[self.relationship]
@@ -1808,7 +1814,7 @@
         []
 
         Use a list of UIDs to set:
-        
+
         >>> nodes[0].setLinks([n.UID() for n in nodes[1:]])
         >>> nodes[0].getLinks()
         [<Refnode...>, <Refnode...>]
@@ -1817,7 +1823,7 @@
         []
 
         Setting multiple values for a non multivalued field will fail:
-        
+
         >>> nodes[1].setLink(nodes)
         Traceback (most recent call last):
         ...
@@ -1825,7 +1831,7 @@
 
         Keyword arguments may be passed directly to addReference(),
         thereby creating properties on the reference objects:
-        
+
         >>> nodes[1].setLink(nodes[0].UID(), foo='bar', spam=1)
         >>> ref = nodes[1].getReferenceImpl()[0]
         >>> ref.foo, ref.spam
@@ -1857,7 +1863,7 @@
             if isinstance(v, basestring):
                 uids.append(v)
             else:
-                uids.append(v.UID())
+                uids.append(IUUID(v, None))
 
         add = [v for v in uids if v and v not in targetUIDs]
         sub = [t for t in targetUIDs if t not in uids]
@@ -1893,7 +1899,7 @@
         relationship
         """
         rc = getToolByName(instance, REFERENCE_CATALOG)
-        brains = rc(sourceUID=instance.UID(),
+        brains = rc(sourceUID=IUUID(instance, None),
                     relationship=self.relationship)
         res = [b.targetUID for b in brains]
         if not self.multiValued and not aslist:
@@ -1903,10 +1909,10 @@
                 res = None
 
         if not self.multiValued or not self.referencesSortable or not hasattr(aq_base(instance), 'at_ordered_refs'):
-            return res       
+            return res
 
         refs = instance.at_ordered_refs
-        order = refs[self.relationship] 
+        order = refs[self.relationship]
         return [r for r in order if r in res]
 
 
@@ -1928,7 +1934,7 @@
 
         if title is not None and isinstance(title, basestring):
             return decode(title, instance)
-        
+
         raise AttributeError, "Brain has no title or id"
 
     def _Vocabulary(self, content_instance):
@@ -1944,7 +1950,7 @@
             allowed_types = meth(self)
 
         skw = allowed_types and {'portal_type':allowed_types} or {}
-        brains = uc.searchResults(**skw)
+        brains = uc.searchResults(skw)
 
         if self.vocabulary_custom_label is not None:
             label = lambda b:eval(self.vocabulary_custom_label, {'b': b})
@@ -2020,7 +2026,7 @@
         'mode' : 'r',
         'storage': ReadOnlyStorage(),
         })
-    
+
     implements(IComputedField)
 
     security = ClassSecurityInfo()
@@ -2049,23 +2055,23 @@
         'type' : 'boolean',
         'default': None,
         'vocabulary': (('True','Yes', 'yes'),('False','No', 'no')),
-        'widget' : BooleanWidget,        
+        'widget' : BooleanWidget,
         })
-        
+
     implements(IBooleanField)
 
     security  = ClassSecurityInfo()
 
     security.declarePrivate('get')
     def get(self, instance, **kwargs):
-        value = super(BooleanField, self).get(instance, **kwargs) 
+        value = super(BooleanField, self).get(instance, **kwargs)
         if value is None:
             return value
         return bool(value)
 
     security.declarePrivate('getRaw')
     def getRaw(self, instance, **kwargs):
-        value = super(BooleanField, self).getRaw(instance, **kwargs) 
+        value = super(BooleanField, self).getRaw(instance, **kwargs)
         if value is None:
             return value
         return bool(value)
@@ -2243,7 +2249,7 @@
 
         sizes may be the name of a method in the instance or a callable which
         returns a dict.
-        
+
         Don't remove scales once they exist! Instead of removing a scale
         from the list of sizes you should set the size to (0,0). Thus
         removeScales method is able to find the scales to delete the
@@ -2264,16 +2270,16 @@
         'sizes' : {'thumb':(80,80)},
         'swallowResizeExceptions' : False,
         'pil_quality' : 88,
-        'pil_resize_algo' : PIL_ALGO, 
+        'pil_resize_algo' : PIL_ALGO,
         'default_content_type' : 'image/png',
         'allowable_content_types' : ('image/gif','image/jpeg','image/png'),
         'widget': ImageWidget,
         'storage': AttributeStorage(),
         'content_class': Image,
         })
-    
+
     implements(IImageField)
-    
+
     security  = ClassSecurityInfo()
 
     default_view = "view"
@@ -2298,7 +2304,7 @@
         get_size = getattr(value, 'get_size', None)
         if get_size is not None and get_size() == 0:
             return
-        
+
         kwargs['mimetype'] = mimetype
         kwargs['filename'] = filename
 
@@ -2343,15 +2349,15 @@
         """rescales the original image and sets the data
 
         for self.original_size or self.max_size
-        
+
         value must be an OFS.Image.Image instance
         """
         data = str(value.data)
         if not HAS_PIL:
             return data
-        
+
         mimetype = kwargs.get('mimetype', self.default_content_type)
-        
+
         if self.original_size or self.max_size:
             if not value:
                 return self.default
@@ -2371,7 +2377,7 @@
                 data = fvalue.read()
         else:
             data = str(value.data)
-            
+
         return data
 
     security.declarePrivate('createOriginal')
@@ -2532,7 +2538,7 @@
     security.declarePublic('get_size')
     def get_size(self, instance):
         """Get size of the stored data used for get_size in BaseObject
-        
+
         TODO: We should only return the size of the original image
         """
         sizes = self.getAvailableSizes(instance)

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Marshall.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Marshall.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Marshall.py	Tue Jan 11 14:41:39 2011
@@ -28,7 +28,7 @@
 
 class NonLoweringMessage(Message):
     """A RFC 822 Message class that doesn't lower header names
-    
+
     IMPORTANT: Only a small subset of the available methods aren't lowering the
                header names!
     """
@@ -41,7 +41,7 @@
             return line[:i]
             #return line[:i].lower()
         else:
-            return None        
+            return None
 
     def getheader(self, name, default=None):
         """Get the header value for a name.
@@ -51,7 +51,7 @@
             # return self.dict[name.lower()]
         except KeyError:
             return default
-    get = getheader  
+    get = getheader
 
 
 
@@ -61,7 +61,7 @@
         headers, including adding leading whitespace to elements which
         contain newlines in order to preserve continuation-line semantics.
 
-        code based on old cmf1.4 impl 
+        code based on old cmf1.4 impl
     """
     munged = []
     linesplit = re.compile( r'[\n\r]+?' )
@@ -75,10 +75,10 @@
 
 def parseRFC822(body):
     """Parse a RFC 822 (email) style string
-    
+
     The code is mostly based on CMFDefault.utils.parseHeadersBody. It doesn't
     capitalize the headers as the CMF function.
-    
+
     >>> headers, body = parseRFC822(sample_data)
     >>> keys = headers.keys(); keys.sort()
     >>> for key in keys:
@@ -87,7 +87,7 @@
     ('keywords', 'foo')
     ('mixedCase', 'a MiXeD case keyword')
     ('title', 'a title')
-    
+
     >>> print body
     This is the body.
     <BLANKLINE>

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/OrderedBaseFolder.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/OrderedBaseFolder.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/OrderedBaseFolder.py	Tue Jan 11 14:41:39 2011
@@ -1,6 +1,6 @@
-"""
+""" A base/mixin class for Archetype folders with order support
+
 OrderedBaseFolder derived from OrderedFolder by Stephan Richter, iuveno AG.
-OrderedFolder adapted to Zope 2.7 style interface by [email protected]
 """
 
 from zope.interface import implements
@@ -8,6 +8,7 @@
 from AccessControl import ClassSecurityInfo
 from App.class_init import InitializeClass
 from DocumentTemplate import sequence
+from OFS.OrderSupport import OrderSupport
 from OFS.interfaces import IOrderedContainer
 from Products.CMFCore.utils import getToolByName
 from Products.CMFCore.interfaces import IDynamicType
@@ -18,9 +19,9 @@
 from Products.Archetypes.ExtensibleMetadata import ExtensibleMetadata
 
 
-class OrderedContainer:
-
-    implements(IOrderedContainer)
+class OrderedContainer(OrderSupport):
+    """ Archetype specific additions and changes to OFS.OrderSupport
+    """
 
     security = ClassSecurityInfo()
 
@@ -37,136 +38,24 @@
         metadata.insert(position, obj_meta)
         self._objects = tuple(metadata)
 
-    # TODO here the implementing of IOrderedContainer starts
-    # this should be replaced by mixing in the 2.7 specific class
-    # OSF.OrderedContainer.OrderedContainer
-
-    security.declareProtected(permissions.ModifyPortalContent, 'moveObjectsByDelta')
-    def moveObjectsByDelta(self, ids, delta, subset_ids=None):
-        """ Move specified sub-objects by delta.
-        """
-        if isinstance(ids, basestring):
-            ids = (ids,)
-        min_position = 0
-        objects = list(self._objects)
-        if subset_ids == None:
-            # OLD: subset_ids = [ obj['id'] for obj in objects ]
-            subset_ids = self.getCMFObjectsSubsetIds(objects)
-        else:
-            subset_ids = list(subset_ids)
-        # unify moving direction
-        if delta > 0:
-            ids = list(ids)
-            ids.reverse()
-            subset_ids.reverse()
-        counter = 0
-
-        for id in ids:
-            try:
-                old_position = subset_ids.index(id)
-            except ValueError:
-                continue
-            new_position = max( old_position - abs(delta), min_position )
-            if new_position == min_position:
-                min_position += 1
-            if not old_position == new_position:
-                subset_ids.remove(id)
-                subset_ids.insert(new_position, id)
-                counter += 1
-
-        if counter > 0:
-            if delta > 0:
-                subset_ids.reverse()
-            obj_dict = {}
-            for obj in objects:
-                obj_dict[ obj['id'] ] = obj
-            pos = 0
-            for i in range( len(objects) ):
-                if objects[i]['id'] in subset_ids:
-                    try:
-                        objects[i] = obj_dict[ subset_ids[pos] ]
-                        pos += 1
-                    except KeyError:
-                        raise ValueError('The object with the id "%s" does '
-                                         'not exist.' % subset_ids[pos])
-            self._objects = tuple(objects)
-
-        return counter
-
     security.declarePrivate('getCMFObjectsSubsetIds')
-    def getCMFObjectsSubsetIds(self, objs):
+    def getIdsSubset(self, objs):
         """Get the ids of only cmf objects (used for moveObjectsByDelta)
         """
         ttool = getToolByName(self, 'portal_types')
         cmf_meta_types = [ti.Metatype() for ti in ttool.listTypeInfo()]
         return [obj['id'] for obj in objs if obj['meta_type'] in cmf_meta_types ]
 
+    # BBB
+    getCMFObjectsSubsetIds = getIdsSubset
+
     security.declareProtected(permissions.ModifyPortalContent, 'getObjectPosition')
     def getObjectPosition(self, id):
-
-        objs = list(self._objects)
-        om = [objs.index(om) for om in objs if om['id']==id ]
-
-        if om: # only 1 in list if any
-            return om[0]
-
-        raise NotFound, 'Object %s was not found' % str(id)
-
-    security.declareProtected(permissions.ModifyPortalContent, 'moveObjectsUp')
-    def moveObjectsUp(self, ids, delta=1, RESPONSE=None):
-        """ Move an object up """
-        self.moveObjectsByDelta(ids, -delta)
-        if RESPONSE is not None:
-            RESPONSE.redirect('manage_workspace')
-
-    security.declareProtected(permissions.ModifyPortalContent, 'moveObjectsDown')
-    def moveObjectsDown(self, ids, delta=1, RESPONSE=None):
-        """ move an object down """
-        self.moveObjectsByDelta(ids, delta)
-        if RESPONSE is not None:
-            RESPONSE.redirect('manage_workspace')
-
-    security.declareProtected(permissions.ModifyPortalContent, 'moveObjectsToTop')
-    def moveObjectsToTop(self, ids, RESPONSE=None):
-        """ move an object to the top """
-        self.moveObjectsByDelta( ids, -len(self._objects) )
-        if RESPONSE is not None:
-            RESPONSE.redirect('manage_workspace')
-
-    security.declareProtected(permissions.ModifyPortalContent, 'moveObjectsToBottom')
-    def moveObjectsToBottom(self, ids, RESPONSE=None):
-        """ move an object to the bottom """
-        self.moveObjectsByDelta( ids, len(self._objects) )
-        if RESPONSE is not None:
-            RESPONSE.redirect('manage_workspace')
-
-    security.declareProtected(permissions.ModifyPortalContent, 'moveObjectToPosition')
-    def moveObjectToPosition(self, id, position):
-        """ Move specified object to absolute position.
-        """
-        delta = position - self.getObjectPosition(id)
-        return self.moveObjectsByDelta(id, delta)
-
-    security.declareProtected(permissions.ModifyPortalContent, 'orderObjects')
-    def orderObjects(self, key, reverse=None):
-        """ Order sub-objects by key and direction.
-        """
-        ids = [ id for id, obj in sequence.sort( self.objectItems(),
-                                        ( (key, 'cmp', 'asc'), ) ) ]
-        if reverse:
-            ids.reverse()
-        return self.moveObjectsByDelta( ids, -len(self._objects) )
-
-    # here the implementing of IOrderedContainer ends
-
-    def manage_renameObject(self, id, new_id, REQUEST=None):
-        " "
-        objidx = self.getObjectPosition(id)
-        method = OrderedContainer.inheritedAttribute('manage_renameObject')
-        result = method(self, id, new_id, REQUEST)
-        self.moveObject(new_id, objidx)
-
-        return result
+        try:
+            pos = OrderSupport.getObjectPosition(self, id)
+        except ValueError:
+            raise NotFound, 'Object %s was not found' % str(id)
+        return pos
 
 InitializeClass(OrderedContainer)
 

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/ReferenceEngine.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/ReferenceEngine.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/ReferenceEngine.py	Tue Jan 11 14:41:39 2011
@@ -6,10 +6,9 @@
 
 from Products.CMFCore.utils import getToolByName
 from Products.Archetypes.interfaces.referenceable import IReferenceable
+from Products.Archetypes.interfaces import IContentReference
 from Products.Archetypes.interfaces import IReference
 from Products.Archetypes.interfaces import IReferenceCatalog
-from Products.Archetypes.interfaces.referenceengine import \
-    IContentReference, IReference as Z2IReference
 
 from Products.Archetypes.utils import make_uuid, getRelURL, shasattr
 from Products.Archetypes.config import (
@@ -29,8 +28,10 @@
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 from Products.ZCatalog.ZCatalog import ZCatalog
 from Products.ZCatalog.Catalog import Catalog
+from Products.ZCatalog.Lazy import LazyMap
 from Products import CMFCore
 
+from plone.uuid.interfaces import IUUID
 
 _www = os.path.join(os.path.dirname(__file__), 'www')
 _catalog_dtml = os.path.join(os.path.dirname(CMFCore.__file__), 'dtml')
@@ -84,30 +85,18 @@
 
     def UID(self):
         """the uid method for compat"""
-        return getattr(aq_base(self), UUID_ATTR)
+        return IUUID(self, None)
 
-    ###
     # Convenience methods
+
     def getSourceObject(self):
-        tool = getToolByName(self, UID_CATALOG, None)
-        if tool is None: return ''
-        brains = tool(UID=self.sourceUID)
-        for brain in brains:
-            obj = brain.getObject()
-            if obj is not None:
-                return obj
+        return self._optimizedGetObject(self.sourceUID)
 
     def getTargetObject(self):
-        tool = getToolByName(self, UID_CATALOG, None)
-        if tool is None: return ''
-        brains = tool(UID=self.targetUID)
-        for brain in brains:
-            obj = brain.getObject()
-            if obj is not None:
-                return obj
+        return self._optimizedGetObject(self.targetUID)
 
-    ###
     # Catalog support
+
     def targetId(self):
         target = self.getTargetObject()
         if target is not None:
@@ -271,13 +260,13 @@
 
 class IndexableObjectWrapper(object):
     """Wwrapper for object indexing
-    """    
+    """
     def __init__(self, obj):
         self._obj = obj
-                
+
     def __getattr__(self, name):
         return getattr(self._obj, name)
-        
+
     def Title(self):
         # TODO: dumb try to make sure UID catalog doesn't fail if Title can't be
         # converted to an ascii string
@@ -367,28 +356,77 @@
         for b in self.getBackReferences(object, relationship):
             self._deleteReference(b)
 
-    def getReferences(self, object, relationship=None, targetObject=None):
+    def getReferences(self, object, relationship=None, targetObject=None,
+                      objects=True):
         """return a collection of reference objects"""
-        sID, sobj = self._uidFor(object)
-        if targetObject:
-            tID, tobj = self._uidFor(targetObject)
-        else:
-            tID, tobj = None,None
-            
-        brains = self._queryFor(sid=sID, relationship=relationship, tid=tID)
-        return self._resolveBrains(brains)
+        return self._optimizedReferences(object, relationship=relationship,
+            targetObject=targetObject, objects=objects, attribute='sourceUID')
 
-    def getBackReferences(self, object, relationship=None, targetObject=None):
+    def getBackReferences(self, object, relationship=None, targetObject=None,
+                          objects=True):
         """return a collection of reference objects"""
         # Back refs would be anything that target this object
+        return self._optimizedReferences(object, relationship=relationship,
+            targetObject=targetObject, objects=objects, attribute='targetUID')
+
+    def _optimizedReferences(self, object, relationship=None,
+        targetObject=None, objects=True, attribute='sourceUID'):
+
         sID, sobj = self._uidFor(object)
         if targetObject:
             tID, tobj = self._uidFor(targetObject)
+            if attribute == 'sourceUID':
+                brains = self._queryFor(sID, tID, relationship)
+            else:
+                brains = self._queryFor(tID, sID, relationship)
+        else:
+            brains = self._optimizedQuery(sID, attribute, relationship)
+
+        if objects:
+            return self._resolveBrains(brains)
+        return brains
+
+    def _optimizedQuery(self, uid, indexname, relationship):
+        """query reference catalog for object matching the info we are
+        given, returns brains
+        """
+        if not uid: # pragma: no cover
+            return []
+
+        _catalog = self._catalog
+        indexes = _catalog.indexes
+
+        # First get one or multiple record ids for the source/target uid index
+        rids = indexes[indexname]._index.get(uid, None)
+        if rids is None:
+            return []
+        elif isinstance(rids, int):
+            rids = [rids]
         else:
-            tID, tobj = None,None
+            rids = list(rids)
 
-        brains = self._queryFor(tid=sID, relationship=relationship, sid=tID)
-        return self._resolveBrains(brains)
+        # As a second step make sure we only get references of the right type
+        # The unindex holds data of the type: [(-311870037, 'relatesTo')]
+        # The index holds data like: [('relatesTo', -311870037)]
+        if relationship is None:
+            result_rids = rids
+        else:
+            rel_unindex_get = indexes['relationship']._unindex.get
+            result_rids = set()
+            if isinstance(relationship, str):
+                relationship = set([relationship])
+            for r in rids:
+                rels = rel_unindex_get(r, None)
+                if rels is None:
+                    rels = set()
+                elif isinstance(rels, str):
+                    rels = set([rels])
+                if not rels.isdisjoint(relationship):
+                    result_rids.add(r)
+
+        # Create brains
+        return LazyMap(_catalog.__getitem__,
+                       list(result_rids), len(result_rids))
 
     def hasRelationshipTo(self, source, target, relationship):
         sID, sobj = self._uidFor(source)
@@ -494,17 +532,16 @@
             if not self.isReferenceable(uobject):
                 raise ReferenceException, "%r not referenceable" % uobject
 
-            # shasattr() doesn't work here
-            if not getattr(aq_base(uobject), UUID_ATTR, None):
+            uuid = IUUID(uobject, None)
+            if uuid is None:
                 uuid = self._getUUIDFor(uobject)
-            else:
-                uuid = getattr(uobject, UUID_ATTR)
+                
         else:
             uuid = obj
             obj = None
             #and we look up the object
             uid_catalog = getToolByName(self, UID_CATALOG)
-            brains = uid_catalog(UID=uuid)
+            brains = uid_catalog(dict(UID=uuid))
             for brain in brains:
                 res = brain.getObject()
                 if res is not None:
@@ -528,7 +565,7 @@
         else:
             annotation = sobj._getReferenceAnnotations()
             try:
-                annotation._delObject(referenceObject.UID())
+                annotation._delObject(IUUID(referenceObject, None))
             except (AttributeError, KeyError):
                 pass
 
@@ -652,4 +689,3 @@
     self._setObject(id, c)
     if REQUEST is not None:
         return self.manage_main(self, REQUEST,update_menu=1)
-

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Referenceable.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Referenceable.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Referenceable.py	Tue Jan 11 14:41:39 2011
@@ -1,5 +1,7 @@
 from zope.interface import implements
 
+from plone.uuid.interfaces import IUUID
+
 from Products.Archetypes import config
 from Products.Archetypes.exceptions import ReferenceException
 from Products.Archetypes.interfaces import IReferenceable
@@ -9,7 +11,6 @@
 from OFS.ObjectManager import BeforeDeleteException
 
 from Products.CMFCore.utils import getToolByName
-from Products.CMFCore.permissions import View
 from OFS.CopySupport import CopySource
 from OFS.Folder import Folder
 from utils import getRelURL
@@ -73,10 +74,11 @@
 
     def getRefs(self, relationship=None, targetObject=None):
         """get all the referenced objects for this object"""
-        tool = getToolByName(self, config.REFERENCE_CATALOG)
-        refs = tool.getReferences(self, relationship, targetObject=targetObject)
-        if refs:
-            return [ref.getTargetObject() for ref in refs]
+        tool = getToolByName(self, 'reference_catalog')
+        brains = tool.getReferences(self, relationship, targetObject=targetObject,
+                                    objects=False)
+        if brains:
+            return [self._optimizedGetObject(b.targetUID) for b in brains]
         return []
 
     def _getURL(self):
@@ -85,10 +87,11 @@
 
     def getBRefs(self, relationship=None, targetObject=None):
         """get all the back referenced objects for this object"""
-        tool = getToolByName(self, config.REFERENCE_CATALOG)
-        refs = tool.getBackReferences(self, relationship, targetObject=targetObject)
-        if refs:
-            return [ref.getSourceObject() for ref in refs]
+        tool = getToolByName(self, 'reference_catalog')
+        brains = tool.getBackReferences(self, relationship,
+                                        targetObject=targetObject, objects=False)
+        if brains:
+            return [self._optimizedGetObject(b.sourceUID) for b in brains]
         return []
 
     #aliases
@@ -111,9 +114,27 @@
             return refs
         return []
 
+    def _optimizedGetObject(self, uid):
+        tool = getToolByName(self, 'uid_catalog', None)
+        if tool is None: # pragma: no cover
+            return ''
+        tool = aq_inner(tool)
+        traverse = aq_parent(tool).unrestrictedTraverse
+
+        _catalog = tool._catalog
+        rids = _catalog.indexes['UID']._index.get(uid, ())
+        if isinstance(rids, int):
+            rids = (rids, )
+
+        for rid in rids:
+            path = _catalog.paths[rid]
+            obj = traverse(path, default=None)
+            if obj is not None:
+                return obj
+
     def _register(self, reference_manager=None):
         """register with the archetype tool for a unique id"""
-        if self.UID() is not None:
+        if IUUID(self, None) is not None:
             return
 
         if reference_manager is None:
@@ -142,10 +163,10 @@
             delattr(self, config.REFERENCE_ANNOTATION)
 
     def UID(self):
-        return getattr(self, config.UUID_ATTR, None)
+        return IUUID(self, None)
 
     def _setUID(self, uid):
-        old_uid = self.UID()
+        old_uid = IUUID(self, None)
         if old_uid is None:
             # Nothing to be done.
             return
@@ -204,9 +225,9 @@
         if isFactoryContained(self):
             return
         isCopy = getattr(item, '_v_is_cp', None)
-        # Before copying we take a copy of the references that are to be copied 
+        # Before copying we take a copy of the references that are to be copied
         # on the new copy
-        rfields=self.Schema().filterFields(type="reference", keepReferencesOnCopy=1) 
+        rfields=self.Schema().filterFields(type="reference", keepReferencesOnCopy=1)
         rrefs={}
         if isCopy:
             # If the object is a copy of a existing object we
@@ -221,11 +242,11 @@
         self._register(reference_manager=ct)
         self._updateCatalog(container)
         self._referenceApply('manage_afterAdd', item, container)
-        # copy the references 
+        # copy the references
         if isCopy:
             for r in rfields:
                 r.set(self,rrefs[r.getName()])
-                 
+
 
     def manage_afterClone(self, item):
         """
@@ -243,8 +264,11 @@
         # TODO Should we ever get here after the isCopy flag addition??
         # If the object has no UID or the UID already exists, then
         # we should get a new one
-        if (not shasattr(self,config.UUID_ATTR) or
-            len(uc(UID=self.UID()))):
+        
+        uuid = IUUID(self, None)
+        
+        if (uuid is None or
+            len(uc(UID=uuid))):
             setattr(self, config.UUID_ATTR, None)
 
         self._register()
@@ -304,7 +328,7 @@
         url = self._getURL()
         # XXX This is an ugly workaround. This method shouldn't be called
         # twice for an object in the first place, so we don't have to check
-        # if it is still cataloged. 
+        # if it is still cataloged.
         rid = uc.getrid(url)
         if rid is not None:
             uc.uncatalog_object(url)
@@ -335,7 +359,7 @@
                 url = getRelURL(uc, ref.getPhysicalPath())
                 # XXX This is an ugly workaround. This method shouldn't be
                 # called twice for an object in the first place, so we don't
-                # have to check if it is still cataloged. 
+                # have to check if it is still cataloged.
                 uc_rid = uc.getrid(url)
                 if uc_rid is not None:
                     uc.uncatalog_object(url)

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Renderer.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Renderer.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Renderer.py	Tue Jan 11 14:41:39 2011
@@ -6,10 +6,10 @@
 _marker = []
 
 class ArchetypesRenderer:
-    
+
     security = ClassSecurityInfo()
     # TODO: more security
-    
+
     def render(self, field_name, mode, widget, instance=None,
                field=None, accessor=None, **kwargs):
         if field is None:
@@ -24,8 +24,8 @@
         result = widget(mode, instance, context)
 
         del context
-        return result    
-    
+        return result
+
     def setupContext(self, field_name, mode, widget, instance, field, \
                      accessor, **kwargs):
 
@@ -37,8 +37,8 @@
             frame = frame.f_back
         if context is _marker:
             raise RuntimeError, 'Context not found'
-        
-        # for editing of multiple AT-based content at once we might want to 
+
+        # for editing of multiple AT-based content at once we might want to
         # prefix the field-name.
         if 'fieldprefix' in kwargs:
             field_name = '%s%s' % (kwargs['fieldprefix'], field_name)

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/SQLStorage.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/SQLStorage.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/SQLStorage.py	Tue Jan 11 14:41:39 2011
@@ -83,12 +83,12 @@
             return 0
         else:
             return 1
-        
+
     def map_reference(self, field, value):
         __traceback_info__ = repr(value)
 
         return ','.join(value)
-    
+
     def unmap_boolean(self, field, value):
         __traceback_info__ = repr(value)
         if not value or value == '0':   # Gadfly return integers as strings
@@ -133,7 +133,7 @@
         factory = getToolByName(instance,'portal_factory')
         if factory.isTemporary(instance):
           return
-              
+
         fields = instance.Schema().fields()
         fields = [f for f in fields if IObjectField.providedBy(f) \
                   and f.getStorage().__class__ is self.__class__]

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/SQLStorageConfig.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/SQLStorageConfig.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/SQLStorageConfig.py	Tue Jan 11 14:41:39 2011
@@ -104,7 +104,7 @@
     def getDefaultConnFor(self, ob):
         """ Return the default conn, if applicable, for ob.
         """
-    
+
         types_tool = getToolByName( self, 'portal_types', None )
         if ( types_tool is not None
             and types_tool.getTypeInfo( ob ) is not None ):
@@ -118,7 +118,7 @@
         c_types = []
         ti = self.getInstalledTypes()
         for t in ti:
-            for field in t['type'].fields():
+            for field in t['schema'].fields():
                 if IObjectField.providedBy(field) and \
                    ISQLStorage.providedBy(field.getStorage()):
                     c_types.append(t)

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Schema/__init__.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Schema/__init__.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Schema/__init__.py	Tue Jan 11 14:41:39 2011
@@ -492,7 +492,7 @@
             if shasattr(field, 'default_content_type'):
                 # specify a mimetype if the mutator takes a
                 # mimetype argument
-                # if the schema supplies a default, we honour that, 
+                # if the schema supplies a default, we honour that,
                 # otherwise we use the site property
                 default_content_type = field.default_content_type
                 if default_content_type is None:
@@ -557,11 +557,11 @@
             schemata = instance.Schemata()
             for fieldset in fieldsets:
                 fields += [(field.getName(), field)
-                           for field in schemata[fieldset].fields()]            
+                           for field in schemata[fieldset].fields()]
         elif fieldset is not None:
             schemata = instance.Schemata()
             fields = [(field.getName(), field)
-                      for field in schemata[fieldset].fields()]            
+                      for field in schemata[fieldset].fields()]
         else:
             if data:
                 fields.extend([(field.getName(), field)
@@ -574,20 +574,20 @@
             form = REQUEST.form
         else:
             form = None
-            
+
         for name, field in fields:
-            
+
             # Should not validate something we can't write to anyway
             if not field.writeable(instance):
                 continue
-            
+
             error = 0
             value = None
             widget = field.widget
-            
+
             if widget.isVisible(widget, 'edit') != 'visible':
                 continue
-            
+
             if form:
                 result = widget.process_form(instance, field, form,
                                              empty_marker=_marker)

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Schema/configure.zcml
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Schema/configure.zcml	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Schema/configure.zcml	Tue Jan 11 14:41:39 2011
@@ -1,7 +1,7 @@
 <configure
    xmlns="http://namespaces.zope.org/zope">
-   
-  <adapter 
+
+  <adapter
     factory=".factory.instanceSchemaFactory" />
-  
+
 </configure>

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Schema/factory.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Schema/factory.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Schema/factory.py	Tue Jan 11 14:41:39 2011
@@ -6,30 +6,30 @@
 @adapter(IBaseObject)
 def instanceSchemaFactory(context):
     """Default schema adapter factory.
-    
+
     In BaseObject, the Schema() method will do 'schema = ISchema(self)'. This
     adapter factory is the default, meaning that setting a 'schema' class
     attribute pointing to a schema is the default way of supplying a schema.
-    
+
     You may override this behaviour by supplying a different adapter. Most
     likely, this will adapt some marker interface you apply to your own
     content type and provide ISchema, e.g.:
-    
+
       @implementer(ISchema)
       @adapter(IMyObject)
       def mySchemaFactory(context):
           return ...
-          
+
     The challenge is that the accessors and mutators of the returned schema
     must be available as methods on 'context', with appropriate security
     declarations. When the schema is set in a 'schema' class-attribute, this
     is taken care of by ClassGen. However, if you wish to provide the schema
     with a different adapter, you have three choices:
-    
+
      1. Provide the accessor and mutator methods explicitly in the class. This
      probably means you will be properly implementing a particular interface,
      which is never a bad thing.
-     
+
      2. Run Products.Archetypes.VariableSchemaSupport.VarClassGen on the class.
      This will generate the missing methods. However, this may be slow, so
      you may need to implement a marker to ensure it only happens once. (The
@@ -37,7 +37,7 @@
      probably not to be relied on). Also note that this effectively precludes
      any site-local or per-instance semantics, since it modifies the global
      class dict.
-     
+
      3. Add the methods per-instance yourself. This is what the ContentFlavors
      product does, so you may be better off using that.
     """

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Storage/Facade.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Storage/Facade.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Storage/Facade.py	Tue Jan 11 14:41:39 2011
@@ -14,7 +14,7 @@
     """
 
     security = ClassSecurityInfo()
-    
+
     def __init__(self, metadata_set):
         self.metadata_set = metadata_set
 

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Storage/annotation.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Storage/annotation.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Storage/annotation.py	Tue Jan 11 14:41:39 2011
@@ -46,15 +46,15 @@
     security = ClassSecurityInfo()
 
     _key = None
-    
+
     def __init__(self, migrate=False):
         self._migrate = migrate
-        
+
     def _migration(self, name, instance, **kwargs):
         """Migrates data from the original storage
         """
         raise NotImplementedError
-        
+
     def _cleanup(self, name, instance, value, **kwargs):
         """Clean up data in set method
         """
@@ -78,7 +78,7 @@
         ann = getAnnotation(instance)
         ann.setSubkey(self._key, value, subkey=name)
         if self._migrate:
-            self._cleanup(name, instance, value, **kwargs) 
+            self._cleanup(name, instance, value, **kwargs)
 
     security.declarePrivate('unset')
     def unset(self, name, instance, **kwargs):
@@ -97,7 +97,7 @@
     _key = AT_ANN_STORAGE
 
     security = ClassSecurityInfo()
-    
+
     def _migration(self, name, instance, **kwargs):
         """Migrates data from the original storage
         """
@@ -107,7 +107,7 @@
         delattr(instance, name) # explicit del althought set would do the job, too
         self.set(name, instance, value, **kwargs)
         return value
-    
+
     def _cleanup(self, name, instance, value, **kwargs):
         if shasattr(instance, name):
             delattr(instance, name)
@@ -121,7 +121,7 @@
     _key = AT_MD_STORAGE
 
     security = ClassSecurityInfo()
-    
+
     def _migration(self, name, instance, **kwargs):
         """Migrates data from the original storage
         """
@@ -135,7 +135,7 @@
         self.set(name, instance, value, **kwargs)
         del md[name]
         return value
-        
+
     def _cleanup(self, name, instance, value, **kwargs):
         md = aq_base(instance)._md
         try:
@@ -173,39 +173,39 @@
 
 def migrateStorageOfType(portal, portal_type, schema):
     """Migrate storage from attribute to annotation storage
-    
+
     portal - portal
     portal_type - portal type name to migrate
     schema - schema of the type
-    
+
     The schema is used to detect annotation and metadata annotation stored field for
     migration.
     """
     catalog = getToolByName(portal, 'portal_catalog')
-    brains = catalog(Type = portal_type)
-    
+    brains = catalog(dict(Type = portal_type))
+
     fields = [ field.getName()
-        for field in schema.fields() 
+        for field in schema.fields()
         if field.storage.__class__ == AnnotationStorage
         ]
     md_fields = [ field.getName()
-        for field in schema.fields() 
+        for field in schema.fields()
         if field.storage.__class__ == MetadataAnnotationStorage
         ]
-    
+
     for brain in brains:
         obj = brain.getObject()
         if obj is None:
             continue
-        
+
         try: state = obj._p_changed
         except: state = 0
-        
+
         ann = getAnnotation(obj)
         clean_obj = aq_base(obj)
         _attr2ann(clean_obj, ann, fields)
         _meta2ann(clean_obj, ann, md_fields)
-        
+
         if state is None: obj._p_deactivate()
 
 def _attr2ann(clean_obj, ann, fields):
@@ -221,7 +221,7 @@
             value = getattr(clean_obj, field, _marker)
             if value is not _marker:
                 delattr(clean_obj, field)
-    
+
 def _meta2ann(clean_obj, ann, fields):
     """metadata 2 annotation
     """

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/UIDCatalog.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/UIDCatalog.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/UIDCatalog.py	Tue Jan 11 14:41:39 2011
@@ -3,6 +3,8 @@
 import time
 import urllib
 from zope.interface import implements
+from zope import component
+from zope import interface
 
 from App.class_init import InitializeClass
 from App.special_dtml import DTMLFile
@@ -22,6 +24,9 @@
 from Products.Archetypes.config import TOOL_NAME
 from Products.Archetypes.interfaces import IUIDCatalog
 from Products.Archetypes.utils import getRelURL
+from plone.indexer.interfaces import IIndexableObject
+from plone.indexer.decorator import indexer
+from plone.uuid.interfaces import IUUID, IUUIDAware
 
 _catalog_dtml = os.path.join(os.path.dirname(CMFCore.__file__), 'dtml')
 logger = logging.getLogger('Archetypes')
@@ -133,6 +138,21 @@
 
 _marker=[]
 
+#let rewrite Title indexer with plone.indexer
+@indexer(interface.Interface, IUIDCatalog)
+def Title(obj):
+    title = obj.Title()
+    if isinstance(title, unicode):
+        return title.encode('utf-8')
+    try:
+        return str(title)
+    except UnicodeDecodeError:
+        return obj.getId()
+
+@indexer(IUUIDAware, IUIDCatalog)
+def UID_indexer(obj):
+    return IUUID(obj, None)
+
 class UIDResolver(Base):
 
     security = ClassSecurityInfo()
@@ -199,25 +219,23 @@
     security.declareProtected(ManageZCatalogEntries, 'catalog_object')
     def catalog_object(self, object, uid, idxs=[],
                        update_metadata=1, pghandler=None):
-        w = IndexableObjectWrapper(object)
-        try:
-            # pghandler argument got added in Zope 2.8
-            ZCatalog.catalog_object(self, w, uid, idxs,
-                                    update_metadata, pghandler=pghandler)
-        except TypeError:
-            try:
-                # update_metadata argument got added somewhere into
-                # the Zope 2.6 line (?)
-                ZCatalog.catalog_object(self, w, uid, idxs, update_metadata)
-            except TypeError:
-                ZCatalog.catalog_object(self, w, uid, idxs)
+
+        w = object
+        if not IIndexableObject.providedBy(object):
+            # This is the CMF 2.2 compatible approach, which should be used going forward
+            wrapper = component.queryMultiAdapter((object, self), IIndexableObject)
+            if wrapper is not None:
+                w = wrapper
+
+        ZCatalog.catalog_object(self, w, uid, idxs,
+                                update_metadata, pghandler=pghandler)
 
     def _catalogObject(self, obj, path):
         """Catalog the object. The object will be cataloged with the absolute
            path in case we don't pass the relative url.
-        """ 
-        url = getRelURL(self, obj.getPhysicalPath()) 
-        self.catalog_object(obj, url) 
+        """
+        url = getRelURL(self, obj.getPhysicalPath())
+        self.catalog_object(obj, url)
 
     security.declareProtected(CMFCore.permissions.ManagePortal, 'manage_rebuildCatalog')
     def manage_rebuildCatalog(self, REQUEST=None, RESPONSE=None):

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/VariableSchemaSupport.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/VariableSchemaSupport.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/VariableSchemaSupport.py	Tue Jan 11 14:41:39 2011
@@ -13,7 +13,7 @@
 from ExtensionClass import Base
 
 class VarClassGen(ClassGenerator):
-    """A version of ClassGen that is able to generate a class' methods based on 
+    """A version of ClassGen that is able to generate a class' methods based on
     an explicitly given schema.
     """
 
@@ -22,7 +22,7 @@
 
     def updateMethods(self, klass):
         """Update the methods of the klass to support a new schema.
-        
+
         This will re-generate methods.
         """
         self.generateMethods(klass, self.schema.fields())
@@ -39,11 +39,11 @@
 class VariableSchemaSupport(Base):
     """
     Mixin class to support instance-based schemas
-    
+
     NOTE: This implementation has been found to be quite slow, because the
     hash is expensive to calculate and does not appear to work very well as
     a cache key.
-    
+
     Attention: must be before BaseFolder or BaseContent in
     the inheritance list, e.g:
 
@@ -86,4 +86,4 @@
     def setSchema(self, schema):
         self.schema=schema
 
-InitializeClass(VariableSchemaSupport)
\ No newline at end of file
+InitializeClass(VariableSchemaSupport)

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/WebDAVSupport.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/WebDAVSupport.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/WebDAVSupport.py	Tue Jan 11 14:41:39 2011
@@ -127,7 +127,7 @@
         event.notify(WebDAVObjectInitializedEvent(self))
     else:
         event.notify(WebDAVObjectEditedEvent(self))
-    
+
     RESPONSE.setStatus(204)
     return RESPONSE
 

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Widget.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Widget.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/Widget.py	Tue Jan 11 14:41:39 2011
@@ -226,7 +226,7 @@
         containers = []
         portal_path = "/".join(purl.getPortalObject().getPhysicalPath())
         for wanted in searchFor:
-            for brain in catalog(portal_type=wanted):
+            for brain in catalog(dict(portal_type=wanted)):
                 relative_path = brain.getPath().replace(portal_path + '/', '')
                 containers.append(relative_path)
 

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/annotations.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/annotations.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/annotations.py	Tue Jan 11 14:41:39 2011
@@ -146,7 +146,7 @@
 
     def getObject(self):
         return self._obj
-        
+
     def getAnnotationObject(self):
         try:
             return self._obj.__annotations__
@@ -161,7 +161,7 @@
     #def iterkeys(self):
     #def itervalues(self):
     #def values(self):
-    #def items(self):    
+    #def items(self):
     #def clear(self):
     #def setdefault(self, key, default):
     #def pop(self, key, *args):

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/atapi.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/atapi.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/atapi.py	Tue Jan 11 14:41:39 2011
@@ -63,7 +63,7 @@
 # storage
 from Products.Archetypes.Storage import *
 from Products.Archetypes.Storage.annotation import AnnotationStorage
-from Products.Archetypes.Storage.annotation import MetadataAnnotationStorage 
+from Products.Archetypes.Storage.annotation import MetadataAnnotationStorage
 from Products.Archetypes.SQLStorage import BaseSQLStorage
 from Products.Archetypes.SQLStorage import GadflySQLStorage
 from Products.Archetypes.SQLStorage import MySQLSQLStorage

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/athistoryaware.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/athistoryaware.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/athistoryaware.py	Tue Jan 11 14:41:39 2011
@@ -44,22 +44,22 @@
 # Archetypes now stores field data in a __annotations__ BTree, and many (if not
 # all) of these field data objects are persistent themselves. This means that
 # each of these objects will get it's own revisions in the ZODB, and retrieving
-# an object's historic revision will not retrieve historic revisions of 
+# an object's historic revision will not retrieve historic revisions of
 # subobjects.
 #
 # The following implementation will merge the histories for the main object,
-# the __annotations__ BTree, and any persistent annotition that uses an 
+# the __annotations__ BTree, and any persistent annotition that uses an
 # Archetypes key. It does not recurse into those objects though (which would
 # make the implementation far more complex), so fields like File and Image will
 # not be correctly reconstructed.
 #
-# When an edit is made to an archetype, it may be that only one field is 
+# When an edit is made to an archetype, it may be that only one field is
 # altered and only that field is then recorded in a transaction. Adding or
 # removing a field from the annotations will result in a new revision of the
-# __annotations__ BTree, but the main object remains unaffected. Editing a 
-# title will affect self, and no fields stored in annotations are altered. 
+# __annotations__ BTree, but the main object remains unaffected. Editing a
+# title will affect self, and no fields stored in annotations are altered.
 #
-# The following table illustrates a series of such transactions 
+# The following table illustrates a series of such transactions
 # (__annotations__ is shortened to 'ann', crosses mark comitted revisions,
 # a slash marks a removed object):
 #
@@ -73,8 +73,8 @@
 #
 # Now, to construct the last 3 historic revisions, one has to pull together
 # various object revisions. For tid 5, to construct the full object, one has to
-# take tid 4 for __annotations__ and field 2, and no revision for field 3. 
-# Tid 3 combines tid 2 for self and field 1, tid 1 for field 2 with tid 3 
+# take tid 4 for __annotations__ and field 2, and no revision for field 3.
+# Tid 3 combines tid 2 for self and field 1, tid 1 for field 2 with tid 3
 # versions of __annotations__ and field 3.
 #
 # Note that packing does not remove older revisions still referenced through
@@ -110,8 +110,8 @@
 
 class ATHistoryAwareMixin:
     """Archetypes history aware mixin class
-    
-    Provide ZODB revisions, constructed from older transactions. Note that 
+
+    Provide ZODB revisions, constructed from older transactions. Note that
     these transactions are available only up to the last pack.
 
     """
@@ -124,10 +124,10 @@
     security.declarePrivate('_constructAnnotatedHistory')
     def _constructAnnotatedHistory(self, max=10):
         """Reconstruct historical revisions of archetypes objects
-        
+
         Merges revisions to self with revisions to archetypes-related items
         in __annotations__. Yields at most max recent revisions.
-        
+
         """
         # All relevant historical states by transaction id
         # For every tid, keep a dict with object revisions, keyed on annotation
@@ -135,16 +135,16 @@
         # Initialize with self revisions
         history = dict([(tid, {None: rev})
                         for (tid, rev) in _objectRevisions(self, max)])
-            
+
         if not getattr(self, '__annotations__', None):
             # No annotations, just return the history we have for self
-            # Note that if this object had __annotations__ in a past 
+            # Note that if this object had __annotations__ in a past
             # transaction they will be ignored! Working around this is a
             # YAGNI I think though.
             for tid in sorted(history.keys()):
                 yield history[tid][None]
             return
-            
+
         # Now find all __annotation__ revisions, and the annotation keys
         # used in those.
         annotation_key_objects = {}
@@ -159,13 +159,13 @@
                     continue # Not persistent
                 if key not in annotation_key_objects:
                     annotation_key_objects[key] = revision[key]
-                    
+
         # For all annotation keys, get their revisions
         for key, obj in annotation_key_objects.iteritems():
             for tid, rev in _objectRevisions(obj, max):
                 history.setdefault(tid, {})[key] = rev
         del annotation_key_objects
-                
+
         # Now we merge the annotation and object revisions into one for each
         # transaction id, and yield the results
         tids = sorted(history.iterkeys(), reverse=True)
@@ -174,22 +174,22 @@
             has_revision = lambda t, h=history, k=key: k in h[t]
             next_tid = itertools.ifilter(has_revision, tids).next()
             return history[next_tid][key]
-        
+
         for i, tid in enumerate(tids[:max]):
             revision = find_revision(tids[i:], None)
             obj = revision['object']
             # Track size to maintain correct metadata
             size = revision['size']
-            
+
             anns_rev = find_revision(tids[i:], '__annotations__')
             size += anns_rev['size']
             anns = anns_rev['object']
-            
+
             # We use a temporary OOBTree to avoid _p_jar complaints from the
             # transaction machinery
             tempbtree = OOBTree()
             tempbtree.__setstate__(anns.__getstate__())
-            
+
             # Find annotation revisions and insert
             for key in itertools.ifilter(isatkey, tempbtree.iterkeys()):
                 if not hasattr(tempbtree[key], '_p_jar'):
@@ -197,52 +197,52 @@
                 value_rev = find_revision(tids[i:], key)
                 size += value_rev['size']
                 tempbtree[key] = value_rev['object']
-                
-            # Now transfer the tembtree state over to anns, effectively 
-            # bypassing the transaction registry while maintaining BTree 
+
+            # Now transfer the tembtree state over to anns, effectively
+            # bypassing the transaction registry while maintaining BTree
             # integrity
             anns.__setstate__(tempbtree.__getstate__())
             anns._p_changed = 0
             del tempbtree
-            
+
             # Do a similar hack to set anns on the main object
             state = obj.__getstate__()
             state['__annotations__'] = anns
             obj.__setstate__(state)
             obj._p_changed = 0
-            
+
             # Update revision metadata if needed
             if revision['tid'] != tid:
                 # any other revision will do; only size and object are unique
                 revision = history[tid].values()[0].copy()
                 revision['object'] = obj
-                
+
             # Correct size based on merged records
             revision['size'] = size
-            
+
             # clean up as we go
             del history[tid]
-            
+
             yield revision
 
     security.declarePrivate('getHistories')
     def getHistories(self, max=10):
         """Iterate over historic revisions.
-        
+
         Yields (object, time, transaction_note, user) tuples, where object
         is an object revision approximating what was committed at that time,
         with the current acquisition context.
 
-        Object revisions include correct archetype-related annotation revisions 
-        (in __annotations__); other persistent sub-objects are in their current 
+        Object revisions include correct archetype-related annotation revisions
+        (in __annotations__); other persistent sub-objects are in their current
         revision, not historical!
-        
+
         """
-        
+
         parent = aq_parent(self)
         for revision in self._constructAnnotatedHistory(max):
             obj = revision['object'].__of__(parent)
-            yield (obj, DateTime(revision['time']), revision['description'], 
+            yield (obj, DateTime(revision['time']), revision['description'],
                    revision['user_name'])
 
 InitializeClass(ATHistoryAwareMixin)

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/bridge.zcml
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/bridge.zcml	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/bridge.zcml	Tue Jan 11 14:41:39 2011
@@ -6,18 +6,18 @@
       zope2="Products.Archetypes.interfaces.orderedfolder.IOrderedFolder"
       package=".interfaces"
       name="IOrderedFolder"
-      /> 
- 
+      />
+
   <bridge
       zope2="Products.Archetypes.interfaces.templatemixin.ITemplateMixin"
       package=".interfaces"
       name="ITemplateMixin"
-      /> 
- 
+      />
+
   <bridge
       zope2="Products.Archetypes.interfaces.vocabulary.IVocabulary"
       package=".interfaces"
       name="IVocabulary"
-      /> 
+      />
 
 </configure>

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/browser/fields.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/browser/fields.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/browser/fields.py	Tue Jan 11 14:41:39 2011
@@ -11,6 +11,6 @@
 
     def getKssClasses(self, fieldname, templateId=None, macro=None):
         return ''
-    
+
     def getKssClassesInlineEditable(self, fieldname, templateId, macro=None):
         return ''

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/browser/widgets.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/browser/widgets.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/browser/widgets.py	Tue Jan 11 14:41:39 2011
@@ -2,10 +2,10 @@
 from Products.Five import BrowserView
 
 
-# map from mimetypes used in allowable_content_types to mimetypes that are stored
-# in the base unit
+# map from mimetypes used in allowable_content_types to mimetypes that
+# are stored in the base unit
 MIMETYPES_MAPPING = {
-    'text/x-python' : 'text/python-source',
+    'text/x-python': 'text/python-source',
     'text/restructured': 'text/x-rst',
 }
 
@@ -39,7 +39,8 @@
     Test with a DisplayList
 
     >>> from Products.Archetypes.utils import DisplayList
-    >>> friends = DisplayList([('Monty Python', u'monty'), (u'Guido van Rossum', u'guido')])
+    >>> friends = DisplayList([('Monty Python', u'monty'),
+    ...                        (u'Guido van Rossum', u'guido')])
     >>> widget.getSelected(friends, 'monty')
     []
     >>> widget.getSelected(friends, u'guido')
@@ -49,7 +50,7 @@
 
     getSelected is used to get a list of selected vocabulary items.
     In the widget, we repeat on the vocabulary, comparing
-    its values with those returned by getSelected. So,    
+    its values with those returned by getSelected. So,
     we always return the same encoding as in the vocabulary.
 
     >>> widget.getSelected(friends, u'Monty Python')
@@ -64,18 +65,23 @@
     Test with an IntDisplayList:
 
     >>> from Products.Archetypes.utils import IntDisplayList
-    >>> quarter_vocabulary = IntDisplayList([(0, '0'), (15, '15'), (30, '30'), (45, '45')])
+    >>> quarter_vocabulary = IntDisplayList([(0, '0'), (15, '15'),
+    ...                                      (30, '30'), (45, '45')])
     >>> widget.getSelected(quarter_vocabulary, 5)
     []
     >>> widget.getSelected(quarter_vocabulary, 15)
     [15]
     >>> widget.getSelected(quarter_vocabulary, '15')
+    [15]
+    >>> widget.getSelected(quarter_vocabulary, 'wrongdata')
+    []
+    >>> widget.getSelected(quarter_vocabulary, None)
     []
 
     """
 
     def getSelected(self, vocab, value):
-        
+
         context = aq_inner(self.context)
 
         site_charset = context.getCharset()
@@ -83,12 +89,15 @@
         # compile a dictionary from the vocabulary of
         # items in {encodedvalue : originalvalue} format
         vocabKeys = {}
+        # Also keep a list of integer keys, if available.
+        integerKeys = {}
         for key in vocab:
             # vocabulary keys can only be strings or integers
             if isinstance(key, str):
                 vocabKeys[key.decode(site_charset)] = key
             else:
                 vocabKeys[key] = key
+                integerKeys[key] = key
 
         # compile a dictonary of {encodedvalue : oldvalue} items
         # from value -- which may be a sequence, string or integer.
@@ -119,7 +128,20 @@
             ov = vocabKeys.get(v)
             if ov:
                 selected.append((pos, ov))
-
+            elif integerKeys:
+                # Submitting a string '5' where the vocabulary has
+                # only integer keys works fine when the edit succeeds.
+                # But when the edit form gets redisplayed (e.g. due to
+                # a missing required field), the string '5' means
+                # nothing is selected here, so you loose what you
+                # filled in.  This gets fixed right here.
+                try:
+                    int_value = int(value)
+                except (ValueError, TypeError):
+                    continue
+                ov = integerKeys.get(int_value)
+                if ov:
+                    selected.append((pos, ov))
         selected.sort()
         return [v for pos, v in selected]
 

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/config.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/config.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/config.py	Tue Jan 11 14:41:39 2011
@@ -8,7 +8,7 @@
 DEBUG =  False ## Hide debug messages
 #DEBUG = True  ## See debug messages
 
-RENAME_AFTER_CREATION_ATTEMPTS = 100 
+RENAME_AFTER_CREATION_ATTEMPTS = 100
 ## Try up to -100 at the end of the id when doing title-to-id renaming
 
 

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/configure.zcml
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/configure.zcml	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/configure.zcml	Tue Jan 11 14:41:39 2011
@@ -8,8 +8,9 @@
 
   <include zcml:condition="installed plone.i18n"
       package="plone.i18n" />
-  
+
   <include package="plone.folder"/>
+  <include package="plone.uuid" />
 
   <include package="Products.CMFFormController" />
   <include package="Products.CMFQuickInstallerTool" />
@@ -34,6 +35,9 @@
   <adapter
       factory=".traverse.ImageTraverser" />
 
+  <adapter
+      factory=".uuid.referenceableUUID" />
+
   <five:deprecatedManageAddDelete
       class=".ReferenceEngine.Reference" />
 
@@ -70,4 +74,7 @@
   <five:deprecatedManageAddDelete
       class=".examples.SimpleType.SimpleType" />
 
+  <adapter factory=".UIDCatalog.Title" name="Title" />
+  <adapter factory=".UIDCatalog.UID_indexer" name="UID" />
+
 </configure>

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/debug.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/debug.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/debug.py	Tue Jan 11 14:41:39 2011
@@ -94,7 +94,7 @@
         return frame
 
     def generateFrames(self, start=None, end=None):
-        try: 
+        try:
             return inspect.stack()[start:end]
         except IndexError:
             # NOTE: this is required for OS-X Tiger somehow

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/docs/sqlstorage-howto.rst
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/docs/sqlstorage-howto.rst	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/docs/sqlstorage-howto.rst	Tue Jan 11 14:41:39 2011
@@ -2106,7 +2106,7 @@
   ----------------------------------------------------------------------
   from Products.Archetypes.Storage import SybaseStorage # Does not exist currently
 
-  results = root.portal_catalog(portal_type='MyObjectType')
+  results = root.portal_catalog(dict(portal_type='MyObjectType'))
   for r in results:
      r.getObject().Schema()['fieldname'].setStorage(SybaseStorage())
   ---------------------------------------------------------------------

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/event.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/event.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/event.py	Tue Jan 11 14:41:39 2011
@@ -39,7 +39,7 @@
     """An edit operation was begun
     """
     implements(IEditBegunEvent)
-    
+
 class EditCancelledEvent(ObjectEvent):
     """An edit operation was cancelled
     """

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/events.zcml
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/events.zcml	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/events.zcml	Tue Jan 11 14:41:39 2011
@@ -9,7 +9,7 @@
         zcml:condition="installed plone.locking"
         for="plone.locking.interfaces.ITTWLockable
              .interfaces.IEditBegunEvent"
-        handler="plone.locking.events.lockOnEditBegins" 
+        handler="plone.locking.events.lockOnEditBegins"
         />
 
     <subscriber
@@ -19,18 +19,18 @@
         handler="plone.locking.events.unlockAfterModification"
         />
 
-    <subscriber 
+    <subscriber
         zcml:condition="installed plone.locking"
         for="plone.locking.interfaces.ITTWLockable
              .interfaces.IObjectEditedEvent"
         handler="plone.locking.events.unlockAfterModification"
         />
 
-	<subscriber 
+	<subscriber
         zcml:condition="installed plone.locking"
         for="plone.locking.interfaces.ITTWLockable
              .interfaces.IObjectInitializedEvent"
         handler="plone.locking.events.unlockAfterModification"
         />
 
-</configure>
\ No newline at end of file
+</configure>

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/examples/ComplexType.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/examples/ComplexType.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/examples/ComplexType.py	Tue Jan 11 14:41:39 2011
@@ -36,11 +36,11 @@
               widget=TextAreaWidget( label='TextArea',
                                      append_only=1,
                                      timestamp=1,),
-              ),                                          
+              ),
     TextField('textarea_maxlength',
               widget=TextAreaWidget( label='TextArea',
                                      maxlength=20,),
-              ),                                          
+              ),
     TextField('richtextfield',
               allowable_content_types=('text/plain',
                                        'text/structured',

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/examples/DDocument.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/examples/DDocument.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/examples/DDocument.py	Tue Jan 11 14:41:39 2011
@@ -37,10 +37,16 @@
                default_output_type='image/jpeg',
                allowable_content_types=('image/*',),
                widget=ImageWidget()),
-    
+
     ReferenceField('related',
                    relationship = 'related',
-                   multiValued = False,
+                   multiValued = True,
+                   widget=ReferenceWidget(),
+                   keepReferencesOnCopy = True),
+
+    ReferenceField('rel2',
+                   relationship = 'rel2',
+                   multiValued = True,
                    widget=ReferenceWidget(),
                    keepReferencesOnCopy = True),
     ),

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/examples/SimpleFile.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/examples/SimpleFile.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/examples/SimpleFile.py	Tue Jan 11 14:41:39 2011
@@ -15,7 +15,7 @@
     """An File (test) type"""
     schema = schema
     archetype_name = "Simple File Type"
-    
+
     def manage_afterPUT(self, data, marshall_data, file, context, mimetype,
                         filename, REQUEST, RESPONSE):
         """For unit tests

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/implements.zcml
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/implements.zcml	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/implements.zcml	Tue Jan 11 14:41:39 2011
@@ -6,5 +6,11 @@
          zcml:condition="installed plone.locking">
     <implements interface="plone.locking.interfaces.ITTWLockable" />
   </class>
+  
+  <!-- Let all AT objects support the IUUID protocol and associated views -->
+  <class class=".BaseObject.BaseObject"
+         zcml:condition="installed plone.uuid">
+      <implements interface="plone.uuid.interfaces.IUUIDAware" />
+  </class>
 
 </configure>

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/__init__.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/__init__.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/__init__.py	Tue Jan 11 14:41:39 2011
@@ -41,7 +41,7 @@
 
 import zope.deferredimport
 zope.deferredimport.deprecated(
-    "Please use the canonical interface from OFS. " 
+    "Please use the canonical interface from OFS. "
     "This alias will be removed in the next major version.",
     IOrderedContainer = 'OFS.interfaces:IOrderedContainer',
     )

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/archetypetool.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/archetypetool.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/archetypetool.py	Tue Jan 11 14:41:39 2011
@@ -13,7 +13,7 @@
 
     def setCatalogsByType(meta_type, catalogList):
         """ associate catalogList with meta_type. (unfortunally not portal_type).
-        
+
             catalogList is a list of strings with the ids of the catalogs.
             Each catalog is has to be a tool, means unique in site root.
         """

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/athistoryaware.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/athistoryaware.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/athistoryaware.py	Tue Jan 11 14:41:39 2011
@@ -2,16 +2,16 @@
 
 class IATHistoryAware(Interface):
     """Archetypes history awareness
-    
+
     Provide access to older revisions of persistent Archetypes
-    
+
     """
 
     def getHistories(max=10):
         """Iterate over at most max historic revisions.
-        
+
         Yields (object, time, transaction_note, user) tuples, where object
         is an object revision approximating what was committed at that time,
         with the current acquisition context.
-        
+
         """

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/event.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/event.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/event.py	Tue Jan 11 14:41:39 2011
@@ -9,23 +9,23 @@
 class IObjectInitializedEvent(IObjectModifiedEvent):
     """An object is being initialised, i.e. populated for the first time
     """
-    
-class IWebDAVObjectInitializedEvent(IObjectInitializedEvent): 
-    """An object is being initialized via WebDAV 
-    """ 
-          
+
+class IWebDAVObjectInitializedEvent(IObjectInitializedEvent):
+    """An object is being initialized via WebDAV
+    """
+
 class IObjectEditedEvent(IObjectModifiedEvent):
     """An object is being edited, i.e. modified after the first save
     """
 
-class IWebDAVObjectEditedEvent(IObjectEditedEvent): 
-    """An object is being edited via WebDAV 
+class IWebDAVObjectEditedEvent(IObjectEditedEvent):
+    """An object is being edited via WebDAV
     """
 
 class IEditBegunEvent(IObjectEvent):
     """An event signalling that editing has begun on an object
     """
-    
+
 class IEditCancelledEvent(IObjectEvent):
     """An event signalling that editing was cancelled on the given object
-    """
\ No newline at end of file
+    """

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/field.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/field.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/field.py	Tue Jan 11 14:41:39 2011
@@ -5,7 +5,7 @@
 
 #     required = Attribute('required', 'Require a value to be present when submitting the field')
 #     default = Attribute('default', 'Default value for a field')
-#     default_method = Attribute('default_method', 'Name of a method on the field ' + 
+#     default_method = Attribute('default_method', 'Name of a method on the field ' +
 #                                                  'or an actual function instance to return the default')
 #     vocabulary = Attribute('vocabulary', 'List of suggested values for the field')
 #     vocabulary_factory = Attribute('vocabulary_factory', 'Name of Zope 3 vocabulary factory')
@@ -61,13 +61,13 @@
               will be created)
 
         3) Zope 3 vocabulary factory vocabulary
-        
+
             - precondition: a content_instance is given
-            
+
             - self.vocabulary_factory is given
-            
-            - a named utility providing zope.schema.interfaces.IVocbularyFactory 
-              exists for the name self.vocabulary_factory.     
+
+            - a named utility providing zope.schema.interfaces.IVocbularyFactory
+              exists for the name self.vocabulary_factory.
 
         """
 
@@ -199,7 +199,7 @@
 
     def get_size(instance):
         """Get size of the stored data used for get_size in BaseObject
-        
+
         Should be overwritte by special fields like FileField. It's safe for
         fields which are storing strings, ints and BaseUnits but it won't return
         the right results for fields containing OFS.Image.File instances or
@@ -279,7 +279,7 @@
 class IReferenceField(IField):
     """Marker interface for reference fields
     """
-    
+
 class IComputedField(IField):
     """Marker interface for computed fields
     """
@@ -297,7 +297,7 @@
     field. If no default or default_method is set on that field
     explicitly, Archetypes will find and call this adapter.
     """
-    
+
     def __call__():
         """Get the default value.
-        """
\ No newline at end of file
+        """

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/orderedfolder.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/orderedfolder.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/orderedfolder.py	Tue Jan 11 14:41:39 2011
@@ -29,7 +29,7 @@
 
 import zope.deferredimport
 zope.deferredimport.deprecated(
-    "Please use the canonical interface from OFS. " 
+    "Please use the canonical interface from OFS. "
     "This alias will be removed in the next major version.",
     IOrderedContainer = 'OFS.interfaces:IOrderedContainer',
     )

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/referenceable.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/referenceable.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/referenceable.py	Tue Jan 11 14:41:39 2011
@@ -1,6 +1,6 @@
-from zope.interface import Interface
+from plone.uuid.interfaces import IUUIDAware
 
-class IReferenceable(Interface):
+class IReferenceable(IUUIDAware):
     """ Referenceable """
 
     def getRefs(relationship=None):

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/schema.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/schema.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/schema.py	Tue Jan 11 14:41:39 2011
@@ -141,10 +141,10 @@
 
     def replaceField(name, field):
         """Replace field under ``name`` with ``field``"""
-        
+
     def moveField(name, direction=None, pos=None, after=None, before=None):
         """Move a field
-        
+
         name:
             name of the field
         direction:
@@ -156,7 +156,7 @@
             Moves the field 'name' after the field 'after'
         before:
             Moves the field 'name' before the field 'before'
-         
+
         """
 
 class ICompositeSchema(ISchema):

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/templatemixin.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/templatemixin.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/templatemixin.py	Tue Jan 11 14:41:39 2011
@@ -9,7 +9,7 @@
 
     def getLayout():
         """
-        @return string for current layout 
+        @return string for current layout
         """
 
     def getDefaultLayout():

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/validator.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/validator.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/validator.py	Tue Jan 11 14:41:39 2011
@@ -4,15 +4,15 @@
 If you're not familiar with subscription adapters, see zope.component's
 README.txt and interfaces.py.
 """
-    
+
 from zope.interface import Interface
 
 class IObjectValidation(Interface):
     """Pre- or post-validate an Archetypes object (common base interface)
-    
+
     Will be called as a subscription adapter during validation.
     """
-    
+
     def __call__(request):
         """Validate the context object. Return a dict with keys of fieldnames
         and values of error strings.
@@ -21,8 +21,8 @@
 class IObjectPreValidation(IObjectValidation):
     """Validate before schema validation
     """
-    
+
 class IObjectPostValidation(IObjectValidation):
     """Validate after schema validation
     """
-    
+

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/vocabulary.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/vocabulary.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/interfaces/vocabulary.py	Tue Jan 11 14:41:39 2011
@@ -9,7 +9,7 @@
 
             The instance of the content is given as parameter.
         """
- 
+
     def getVocabularyDict(self, instance):
         """ returns the vocabulary as a dictionary with a string key and a
             string value. If it is not a flat vocabulary, the value is a

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/mimetype_utils.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/mimetype_utils.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/mimetype_utils.py	Tue Jan 11 14:41:39 2011
@@ -20,14 +20,14 @@
             site_properties.manage_changeProperties(default_contenttype=value)
 
 def getAllowedContentTypes(context):
-    """ computes the list of allowed content types by subtracting the site property blacklist 
+    """ computes the list of allowed content types by subtracting the site property blacklist
         from the list of installed types.
     """
     allowable_types = getAllowableContentTypes(context)
     forbidden_types = getForbiddenContentTypes(context)
     allowed_types = [type for type in allowable_types if type not in forbidden_types]
     return allowed_types
-    
+
 def getAllowableContentTypes(context):
     """ retrieves the list of installed content types by querying portal transforms. """
     portal_transforms = getToolByName(context, 'portal_transforms')

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/add_reference.cpy
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/add_reference.cpy	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/add_reference.cpy	Tue Jan 11 14:41:39 2011
@@ -63,13 +63,13 @@
 # The following code checks the submitted form for an 'associate_ref' list
 # value.  if the field exists, and the name of the ReferenceField is among the
 # listed values, then the reference will be associated immediately upon
-# creation. If not, then the reference will not become associated until the 
+# creation. If not, then the reference will not become associated until the
 # reference source object is saved (i.e. current behaviour remains).
 if add_reference['field'] in req_get('associate_ref', []):
     if field.multiValued:
         field.getMutator(context)(field.getAccessor(context)() + [reference_object])
     else:
-        field.getMutator(context)(reference_object) 
+        field.getMutator(context)(reference_object)
 
 info = {'reference_source_field':add_reference['field'],
         'reference_source_url':portal.portal_url.getRelativeUrl(context),

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/base_metadata.cpt
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/base_metadata.cpt	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/base_metadata.cpt	Tue Jan 11 14:41:39 2011
@@ -51,10 +51,10 @@
     <metal:main fill-slot="main">
       <metal:block define-macro="main">
 
-  <h1 class="documentFirstHeading" 
+  <h1 class="documentFirstHeading"
       tal:content="context/title_or_id"
       metal:use-macro="metadata_macros/header|default" />
-      
+
   <div id="content-core">
       <form name="edit_form"
             method="post"
@@ -90,7 +90,7 @@
                        name="add_reference.destination:record"
                        value=""
                        />
-       
+
           <div class="field">
             <label>&nbsp;</label>
             <input class="context"
@@ -101,7 +101,7 @@
           </div>
       </form>
   </div>
-  
+
   </metal:block>
   </metal:main>
 

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/edit_macros.pt
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/edit_macros.pt	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/edit_macros.pt	Tue Jan 11 14:41:39 2011
@@ -97,7 +97,7 @@
                   <legend id=""
                           tal:content="python: view.getTranslatedSchemaLabel(fieldset)"
                           tal:attributes="id string:fieldsetlegend-${fieldsetid}"
-                          tal:condition="not:sole_fieldset" 
+                          tal:condition="not:sole_fieldset"
                           i18n:translate=""></legend>
                   <tal:fields repeat="field python:schematas[fieldset].editableFields(here, visible_only=True)">
                     <metal:fieldMacro use-macro="python:context.widget(field.getName(), mode='edit')" />
@@ -131,7 +131,7 @@
 		   tal:condition="python: fieldsets and not allow_tabbing"
 		   />
 
-	    
+	
             <input type="hidden"
                    name="form.submitted"
                    value="1"
@@ -248,7 +248,7 @@
 
     <metal:footer_macro define-macro="footer">
     </metal:footer_macro>
-        
+
   </body>
 
 </html>

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/unicodeTestIn.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/unicodeTestIn.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/unicodeTestIn.py	Tue Jan 11 14:41:39 2011
@@ -11,6 +11,8 @@
     return 0
 
 value = context.unicodeEncode(value)
-vocab = [context.unicodeEncode(v) for v in vocab]
+for v in vocab:
+    if context.unicodeEncode(v) == value:
+        return True
 
-return value in vocab
+return False

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/boolean.pt
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/boolean.pt	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/boolean.pt	Tue Jan 11 14:41:39 2011
@@ -17,7 +17,7 @@
                               templateId='widgets/boolean', macro='boolean-field-view');"
             tal:attributes="class kss_class;
                             id string:parent-fieldname-$fieldName">
-            <span metal:define-slot="inside" 
+            <span metal:define-slot="inside"
                   tal:define="voc field/Vocabulary; key accessor;
                               value python:voc and voc.getValue(str(key)) or key"
                   tal:replace="value"

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/calendar.pt
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/calendar.pt	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/calendar.pt	Tue Jan 11 14:41:39 2011
@@ -24,7 +24,7 @@
                        result python:(format and formatted) or (d and tlt and tlt(d, long_format=1)) or None;"
             tal:attributes="class kss_class;
                             id string:parent-fieldname-$fieldName">
-            <span metal:define-slot="inside" 
+            <span metal:define-slot="inside"
                   tal:replace="structure result">calendar</span>
         </div>
     </metal:view_macro>

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/field.pt
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/field.pt	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/field.pt	Tue Jan 11 14:41:39 2011
@@ -78,7 +78,7 @@
                          kss_class python:getKssClasses(fieldName);"
              tal:condition="python:('edit' in widget.modes and 'w' in field.mode and field.checkPermission('w',here))
                                     or (mode=='search' and field.checkPermission('r',here))"
-             tal:attributes="class python: test(error_id, 'field error ' + 'Archetypes' + widget.getName(), 'field ' + 'Archetypes' + widget.getName()) + ' ' + kss_class; 
+             tal:attributes="class python: test(error_id, 'field error ' + 'Archetypes' + widget.getName(), 'field ' + 'Archetypes' + widget.getName()) + ' ' + kss_class;
                              id python: 'archetypes-fieldname-' + fieldName">
           <span metal:define-slot="widget_body_label_prefix"></span>
           <label class="formQuestion" i18n:translate=""

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/image.pt
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/image.pt	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/image.pt	Tue Jan 11 14:41:39 2011
@@ -5,7 +5,7 @@
       i18n:domain="plone">
   <head><title></title></head>
   <body>
- 
+
     <div class="field" metal:define-macro="image_display">
       <metal:block define-slot="widget_label">
       </metal:block>

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/inandout.pt
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/inandout.pt	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/inandout.pt	Tue Jan 11 14:41:39 2011
@@ -9,7 +9,7 @@
     <metal:view_macro define-macro="view">
 
      <tal:block tal:condition="python:hasattr(field, 'relationship')">
-        
+
       <tal:block  tal:define="targets python:context.getRefs(field.relationship)"
                   tal:condition="targets">
 
@@ -34,7 +34,7 @@
       </tal:block>
      </tal:block>
 
-      <tal:block 
+      <tal:block
             tal:condition="not:python:hasattr(field, 'relationship')"
             tal:define="vocab python:field.Vocabulary(here);
                         value python:accessor();
@@ -67,7 +67,7 @@
                                         id string:${fieldName}_options;
                                         size widget/size;
                                         onDblClick string:javascript:inout_moveKeywords('${fieldName}_options','${fieldName}','${fieldName}')">
-      
+
                         <tal:block tal:repeat="vocab_item vocab">
                           <option
                             tal:define="label python:vocab.getValue(vocab_item)"
@@ -78,10 +78,10 @@
                             option
                           </option>
                         </tal:block>
-      
+
                       </select>
                     </td>
-      
+
                     <td style="vertical-align:middle;padding-left:0.5em;padding-right:0.5em">
                       <input type="button" class="context" value="&gt;&gt;"
                              tal:attributes="onClick string:javascript:inout_moveKeywords('${fieldName}_options','${fieldName}','${fieldName}')"
@@ -98,7 +98,7 @@
                                           id string:${fieldName};
                                           size widget/size;
                                           onDblClick string:javascript:inout_moveKeywords('${fieldName}','${fieldName}_options','${fieldName}')">
-  	              
+  	
                           <tal:block tal:repeat="single_value selection">
                             <option
                               tal:attributes="value single_value;"

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/js/textcount.js
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/js/textcount.js	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/js/textcount.js	Tue Jan 11 14:41:39 2011
@@ -1,19 +1,12 @@
 <!-- Original:  Ronnie T. Moore -->
 <!-- Dynamic 'fix' by: Nannette Thacker -->
-
 function textCounter(field, countfield, maxlimit) {
-
-	if (field.value.length > maxlimit) {
-	
-		// if too long...trim it!
-		field.value = field.value.substring(0, maxlimit);
-		
-        alert( 'This field is limited to ' + maxlimit + ' characters in length.' );
-        		
-	} else {
-	
-		// otherwise, update 'characters left' counter	
-		countfield.value = maxlimit - field.value.length;
-		
-	}
-}
\ No newline at end of file
+  var fieldval = jq(field).attr('value');
+  if (fieldval.length > maxlimit) {
+      // if too long...trim it!
+      jq(field).attr('value',  fieldval.substring(0, maxlimit));
+      alert( 'This field is limited to ' + maxlimit + ' characters in length.' );
+  } 
+  // update 'characters left' counter	
+  jq('input[name="' + countfield + '"]').attr('value', Math.max(maxlimit - fieldval.length, 0));
+}

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/keyword.pt
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/keyword.pt	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/keyword.pt	Tue Jan 11 14:41:39 2011
@@ -122,7 +122,7 @@
 						<div class="visualClear"><!-- --></div>
 					</div>
 					
-					<tal:condition condition="python:not widget.roleBasedAdd or (allowRolesToAddKeywords and [role for role in user.getRolesInContext(here) if role in allowRolesToAddKeywords])">
+					<tal:condition condition="python:not widget.roleBasedAdd or (allowRolesToAddKeywords and [role for role in user.getRolesInContext(context) if role in allowRolesToAddKeywords])">
 						<dl id="newTagsSection">
 							<label for="subject_keywords">
 								<dt id="newTagsTitle">
@@ -145,7 +145,7 @@
 									rows="4"
 									tal:attributes="id string:${fieldName}_keywords;
 													name string:${fieldName}_keywords:lines;"
-									tal:define="subject python:[item for item in value if item not in allowedKeywords]"
+									tal:define="subject python:[item for item in value if not context.unicodeTestIn(item,allowedKeywords)]"
 									tal:content="python:'\n'.join(subject)">
 									A new tag
 								</textarea>

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/multiselection.pt
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/multiselection.pt	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/multiselection.pt	Tue Jan 11 14:41:39 2011
@@ -30,7 +30,7 @@
 
       <div tal:condition="python:format=='checkbox'"
             tal:attributes="id fieldName;">
-        <tal:item repeat="item vocab"> 
+        <tal:item repeat="item vocab">
           <div class="ArchetypesMultiSelectionValue" id=""
                tal:attributes="id string:archetypes-value-${fieldName}_${repeat/item/number}">
             <input class="blurrable"

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/rich.pt
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/rich.pt	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/rich.pt	Tue Jan 11 14:41:39 2011
@@ -16,7 +16,7 @@
                               templateId='widgets/rich', macro='rich-field-view');"
             tal:attributes="class kss_class;
                             id string:parent-fieldname-$fieldName">
-            <span metal:define-slot="inside" 
+            <span metal:define-slot="inside"
                   tal:define="transformable python: context.isTransformable(fieldName);"
                   tal:condition="transformable"
                   tal:replace="structure accessor">rich</span>
@@ -30,7 +30,7 @@
             </tal:comment>
         </div>
     </metal:view_macro>
- 
+
     <metal:define define-macro="edit">
       <metal:use use-macro="field_macro | context/widgets/field/macros/edit">
         <metal:fill fill-slot="widget_body"
@@ -43,7 +43,7 @@
           </metal:use>
           <div class="fieldUploadFile"
                tal:condition="widget/allow_file_upload | python:1">
-              <span class="discreet" 
+              <span class="discreet"
                     i18n:translate="or_upload_a_file">or upload a file (existing content will be replaced)</span>
               <input type="file"
                      size="30"

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/selection.pt
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/selection.pt	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/selection.pt	Tue Jan 11 14:41:39 2011
@@ -20,7 +20,7 @@
                               templateId='widgets/selection', macro='selection-field-view');"
             tal:attributes="class kss_class;
                             id string:parent-fieldname-$fieldName">
-            <span metal:define-slot="inside" 
+            <span metal:define-slot="inside"
                 tal:define="vocab python:field.Vocabulary(context);
                             value python:accessor();
                             display python:context.displayValue(vocab, value)"

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/string.pt
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/string.pt	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/string.pt	Tue Jan 11 14:41:39 2011
@@ -15,7 +15,7 @@
                               templateId='widgets/string', macro='string-field-view');"
             tal:attributes="class kss_class;
                             id string:parent-fieldname-$fieldName">
-            <span metal:define-slot="inside" 
+            <span metal:define-slot="inside"
                   tal:replace="accessor">string</span>
         </span>
     </metal:view_macro>

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/textarea.pt
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/textarea.pt	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/textarea.pt	Tue Jan 11 14:41:39 2011
@@ -18,7 +18,7 @@
                               templateId='widgets/textarea', macro='textarea-field-view');"
             tal:attributes="class kss_class;
                             id string:parent-fieldname-$fieldName">
-            <span metal:define-slot="inside" 
+            <span metal:define-slot="inside"
                   tal:replace="accessor">textarea</span>
         </span>
     </metal:view_macro>
@@ -30,9 +30,10 @@
                   content python: not not base and value.getRaw() or value;
                   content python: not binary and content or '';
                   content_length python:len(content);
-                  append_only python: getattr(widget, 'append_only', None);
-                  maxlength python: getattr(widget, 'maxlength', None);
-                  keypress string:textCounter(this, this.form.textCounter_${fieldName}, ${maxlength});">
+                  append_only widget/append_only|nothing;
+                  maxlength widget/maxlength|nothing;
+                  tcname string:textCounter_${fieldName};
+                  keypress string:textCounter(this, '${tcname}', ${maxlength});">
 
         <textarea
             class="blurrable firstToFocus"
@@ -41,7 +42,7 @@
                             cols widget/cols;
                             rows widget/rows;
                             onkeydown python:test(maxlength, keypress, None);
-                            onkeyup python:test(maxlength, keypress, None);"                            
+                            onkeyup python:test(maxlength, keypress, None);"
             tal:define="content python:not append_only and content or '';"
             tal:content="content">content</textarea>
 
@@ -54,12 +55,9 @@
                        size="4"
                        value=""
                        i18n:name="count"
-                       tal:define="remaining python:(int(maxlength) - content_length) + content.count('\n');
-                                   inputsize string:4"
-                       tal:attributes="name string:textCounter_${fieldName};
+                       tal:define="remaining python:(int(maxlength) - content_length) + content.count('\n')"
+                       tal:attributes="name tcname;
                                        value remaining;
-                                       maxlength inputsize;
-                                       size inputsize;
                                        id string:maxlength_${fieldName};" />
                 characters remaining
             </div>

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/zid.pt
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/zid.pt	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/skins/archetypes/widgets/zid.pt	Tue Jan 11 14:41:39 2011
@@ -19,7 +19,7 @@
     />
 
     <metal:define define-macro="edit">
-        
+
       <tal:block tal:define="member python:context.portal_membership.getAuthenticatedMember();
                              member_visible_ids python:member.getProperty('visible_ids', context.portal_memberdata.getProperty('visible_ids'));
                              widget_visible_ids widget/ignore_visible_ids|nothing;

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/doctestcase.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/doctestcase.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/doctestcase.py	Tue Jan 11 14:41:39 2011
@@ -90,7 +90,7 @@
             name = 'ZDT%s' % name
         test_class = type(name, (TestCase, test_class), {})
 
-    # If the test_class does not have a runTest attribute, 
+    # If the test_class does not have a runTest attribute,
     # we add one.
     #if not hasattr(test_class, 'runTest'):
     setattr(test_class, 'runTest', None)
@@ -113,7 +113,7 @@
             kwsetUp(test_instance)
 
     kw['setUp'] = setUp
-    
+
     # tearDown
     kwtearDown = kw.get('tearDown')
     def tearDown(test):
@@ -122,7 +122,7 @@
         test_instance.tearDown()
 
     kw['tearDown'] = tearDown
-    
+
     # other options
     if 'optionflags' not in kw:
         kw['optionflags'] = (doctest.ELLIPSIS

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/layer.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/layer.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/layer.py	Tue Jan 11 14:41:39 2011
@@ -31,6 +31,9 @@
         import Products.PlacelessTranslationService
         zcml.load_config('configure.zcml', Products.PlacelessTranslationService)
 
+        import plone.uuid
+        zcml.load_config('configure.zcml', plone.uuid)
+
     setUp = classmethod(setUp)
 
     def tearDown(cls):

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_annotation.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_annotation.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_annotation.py	Tue Jan 11 14:41:39 2011
@@ -60,18 +60,18 @@
         self.folder.dummy.initializeArchetype()
         self.dummy = self.folder.dummy
         self.ann = getAnnotation(self.dummy)
-        
+
     def test_empty(self):
         ann = self.ann
         self.failUnlessEqual(bool(ann), False)
         self.failUnlessEqual(getattr(self.dummy, '__annotations__', None), None)
-        
+
     def test_create(self):
         ann = self.ann
         ann['test'] = 'test'
         self.failUnlessEqual(bool(ann), True)
         self.failIfEqual(getattr(self.dummy, '__annotations__', None), None)
-    
+
     def test_set(self):
         ann = self.ann
         ann['test'] = 'test1'
@@ -81,7 +81,7 @@
         ann.setSubkey('test', 'test3', subkey='testsub')
         self.failUnlessEqual(ann['test-testsub'], 'test3')
         self.failUnlessEqual(ann.getSubkey('test', subkey='testsub'), 'test3')
-        
+
     def test_get(self):
         ann = self.ann
         ann['test'] = 'test1'
@@ -89,7 +89,7 @@
         self.failUnlessEqual(ann.get('test'), 'test1')
         self.failUnless(ann.has_key('test'))
         self.failUnlessEqual(ann.get('none', default='default'), 'default')
-        
+
     def test_del(self):
         ann = self.ann
         ann['test'] = 'test1'
@@ -110,7 +110,7 @@
         self.dummy = self.folder.dummy
         self.dummy.initializeArchetype()
         self.ann = getAnnotation(self.dummy)
-        
+
     def test_setup(self):
         dummy = self.dummy
         field = dummy.getField('meta')
@@ -126,7 +126,7 @@
         self.failUnlessEqual(ann.getSubkey(AT_MD_STORAGE, subkey='meta'), 'egg')
 
 class AnnotationStorageTest(ATSiteTestCase):
-    
+
     def afterSetUp(self):
         gen_anndummy()
         dummy = AnnDummy(oid='dummy')
@@ -134,33 +134,33 @@
         self.dummy = self.folder.dummy
         self.dummy.initializeArchetype()
         self.ann = getAnnotation(self.dummy)
-        
+
     def test_setup(self):
         dummy = self.dummy
         field = dummy.getField('string')
         self.failUnless(isinstance(field.storage, AnnotationStorage))
         self.failUnless(self.ann.hasSubkey(AT_ANN_STORAGE, 'string'))
         self.failUnlessEqual(self.ann.getSubkey(AT_ANN_STORAGE, subkey='string'), 'stringdefault')
-        
+
     def test_gestset(self):
         dummy = self.dummy
         ann = self.ann
         dummy.setString('egg')
         self.failUnlessEqual(dummy.getString(), 'egg')
         self.failUnlessEqual(ann.getSubkey(AT_ANN_STORAGE, subkey='string'), 'egg')
-        
+
     def test_storageGetSetDel(self):
         dummy = self.dummy
         ann = self.ann
         field = dummy.getField('string')
         storage = field.storage
-        
+
         dummy.setString('egg')
         self.failUnlessEqual(storage.get('string', dummy), 'egg')
-        
+
         storage.set('string', dummy, 'spam')
         self.failUnlessEqual(storage.get('string', dummy), 'spam')
-        
+
         storage.unset('string', dummy)
         self.failIf(ann.hasSubkey(AT_ANN_STORAGE, 'string'))
 
@@ -168,41 +168,41 @@
         dummy = self.dummy
         ann = self.ann
         storage = AnnotationStorage()
-        
+
         self.failUnlessRaises(AttributeError, storage.get, 'nonexisting', dummy)
-        
+
         # del shouldn't raise anything
         storage.unset('nonexisting', dummy)
-        
+
         # set should create an entry
         storage.set('nonexisting', dummy,  value='bar')
         self.failUnlessEqual(storage.get('nonexisting', dummy), 'bar')
-        
+
     def test_migration(self):
         dummy = self.dummy
         ann = self.ann
         field = dummy.getField('string')
         storage = field.storage
-        
+
         # migration mode on
         self.failUnlessEqual(storage._migrate, False)
         storage._migrate = True
-        
+
         # test clean up
         dummy.string = 'spam'
         self.failUnless(hasattr(aq_base(dummy), 'string'))
-        
+
         self.failIfEqual(storage.get('string', dummy), 'spam')
         storage.set('string', dummy, 'bar')
         self.failIf(hasattr(aq_base(dummy), 'string'))
         self.failUnlessEqual(storage.get('string', dummy), 'bar')
-        
+
         # test migration
         ann.delSubkey(AT_ANN_STORAGE, subkey='string')
         dummy.string = 'spam'
         self.failUnlessEqual(storage.get('string', dummy), 'spam')
         self.failIf(hasattr(aq_base(dummy), 'string'))
-               
+
 
 def test_suite():
     from unittest import TestSuite, makeSuite

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_athistoryaware.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_athistoryaware.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_athistoryaware.py	Tue Jan 11 14:41:39 2011
@@ -24,7 +24,7 @@
 class DummyObject(Acquisition.Implicit, persistent.Persistent,
                   ATHistoryAwareMixin):
     foo = 'bar'
-    
+
     def __init__(self):
         annotations = BTrees.OOBTree.OOBTree()
         annotations[KEY1] = DummyAnnotation()
@@ -33,7 +33,7 @@
 
 class ATHistoryAwareTests(unittest.TestCase):
     def setUp(self):
-        # Set up a ZODB and Application object. We can't use DemoStorage 
+        # Set up a ZODB and Application object. We can't use DemoStorage
         # as it doesn't support the history() API.
         self._dir = tempfile.mkdtemp()
         self._storage = FileStorage(
@@ -43,7 +43,7 @@
         root = self._connection.root()
         root['Application'] = OFS.Application.Application()
         self.app = root['Application']
-        
+
         # Our basic testing object
         self.app.object = DummyObject()
         self.object = self.app.object
@@ -52,7 +52,7 @@
         t.note('Transaction 1')
         t.setUser('User 1')
         t.commit()
-        
+
         # Alter object and annotations over several transactions
         annotations = self.object.__annotations__
         self.object.foo = 'baz'
@@ -61,27 +61,27 @@
         t.note('Transaction 2')
         t.setUser('User 2')
         t.commit()
-        
+
         annotations[KEY3] = DummyAnnotation()
         t = transaction.get()
         t.note('Transaction 3')
         t.setUser('User 3')
         t.commit()
-        
+
         del annotations[KEY3]
         annotations[KEY2].spam = 'lumberjack'
         t = transaction.get()
         t.note('Transaction 4')
         t.setUser('User 4')
         t.commit()
-        
+
         self.object.foo = 'mit'
         annotations[KEY1].spam = 'trout'
         t = transaction.get()
         t.note('Transaction 5')
         t.setUser('User 5')
         t.commit()
-        
+
     def tearDown(self):
         transaction.abort()
         del self.app
@@ -90,48 +90,48 @@
         self._storage.close()
         del self._storage
         shutil.rmtree(self._dir)
-        
+
     def test_historyMetadata(self):
         """Each revision entry has unique metadata"""
         for i, entry in enumerate(self.object.getHistories()):
             # History is returned in reverse order, so Transaction 5 is first
             self.assertEqual(entry[2], 'Transaction %d' % (5 - i))
             self.assertEqual(entry[3], '/ User %d' % (5 - i))
-            
+
     def test_objectContext(self):
         """Objects are returned with an acquisition context"""
         for entry in self.object.getHistories():
             self.assertEqual(entry[0].aq_parent, self.app)
-        
+
     def test_simpleAttributes(self):
         """Simple, non-persistent attributes are tracked"""
         foo_history = (e[0].foo for e in self.object.getHistories())
         expected = ('mit', 'baz', 'baz', 'baz', 'bar')
         self.assertEqual(tuple(foo_history), expected)
-        
+
     def test_annotation(self):
         """Persistent subkeys of the __annotations__ object"""
         key1_history = (e[0].__annotations__[KEY1].spam
                         for e in self.object.getHistories())
         expected = ('trout', 'python', 'python', 'python', 'eggs')
         self.assertEqual(tuple(key1_history), expected)
-        
+
         key2_history = (e[0].__annotations__[KEY2].spam
                         for e in self.object.getHistories())
         expected = ('lumberjack', 'lumberjack', 'eggs', 'eggs', 'eggs')
         self.assertEqual(tuple(key2_history), expected)
-        
+
     def test_annotationlifetime(self):
         """Addition and deletion of subkeys is tracked"""
         key3_history = (bool(e[0].__annotations__.has_key(KEY3))
                         for e in self.object.getHistories())
         expected = (False, False, True, False, False)
         self.assertEqual(tuple(key3_history), expected)
-        
+
     def test_maxReturned(self):
         history = list(self.object.getHistories(max=2))
         self.assertEqual(len(history), 2)
-        
+
 def test_suite():
     suite = unittest.TestSuite()
     suite.addTests((

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_baseunit.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_baseunit.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_baseunit.py	Tue Jan 11 14:41:39 2011
@@ -52,7 +52,7 @@
                       instance=dummy)
         input.close()
         got = normalize_html(bu.transform(dummy, 'text/html'))
-        
+
         try:
             output = open(self.output)
         except IOError:
@@ -60,7 +60,7 @@
             output = open(self.output, 'w')
             output.write(got)
             output.close()
-            
+
         output = open(self.output)
         expected = normalize_html(output.read())
         output.close()

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_default_mimetypes.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_default_mimetypes.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_default_mimetypes.py	Tue Jan 11 14:41:39 2011
@@ -11,7 +11,7 @@
 
     def test_ATDocumentDefaultType(self):
         self.loginAsPortalOwner()
-        # we create a new document: 
+        # we create a new document:
         self.portal.invokeFactory('DDocument', id='testdoc', title='TestDocument')
         obj = self.portal.testdoc
         # its text field should have the site wide default 'text/plain'
@@ -21,7 +21,7 @@
         teaserfield = obj.getField('teaser')
         self.assertEqual(teaserfield.getContentType(obj), 'text/plain')
 
-        # then we try to change the sitewide default: 
+        # then we try to change the sitewide default:
         setDefaultContentType(self.portal, "text/x-web-markdown")
         # while this raises no error it won't change the default, as we have
         # no properties tool nor properties sheet

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_event.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_event.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_event.py	Tue Jan 11 14:41:39 2011
@@ -37,41 +37,41 @@
 
 class PreValidation(object):
     implements(IObjectPreValidation)
-    
+
     def __init__(self, context):
         self.context = context
-    
+
     def __call__(self, request):
         return dict(foo="Foo was invalid.")
 
 class PostValidation(object):
     implements(IObjectPostValidation)
-    
+
     def __init__(self, context):
         self.context = context
-    
+
     def __call__(self, request):
         return dict(bar="Bar was invalid.")
-    
+
 def created_handler(ob, event):
     ob._createdCaught = True
-    
+
 def initialized_handler(ob, event):
     ob._initializedCaught = True
-    
+
 def edited_handler(ob, event):
     ob._editedCaught = True
 
 class ValidationEventTests(ATSiteTestCase):
 
     def testPreValidatingEvent(self):
-        
+
         # Register some subscription adapters for different types of objects
         # These will be called during validation
 
         component.provideSubscriptionAdapter(PreValidation, adapts=(IObject1,))
         component.provideSubscriptionAdapter(PreValidation, adapts=(IObject3,))
-        
+
         # Verify that they are called only on the right type of object,
         # and that their return values are included in the error output
 
@@ -80,85 +80,85 @@
         errors = ob.validate()
         self.failUnless(errors['foo'])
         del ob
-        
+
         ob = Dummy('dummy')
         directlyProvides(ob, IObject2)
         errors = ob.validate()
         self.failIf(errors.has_key('foo'))
         del ob
-        
+
         ob = Dummy('dummy')
         directlyProvides(ob, IObject3)
         errors = ob.validate()
         self.failUnless(errors['foo'])
         del ob
-        
+
         sm = component.getSiteManager()
         sm.unregisterSubscriptionAdapter(PreValidation, required=(IObject1,))
         sm.unregisterSubscriptionAdapter(PreValidation, required=(IObject3,))
 
     def testPostValidatingEvent(self):
-        
+
         # This test is similar to the test for pre-validation above. The
         # difference is that the post validation works after main schema
         # validation, whilst the pre-validation works before, and may
         # short-circuit schema validation.
-        
+
         component.provideSubscriptionAdapter(PostValidation, adapts=(IObject2,))
         component.provideSubscriptionAdapter(PostValidation, adapts=(IObject3,))
-        
+
         ob = Dummy('dummy')
         directlyProvides(ob, IObject1)
         errors = ob.validate()
         self.failIf(errors.has_key('bar'))
         del ob
-        
+
         ob = Dummy('dummy')
         directlyProvides(ob, IObject2)
         errors = ob.validate()
         self.failUnless(errors['bar'])
         del ob
-        
+
         ob = Dummy('dummy')
         directlyProvides(ob, IObject3)
         errors = ob.validate()
         self.failUnless(errors.has_key('bar'))
         del ob
-        
+
         sm = component.getSiteManager()
         sm.unregisterSubscriptionAdapter(PostValidation, required=(IObject2,))
         sm.unregisterSubscriptionAdapter(PostValidation, required=(IObject3,))
-        
+
     def testInitializedAndEditedEvent(self):
-        
+
         component.provideHandler(created_handler, (IObject1, IObjectCreatedEvent,))
         component.provideHandler(initialized_handler, (IObject1, IObjectInitializedEvent,))
         component.provideHandler(edited_handler, (IObject1, IObjectEditedEvent,))
-        
+
         ob = Dummy('dummy')
         directlyProvides(ob, IObject1)
         self.folder._setObject('dummy', ob)
         ob = self.folder.dummy
-        
+
         ob._initializedCaught = False
         ob._editedCaught = False
-        
+
         # Simulate first edit
         ob._at_creation_flag = True
         ob.processForm(REQUEST=TestRequest())
-        
+
         self.assertEquals(True, ob._initializedCaught)
         self.assertEquals(False, ob._editedCaught)
-        
+
         # Simulate subsequent edit
         ob.processForm(REQUEST=TestRequest())
         self.assertEquals(True, ob._editedCaught)
-        
+
         sm = component.getSiteManager()
         sm.unregisterHandler(created_handler, (IObject1, IObjectCreatedEvent,))
         sm.unregisterHandler(initialized_handler, (IObject1, IObjectCreatedEvent,))
         sm.unregisterHandler(edited_handler, (IObject1, IObjectCreatedEvent,))
-        
+
 
 def test_suite():
     from unittest import TestSuite, makeSuite

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_extensions_utils.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_extensions_utils.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_extensions_utils.py	Tue Jan 11 14:41:39 2011
@@ -16,19 +16,19 @@
             del ComplexType.schema['richtextfield'].index_method
         except (AttributeError, KeyError):
             pass
-        
+
     def test_base_usage(self):
         ComplexType.schema['richtextfield'].index = 'FieldIndex'
         utils.install_indexes(self.portal, StringIO(), (ComplexType,) )
         self.failUnless('getRichtextfield' in self.portal.portal_catalog.indexes())
 
-        
+
     def test_index_method(self):
         ComplexType.schema['richtextfield'].index = 'FieldIndex'
         ComplexType.schema['richtextfield'].index_method = 'Whatever'
         utils.install_indexes(self.portal, StringIO(), (ComplexType,) )
         self.failUnless('Whatever' in self.portal.portal_catalog.indexes())
-        
+
         ComplexType.schema['richtextfield'].index_method = '_at_accessor'
         utils.install_indexes(self.portal, StringIO(), (ComplexType,) )
         self.failUnless('getRichtextfield' in self.portal.portal_catalog.indexes())
@@ -37,7 +37,7 @@
         utils.install_indexes(self.portal, StringIO(), (ComplexType,) )
         self.failUnless('getRawRichtextfield' in self.portal.portal_catalog.indexes())
 
-        
+
     def test_bad_index_method(self):
         ComplexType.schema['richtextfield'].index = 'FieldIndex'
         ComplexType.schema['richtextfield'].index_method = lambda x: 'yop'
@@ -50,7 +50,7 @@
         ComplexType.schema['richtextfield'].index_method = ComplexType._get_selection_vocab
         self.failUnlessRaises(ValueError,
                               utils.install_indexes, self.portal, StringIO(), (ComplexType,) )
-        
+
 
 def test_suite():
     from unittest import TestSuite, makeSuite

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_fields.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_fields.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_fields.py	Tue Jan 11 14:41:39 2011
@@ -201,12 +201,12 @@
         dummy.processForm()
 
         image_field = dummy.getField('imagefield')
-        self.assertEquals(image_field.tag(dummy), 
+        self.assertEquals(image_field.tag(dummy),
                           '<img src="%s/dummy/imagefield" alt="Spam" title="Spam" height="16" width="16" />' % portal_name)
-        self.assertEquals(image_field.tag(dummy, alt=''), 
+        self.assertEquals(image_field.tag(dummy, alt=''),
                           '<img src="%s/dummy/imagefield" alt="" title="Spam" height="16" width="16" />' % portal_name)
-        self.assertEquals(image_field.tag(dummy, alt='', title=''), 
-                          '<img src="%s/dummy/imagefield" alt="" title="" height="16" width="16" />' % portal_name)        
+        self.assertEquals(image_field.tag(dummy, alt='', title=''),
+                          '<img src="%s/dummy/imagefield" alt="" title="" height="16" width="16" />' % portal_name)
 
     def test_get_size(self):
         dummy = self.makeDummy()
@@ -235,7 +235,7 @@
 
     def test_validation_visible_fields(self):
         """ we assume that every field is visible """
-        
+
         dummy = self.makeDummy()
         request = TestRequest()
         alsoProvides(request, IAttributeAnnotatable)
@@ -245,7 +245,7 @@
         errors = {}
         dummy.validate(errors=errors, REQUEST=request)
         self.failUnless(errors, errors)
-        
+
     def test_validation_invisible_fields(self):
         dummy = self.makeDummy()
         request = FakeRequest()
@@ -258,7 +258,7 @@
         errors = {}
         dummy.validate(errors=errors, REQUEST=request)
         self.failIf(errors, errors)
-        
+
     def test_validation_hidden_fields(self):
         dummy = self.makeDummy()
         request = FakeRequest()
@@ -278,7 +278,7 @@
         request.form.update(empty_values)
         request.form['fieldset'] = 'default'
         self._test_required(request)
-        
+
     def test_required_empty_request(self):
         request = FakeRequest()
         request.form = {}
@@ -351,9 +351,9 @@
 
         # Default
         self.failUnlessEqual(field.Vocabulary(dummy), DisplayList())
-        
+
         expected = DisplayList([('value1', 'title1'), ('v2', 't2')])
-        
+
         # # Vocabulary factory
         field.vocabulary = ()
         field.vocabulary_factory = 'archetypes.tests.dummyvocab'
@@ -368,11 +368,11 @@
 
         # Default
         self.failUnlessEqual(field.getDefault(dummy), None)
-        
+
         # Value
         field.default = "Hello"
         self.failUnlessEqual(field.getDefault(dummy), 'Hello')
-        
+
         # Method
         field.default = None
         field.default_method = 'default_val'
@@ -380,14 +380,14 @@
 
         # Adapter
         field.default_method = None
-        
+
         class DefaultFor(object):
             implements(IFieldDefaultProvider)
             def __init__(self, context):
                 self.context = context
             def __call__(self):
                 return "Adapted"
-        
+
         getSiteManager().registerAdapter(factory=DefaultFor, required=(Dummy,), name=field.__name__)
         self.failUnlessEqual(field.getDefault(dummy), 'Adapted')
         getSiteManager().unregisterAdapter(factory=DefaultFor, required=(Dummy,), name=field.__name__)
@@ -397,7 +397,7 @@
         dummy = self.makeDummy()
         request = FakeRequest()
         field = dummy.Schema().fields()[3] # textfield
-        field.set(self.portal, 'some_text_with_weird_encoding', encoding='latin' ) 
+        field.set(self.portal, 'some_text_with_weird_encoding', encoding='latin' )
         encoding = field.getRaw(self.portal, raw=1).original_encoding
         self.assertEqual(encoding, 'latin')
 
@@ -416,7 +416,7 @@
         self.field.getMutator(self.dummy)(self.wordfile.read())
         self.request = self.app.REQUEST
         self.response = self.request.response
-    
+
     def test_download_from_textfield(self):
         # make sure field data doesn't get transformed when using the
         # download method
@@ -430,7 +430,7 @@
         self.field.download(self.dummy, no_output=True)
         self.assertEqual(self.response.headers['content-disposition'],
                          'attachment; filename="uberzeugen"')
-        
+
 def test_suite():
     from unittest import TestSuite, makeSuite
     suite = TestSuite()

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_file_upload.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_file_upload.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_file_upload.py	Tue Jan 11 14:41:39 2011
@@ -317,7 +317,7 @@
         # compatibility.
         self.failUnless(isinstance(result, self.factory),
                         (type(result), self.factory))
-                        
+
     def test_delete_file_via_set(self):
         sample = 'a sample text file to be deleted ............................'
         self.field.set(self.instance, sample)

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_filename.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_filename.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_filename.py	Tue Jan 11 14:41:39 2011
@@ -172,7 +172,7 @@
         self.assertEqual(obj.getBody().size, 140000)
         obj.getBody().setFilename('Spam.txt')
         self.assertEqual(obj.getBody().size, 140000)
-        
+
 
 class StrangeIdTest(ATSiteTestCase):
     def test_strangeUnallowedIds(self):

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_functional.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_functional.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_functional.py	Tue Jan 11 14:41:39 2011
@@ -98,35 +98,35 @@
         # Make our content type use auto generated ids
         from Products.Archetypes.examples.DDocument import DDocument
         DDocument._at_rename_after_creation = True
-    
+
         auto_id='orig_id'
-    
+
         # create an object with an autogenerated id
         response = self.publish(self.folder_path +
                                 '/invokeFactory?type_name=DDocument&id=%s'%auto_id,
                                 self.basic_auth)
-    
+
         # XXX now lets test if http://plone.org/collector/4487 is present
         if  "base_edit.cpt" in self.portal.portal_skins.archetypes.objectIds():
             raise AttributeError, ("test_id_change_with_non_auto_id "
                   "is expected to fail unless  http://plone.org/collector/4487 is fixed")
-    
+
         self.failUnless(auto_id in self.folder.objectIds())
         new_obj = getattr(self.folder, auto_id)
-    
+
         #Change the title
         obj_title = "New Title for Object"
         new_obj_path = '/%s' % new_obj.absolute_url(1)
         self.failUnless(new_obj.checkCreationFlag()) # object is not yet edited
-    
+
         response = self.publish('%s/base_edit?form.submitted=1&title=%s&body=Blank' % (new_obj_path, obj_title,), self.basic_auth) # Edit object
         self.assertStatusEqual(response.getStatus(), 302) # OK
         self.failIf(new_obj.checkCreationFlag()) # object is fully created
         self.failUnlessEqual(new_obj.Title(),obj_title) # title is set
         self.failUnlessEqual(new_obj.getId(), auto_id) # id should not have changed
-    
+
         del DDocument._at_rename_after_creation
-    
+
     def test_id_change_with_without_marker(self):
         # Id should not be changed unless _at_rename_after_creation is set
         # on the class.
@@ -136,14 +136,14 @@
             del DDocument._at_rename_after_creation
         except (AttributeError, KeyError):
             pass
-    
+
         auto_id='orig_id'
-    
+
         # create an object with an autogenerated id
         response = self.publish(self.folder_path +
                                 '/invokeFactory?type_name=DDocument&id=%s'%auto_id,
                                 self.basic_auth)
-    
+
         # XXX now lets test if http://plone.org/collector/4487 is present
         if  "base_edit.cpt" in self.portal.portal_skins.archetypes.objectIds():
             raise AttributeError("test_id_change_with_without_marker is "
@@ -151,15 +151,15 @@
                   "fixed. This might also occur with chameleon cache files "
                   "but chameleon not installed. You can find them via: "
                   "find . -name \"*pt.py\"")
-    
+
         self.failUnless(auto_id in self.folder.objectIds())
         new_obj = getattr(self.folder, auto_id)
-    
+
         #Change the title
         obj_title = "New Title for Object"
         new_obj_path = '/%s' % new_obj.absolute_url(1)
         self.failUnless(new_obj.checkCreationFlag()) # object is not yet edited
-    
+
         response = self.publish('%s/base_edit?form.submitted=1&title=%s&body=Blank' % (new_obj_path, obj_title,), self.basic_auth) # Edit object
         self.assertStatusEqual(response.getStatus(), 302) # OK
         self.failIf(new_obj.checkCreationFlag()) # object is fully created

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_index.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_index.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_index.py	Tue Jan 11 14:41:39 2011
@@ -106,12 +106,12 @@
                            id='simple_type')
 
         # Make sure the object is indexed by portal_catalog...
-        results = self.pc.searchResults(getId='simple_type')
+        results = self.pc.searchResults(dict(getId='simple_type'))
         self.failUnlessEqual(len(results), 1)
         self.failUnlessEqual(results[0].getObject(), inst)
 
         # ...but isn't by the zope_catalog
-        results = self.zc.searchResults(getId='simple_type')
+        results = self.zc.searchResults(dict(getId='simple_type'))
         self.failUnlessEqual(len(results), 0)
 
     def test_new_catalog(self):
@@ -122,12 +122,12 @@
                            id='simple_type')
 
         # Make sure the object is indexed by the new zope_catalog...
-        results = self.zc.searchResults(getId='simple_type')
+        results = self.zc.searchResults(dict(getId='simple_type'))
         self.failUnlessEqual(len(results), 1)
         self.failUnlessEqual(results[0].getObject(), inst)
 
         # ...but isn't indexed anymore by portal_catalog
-        results = self.pc.searchResults(getId='simple_type')
+        results = self.pc.searchResults(dict(getId='simple_type'))
         self.failUnlessEqual(len(results), 0)
 
     def test_both_catalogs(self):
@@ -139,12 +139,12 @@
                            id='simple_type')
 
         # Make sure the object is indexed by portal_catalog...
-        results = self.pc.searchResults(getId='simple_type')
+        results = self.pc.searchResults(dict(getId='simple_type'))
         self.failUnlessEqual(len(results), 1)
         self.failUnlessEqual(results[0].getObject(), inst)
 
         # ...and also by the zope_catalog
-        results = self.zc.searchResults(getId='simple_type')
+        results = self.zc.searchResults(dict(getId='simple_type'))
         self.failUnlessEqual(len(results), 1)
         self.failUnlessEqual(results[0].getObject(), inst)
 

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_interfaces.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_interfaces.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_interfaces.py	Tue Jan 11 14:41:39 2011
@@ -100,7 +100,7 @@
             self.fail('The class %s does not implement %s correctly: \n%s'
                 % (className(klass), className(interface), errmsg))
 
-    def interfaceImplementedBy(self, instance, interface):        
+    def interfaceImplementedBy(self, instance, interface):
         """ tests if the instance implements the interface in the right way """
         # is the class really implemented by the given interface?
         self.failUnless(interface.providedBy(instance),

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_metadata.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_metadata.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_metadata.py	Tue Jan 11 14:41:39 2011
@@ -338,7 +338,7 @@
         dummy.allowDiscussion(False)
         self.failIf(dummy.isDiscussable())
         self.assertEqual(dummy.editIsDiscussable(), False)
-        
+
     def testDiscussionOverride(self):
         # Make sure that if allowed_discussion is set on the class
         # we can still use allowDiscussion to override it.

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_referenceCatalog.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_referenceCatalog.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_referenceCatalog.py	Tue Jan 11 14:41:39 2011
@@ -22,6 +22,12 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ################################################################################
+from zope import component
+from zope import interface
+from zope.event import notify
+from zope.lifecycleevent import ObjectCreatedEvent
+from plone.indexer.interfaces import IIndexableObject
+from Products.ZCatalog.interfaces import IZCatalog
 """
 Unittests for a reference Catalog
 
@@ -36,22 +42,58 @@
 from OFS.ObjectManager import BeforeDeleteException
 import transaction
 
+from plone.uuid.interfaces import IAttributeUUID, IUUID
+from plone.indexer import wrapper
+
+class DexterityLike(object):
+    """Create a new class non based on Archetypes"""
+    interface.implements(IAttributeUUID)
+
+    def __init__(self):
+        self.id = "myid"
+        self.portal_type = "dexterity_like"
+        self.path = []
+
+    def Title(self):
+        return u"My dexterity like content"
+
+    def getPhysicalPath(self):
+        if self.path[-1] != self.id:
+            self.path.append(self.id)
+        return self.path
+
+    def manage_fixupOwnershipAfterAdd(self):
+        pass
+    
+    def getId(self):
+        return self.id
+
+
 class ReferenceCatalogTests(ATSiteTestCase):
 
+    def afterSetUp(self):
+        #register the test class as indexable with plone.indexer default
+        sm = component.getSiteManager()
+        sm.registerAdapter(factory=wrapper.IndexableObjectWrapper,
+                           required=(interface.Interface, IZCatalog),
+                           provided=IIndexableObject)
+
     def verifyBrains(self):
         uc = getattr(self.portal, config.UID_CATALOG)
         rc = getattr(self.portal, config.REFERENCE_CATALOG)
 
-        #Verify all UIDs resolve
-        brains = uc()
+        # Verify all UIDs resolve
+        uids = uc.uniqueValuesFor('UID')
+        brains = uc(dict(UID=uids))
         objects = [b.getObject() for b in brains]
         self.failIf(None in objects, """bad uid resolution""")
         for b in brains:
             if b.getPath().startswith('/'):
                 print "Bad Brain", b, b.getObject()
 
-        #Verify all references resolve
-        brains = rc()
+        # Verify all references resolve
+        uids = rc.uniqueValuesFor('UID')
+        brains = rc(dict(UID=uids))
         objects = [b.getObject() for b in brains]
         self.failIf(None in objects, """bad ref catalog resolution""")
 
@@ -77,7 +119,9 @@
         uid1 = obj.UID()
         uid2 = obj2.UID()
 
-        brains = rc()
+        uids = rc.uniqueValuesFor('UID')
+        brains = rc(dict(UID=uids))
+
         ref = brains[0].getObject()
         self.failUnless(ref.sourceUID == uid1)
         self.failUnless(ref.targetUID == uid2)
@@ -253,23 +297,65 @@
         obj2 = makeContent(self.folder, portal_type='Refnode',id='reftwo')
         obj3 = makeContent(self.folder, portal_type='Refnode',id='refthree')
         obj4 = makeContent(self.folder, portal_type='Refnode',id='reffour')
-        
+
         o2U = obj2.UID()
         o3U = obj3.UID()
         o4U = obj4.UID()
-        
+
         links1 = [o2U, o3U, o4U]
         obj1.update(sortedlinks=links1)
         self.assertEqual(obj1.getRawSortedlinks(), links1)
-        
+
         links2 = [o4U, o3U, o2U]
         obj1.update(sortedlinks=links2)
         self.assertEqual(obj1.getRawSortedlinks(), links2)
-        
+
         links3 = [o3U, o2U]
         obj1.update(sortedlinks=links3)
         self.assertEqual(obj1.getRawSortedlinks(), links3)
-      
+    def test_TitleIndexer(self):
+        uc = getattr(self.portal, config.UID_CATALOG)
+        dext = DexterityLike()
+        dext.path = list(self.folder.getPhysicalPath())
+        self.folder[dext.id] = dext
+        uc.catalog_object(dext, '/'.join(dext.getPhysicalPath()))
+        results = uc(Title=dext.Title())
+        self.failUnless(len(results)==1)
+        self.failUnless(type(dext.Title())==unicode)
+        self.failUnless(type(results[0].Title)==str)
+
+    def test_UIDIndexer(self):
+        uc = getattr(self.portal, config.UID_CATALOG)
+        dext = DexterityLike()
+        dext.path = list(self.folder.getPhysicalPath())
+        self.folder[dext.id] = dext
+        notify(ObjectCreatedEvent(dext)) #it supposed to add uuid attribute
+
+        #catalog dext instance
+        uc.catalog_object(dext, '/'.join(dext.getPhysicalPath()))
+
+        #check lookup
+        uuid = IUUID(dext, None)
+        results = uc(UID=uuid)
+
+        self.failUnless(len(results)==1)
+        self.failUnless(results[0].UID==uuid)
+        self.failUnless(results[0].Title==str(dext.Title()))
+
+    def test_reference_non_archetypes_content(self):
+        # create a archetype based content instance
+        ob = makeContent(self.folder, portal_type='DDocument',id='mydocument')
+        uc = getattr(self.portal, config.UID_CATALOG)
+        uc.catalog_object(ob, '/'.join(ob.getPhysicalPath()))
+        # create a non archetype based content
+        dext = DexterityLike()
+        dext.path = list(self.folder.getPhysicalPath())
+        self.folder[dext.id] = dext
+        notify(ObjectCreatedEvent(dext)) #it supposed to add uuid attribute
+        uc.catalog_object(dext, '/'.join(dext.getPhysicalPath()))
+        # create the relation between those
+        ob.setRelated(dext)
+        self.assertEqual(ob.getRelated()[0], dext)
 
 def test_suite():
     from unittest import TestSuite, makeSuite

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_referenceable.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_referenceable.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_referenceable.py	Tue Jan 11 14:41:39 2011
@@ -32,6 +32,7 @@
 from Products.Archetypes.examples import *
 from Products.Archetypes.config import *
 from Products.Archetypes.atapi import DisplayList
+from plone.uuid.interfaces import IUUIDAware, IUUID
 
 class BaseReferenceableTests(ATSiteTestCase):
 
@@ -42,12 +43,16 @@
         rc = getattr(self.portal, REFERENCE_CATALOG)
 
         #Verify all UIDs resolve
-        brains = uc()
+        uids = uc.uniqueValuesFor('UID')
+        brains = uc(dict(UID=uids))
+
         uobjects = [b.getObject() for b in brains]
         self.failIf(None in uobjects, """bad uid resolution""")
 
         #Verify all references resolve
-        brains = rc()
+        uids = rc.uniqueValuesFor('UID')
+        brains = rc(dict(UID=uids))
+
         robjects = [b.getObject() for b in brains]
         self.failIf(None in robjects, """bad ref catalog resolution""")
         return uobjects, robjects
@@ -60,6 +65,14 @@
         self.failUnless(hasattr(aq_base(doc), UUID_ATTR))
         self.failUnless(getattr(aq_base(doc), UUID_ATTR, None))
 
+    def test_uuid(self):
+        doc = makeContent( self.folder
+                           , portal_type='DDocument'
+                           , title='Foo' )
+
+        self.failUnless(IUUIDAware.providedBy(doc))
+        uuid = IUUID(doc, None)
+        self.failUnless(uuid == doc.UID())
 
     def test_renamedontchangeUID( self ):
         catalog = self.portal.uid_catalog
@@ -412,7 +425,7 @@
         a.addReference(b, 'Flogs')
         self.assertEquals(len(a.getRefs('KnowsAbout')), 2)
         self.assertEquals(len(a.getRefs()), 3)
-        
+
 
     def test_UIDunderContainment(self):
         # If an object is referenced don't record its reference again
@@ -462,7 +475,8 @@
         self.failUnless(a.UID() in uids, (a.UID(), uids))
         self.failUnless(b.UID() in uids, (b.UID(), uids))
 
-        refs = rc()
+        uids = rc.uniqueValuesFor('UID')
+        refs = rc(dict(UID=uids))
         self.assertEquals(len(refs), 1)
         ref = refs[0].getObject()
         self.assertEquals(ref.targetUID, b.UID())
@@ -472,8 +486,8 @@
         self.folder._delObject("reftest")
         self.verifyBrains()
 
-        uids = uc.uniqueValuesFor('UID')
-        self.assertEquals(len(rc()), 0)
+        uids = rc.uniqueValuesFor('UID')
+        self.assertEquals(len(uids), 0)
 
     def test_reindexUIDCatalog(self):
         catalog = self.portal.uid_catalog
@@ -482,7 +496,7 @@
                           portal_type='DDocument',
                           id='demodoc')
         doc.update(title="sometitle")
-        brain = catalog(UID=doc.UID())[0]
+        brain = catalog(dict(UID=doc.UID()))[0]
         self.assertEquals(brain.Title, doc.Title())
 
     def test_referenceReference(self):

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_schemata.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_schemata.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_schemata.py	Tue Jan 11 14:41:39 2011
@@ -182,12 +182,12 @@
                 write_permission = ModifyPortalContent,
                 widget=StringWidget(visible={'edit': 'invisible'}),
             ),
-            StringField('f2', 
+            StringField('f2',
                 mutator='setF2',
                 write_permission = ModifyPortalContent,
                 widget=StringWidget(visible={'edit': 'hidden'}),
             ),
-            StringField('f3', 
+            StringField('f3',
                 mutator='setF3',
                 write_permission = ModifyPortalContent,
                 widget=StringWidget(condition='python:False',),

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_update_schema.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_update_schema.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_update_schema.py	Tue Jan 11 14:41:39 2011
@@ -149,7 +149,7 @@
         self.assertEqual(dummy.TEXTFIELD2(), 'B')
         # Note: TEXTFIELD is a BaseUnit, which means you need to call
         # it to get its value.
-        
+
     def test_no_schema_attribute_added(self):
         """Does updating the schema mess things up?
 

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_utils.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_utils.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_utils.py	Tue Jan 11 14:41:39 2011
@@ -34,7 +34,7 @@
     """Some ppl have reported problems with uids. This test isn't mathematical
     correct but should show the issue on plattform. I suspect it's Windows :|
     """
-    
+
     def test_uuid(self):
         uids = {}
         loop_length = 10**5 # about 1.5 seconds on a fast cpu

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_utils2.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_utils2.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_utils2.py	Tue Jan 11 14:41:39 2011
@@ -85,7 +85,7 @@
         (k,v) = self.d.popitem()
         self.failUnless(k == 'c')
         self.failUnless(v == '3')
-        
+
 
 def test_suite():
     from unittest import TestSuite, makeSuite

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_varschema.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_varschema.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_varschema.py	Tue Jan 11 14:41:39 2011
@@ -41,7 +41,7 @@
         registerType(Dummy, 'Archetypes')
         content_types, constructors, ftis = process_types(listTypes(), PKG_NAME)
 
-    def test_variableschema(self):        
+    def test_variableschema(self):
         self.folder.dummy = Dummy(oid='dummy')
         dummy = self.folder.dummy
         dummy.setTitle('dummy1')

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_widgets.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_widgets.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/tests/test_widgets.py	Tue Jan 11 14:41:39 2011
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 ################################################################################
 #
 # Copyright (c) 2002-2005, Benjamin Saller <[email protected]>, and
@@ -125,6 +126,31 @@
         result = widget.process_form(doc, field, form, empty_marker)
         self.assertEqual(expected, result)
 
+    def test_unicodeTestIn(self):
+        # Test the unicodeTestIn skin script.
+        vocab = ['\xc3\xab', u'\xeb', 'maurits']
+        self.assertEqual(self.portal.unicodeTestIn('maurits', vocab), True)
+        self.assertEqual(self.portal.unicodeTestIn(u'maurits', vocab), True)
+        # There is no spoon:
+        self.assertEqual(self.portal.unicodeTestIn('spoon', vocab), False)
+
+        # This is the most tricky one, as it runs the danger of
+        # raising a UnicodeDecodeError (python2.4) or giving a
+        # UnicodeWarning (python2.6) which again might raise an
+        # Unauthorized error due to guarded_import restrictions.
+        self.assertEqual(self.portal.unicodeTestIn(u'\xeb', vocab), True)
+
+        # The unicodeTestIn script can be called very often on edit
+        # forms when you have lots of keywords (Subject) in your site.
+        # So an interesting test here is: how fast is this?  For a
+        # speed test, uncomment the next few lines.  It basically
+        # tests having 3000 keywords, of which 50 are selected on a
+        # page.  The related change in unicodeTestIn speeds this up
+        # from 42 to 15 seconds.
+        #vocab += [str(x) for x in range(3000)]
+        #for x in range(1000, 1050):
+        #    self.assertEqual(self.portal.unicodeTestIn(str(x), vocab), True)
+
     def _test_widgets(self):
         doc = makeContent(self.folder, portal_type='ComplexType', id='demodoc')
 

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/utils.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/utils.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/utils.py	Tue Jan 11 14:41:39 2011
@@ -1,19 +1,12 @@
 import logging
 import os
-import socket
 import sys
-from random import random
-from time import time
 from inspect import getargs, getmro
 from types import ClassType, MethodType
 from UserDict import UserDict as BaseDict
 
-try:
-    from hashlib import md5
-except:
-    from md5 import md5
-
 import transaction
+from zope.component import getUtility
 from zope.i18n import translate
 from zope.i18nmessageid import Message
 
@@ -28,40 +21,14 @@
 from Products.Archetypes.config import DEBUG_SECURITY
 from Products.statusmessages.interfaces import IStatusMessage
 
-try:
-    _v_network = str(socket.gethostbyname(socket.gethostname()))
-except:
-    _v_network = str(random() * 100000000000000000L)
+from plone.uuid.interfaces import IUUIDGenerator
 
 def make_uuid(*args):
-    t = str(time() * 1000L)
-    r = str(random()*100000000000000000L)
-    data = t +' '+ r +' '+ _v_network +' '+ str(args)
-    uid = md5(data).hexdigest()
-    return uid
-
-# linux kernel uid generator. It's a little bit slower but a little bit better
-KERNEL_UUID = '/proc/sys/kernel/random/uuid'
+    generator = getUtility(IUUIDGenerator)
+    return generator()
 
 logger = logging.getLogger('Archetypes')
 
-if os.path.isfile(KERNEL_UUID):
-    HAS_KERNEL_UUID = True
-    def uuid_gen():
-        fp = open(KERNEL_UUID, 'r')
-        while 1:
-            uid = fp.read()[:-1]
-            fp.seek(0)
-            yield uid
-    uid_gen = uuid_gen()
-
-    def kernel_make_uuid(*args):
-        return uid_gen.next()
-else:
-    HAS_KERNEL_UUID = False
-    kernel_make_uuid = make_uuid
-
-
 def fixSchema(schema):
     """Fix persisted schema from AT < 1.3 (UserDict-based)
     to work with the new fixed order schema."""
@@ -352,7 +319,7 @@
         return  a[0] - b[0]
 
     def add(self, key, value, msgid=None):
-        if not isinstance(key, basestring): 
+        if not isinstance(key, basestring):
             raise TypeError('DisplayList keys must be strings, got %s' %
                             type(key))
         if not isinstance(value, basestring) and not isinstance(value, int):
@@ -559,7 +526,7 @@
         """
         Get i18n value
         """
-        if not isinstance(key, basestring) and not isinstance(key, int): 
+        if not isinstance(key, basestring) and not isinstance(key, int):
             raise TypeError('DisplayList keys must be strings or ints, got %s' %
                             type(key))
         v = self._keys.get(key, None)

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/addSchema.zpt
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/addSchema.zpt	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/addSchema.zpt	Tue Jan 11 14:41:39 2011
@@ -1,27 +1,27 @@
 <h1 tal:replace="structure context/manage_page_header|nothing">Header</h1>
 <h2 tal:define="manage_tabs_message options/manage_tabs_message | nothing"
     tal:replace="structure context/manage_tabs">Tabs</h2>
-  
+
 
   <form method="POST" action="manage_addSchema">
     <div class="form-title">
       Add a new schema
     </div>
-    
+
     <div class="form-help">
       This is an Archetype Schema
     </div>
-    
+
     <div tal:define="status python:request.get('portal_status', '')"
       tal:condition="status"
       class="error"	
       tal:content="status"
       />
-      
+
       <table width="50%">
 	<tr>
 	  <td> ID</td>
-	  <td> 
+	  <td>
 	    <input style="border: 1px solid black;" name="id" tal:attributes="value python:request.get('id', '');"/>
 	  </td>
 	</tr>		
@@ -34,9 +34,9 @@
 	  </td>	
 	</tr>
       </table>
-      
+
       <br />
       <input type="submit" value="Add Schema"/>
   </form>
-    
+
 <tal:footer tal:replace="structure context/manage_page_footer|nothing">footer</tal:footer>

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/generateDebug.zpt
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/generateDebug.zpt	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/generateDebug.zpt	Tue Jan 11 14:41:39 2011
@@ -42,12 +42,12 @@
                           inst_val python: typ != None;
                           installed python: test(typ != None, 'installed', 'not installed');
                           spec python:context.getTypeSpec(package, type_name)">
-            <a tal:condition="nothing" href="#" tal:attributes="href string:${request/URL1}/manage_dumpSchema?package=${package}&type_name=${type_name}">
+            <a tal:condition="nothing" href="#" tal:attributes="href string:${request/URL1}/manage_dumpSchema?package=${package}&amp;type_name=${type_name}">
               [dump schema]
             </a>
             <span tal:replace="string:${package}::${type_name}"/>
-            <a tal:condition="not: inst_val" tal:attributes="href string:${gen/absolute_url}/manage_installType?typeName=${type_name}&package=${package}">Install</a>
-            <a tal:condition="inst_val" tal:attributes="href string:${gen/absolute_url}/manage_installType?typeName=${type_name}&uninstall=1">Uninstall</a>
+            <a tal:condition="not: inst_val" tal:attributes="href string:${gen/absolute_url}/manage_installType?typeName=${type_name}&amp;package=${package}">Install</a>
+            <a tal:condition="inst_val" tal:attributes="href string:${gen/absolute_url}/manage_installType?typeName=${type_name}&amp;uninstall=1">Uninstall</a>
           </td>
         </tr>
         <tr tal:condition="nothing">
@@ -73,4 +73,4 @@
     </form>
 
   </body>
-</html>
\ No newline at end of file
+</html>

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/manageTemplates.zpt
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/manageTemplates.zpt	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/manageTemplates.zpt	Tue Jan 11 14:41:39 2011
@@ -6,13 +6,13 @@
 	  td {
 	     vertical-align: top;
 	  }
-	  
+	
 	</style>
 
     <p>Templates are bind by 'portal_type'. Every Template Mixin enabled
          type registered in portal_types-tool is listed here.</p>
 	
-	<form action="manage_templates" method="POST" 
+	<form action="manage_templates" method="POST"
 	      tal:define="at context/archetype_tool;
 	                  templates at/listTemplates;
 			  vocab python:templates;
@@ -20,7 +20,7 @@
 	
     <table class="main">
 	<tr tal:repeat="fti python: at.listTemplateEnabledPortalTypes()">
-   
+
 	  <td><h3><img tal:attributes="src fti/content_icon" />
               <span tal:replace="string:${fti/product}" />:
               <span tal:replace="string:${fti/title_or_id}" /></h3>
@@ -37,7 +37,7 @@
                 Template-Implemenation. Rebind this template if you need it.</p>
             </tal:condition>
           </tal>
-            
+
       </td>
 	  <td>
 	    <select multiple="multiple"
@@ -51,7 +51,7 @@
 		                           selected python:item in currentselection and 'selected' or None;"
 		          tal:content="python:'%s - (%s)' % (item, getValue(item))"/>
 	    </select>
-        
+
       </td>
 	</tr>
     <tr>
@@ -70,15 +70,15 @@
 	</tr>
     <tr>
        <td><input type="submit" name="addTemplate" value="Add Template"/></td>
-       <td>&nbsp;</td> 
+       <td>&nbsp;</td>
     </tr>
     </table>
 
-   
-      
-      
-      
-      
+
+
+
+
+
     </form>
 
       </body>

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/manage_catalogs.zpt
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/manage_catalogs.zpt	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/manage_catalogs.zpt	Tue Jan 11 14:41:39 2011
@@ -6,17 +6,17 @@
 	  div.row {
 	  padding-top: 2px;
 	  }
-	  
+	
 	  .cell {
 	  margin-right:1em;
 	  width: 33%;
-	  }	    
-	  
+	  }	
+	
 	  .content_type {
 	  border: 1px solid black;
 	  margin: 4px;
 	  }
-	    
+	
 	  .main td {
 	    text-align: left;
 	    }
@@ -32,7 +32,7 @@
 
 	</style>
 	
-	<form action="manage_updateCatalogs" method="POST" 
+	<form action="manage_updateCatalogs" method="POST"
 	      tal:define="at context/archetype_tool;
 	                  catalogs at/listCatalogs;
 	                  vocab at/getCatalogsInSite;">
@@ -56,10 +56,10 @@
           </td>
 	</tr>
       </table>
-      
+
       <input type="submit" name="submit" value="Update Catalogs"/>
-      
+
     </form>
-      
+
     </body>
   </html>

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/migrationForm.zpt
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/migrationForm.zpt	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/migrationForm.zpt	Tue Jan 11 14:41:39 2011
@@ -7,10 +7,10 @@
 
 <ul>
 <li>This covers at the moment 1.2 and 1.3b2 to a recent 1.3 version.</li>
-<li><strong><span style="color: red;">Backup</span> your database before!!!</strong> 
+<li><strong><span style="color: red;">Backup</span> your database before!!!</strong>
     Theres no guaranty that it works in smoothly every situation and environment.</li>
-<li>Please read the <code>docs/migration.txt</code>. 
-    <a href="http://sourceforge.net/tracker/?group_id=75272&atid=543430">Bug-reports</a> 
+<li>Please read the <code>docs/migration.txt</code>.
+    <a href="http://sourceforge.net/tracker/?group_id=75272&amp;atid=543430">Bug-reports</a>
     and patches are welcome.</li>
 
 <li><em>This may take a while.</em></li>
@@ -18,5 +18,5 @@
 <form method="put" action="manage_migrate">
   <input type="submit" name="submit" value="start migration" />
 </form>
-    
+
 <tal:footer tal:replace="structure context/manage_page_footer|nothing">footer</tal:footer>

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/registry_xml.zpt
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/registry_xml.zpt	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/registry_xml.zpt	Tue Jan 11 14:41:39 2011
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 
-<tal:block omit-tag="" 
+<tal:block omit-tag=""
         xmlns:tal="http://xml.zope.org/namespaces/tal"
         xmlns:metal="http://xml.zope.org/namespaces/metal"
         metal:define-macro="body">
@@ -13,4 +13,4 @@
    <metal:block use-macro="context/types_template/macros/body" />
   </registry>
 
-</tal:block>
\ No newline at end of file
+</tal:block>

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/schema.zpt
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/schema.zpt	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/schema.zpt	Tue Jan 11 14:41:39 2011
@@ -13,8 +13,8 @@
                              required field/required|nothing;
                              default field/default|nothing;
                              vocabulary field/vocabulary|nothing;
-                             enforceVocabulary field/enforceVocabulary|nothing; 
-                             multiValued field/multiValued|nothing; 
+                             enforceVocabulary field/enforceVocabulary|nothing;
+                             multiValued field/multiValued|nothing;
                              searchable field/searchable|nothing;
                              isMetadata field/isMetadata|nothing;
                              accessor field/accessor|nothing;

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/updateSchemaForm.zpt
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/updateSchemaForm.zpt	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/updateSchemaForm.zpt	Tue Jan 11 14:41:39 2011
@@ -16,7 +16,7 @@
   <table border="0">
     <tr tal:repeat="klass python:context.getChangedSchema()">
       <td>
-        <input type="checkbox" 
+        <input type="checkbox"
                tal:attributes="name python:klass[0];
                                checked python:klass[1];" />
         <span tal:replace="python:klass[0]" />
@@ -24,7 +24,7 @@
     </tr>
   </table>
 
-  <p>Update 
+  <p>Update
   <select name="update_all:int">
     <option value="0">Objects with old schemas</option>
     <option value="1">All objects</option>
@@ -40,5 +40,5 @@
 
    <input type="submit" name="submit" value="Update schema"/>
 </form>
-    
+
 <tal:footer tal:replace="structure context/manage_page_footer|nothing">footer</tal:footer>

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/validators_xml.zpt
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/validators_xml.zpt	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/Products/Archetypes/www/validators_xml.zpt	Tue Jan 11 14:41:39 2011
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 
-<tal:block omit-tag="" 
+<tal:block omit-tag=""
         xmlns:tal="http://xml.zope.org/namespaces/tal"
         xmlns:metal="http://xml.zope.org/namespaces/metal"
         tal:define="validators options/validators"
@@ -13,7 +13,7 @@
                     tal:attributes="id validator/id">
       <title tal:content="validator/title">Well-formed URL</title>
       <description tal:content="validator/description">
-          Check to see if a string has a valid protocol 
+          Check to see if a string has a valid protocol
           and syntactically valid
           format for URLs
       </description>

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/README.txt
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/README.txt	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/README.txt	Tue Jan 11 14:41:39 2011
@@ -29,15 +29,13 @@
 Unit testing
 ------------
 
-* Install the `CMFTestCase`_ product.
-
-* Go into the root of your instance and run 
-  INSTANCE_HOME/bin/zopectl test --s Products.Archetypes
+* Go into the root of your buildout and run::
+ 
+  bin/test Products.Archetypes
 
 Documentation
 -------------
 
 Major resource for documentation is located at `plone.org`_.
 
-.. _CMFTestCase: http://plone.org/products/cmftestcase
 .. _plone.org: http://plone.org/products/archetypes/documentation

Modified: Products.Archetypes/branches/plip11017-tag-selector-rmattb/setup.py
==============================================================================
--- Products.Archetypes/branches/plip11017-tag-selector-rmattb/setup.py	(original)
+++ Products.Archetypes/branches/plip11017-tag-selector-rmattb/setup.py	Tue Jan 11 14:41:39 2011
@@ -1,6 +1,6 @@
 from setuptools import setup, find_packages
 
-version = '1.6.2'
+version = '1.7.1'
 
 setup(name='Products.Archetypes',
       version=version,
@@ -62,12 +62,13 @@
           'Products.statusmessages',
           'Products.validation',
           'plone.folder',
+          'plone.uuid',
           'plone.app.folder',
           'Acquisition',
           'DateTime',
           'ExtensionClass',
           'transaction',
           'ZODB3',
-          'Zope2',
+          'Zope2 >= 2.13.1',
       ],
       )

------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.