Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes | Static Private Attributes
CMFCore.ContentTypeRegistry.MajorMinorPredicate Class Reference
Inheritance diagram for CMFCore.ContentTypeRegistry.MajorMinorPredicate:
Inheritance graph
[legend]
Collaboration diagram for CMFCore.ContentTypeRegistry.MajorMinorPredicate:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def getMajorType
def getMinorType
def edit
def __call__
def getTypeLabel

Public Attributes

 id
 minor

Static Public Attributes

 major = minorNone
string PREDICATE_TYPE = 'major_minor'
tuple security = ClassSecurityInfo()
tuple predicateWidget = DTMLFile( 'majorMinorWidget', _dtmldir )

Static Private Attributes

 __implements__ = z2IContentTypeRegistryPredicate

Detailed Description

    Predicate matching on 'major/minor' content types.
    Empty major or minor implies wildcard (all match).

Definition at line 39 of file ContentTypeRegistry.py.


Constructor & Destructor Documentation

Definition at line 54 of file ContentTypeRegistry.py.

00054 
00055     def __init__( self, id ):
00056         self.id = id


Member Function Documentation

def CMFCore.ContentTypeRegistry.MajorMinorPredicate.__call__ (   self,
  name,
  typ,
  body 
)
    Return true if the rule matches, else false.

Definition at line 93 of file ContentTypeRegistry.py.

00093 
00094     def __call__( self, name, typ, body ):
00095         """
00096             Return true if the rule matches, else false.
00097         """
00098         if self.major is None:
00099             return 0
00100 
00101         if self.minor is None:
00102             return 0
00103 
00104         typ = typ or '/'
00105         if not '/' in typ:
00106             typ = typ + '/'
00107         major, minor = typ.split('/', 1)
00108 
00109         if self.major and not major in self.major:
00110             return 0
00111 
00112         if self.minor and not minor in self.minor:
00113             return 0
00114 
00115         return 1

Here is the caller graph for this function:

def CMFCore.ContentTypeRegistry.MajorMinorPredicate.edit (   self,
  major,
  minor,
  COMMA_SPLIT = re.compile( r'[, ]' 
)

Definition at line 74 of file ContentTypeRegistry.py.

00074 
00075     def edit( self, major, minor, COMMA_SPLIT=re.compile( r'[, ]' ) ):
00076 
00077         if major == 'None':
00078             major = None
00079         if type( major ) is type( '' ):
00080             major = filter( None, COMMA_SPLIT.split( major ) )
00081 
00082         if minor == 'None':
00083             minor = None
00084         if type( minor ) is type( '' ):
00085             minor = filter( None, COMMA_SPLIT.split( minor ) )
00086 
00087         self.major = major
00088         self.minor = minor

Here is the caller graph for this function:

Get major content types.

Definition at line 58 of file ContentTypeRegistry.py.

00058 
00059     def getMajorType(self):
00060         """ Get major content types.
00061         """
00062         if self.major is None:
00063             return 'None'
00064         return ' '.join(self.major)

Get minor content types.

Definition at line 66 of file ContentTypeRegistry.py.

00066 
00067     def getMinorType(self):
00068         """ Get minor content types.
00069         """
00070         if self.minor is None:
00071             return 'None'
00072         return ' '.join(self.minor)

    Return a human-readable label for the predicate type.

Definition at line 117 of file ContentTypeRegistry.py.

00117 
00118     def getTypeLabel( self ):
00119         """
00120             Return a human-readable label for the predicate type.
00121         """
00122         return self.PREDICATE_TYPE


Member Data Documentation

CMFCore.ContentTypeRegistry.MajorMinorPredicate.__implements__ = z2IContentTypeRegistryPredicate [static, private]

Definition at line 47 of file ContentTypeRegistry.py.

Definition at line 55 of file ContentTypeRegistry.py.

Definition at line 49 of file ContentTypeRegistry.py.

Definition at line 87 of file ContentTypeRegistry.py.

Definition at line 50 of file ContentTypeRegistry.py.

tuple CMFCore.ContentTypeRegistry.MajorMinorPredicate.predicateWidget = DTMLFile( 'majorMinorWidget', _dtmldir ) [static]

Definition at line 124 of file ContentTypeRegistry.py.

tuple CMFCore.ContentTypeRegistry.MajorMinorPredicate.security = ClassSecurityInfo() [static]

Definition at line 52 of file ContentTypeRegistry.py.


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