Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
ATContentTypes.criteria._CriterionRegistry Class Reference
Inheritance diagram for ATContentTypes.criteria._CriterionRegistry:
Inheritance graph
[legend]
Collaboration diagram for ATContentTypes.criteria._CriterionRegistry:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def register
def unregister
def listTypes
def listSortTypes
def listSearchTypes
def listCriteria
def indicesByCriterion
def criteriaByIndex
def getPortalTypes

Public Attributes

 index2criterion
 criterion2index
 portaltypes

Detailed Description

Registry for criteria 

Definition at line 62 of file __init__.py.


Constructor & Destructor Documentation

def ATContentTypes.criteria._CriterionRegistry.__init__ (   self,
  args,
  kwargs 
)

Definition at line 65 of file __init__.py.

00065 
00066     def __init__(self, *args, **kwargs):
00067         UserDict.__init__(self, *args, **kwargs)
00068         self.index2criterion = {}
00069         self.criterion2index = {}
00070         self.portaltypes = {}


Member Function Documentation

Definition at line 119 of file __init__.py.

00119 
00120     def criteriaByIndex(self, index):
00121         try:
00122             return self.index2criterion[index]
00123         except KeyError:
00124             return ()
    

Definition at line 125 of file __init__.py.

00125 
00126     def getPortalTypes(self):
00127         return tuple(self.portaltypes.keys())

Definition at line 116 of file __init__.py.

00116 
00117     def indicesByCriterion(self, criterion):
00118         return self.criterion2index[criterion]

Definition at line 113 of file __init__.py.

00113 
00114     def listCriteria(self):
00115         return self.values()

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 109 of file __init__.py.

00109 
00110     def listSearchTypes(self):
00111         return [key for key in self.keys()
00112                     if IATTopicSearchCriterion.isImplementedByInstancesOf(self[key])]

Here is the call graph for this function:

Definition at line 105 of file __init__.py.

00105 
00106     def listSortTypes(self):
00107         return [key for key in self.keys()
00108                     if IATTopicSortCriterion.isImplementedByInstancesOf(self[key])]

Here is the call graph for this function:

Definition at line 102 of file __init__.py.

00102 
00103     def listTypes(self):
00104         return self.keys()

Here is the call graph for this function:

def ATContentTypes.criteria._CriterionRegistry.register (   self,
  criterion,
  indices 
)

Definition at line 71 of file __init__.py.

00071 
00072     def register(self, criterion, indices):
00073         if type(indices) is StringType:
00074             indices = (indices,)
00075         indices = tuple(indices)
00076 
00077         if indices == ():
00078             indices = ALL_INDICES
00079 
00080         assert IATTopicCriterion.isImplementedByInstancesOf(criterion)
00081         registerType(criterion, PROJECTNAME)
00082 
00083         crit_id = criterion.meta_type
00084         self[crit_id] = criterion
00085         self.portaltypes[criterion.portal_type] = criterion
00086 
00087         self.criterion2index[crit_id] = indices
00088         for index in indices:
00089             value = self.index2criterion.get(index, ())
00090             self.index2criterion[index] = value + (crit_id,)
00091 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 92 of file __init__.py.

00092 
00093     def unregister(self, criterion):
00094         crit_id = criterion.meta_type
00095         self.pop(crit_id)
00096         self.criterion2index.pop(crit_id)
00097         for (index, value) in self.index2criterion.items():
00098             if id in value:
00099                 valuelist = list(value)
00100                 del valuelist[valuelist.index(crit_id)]
00101                 self.index2criterion[index] = tuple(valuelist)

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 68 of file __init__.py.

Definition at line 67 of file __init__.py.

Definition at line 69 of file __init__.py.


The documentation for this class was generated from the following file: