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
7b80be50
Commit
7b80be50
authored
May 05, 1999
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added delete protocol.
parent
1f497f69
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
9 deletions
+27
-9
lib/python/OFS/CopySupport.py
lib/python/OFS/CopySupport.py
+3
-3
lib/python/OFS/ObjectManager.py
lib/python/OFS/ObjectManager.py
+14
-4
lib/python/OFS/SimpleItem.py
lib/python/OFS/SimpleItem.py
+10
-2
No files found.
lib/python/OFS/CopySupport.py
View file @
7b80be50
...
...
@@ -83,7 +83,7 @@
#
##############################################################################
__doc__
=
"""Copy interface"""
__version__
=
'$Revision: 1.3
3
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.3
4
$'
[
11
:
-
2
]
import
sys
,
string
,
Globals
,
Moniker
,
tempfile
,
ExtensionClass
from
marshal
import
loads
,
dumps
...
...
@@ -212,7 +212,7 @@ class CopyContainer(ExtensionClass.Base):
id
=
absattr
(
ob
.
id
)
if
not
ob
.
cb_isMoveable
():
raise
CopyError
,
eNotSupported
%
id
ob
.
aq_parent
.
_delObject
(
id
)
ob
.
aq_parent
.
_delObject
(
id
,
dp
=
0
)
if
hasattr
(
ob
,
'aq_base'
):
ob
=
ob
.
aq_base
id
=
_get_id
(
self
,
id
)
...
...
@@ -248,7 +248,7 @@ class CopyContainer(ExtensionClass.Base):
title
=
'Rename Error'
,
message
=
sys
.
exc_value
,
action
=
'manage_main'
)
self
.
_delObject
(
id
)
self
.
_delObject
(
id
,
dp
=
0
)
if
hasattr
(
ob
,
'aq_base'
):
ob
=
ob
.
aq_base
self
.
_setObject
(
new_id
,
ob
)
...
...
lib/python/OFS/ObjectManager.py
View file @
7b80be50
...
...
@@ -84,9 +84,9 @@
##############################################################################
__doc__
=
"""Object Manager
$Id: ObjectManager.py,v 1.7
0 1999/04/30 14:12:56
brian Exp $"""
$Id: ObjectManager.py,v 1.7
1 1999/05/05 14:58:34
brian Exp $"""
__version__
=
'$Revision: 1.7
0
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.7
1
$'
[
11
:
-
2
]
import
App.Management
,
Acquisition
,
App
.
Undo
,
Globals
,
CopySupport
import
os
,
App
.
FactoryDispatcher
,
ts_regex
,
Products
...
...
@@ -213,7 +213,7 @@ class ObjectManager(
object
.
manage_setLocalRoles
(
name
,
[
'Owner'
])
return
id
def
_delObject
(
self
,
id
):
def
_delObject
(
self
,
id
,
dp
=
1
):
if
id
==
'acl_users'
:
# Yikes - acl_users is referred to by two names and
# must be treated as a special case! Only get rid of
...
...
@@ -224,7 +224,17 @@ class ObjectManager(
if
hasattr
(
self
,
'__allow_groups__'
)
and
\
self
.
__dict__
.
has_key
(
'__allow_groups__'
):
delattr
(
self
,
'__allow_groups__'
)
# Deletion protocol - when an object is being deleted,
# attempt to call it's _on_delete_object method if
# if has one. The dp flag allows allows callers to
# avoid having the delete protocol triggered (for
# instance when an object is cut and pasted).
if
dp
:
ob
=
self
.
_getOb
(
id
)
if
hasattr
(
ob
,
'_on_delete_object'
)
and
\
callable
(
ob
.
_on_delete_object
):
ob
.
_on_delete_object
()
del
ob
self
.
_objects
=
tuple
(
filter
(
lambda
i
,
n
=
id
:
i
[
'id'
]
!=
n
,
self
.
_objects
))
self
.
_delOb
(
id
)
...
...
lib/python/OFS/SimpleItem.py
View file @
7b80be50
...
...
@@ -89,8 +89,8 @@ Aqueduct database adapters, etc.
This module can also be used as a simple template for implementing new
item types.
$Id: SimpleItem.py,v 1.4
7 1999/04/28 16:25:45
brian Exp $'''
__version__
=
'$Revision: 1.4
7
$'
[
11
:
-
2
]
$Id: SimpleItem.py,v 1.4
8 1999/05/05 14:58:34
brian Exp $'''
__version__
=
'$Revision: 1.4
8
$'
[
11
:
-
2
]
import
regex
,
sys
,
Globals
,
App
.
Management
,
Acquisition
from
webdav.Resource
import
Resource
...
...
@@ -110,6 +110,14 @@ class Item(Base, Resource, CopySource, App.Management.Tabs):
isPrincipiaFolderish
=
0
isTopLevelPrincipiaApplicationObject
=
0
# HACK HACK HACK -- TAKE THIS OUT LATER!!!!
def
_on_delete_object
(
self
):
if
hasattr
(
self
,
'onDeleteObject'
)
and
\
callable
(
self
.
onDeleteObject
):
self
.
onDeleteObject
()
# The name of this object and the name used to traverse to thie
# object in a URL:
id
=
''
...
...
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