Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
42a193e4
Commit
42a193e4
authored
Dec 11, 2003
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added api help for OrderSupport and OrderedFolder
parent
c3eddb05
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
142 additions
and
5 deletions
+142
-5
lib/python/OFS/IOrderSupport.py
lib/python/OFS/IOrderSupport.py
+2
-2
lib/python/OFS/OrderSupport.py
lib/python/OFS/OrderSupport.py
+3
-3
lib/python/Products/OFSP/help/OrderSupport.py
lib/python/Products/OFSP/help/OrderSupport.py
+106
-0
lib/python/Products/OFSP/help/OrderedFolder.py
lib/python/Products/OFSP/help/OrderedFolder.py
+31
-0
No files found.
lib/python/OFS/IOrderSupport.py
View file @
42a193e4
...
...
@@ -12,7 +12,7 @@
##############################################################################
""" Order support interfaces.
$Id: IOrderSupport.py,v 1.
2 2003/06/12 10:20:59
yuppie Exp $
$Id: IOrderSupport.py,v 1.
3 2003/12/11 17:39:18
yuppie Exp $
"""
from
Interface
import
Interface
...
...
@@ -102,7 +102,7 @@ class IOrderedContainer(Interface):
"""
def
moveObjectToPosition
(
id
,
position
):
""" Move
s
specified object to absolute position.
""" Move specified object to absolute position.
Permission -- Manage properties
...
...
lib/python/OFS/OrderSupport.py
View file @
42a193e4
...
...
@@ -12,7 +12,7 @@
##############################################################################
""" Order support for 'Object Manager'.
$Id: OrderSupport.py,v 1.
4 2003/09/20 10:59:51
yuppie Exp $
$Id: OrderSupport.py,v 1.
5 2003/12/11 17:39:18
yuppie Exp $
"""
from
types
import
StringType
...
...
@@ -29,7 +29,7 @@ from ObjectManager import ObjectManager
class
OrderSupport
:
""" Ordered container mixin class.
This is an extension to the regular ObjectManager. It saves the objects in
order and lets you change the order of the contained objects. This is
particular helpful, if the order does not depend on object attributes, but
...
...
@@ -216,7 +216,7 @@ class OrderSupport:
security
.
declareProtected
(
manage_properties
,
'moveObjectToPosition'
)
def
moveObjectToPosition
(
self
,
id
,
position
):
""" Move specified object to absolute position.
"""
"""
delta
=
position
-
self
.
getObjectPosition
(
id
)
return
self
.
moveObjectsByDelta
(
id
,
delta
)
...
...
lib/python/Products/OFSP/help/OrderSupport.py
0 → 100644
View file @
42a193e4
##############################################################################
#
# Copyright (c) 2003 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################
class
OrderSupport
:
""" Ordered container mixin class.
This is an extension to the regular ObjectManager. It saves the objects in
order and lets you change the order of the contained objects. This is
particular helpful, if the order does not depend on object attributes, but
is totally user-specific.
"""
def
moveObjectsByDelta
(
ids
,
delta
):
""" Move specified sub-objects by delta.
If delta is higher than the possible maximum, objects will be moved to
the bottom. If delta is lower than the possible minimum, objects will
be moved to the top.
The order of the objects specified by ids will always be preserved. So
if you don't want to change their original order, make sure the order
of ids corresponds to their original order.
If an object with id doesn't exist an error will be raised.
Permission -- Manage properties
Returns -- Number of moved sub-objects
"""
def
moveObjectsUp
(
ids
,
delta
=
1
):
""" Move specified sub-objects up by delta in container.
If no delta is specified, delta is 1. See moveObjectsByDelta for more
details.
Permission -- Manage properties
Returns -- Number of moved sub-objects
"""
def
moveObjectsDown
(
ids
,
delta
=
1
):
""" Move specified sub-objects down by delta in container.
If no delta is specified, delta is 1. See moveObjectsByDelta for more
details.
Permission -- Manage properties
Returns -- Number of moved sub-objects
"""
def
moveObjectsToTop
(
ids
):
""" Move specified sub-objects to top of container.
See moveObjectsByDelta for more details.
Permission -- Manage properties
Returns -- Number of moved sub-objects
"""
def
moveObjectsToBottom
(
ids
):
""" Move specified sub-objects to bottom of container.
See moveObjectsByDelta for more details.
Permission -- Manage properties
Returns -- Number of moved sub-objects
"""
def
orderObjects
(
key
,
reverse
=
None
):
""" Order sub-objects by key and direction.
Permission -- Manage properties
Returns -- Number of moved sub-objects
"""
def
getObjectPosition
(
id
):
""" Get the position of an object by its id.
Permission -- Access contents information
Returns -- Position
"""
def
moveObjectToPosition
(
id
,
position
):
""" Move specified object to absolute position.
Permission -- Manage properties
Returns -- Number of moved sub-objects
"""
lib/python/Products/OFSP/help/OrderedFolder.py
0 → 100644
View file @
42a193e4
##############################################################################
#
# Copyright (c) 2003 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################
def
manage_addOrderedFolder
(
id
,
title
=
''
,
createPublic
=
0
,
createUserF
=
0
,
REQUEST
=
None
):
""" Add a new ordered Folder object with id *id*.
If the 'createPublic' and 'createUserF' parameters are set to any true
value, an 'index_html' and a 'UserFolder' objects are created respectively
in the new folder.
"""
class
OrderedFolder
:
""" Extends the default Folder by order support.
"""
__extends__
=
(
'OFSP.OrderSupport.OrderSupport'
,
'OFSP.Folder.Folder'
)
__constructor__
=
manage_addOrderedFolder
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment