Back to index

plone3  3.1.7
interfaces.py
Go to the documentation of this file.
00001 #  ATContentTypes http://plone.org/products/atcontenttypes/
00002 #  Archetypes reimplementation of the CMF core types
00003 #  Copyright (c) 2003-2006 AT Content Types development team
00004 #
00005 #  This program is free software; you can redistribute it and/or modify
00006 #  it under the terms of the GNU General Public License as published by
00007 #  the Free Software Foundation; either version 2 of the License, or
00008 #  (at your option) any later version.
00009 #
00010 #  This program is distributed in the hope that it will be useful,
00011 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 #  GNU General Public License for more details.
00014 #
00015 #  You should have received a copy of the GNU General Public License
00016 #  along with this program; if not, write to the Free Software
00017 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 #
00019 """AT Content Types general Zope 2 interfaces
00020 
00021 All these interfaces are DEPRECATED.
00022 Please use Z3 interfaces defined in the interface folder
00023 
00024 
00025 """
00026 
00027 __author__  = 'Christian Heimes <tiran@cheimes.de>'
00028 __docformat__ = 'restructuredtext'
00029 
00030 from Interface import Interface
00031 
00032 
00033 from Interface import Attribute
00034 
00035 from Products.Archetypes.interfaces.base import IBaseContent
00036 from Products.CMFDynamicViewFTI.interfaces import ISelectableBrowserDefault
00037 
00038 from Products.Archetypes.OrderedBaseFolder import IOrderedContainer
00039 from Products.Archetypes.OrderedBaseFolder import IZopeOrderedContainer
00040 from Products.Archetypes.interfaces.athistoryaware import IATHistoryAware
00041 
00042 from Products.CMFPlone.interfaces.ConstrainTypes import \
00043     ISelectableConstrainTypes
00044 
00045 _marker = object()
00046 
00047 class IAutoSortSupport(Interface):
00048     """Interface for auto sorting
00049     """
00050 
00051     _default_sort_key = Attribute('Sort key, default: Title')
00052     _default_sort_reverse = Attribute('Reverse, default: False')
00053     _default_sort_folderish_first = Attribute('Sort folderish first, default: True')
00054     # auto sort flag is required to make tpValues happy
00055     _default_sort_auto = Attribute('Enable auto, default: True')
00056 
00057     def setDefaultSorting(key, reverse=_marker):
00058         """Set default sorting key and direction.
00059         """
00060 
00061     def getDefaultSorting():
00062         """Get default sorting key and direction.
00063 
00064         Return sort_on attribute, reverse
00065         sort_on attribute is either an attribute or method name
00066         """
00067 
00068     def setSortFolderishFirst(value):
00069         """Set the value for sorting folderish objects before ordinary items
00070         """
00071 
00072     def getSortFolderishFirst():
00073         """Get the value for sorting folderish objects before ordinary items
00074         """
00075 
00076     def setSortReverse(value):
00077         """Set reverse sort setting
00078         """
00079 
00080     def getSortReverse():
00081         """Get reverse sort setting
00082         """
00083 
00084     def setSortAuto(value):
00085        """Set auto sort setting
00086        """
00087 
00088     def getSortAuto():
00089         """Get auto sort setting
00090         """
00091 
00092 class IAutoOrderSupport(IAutoSortSupport, IOrderedContainer, IZopeOrderedContainer):
00093     """Interface for auto sorting and auto ordering
00094     """
00095 
00096     def autoOrderItems():
00097         """Auto order all containing items according to the settings
00098         """
00099 
00100     def moveObjectsByDelta(ids, delta, subset_ids=None, disable_auto_sort=True):
00101         """Move specified sub-objects by delta.
00102 
00103         Overwritten to disable auto sort
00104         """
00105 
00106     def manage_renameObject(id, new_id, REQUEST=None):
00107         """Rename a particular sub-object without changing its position.
00108 
00109         Overwritten to keep auto sort
00110         """
00111 
00112     def manage_afterAdd(item, container):
00113         """after add hook
00114 
00115         Overwritten to auto sort items
00116         """
00117 
00118 
00119 
00120 class IATContentType(ISelectableBrowserDefault, IBaseContent):
00121     """interface for AT Content Types
00122     """
00123 
00124     default_view = Attribute('''Default view template - used for dynamic view''')
00125     suppl_views = Attribute('''Supplementary views - used for dynamic view''')
00126 
00127     _atct_newTypeFor = Attribute('''XXX''')
00128 
00129     assocMimetypes = Attribute('''A tuple of mimetypes that are associated
00130                                   with this type. Format: ('bar/foo', 'foo/*',)
00131                                ''')
00132 
00133     assocFileExt = Attribute('''A tuple of file extensions that are associated
00134                                 with this type. Format: ('jpeg', 'png',)
00135                              ''')
00136 
00137     cmf_edit_kws = Attribute('''List of keyword names.
00138 
00139     If one of this kw names is used with edit() then the cmf_edit method is
00140     called.
00141     ''')
00142 
00143 class IHistoryAware(IATHistoryAware):
00144     """History awareness marker interface
00145     """
00146 
00147     def getHistorySource():
00148         """get source for HistoryAwareMixin
00149 
00150         Must return a (raw) string
00151         """
00152 
00153     def getLastEditor():
00154         """Returns the user name of the last editor.
00155 
00156         Returns None if no last editor is known.
00157         """
00158 
00159     def getDocumentComparisons(max=10, filterComment=0):
00160         """Get history as unified diff
00161         """
00162 
00163 class ICalendarSupport(Interface):
00164     """Calendar import/export
00165     """
00166 
00167 class IImageContent(Interface):
00168     """Interface for types containing an image
00169     """
00170 
00171     def getImage(**kwargs):
00172         """
00173         """
00174 
00175     def setImage(value, **kwargs):
00176         """
00177         """
00178 
00179     def tag(**kwargs):
00180         """
00181         """
00182 
00183 class IFileContent(Interface):
00184     """Interface for types containing a file
00185     """
00186 
00187     def getFile(**kwargs):
00188         """
00189         """
00190 
00191     def setFile(value, **kwargs):
00192         """
00193         """
00194 
00195 class ITextContent(Interface):
00196     """Interface for types containing text
00197     """
00198 
00199     def getText(**kwargs):
00200         """
00201         """
00202 
00203     def setText(value, **kwargs):
00204         """
00205         """
00206 
00207     def CookedBody(stx_level='ignored'):
00208         """
00209         """
00210 
00211     def EditableBody():
00212         """
00213         """
00214 
00215 # content types
00216 
00217 class IATDocument(ITextContent):
00218     """AT Document marker interface
00219     """
00220 
00221 class IATEvent(IATContentType):
00222     """AT Event marker interface
00223     """
00224 
00225 class IATLink(IATContentType):
00226     """AT Link marker interface
00227     """
00228 
00229 class IATFile(IFileContent):
00230     """AT File marker interface
00231     """
00232 
00233 class IATFolder(IATContentType):
00234     """AT Folder marker interface
00235     """
00236 
00237 class IATBTreeFolder(IATContentType):
00238     """AT BTree Folder marker interface
00239     """
00240 
00241 class IATImage(IImageContent):
00242     """AT Image marker Interface
00243     """
00244 
00245 class IATLink(IATContentType):
00246     """AT Link marker interface
00247     """
00248 
00249 # second class content types
00250 
00251 class IATNewsItem(IATDocument, IImageContent):
00252     """AT News Item marker interface
00253     """
00254 
00255 
00256 class IATFavorite(IATLink):
00257     """AT Favorite marker interface
00258     """
00259 
00260 # topic types
00261 
00262 class IATTopic(IATContentType):
00263     """AT Topic marker interface
00264     """
00265 
00266     def listCriteriaTypes():
00267         """List available criteria types as dict
00268         """
00269 
00270     def listCriteriaMetaTypes():
00271         """List available criteria
00272         """
00273 
00274     def listSearchCriteriaTypes():
00275         """List available search criteria types as dict
00276         """
00277 
00278     def listSearchCriteriaMetaTypes():
00279         """List available search criteria
00280         """
00281 
00282     def listSortCriteriaTypes():
00283         """List available sort criteria types as dict
00284         """
00285 
00286     def listSortCriteriaMetaTypes():
00287         """List available sort criteria
00288         """
00289 
00290     def listCriteria():
00291         """Return a list of our criteria objects.
00292         """
00293 
00294     def listSearchCriteria():
00295         """Return a list of our search criteria objects.
00296         """
00297 
00298     def hasSortCriterion():
00299         """Tells if a sort criterai is already setup.
00300         """
00301 
00302     def getSortCriterion():
00303         """Return the Sort criterion if setup.
00304         """
00305 
00306     def removeSortCriterion():
00307         """remove the Sort criterion.
00308         """
00309 
00310     def setSortCriterion(field, reversed):
00311         """Set the Sort criterion.
00312         """
00313 
00314     def listAvailableFields():
00315         """Return a list of available fields for new criteria.
00316         """
00317 
00318     def listSortFields():
00319         """Return a list of available fields for sorting."""
00320 
00321     def listSubtopics():
00322         """Return a list of our subtopics.
00323         """
00324 
00325     def buildQuery():
00326         """Construct a catalog query using our criterion objects.
00327         """
00328 
00329     def queryCatalog(REQUEST=None, **kw):
00330         """Invoke the catalog using our criteria to augment any passed
00331             in query before calling the catalog.
00332         """
00333 
00334     def addCriterion(field, criterion_type):
00335         """Add a new search criterion.
00336         """
00337 
00338     def deleteCriterion(criterion_id):
00339         """Delete selected criterion.
00340         """
00341 
00342     def getCriterion(criterion_id):
00343         """Get the criterion object.
00344         """
00345 
00346     def addSubtopic(id):
00347         """Add a new subtopic.
00348         """
00349 
00350 
00351 class IATTopicCriterion(Interface):
00352     """AT Topic Criterion interface
00353     """
00354 
00355     def widget(field_name, mode="view", field=None, **kwargs):
00356         """redefine widget() to allow seperate field_names from field
00357         """
00358 
00359     def getId():
00360         """get the objects id
00361         """
00362 
00363     def Type():
00364         """
00365         """
00366 
00367     def Description():
00368         """
00369         """
00370 
00371     def getCriteriaItems():
00372         """Return a sequence of items to be used to build the catalog query.
00373         """
00374 
00375 class IATTopicSearchCriterion(IATTopicCriterion):
00376     """Interface for criteria used for searching
00377     """
00378 
00379 class IATTopicSortCriterion(IATTopicCriterion):
00380     """Interface for criteria used for sorting
00381     """
00382 
00383 class IATCTTool(Interface):
00384     """
00385     """
00386 
00387 class IATCTTopicsTool(Interface):
00388     """Mixin class for providing features to customize the display of topics
00389     """