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
f6605c17
Commit
f6605c17
authored
Feb 16, 1999
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made fixes to import/export sanity checking
parent
e967b505
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
15 deletions
+20
-15
lib/python/OFS/Folder.py
lib/python/OFS/Folder.py
+18
-13
lib/python/OFS/importExport.dtml
lib/python/OFS/importExport.dtml
+2
-2
No files found.
lib/python/OFS/Folder.py
View file @
f6605c17
...
...
@@ -105,9 +105,9 @@
Folders are the basic container objects and are analogous to directories.
$Id: Folder.py,v 1.6
2 1999/02/15 23:10:19
brian Exp $"""
$Id: Folder.py,v 1.6
3 1999/02/16 15:55:43
brian Exp $"""
__version__
=
'$Revision: 1.6
2
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.6
3
$'
[
11
:
-
2
]
import
Globals
,
SimpleItem
,
Acquisition
,
mimetypes
,
content_types
from
Globals
import
HTMLFile
...
...
@@ -182,7 +182,7 @@ class Folder(ObjectManager, PropertyManager, RoleManager, SimpleItem.Item,
'manage_cutObjects'
,
'manage_copyObjects'
,
'manage_pasteObjects'
,
'manage_renameForm'
,
'manage_renameObject'
,
'manage_findFrame'
,
'manage_findForm'
,
'manage_findAdv'
,
'manage_findResult'
,
'manage_findOpt'
)),
'manage_findResult'
)),
(
'Access contents information'
,
(
'objectIds'
,
'objectValues'
,
'objectItems'
,
'hasProperty'
,
'propertyIds'
,
'propertyValues'
,
'propertyItems'
,
''
),
...
...
@@ -293,17 +293,22 @@ class Folder(ObjectManager, PropertyManager, RoleManager, SimpleItem.Item,
manage_importExportForm
=
HTMLFile
(
'importExport'
,
globals
())
def
manage_importObject
(
self
,
file
,
REQUEST
=
None
):
"Import an object from a file"
if
find
(
file
,
'..'
)
!=
-
1
:
raise
ValueError
,
'Bad file name %s'
%
file
f
=
os
.
path
.
join
(
INSTANCE_HOME
,
'Import'
,
file
)
o
=
self
.
_p_jar
.
import_file
(
f
)
id
=
o
.
id
if
hasattr
(
id
,
'im_func'
):
id
=
id
()
self
.
_setObject
(
id
,
o
)
def
manage_importObject
(
self
,
file
,
REQUEST
=
None
):
"""Import an object from a file"""
dirname
,
file
=
os
.
path
.
split
(
file
)
if
dirname
:
raise
'Bad Request'
,
'Invalid file name %s'
%
file
file
=
os
.
path
.
join
(
INSTANCE_HOME
,
'import'
,
file
)
if
not
os
.
path
.
exists
(
file
):
raise
'Bad Request'
,
'File does not exist: %s'
%
file
ob
=
self
.
_p_jar
.
import_file
(
file
)
if
REQUEST
:
self
.
_verifyObjectPaste
(
ob
,
REQUEST
)
id
=
ob
.
id
if
hasattr
(
id
,
'im_func'
):
id
=
id
()
self
.
_setObject
(
id
,
ob
)
if
REQUEST
is
not
None
:
return
MessageDialog
(
title
=
'Object imported'
,
return
MessageDialog
(
title
=
'Object imported'
,
message
=
'<EM>%s</EM> sucessfully imported'
%
id
,
action
=
'manage_main'
)
...
...
lib/python/OFS/importExport.dtml
View file @
f6605c17
...
...
@@ -40,9 +40,9 @@ on the server.
<P>
You may import Zope objects which have been previously
exported to a file, by placing the file in the "
I
mport"
exported to a file, by placing the file in the "
i
mport"
directory of your Zope installation on the server. You should create
the "
I
mport" directory in the root of your Zope installation
the "
i
mport" directory in the root of your Zope installation
if it does not yet exist.
</P>
...
...
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