Back to index

plone3  3.1.7
OrderedContainer.py
Go to the documentation of this file.
00001 from Interface import Interface
00002 
00003 #Portions of this class was copy/pasted from the OFS.IOrderSupport from
00004 #Zope2.7.  This class is licensed under the ZPL 2.0 as stated here:
00005 #http://www.zope.org/Resources/ZPL
00006 #Zope Public License (ZPL) Version 2.0
00007 #This software is Copyright (c) Zope Corporation (tm) and Contributors. All rights reserved.
00008 
00009 class IOrderedContainer(Interface):
00010     """ Ordered Container interface.
00011 
00012     This interface provides a common mechanism for maintaining ordered
00013     collections.
00014     """
00015 
00016     def moveObjectsByDelta(ids, delta, subset_ids=None):
00017         """ Move specified sub-objects by delta.
00018 
00019         If delta is higher than the possible maximum, objects will be moved to
00020         the bottom. If delta is lower than the possible minimum, objects will
00021         be moved to the top.
00022 
00023         If subset_ids is not None, delta will be interpreted relative to the
00024         subset specified by a sequence of ids. The position of objects that
00025         are not part of this subset will not be changed.
00026 
00027         The order of the objects specified by ids will always be preserved. So
00028         if you don't want to change their original order, make sure the order
00029         of ids corresponds to their original order.
00030 
00031         If an object with id doesn't exist an error will be raised.
00032 
00033         Permission -- Manage properties
00034 
00035         Returns -- Number of moved sub-objects
00036         """
00037 
00038     def moveObjectsUp(ids, delta=1):
00039         """ Move specified sub-objects up by delta in container.
00040 
00041         If no delta is specified, delta is 1. See moveObjectsByDelta for more
00042         details.
00043 
00044         Permission -- Manage properties
00045 
00046         Returns -- Number of moved sub-objects
00047         """
00048 
00049     def moveObjectsDown(ids, delta=1):
00050         """ Move specified sub-objects down by delta in container.
00051 
00052         If no delta is specified, delta is 1. See moveObjectsByDelta for more
00053         details.
00054 
00055         Permission -- Manage properties
00056 
00057         Returns -- Number of moved sub-objects
00058         """
00059 
00060     def moveObjectsToTop(ids):
00061         """ Move specified sub-objects to top of container.
00062 
00063         See moveObjectsByDelta for more details.
00064 
00065         Permission -- Manage properties
00066 
00067         Returns -- Number of moved sub-objects
00068         """
00069 
00070     def moveObjectsToBottom(ids):
00071         """ Move specified sub-objects to bottom of container.
00072 
00073         See moveObjectsByDelta for more details.
00074 
00075         Permission -- Manage properties
00076 
00077         Returns -- Number of moved sub-objects
00078         """
00079 
00080     def orderObjects(key, reverse=None):
00081         """ Order sub-objects by key and direction.
00082 
00083         Permission -- Manage properties
00084 
00085         Returns -- Number of moved sub-objects
00086         """
00087 
00088     def getObjectPosition(id):
00089         """ Get the position of an object by its id.
00090 
00091         Permission -- Access contents information
00092 
00093         Returns -- Position
00094         """
00095 
00096     def moveObjectToPosition(id, position):
00097         """ Moves specified object to absolute position.
00098 
00099         Permission -- Manage properties
00100 
00101         Returns -- Number of moved sub-objects
00102         """