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
31973864
Commit
31973864
authored
Mar 09, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Got rid of FolderHandler and got rid of most "handler" base classes.
parent
807df31f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
60 deletions
+20
-60
lib/python/OFS/Folder.py
lib/python/OFS/Folder.py
+20
-60
No files found.
lib/python/OFS/Folder.py
View file @
31973864
"""Folder object
$Id: Folder.py,v 1.3
8 1998/02/10 18:37:07
jim Exp $"""
$Id: Folder.py,v 1.3
9 1998/03/09 19:39:05
jim Exp $"""
__version__
=
'$Revision: 1.3
8
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.3
9
$'
[
11
:
-
2
]
from
Globals
import
HTMLFile
from
ObjectManager
import
ObjectManager
from
CopySupport
import
CopyContainer
from
Image
import
Image
,
File
,
ImageHandler
from
Image
import
Image
,
File
from
Document
import
DocumentHandler
from
AccessControl.User
import
UserFolderHandler
from
AccessControl.Role
import
RoleManager
import
SimpleItem
from
string
import
rfind
,
lower
from
content_types
import
content_type
,
find_binary
,
text_type
import
Globals
class
FolderHandler
:
""" """
manage_addFolderForm
=
HTMLFile
(
'folderAdd'
,
globals
())
def
folderClass
(
self
):
return
Folder
return
self
.
__class__
manage_addFolderForm
=
HTMLFile
(
'folderAdd'
,
globals
())
def
manage_addFolder
(
self
,
id
,
title
=
''
,
createPublic
=
0
,
createUserF
=
0
,
def
manage_addFolder
(
self
,
id
,
title
=
''
,
createPublic
=
0
,
createUserF
=
0
,
REQUEST
=
None
):
"""Add a new Folder object"""
i
=
self
.
folderClass
()()
i
.
id
=
id
i
.
title
=
title
self
.
_setObject
(
id
,
i
)
if
createUserF
:
i
.
manage_addUserFolder
()
if
createPublic
:
i
.
manage_addDocument
(
id
=
'index_html'
,
title
=
''
)
if
REQUEST
:
return
self
.
manage_main
(
self
,
REQUEST
,
update_menu
=
1
)
def
folderIds
(
self
):
t
=
[]
for
i
in
self
.
objectMap
():
if
i
[
'meta_type'
]
==
'Folder'
:
t
.
append
(
i
[
'id'
])
return
t
def
folderValues
(
self
):
t
=
[]
for
i
in
self
.
objectMap
():
if
i
[
'meta_type'
]
==
'Folder'
:
t
.
append
(
getattr
(
self
,
i
[
'id'
]))
return
t
def
folderItems
(
self
):
t
=
[]
for
i
in
self
.
objectMap
():
if
i
[
'meta_type'
]
==
'Folder'
:
n
=
i
[
'id'
]
t
.
append
((
n
,
getattr
(
self
,
n
)))
return
t
test_url___allow_groups__
=
None
def
test_url_
(
self
):
"""Test connection"""
return
'PING'
Globals
.
default__class_init__
(
FolderHandler
)
"""Add a new Folder object"""
i
=
self
.
folderClass
()()
i
.
id
=
id
i
.
title
=
title
self
.
_setObject
(
id
,
i
)
if
createUserF
:
i
.
manage_addUserFolder
()
if
createPublic
:
i
.
manage_addDocument
(
id
=
'index_html'
,
title
=
''
)
if
REQUEST
:
return
self
.
manage_main
(
self
,
REQUEST
,
update_menu
=
1
)
class
Folder
(
ObjectManager
,
RoleManager
,
DocumentHandler
,
ImageHandler
,
FolderHandler
,
UserFolderHandler
,
SimpleItem
.
Item
,
CopyContainer
):
""" """
__roles__
=
[
'Manager'
,
'Shared'
]
...
...
@@ -102,14 +67,6 @@ class Folder(ObjectManager,RoleManager,DocumentHandler,
(
'Undo changes'
,
[
'manage_undo_transactions'
]),
(
'Change permissions'
,
[
'manage_access'
]),
(
'Add objects'
,
[
'manage_addObject'
]),
(
'Add Documents, Images, and Files'
,
(
'manage_addDocumentForm'
,
'manage_addDocument'
,
'manage_addFileForm'
,
'manage_addFile'
,
'manage_addImageForm'
,
'manage_addImage'
,
'PUT'
)
),
(
'Add Folders'
,(
'manage_addFolderForm'
,
'manage_addFolder'
)),
(
'Add User Folders'
,(
'manage_addUserFolder'
,)),
(
'Delete objects'
,
[
'manage_delObjects'
]),
(
'Add properties'
,
[
'manage_addProperty'
]),
(
'Change properties'
,
[
'manage_editProperties'
]),
...
...
@@ -144,11 +101,14 @@ class Folder(ObjectManager,RoleManager,DocumentHandler,
except
:
pass
raise
KeyError
,
key
PUT__roles__
=
'Manager'
,
def
PUT
(
self
):
# This is here mainly as a hac^H^Hook for holding PUT permissions
raise
TypeError
,
'Directory PUT is not supported'
def
folderClass
(
self
):
return
Folder
return
self
.
__class__
test_url___allow_groups__
=
None
def
test_url_
(
self
):
"""Test connection"""
return
'PING'
class
PUTer
:
""" """
...
...
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