Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Static Private Attributes
ATContentTypes.tool.atct.ATCTTool Class Reference
Inheritance diagram for ATContentTypes.tool.atct.ATCTTool:
Inheritance graph
[legend]
Collaboration diagram for ATContentTypes.tool.atct.ATCTTool:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def om_icons
def recreateImageScales
def listContentTypes

Static Public Attributes

tuple security = ClassSecurityInfo()
 id = TOOLNAME
string meta_type = 'ATCT Tool'
string title = 'ATContentTypes Tool'
tuple manage_options
tuple manage_imageScales = PageTemplateFile('imageScales', WWW_DIR)
tuple manage_overview = PageTemplateFile('overview', WWW_DIR)

Static Private Attributes

tuple __implements__
tuple _properties

Detailed Description

ATContentTypes tool

Definition at line 53 of file atct.py.


Member Function Documentation

List all content types. Used for image/folder_types property.

Definition at line 138 of file atct.py.

00138 
00139     def listContentTypes(self):
00140         """List all content types. Used for image/folder_types property.
00141         """
00142         ttool = getToolByName(self, 'portal_types')
00143         return ttool.listContentTypes()
00144 
00145 InitializeClass(ATCTTool)
00146 registerToolInterface('portal_atct', IATCTTool)

Here is the call graph for this function:

Definition at line 93 of file atct.py.

00093 
00094     def om_icons(self):
00095         icons = ({'path':'misc_/ATContentTypes/tool.gif',
00096                   'alt':self.meta_type,
00097                   'title':self.meta_type},)
00098         return icons

def ATContentTypes.tool.atct.ATCTTool.recreateImageScales (   self,
  portal_type = None 
)
Recreates AT Image scales (doesn't remove unused!)

Definition at line 102 of file atct.py.

00102 
00103     def recreateImageScales(self, portal_type=None):
00104         """Recreates AT Image scales (doesn't remove unused!)
00105         """
00106         if portal_type is None:
00107             portal_type = tuple(self.image_types)
00108         out = StringIO()
00109         print >> out, "Updating AT Image scales"
00110         catalog = getToolByName(self, 'portal_catalog')
00111         brains = catalog(portal_type = portal_type,
00112                          portal_type_operator = 'or')
00113         for brain in brains:
00114             obj = brain.getObject()
00115             if obj is None:
00116                 continue
00117             if not IImageContent.isImplementedBy(obj):
00118                 continue
00119             try:
00120                 state = obj._p_changed
00121             except (ConflictError, KeyboardInterrupt):
00122                 raise
00123             except:
00124                 state = 0
00125 
00126             field = obj.getField('image')
00127             if field is not None:
00128                 print >> out, 'Updating %s' % obj.absolute_url(1)
00129                 field.removeScales(obj)
00130                 field.createScales(obj)
00131 
00132             if state is None:
00133                 obj._p_deactivate()
00134 
00135         print >> out, "Updated AT Image scales"
00136         return out.getvalue()

Here is the call graph for this function:


Member Data Documentation

Initial value:
(SimpleItem.__implements__, z2IATCTTool,
                      ATTopicsTool.__implements__)

Definition at line 62 of file atct.py.

Initial value:
PropertyManager._properties+(
        {'id' : 'image_types', 'type' : 'multiple selection',
         'mode' : 'w', 'select_variable' : 'listContentTypes'},
        {'id' : 'folder_types', 'type' : 'multiple selection',
         'mode' : 'w', 'select_variable' : 'listContentTypes'},
        {'id' : 'album_batch_size', 'type' : 'int', 'mode' : 'w'},
        {'id' : 'album_image_scale', 'type' : 'string', 'mode' : 'w'},
        {'id' : 'single_image_scale', 'type' : 'string', 'mode' : 'w'},
        )

Definition at line 75 of file atct.py.

Definition at line 58 of file atct.py.

tuple ATContentTypes.tool.atct.ATCTTool.manage_imageScales = PageTemplateFile('imageScales', WWW_DIR) [static]

Definition at line 88 of file atct.py.

Initial value:
(
            {'label' : 'Overview', 'action' : 'manage_overview'},
            {'label' : 'Image scales', 'action' : 'manage_imageScales'}
        )

Definition at line 67 of file atct.py.

tuple ATContentTypes.tool.atct.ATCTTool.manage_overview = PageTemplateFile('overview', WWW_DIR) [static]

Definition at line 91 of file atct.py.

string ATContentTypes.tool.atct.ATCTTool.meta_type = 'ATCT Tool' [static]

Definition at line 59 of file atct.py.

tuple ATContentTypes.tool.atct.ATCTTool.security = ClassSecurityInfo() [static]

Definition at line 56 of file atct.py.

string ATContentTypes.tool.atct.ATCTTool.title = 'ATContentTypes Tool' [static]

Definition at line 60 of file atct.py.


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