Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Private Attributes | Static Private Attributes
ATContentTypes.content.base.ATCTMixin Class Reference
Inheritance diagram for ATContentTypes.content.base.ATCTMixin:
Inheritance graph
[legend]
Collaboration diagram for ATContentTypes.content.base.ATCTMixin:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def initializeArchetype
def copyLayoutFromParent
def edit
def cmf_edit
def exclude_from_nav
def get_size

Static Public Attributes

 schema = ATContentTypeSchema
string archetype_name = 'AT Content Type'
tuple assocMimetypes = ()
tuple assocFileExt = ()
tuple cmf_edit_kws = ()
 isDocTemp = False
tuple security = ClassSecurityInfo()

Private Attributes

 _signature

Static Private Attributes

dictionary _atct_newTypeFor = {'portal_type' : None, 'meta_type' : None}
 _at_rename_after_creation = True
tuple __implements__ = (IATContentType, BrowserDefaultMixin.__implements__)

Detailed Description

Mixin class for AT Content Types

Definition at line 104 of file base.py.


Member Function Documentation

def ATContentTypes.content.base.ATCTMixin.cmf_edit (   self,
  args,
  kwargs 
)
Overwrite this method to make AT compatible with the crappy
CMF edit()

Definition at line 182 of file base.py.

00182 
00183     def cmf_edit(self, *args, **kwargs):
00184         """Overwrite this method to make AT compatible with the crappy
00185         CMF edit()
00186         """
00187         raise NotImplementedError("cmf_edit method isn't implemented")

Here is the caller graph for this function:

Copies the layout from the parent object if it's of the same type.

Definition at line 149 of file base.py.

00149 
00150     def copyLayoutFromParent(self):
00151         """Copies the layout from the parent object if it's of the same type."""
00152         parent = aq_parent(aq_inner(self))
00153         if parent is not None:
00154             # Only set the layout if we are the same type as out parent object
00155             if parent.meta_type == self.meta_type:
00156                 # If the parent is the same type as us it should implement
00157                 # BrowserDefaultMixin
00158                 parent_layout = parent.getLayout()
00159                 # Just in case we should make sure that the layout is
00160                 # available to the new object
00161                 if parent_layout in [l[0] for l in self.getAvailableLayouts()]:
00162                     self.setLayout(parent_layout)

Here is the call graph for this function:

def ATContentTypes.content.base.ATCTMixin.edit (   self,
  args,
  kwargs 
)
Reimplementing edit() to have a compatibility method for the old
cmf edit() method

Definition at line 164 of file base.py.

00164 
00165     def edit(self, *args, **kwargs):
00166         """Reimplementing edit() to have a compatibility method for the old
00167         cmf edit() method
00168         """
00169         if len(args) != 0:
00170             # use cmf edit method
00171             return self.cmf_edit(*args, **kwargs)
00172 
00173         # if kwargs is containing a key that is also in the list of cmf edit
00174         # keywords then we have to use the cmf_edit comp. method
00175         cmf_edit_kws = getattr(aq_inner(self).aq_explicit, 'cmf_edit_kws', ())
00176         for kwname in kwargs.keys():
00177             if kwname in cmf_edit_kws:
00178                 return self.cmf_edit(**kwargs)
00179         # standard AT edit - redirect to update()
00180         return self.update(**kwargs)

Here is the caller graph for this function:

Accessor for excludeFromNav field

Definition at line 188 of file base.py.

00188 
00189     def exclude_from_nav(self):
00190         """Accessor for excludeFromNav field
00191         """
00192         field = self.getField('excludeFromNav')
00193         if field is not None:
00194             return field.get(self)
00195         else:
00196             return False

Here is the call graph for this function:

ZMI / Plone get size method

Reimplemented in ATContentTypes.content.base.ATCTFolderMixin, and ATContentTypes.content.base.ATCTFolder.

Definition at line 198 of file base.py.

00198 
00199     def get_size(self):
00200         """ZMI / Plone get size method
00201         """
00202         f = self.getPrimaryField()
00203         if f is None:
00204             return 0
00205         return f.get_size(self) or 0
00206 
00207 InitializeClass(ATCTMixin)

Here is the call graph for this function:

Here is the caller graph for this function:

called by the generated add* factory in types tool

Overwritten to call edit() instead of update() to have the cmf
compatibility method.

Definition at line 125 of file base.py.

00125 
00126     def initializeArchetype(self, **kwargs):
00127         """called by the generated add* factory in types tool
00128 
00129         Overwritten to call edit() instead of update() to have the cmf
00130         compatibility method.
00131         """
00132         try:
00133             self.initializeLayers()
00134             self.markCreationFlag()
00135             self.setDefaults()
00136             if kwargs:
00137                 self.edit(**kwargs)
00138             self._signature = self.Schema().signature()
00139             if self.isPrincipiaFolderish:
00140                 self.copyLayoutFromParent()
00141         except ConflictError:
00142             raise
00143         except Exception, msg:
00144             LOG.warn('Exception in initializeArchetype', exc_info=True)
00145             if DEBUG and str(msg) not in ('SESSION',):
00146                 # debug code
00147                 raise

Here is the call graph for this function:


Member Data Documentation

tuple ATContentTypes.content.base.ATCTMixin.__implements__ = (IATContentType, BrowserDefaultMixin.__implements__) [static, private]

Definition at line 117 of file base.py.

dictionary ATContentTypes.content.base.ATCTMixin._atct_newTypeFor = {'portal_type' : None, 'meta_type' : None} [static, private]

Definition at line 110 of file base.py.

Definition at line 137 of file base.py.

string ATContentTypes.content.base.ATCTMixin.archetype_name = 'AT Content Type' [static]

Definition at line 109 of file base.py.

Definition at line 112 of file base.py.

Definition at line 111 of file base.py.

Definition at line 113 of file base.py.

Definition at line 116 of file base.py.

ATContentTypes.content.base.ATCTMixin.schema = ATContentTypeSchema [static]

Definition at line 107 of file base.py.

tuple ATContentTypes.content.base.ATCTMixin.security = ClassSecurityInfo() [static]

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