Changeset 1361

Show
Ignore:
Timestamp:
08/19/08 18:19:21 (3 months ago)
Author:
sgillies
Message:

Add resource interface and collection support

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • pleiades.workspace/trunk

    • Property svn:ignore set to
      *.pyc
  • pleiades.workspace/trunk/docs

    • Property svn:ignore set to
      *.pyc
  • pleiades.workspace/trunk/pleiades

    • Property svn:ignore set to
      *.pyc
  • pleiades.workspace/trunk/pleiades/workspace

    • Property svn:ignore set to
      *.pyc
  • pleiades.workspace/trunk/pleiades/workspace/__init__.py

    r1327 r1361  
    22""" 
    33 
    4 from zope.i18nmessageid import MessageFactory 
    5 from pleiades.workspace import config 
    6  
     4from pleiades.workspace import config, resource 
     5from Products.CMFPlone.CatalogTool import registerIndexableAttribute 
    76from Products.Archetypes import atapi 
    87from Products.CMFCore import utils 
    98 
    10 # Define a message factory for when this product is internationalised. 
    11 # This will be imported with the special name "_" in most modules. Strings 
    12 # like _(u"message") will then be extracted by i18n tools for translation. 
    13  
    14 WorkspaceMessageFactory = MessageFactory('pleiades.workspace') 
     9registerIndexableAttribute('pleiades_wsuids', resource.pleiades_wsuids_value) 
    1510 
    1611def initialize(context): 
  • pleiades.workspace/trunk/pleiades/workspace/browser

    • Property svn:ignore set to
      *.pyc
  • pleiades.workspace/trunk/pleiades/workspace/content

    • Property svn:ignore set to
      *.pyc
  • pleiades.workspace/trunk/pleiades/workspace/content/folder.py

    r1327 r1361  
    2828from pleiades.workspace.interfaces import IWorkspaceFolder 
    2929from pleiades.workspace.config import PROJECTNAME 
    30 from pleiades.workspace import WorkspaceMessageFactory as _ 
     30from pleiades.workspace.i18n import WorkspaceMessageFactory as _ 
    3131 
    3232from Products.PleiadesEntity.content.PlaceContainer import PlaceContainer 
  • pleiades.workspace/trunk/pleiades/workspace/content/workspace.py

    r1359 r1361  
    1717from pleiades.workspace.interfaces import IWorkspace 
    1818from pleiades.workspace.config import PROJECTNAME 
    19 from pleiades.workspace import WorkspaceMessageFactory as _ 
     19from pleiades.workspace.i18n import WorkspaceMessageFactory as _ 
    2020 
    2121from Products.PleiadesEntity.content.PlaceContainer import PlaceContainer 
     
    8585    def initTopic(self, oid, type): 
    8686        topic = self[oid] 
    87         c = topic.addCriterion('pleiades_wsuids', 'ATSelectionCriterion') 
     87        c = topic.addCriterion('pleiades_wsuids', 'ATSimpleStringCriterion') 
    8888        c.setValue(self.UID()) 
    8989        c = topic.addCriterion('Type', 'ATPortalTypeCriterion') 
  • pleiades.workspace/trunk/pleiades/workspace/interfaces.py

    r1355 r1361  
    11from zope.interface import Interface, Attribute 
    22from zope import schema 
    3  
    43from zope.app.container.constraints import contains 
    54 
    6 from pleiades.workspace import WorkspaceMessageFactory as _ 
     5from pleiades.workspace.i18n import WorkspaceMessageFactory as _ 
    76 
    87 
  • pleiades.workspace/trunk/pleiades/workspace/profiles

    • Property svn:ignore set to
      *.pyc
  • pleiades.workspace/trunk/pleiades/workspace/profiles/default

    • Property svn:ignore set to
      *.pyc
  • pleiades.workspace/trunk/pleiades/workspace/profiles/default/types

    • Property svn:ignore set to
      *.pyc
  • pleiades.workspace/trunk/pleiades/workspace/setuphandlers.py

    r1355 r1361  
    1 from zope.component.interfaces import ComponentLookupError 
    21from Products.CMFCore.utils import getToolByName 
    3 from Products.CMFPlone.CatalogTool import registerIndexableAttribute 
    4 from pleiades.workspace.interfaces import IResource 
    52 
    63def setupVarious(context): 
     
    96    portal = context.getSite() 
    107    addToCatalog(portal) 
    11  
    12 def pleiades_wsids_value(object, portal, **kwargs): 
    13     try: 
    14         resource = IResource(object) 
    15         return list(resource.wsuids) 
    16     except (ComponentLookupError, TypeError, ValueError, KeyError): 
    17         # The catalog expects AttributeErrors when a value can't be found 
    18         raise AttributeError 
    19  
    20 registerIndexableAttribute('pleiades_wsuids', pleiades_wsids_value) 
    218 
    229def addToCatalog(portal): 
  • pleiades.workspace/trunk/pleiades/workspace/tests

    • Property svn:ignore set to
      *.pyc