Back to index

plone3  3.1.7
_orderedfolder.py
Go to the documentation of this file.
00001 from zope.interface import Interface
00002 
00003 class IOrderedFolder(Interface):
00004     """ DEPRECATED, will be removed in next releaese """
00005 
00006     def get_object_position( id ):
00007         """Return the position of the object.
00008         """
00009 
00010     def move_object_to_position( id, newpos ):
00011         """Move object to position.
00012         """
00013 
00014     def move_object_up( id ):
00015         """Move object up.
00016         """
00017 
00018     def move_object_down( id ):
00019         """Move object down.
00020         """
00021 
00022     def move_object_to_top( id ):
00023         """Move object to top.
00024         """
00025 
00026     def move_object_to_bottom( id ):
00027         """Move object to bottom.
00028         """
00029 
00030 
00031 
00032 # this interface is needed while Archetypes isnt dependend on Zope 2.7
00033 # if it depends on it should be replaced by importing
00034 # http://cvs.zope.org/Packages/OFS/IOrderSupport.py
00035 # instead of this class.
00036 class IOrderedContainer(Interface):
00037     """ Ordered Container interface.
00038 
00039     This interface provides a common mechanism for maintaining ordered
00040     collections.
00041     """
00042 
00043     def moveObjectsByDelta(ids, delta, subset_ids=None):
00044         """ Move specified sub-objects by delta.
00045 
00046         If delta is higher than the possible maximum, objects will be moved to
00047         the bottom. If delta is lower than the possible minimum, objects will
00048         be moved to the top.
00049 
00050         If subset_ids is not None, delta will be interpreted relative to the
00051         subset specified by a sequence of ids. The position of objects that
00052         are not part of this subset will not be changed.
00053 
00054         The order of the objects specified by ids will always be preserved. So
00055         if you don't want to change their original order, make sure the order
00056         of ids corresponds to their original order.
00057 
00058         If an object with id doesn't exist an error will be raised.
00059 
00060         Permission -- Manage properties
00061 
00062         Returns -- Number of moved sub-objects
00063         """
00064 
00065     def moveObjectsUp(ids, delta=1):
00066         """ Move specified sub-objects up by delta in container.
00067 
00068         If no delta is specified, delta is 1. See moveObjectsByDelta for more
00069         details.
00070 
00071         Permission -- Manage properties
00072 
00073         Returns -- Number of moved sub-objects
00074         """
00075 
00076     def moveObjectsDown(ids, delta=1):
00077         """ Move specified sub-objects down by delta in container.
00078 
00079         If no delta is specified, delta is 1. See moveObjectsByDelta for more
00080         details.
00081 
00082         Permission -- Manage properties
00083 
00084         Returns -- Number of moved sub-objects
00085         """
00086 
00087     def moveObjectsToTop(ids):
00088         """ Move specified sub-objects to top of container.
00089 
00090         See moveObjectsByDelta for more details.
00091 
00092         Permission -- Manage properties
00093 
00094         Returns -- Number of moved sub-objects
00095         """
00096 
00097     def moveObjectsToBottom(ids):
00098         """ Move specified sub-objects to bottom of container.
00099 
00100         See moveObjectsByDelta for more details.
00101 
00102         Permission -- Manage properties
00103 
00104         Returns -- Number of moved sub-objects
00105         """
00106 
00107     def orderObjects(key, reverse=None):
00108         """ Order sub-objects by key and direction.
00109 
00110         Permission -- Manage properties
00111 
00112         Returns -- Number of moved sub-objects
00113         """
00114 
00115     def getObjectPosition(id):
00116         """ Get the position of an object by its id.
00117 
00118         Permission -- Access contents information
00119 
00120         Returns -- Position
00121         """