Back to index

plone3  3.1.7
Public Member Functions | Private Member Functions | Static Private Attributes
CMFDefault.browser.folder.BatchViewBase Class Reference
Inheritance diagram for CMFDefault.browser.folder.BatchViewBase:
Inheritance graph
[legend]
Collaboration diagram for CMFDefault.browser.folder.BatchViewBase:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def listItemInfos
def navigation_previous
def navigation_next
def summary_length
def summary_type
def summary_match

Private Member Functions

def _getBatchStart
def _getBatchObj
def _getHiddenVars
def _getNavigationVars
def _getNavigationURL

Static Private Attributes

int _BATCH_SIZE = 25

Detailed Description

Definition at line 126 of file folder.py.


Member Function Documentation

Definition at line 137 of file folder.py.

00137 
00138     def _getBatchObj(self):
00139         b_start = self._getBatchStart()
00140         items = self._getItems()
00141         return Batch(items, self._BATCH_SIZE, b_start, orphan=0)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 133 of file folder.py.

00133 
00134     def _getBatchStart(self):
00135         return self.request.form.get('b_start', 0)

Here is the caller graph for this function:

Reimplemented in CMFDefault.browser.folder.FolderContentsView.

Definition at line 143 of file folder.py.

00143 
00144     def _getHiddenVars(self):
00145         return {}

Here is the caller graph for this function:

def CMFDefault.browser.folder.BatchViewBase._getNavigationURL (   self,
  b_start 
) [private]

Definition at line 151 of file folder.py.

00151 
00152     def _getNavigationURL(self, b_start):
00153         target = self._getViewURL()
00154         kw = self._getNavigationVars().copy()
00155 
00156         kw['b_start'] = b_start
00157         for k, v in kw.items():
00158             if not v or k == 'portal_status_message':
00159                 del kw[k]
00160 
00161         query = kw and ('?%s' % make_query(kw)) or ''
00162         return u'%s%s' % (target, query)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 147 of file folder.py.

00147 
00148     def _getNavigationVars(self):
00149         return self._getHiddenVars()

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented in CMFDefault.browser.folder.FolderContentsView.

Definition at line 167 of file folder.py.

00167 
00168     def listItemInfos(self):
00169         batch_obj = self._getBatchObj()
00170         portal_url = self._getPortalURL()
00171 
00172         items = []
00173         for item in batch_obj:
00174             item_description = item.Description()
00175             item_icon = item.getIcon(1)
00176             item_title = item.Title()
00177             item_type = remote_type = item.Type()
00178             if item_type == 'Favorite' and not item_icon == 'p_/broken':
00179                 item = item.getObject()
00180                 item_description = item_description or item.Description()
00181                 item_title = item_title or item.Title()
00182                 remote_type = item.Type()
00183             is_file = remote_type in ('File', 'Image')
00184             is_link = remote_type == 'Link'
00185             items.append({'description': item_description,
00186                           'format': is_file and item.Format() or '',
00187                           'icon': item_icon and ('%s/%s' %
00188                                                (portal_url, item_icon)) or '',
00189                           'size': is_file and ('%0.0f kb' %
00190                                             (item.get_size() / 1024.0)) or '',
00191                           'title': item_title,
00192                           'type': item_type,
00193                           'url': is_link and item.getRemoteUrl() or
00194                                  item.absolute_url()})
00195         return tuple(items)

Here is the call graph for this function:

Definition at line 211 of file folder.py.

00211 
00212     def navigation_next(self):
00213         batch_obj = self._getBatchObj().next
00214         if batch_obj is None:
00215             return None
00216 
00217         length = len(batch_obj)
00218         url = self._getNavigationURL(batch_obj.first)
00219         if length == 1:
00220             title = _(u'Next item')
00221         else:
00222             title = _(u'Next ${count} items', mapping={'count': length})
00223         return {'title': title, 'url': url}

Here is the call graph for this function:

Definition at line 197 of file folder.py.

00197 
00198     def navigation_previous(self):
00199         batch_obj = self._getBatchObj().previous
00200         if batch_obj is None:
00201             return None
00202 
00203         length = len(batch_obj)
00204         url = self._getNavigationURL(batch_obj.first)
00205         if length == 1:
00206             title = _(u'Previous item')
00207         else:
00208             title = _(u'Previous ${count} items', mapping={'count': length})
00209         return {'title': title, 'url': url}

Here is the call graph for this function:

Definition at line 225 of file folder.py.

00225 
00226     def summary_length(self):
00227         length = self._getBatchObj().sequence_length
00228         return length and thousands_commas(length) or ''

Here is the call graph for this function:

Definition at line 236 of file folder.py.

00236 
00237     def summary_match(self):
00238         return self.request.form.get('SearchableText')
00239 

Definition at line 230 of file folder.py.

00230 
00231     def summary_type(self):
00232         length = self._getBatchObj().sequence_length
00233         return (length == 1) and _(u'item') or _(u'items')

Here is the call graph for this function:


Member Data Documentation

Definition at line 130 of file folder.py.


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