Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Private Attributes | Static Private Attributes
ATContentTypes.lib.autosort.AutoOrderSupport Class Reference
Inheritance diagram for ATContentTypes.lib.autosort.AutoOrderSupport:
Inheritance graph
[legend]
Collaboration diagram for ATContentTypes.lib.autosort.AutoOrderSupport:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def autoOrderItems
def moveObject
def moveObjectsByDelta
def manage_renameObject
def manage_afterAdd
def setDefaultSorting
def getDefaultSorting
def setSortFolderishFirst
def getSortFolderishFirst
def setSortReverse
def getSortReverse
def setSortAuto
def getSortAuto

Static Public Attributes

tuple security = ClassSecurityInfo()

Private Attributes

 _objects

Static Private Attributes

tuple __implements__ = (IAutoOrderSupport, )

Detailed Description

Definition at line 101 of file autosort.py.


Member Function Documentation

Auto order all containing items according to the settings

Definition at line 108 of file autosort.py.

00108 
00109     def autoOrderItems(self):
00110         """Auto order all containing items according to the settings
00111         """
00112         if not self.getSortAuto():
00113             return
00114         key, reverse = self.getDefaultSorting()
00115         folderish_first = self.getSortFolderishFirst()
00116 
00117         self.orderObjects(key, reverse)
00118         # TODO: folderish first is missing, use the catalog to resort it!

Here is the call graph for this function:

Get default sorting key and direction.

Definition at line 57 of file autosort.py.

00057 
00058     def getDefaultSorting(self):
00059         """Get default sorting key and direction.
00060         """
00061         return self._default_sort_key, self._default_sort_reverse

Here is the caller graph for this function:

Get auto sort setting

Definition at line 93 of file autosort.py.

00093 
00094     def getSortAuto(self):
00095         """Get auto sort setting
00096         """
00097         return self._default_sort_auto
00098 
00099 InitializeClass(AutoSortSupport)
00100 

Here is the caller graph for this function:

Get the value for sorting folderish objects before ordinary items

Definition at line 69 of file autosort.py.

00069 
00070     def getSortFolderishFirst(self):
00071         """Get the value for sorting folderish objects before ordinary items
00072         """
00073         return self._default_sort_folderish_first

Here is the caller graph for this function:

Get reverse sort setting

Definition at line 81 of file autosort.py.

00081 
00082     def getSortReverse(self):
00083         """Get reverse sort setting
00084         """
00085         return self._default_sort_reverse

def ATContentTypes.lib.autosort.AutoOrderSupport.manage_afterAdd (   self,
  item,
  container 
)
after add hook

Overwritten to auto sort items
CAUTION: Make sure that you call this method explictly!

Definition at line 155 of file autosort.py.

00155 
00156     def manage_afterAdd(self, item, container):
00157         """after add hook
00158 
00159         Overwritten to auto sort items
00160         CAUTION: Make sure that you call this method explictly!
00161         """
00162         # XXX: disabled
00163         # we need a proper event system to make it work
00164         #if item.aq_inner.aq_parent == self:
00165         #    self.autoOrderItems()
00166 
00167 InitializeClass(AutoOrderSupport)
def ATContentTypes.lib.autosort.AutoOrderSupport.manage_renameObject (   self,
  id,
  new_id,
  REQUEST = None 
)
Rename a particular sub-object without changing its position.

Overwritten to keep auto sort

Definition at line 140 of file autosort.py.

00140 
00141     def manage_renameObject(self, id, new_id, REQUEST=None):
00142         """Rename a particular sub-object without changing its position.
00143 
00144         Overwritten to keep auto sort
00145         """
00146         old_position = self.getObjectPosition(id)
00147         old_sort_auto = self.getSortAuto()
00148         result = OrderedBaseFolder.manage_renameObject(self, id, new_id, REQUEST)
00149         self.moveObjectToPosition(new_id, old_position)
00150         putils = getToolByName(self, 'plone_utils')
00151         putils.reindexOnReorder(self)
00152         self.setSortAuto(old_sort_auto)
00153         return result

Here is the call graph for this function:

Here is the caller graph for this function:

def ATContentTypes.lib.autosort.AutoOrderSupport.moveObject (   self,
  id,
  position 
)

Definition at line 120 of file autosort.py.

00120 
00121     def moveObject(self, id, position):
00122         obj_idx  = self.getObjectPosition(id)
00123         if obj_idx == position:
00124             return None
00125         elif position < 0:
00126             position = 0
00127 
00128         metadata = list(self._objects)
00129         obj_meta = metadata.pop(obj_idx)
00130         metadata.insert(position, obj_meta)
00131         self._objects = tuple(metadata)

Here is the call graph for this function:

Here is the caller graph for this function:

def ATContentTypes.lib.autosort.AutoOrderSupport.moveObjectsByDelta (   self,
  ids,
  delta,
  subset_ids = None,
  disable_auto_sort = True 
)
Move specified sub-objects by delta.

Overwritten to disable auto sort

Definition at line 132 of file autosort.py.

00132 
00133     def moveObjectsByDelta(self, ids, delta, subset_ids=None, disable_auto_sort=True):
00134         """Move specified sub-objects by delta.
00135 
00136         Overwritten to disable auto sort
00137         """
00138         OrderedContainer.moveObjectsByDelta(self, ids, delta, subset_ids=subset_ids)
00139         self.setSortAuto(disable_auto_sort)

Here is the call graph for this function:

Here is the caller graph for this function:

def ATContentTypes.lib.autosort.AutoSortSupport.setDefaultSorting (   self,
  key,
  reverse = _marker 
) [inherited]
Set default sorting key and direction.

Definition at line 49 of file autosort.py.

00049 
00050     def setDefaultSorting(self, key, reverse=_marker):
00051         """Set default sorting key and direction.
00052         """
00053         self._default_sort_key = key
00054         if reverse is not _marker:
00055             self._default_sort_reverse = bool(reverse)

def ATContentTypes.lib.autosort.AutoSortSupport.setSortAuto (   self,
  value 
) [inherited]
Set auto sort setting

Definition at line 87 of file autosort.py.

00087 
00088     def setSortAuto(self, value):
00089        """Set auto sort setting
00090        """
00091        self._default_sort_auto = bool(value)

Here is the caller graph for this function:

Set the value for sorting folderish objects before ordinary items

Definition at line 63 of file autosort.py.

00063 
00064     def setSortFolderishFirst(self, value):
00065         """Set the value for sorting folderish objects before ordinary items
00066         """
00067         self._default_sort_folderish_first = bool(value)

def ATContentTypes.lib.autosort.AutoSortSupport.setSortReverse (   self,
  value 
) [inherited]
Set reverse sort setting

Definition at line 75 of file autosort.py.

00075 
00076     def setSortReverse(self, value):
00077         """Set reverse sort setting
00078         """
00079         self._default_sort_reverse = bool(value)


Member Data Documentation

tuple ATContentTypes.lib.autosort.AutoOrderSupport.__implements__ = (IAutoOrderSupport, ) [static, private]

Reimplemented from ATContentTypes.lib.autosort.AutoSortSupport.

Definition at line 103 of file autosort.py.

Definition at line 130 of file autosort.py.

tuple ATContentTypes.lib.autosort.AutoOrderSupport.security = ClassSecurityInfo() [static]

Reimplemented from ATContentTypes.lib.autosort.AutoSortSupport.

Definition at line 105 of file autosort.py.


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