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
b94b21d2
Commit
b94b21d2
authored
Feb 15, 1999
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made some bug fixes to import/export.
parent
8752301b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
29 deletions
+33
-29
lib/python/OFS/Folder.py
lib/python/OFS/Folder.py
+13
-10
lib/python/OFS/importExport.dtml
lib/python/OFS/importExport.dtml
+20
-19
No files found.
lib/python/OFS/Folder.py
View file @
b94b21d2
...
...
@@ -105,9 +105,9 @@
Folders are the basic container objects and are analogous to directories.
$Id: Folder.py,v 1.6
1 1999/02/11 00:49:45 amos
Exp $"""
$Id: Folder.py,v 1.6
2 1999/02/15 23:10:19 brian
Exp $"""
__version__
=
'$Revision: 1.6
1
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.6
2
$'
[
11
:
-
2
]
import
Globals
,
SimpleItem
,
Acquisition
,
mimetypes
,
content_types
from
Globals
import
HTMLFile
...
...
@@ -268,24 +268,27 @@ class Folder(ObjectManager, PropertyManager, RoleManager, SimpleItem.Item,
# These methods replace manage_importHack and manage_exportHack
def
manage_exportObject
(
self
,
id
=
None
,
download
=
None
,
RESPONSE
=
None
):
def
manage_exportObject
(
self
,
id
=
''
,
download
=
None
,
RESPONSE
=
None
):
"""Exports an object to a file and returns that file."""
if
id
is
None
:
o
=
self
else
:
o
=
getattr
(
self
,
id
)
if
not
id
:
id
=
self
.
id
if
callable
(
id
):
id
=
id
()
ob
=
self
else
:
ob
=
getattr
(
self
,
id
)
if
download
:
f
=
StringIO
()
o
.
_p_jar
.
export_file
(
o
,
f
)
o
b
.
_p_jar
.
export_file
(
ob
,
f
)
RESPONSE
.
setHeader
(
'Content-type'
,
'application/data'
)
RESPONSE
.
setHeader
(
'Content-Disposition'
,
'inline;filename=%s.bbe'
%
id
)
return
f
.
getvalue
()
f
=
Globals
.
data_dir
+
'/%s.bbe'
%
id
o
.
_p_jar
.
export_file
(
o
,
f
)
o
b
.
_p_jar
.
export_file
(
ob
,
f
)
if
RESPONSE
is
not
None
:
return
MessageDialog
(
title
=
"Object exported"
,
message
=
"<EM>%s</EM> sucessfully
\
exported to <pre>%s</pre>."
%
(
id
,
f
),
exported to <pre>%s</pre>."
%
(
id
,
f
),
action
=
"manage_main"
)
manage_importExportForm
=
HTMLFile
(
'importExport'
,
globals
())
...
...
@@ -361,7 +364,7 @@ class PUTer(Acquisition.Explicit):
type
,
enc
=
mimetypes
.
guess_type
(
name
)
if
type
is
None
:
if
content_types
.
find_binary
(
body
)
>=
0
:
raise
'Bad Request'
,
'Unknown content type
'
content_type
=
'application/octet-stream
'
else
:
type
=
content_types
.
text_type
(
body
)
type
=
lower
(
type
)
if
type
in
(
'text/html'
,
'text/xml'
,
'text/plain'
):
...
...
lib/python/OFS/importExport.dtml
View file @
b94b21d2
...
...
@@ -9,21 +9,17 @@
You can export Zope objects to a file in order to transfer
them to a different Zope installation. You can either choose
to download the export file to your local machine, or save it
in Zope's 'var' directory on the server.
in the "var" directory of your Zope installation
on the server.
</P>
<FORM ACTION="manage_exportObject" METHOD="POST"
TARGET="manage_main">
<FORM ACTION="manage_exportObject" METHOD="POST" TARGET="manage_main">
<TABLE CELLSPACING="2">
<TR>
<TH ALIGN="LEFT" VALIGN="TOP">Export object id</TH>
<TD ALIGH="LEFT" VALIGN="TOP">
<INPUT TYPE="TEXT" NAME="id" SIZE="25"
<!--#if ids-->
VALUE="<!--#var "ids[0]"-->">
<!--#else-->
VALUE="">
<!--#/if-->
<INPUT TYPE="TEXT" NAME="id" SIZE="25" VALUE="<!--#if ids--><!--#var
"ids[0]"--><!--#/if-->">
</TD>
</TR>
<TR>
...
...
@@ -31,23 +27,23 @@ TARGET="manage_main">
<TD ALIGN="LEFT" VALIGN="TOP">
<INPUT TYPE="RADIO" NAME="download:int" VALUE="1">
Download to local machine<BR>
<INPUT TYPE="RADIO" NAME="download:int" VALUE="0">
<INPUT TYPE="RADIO" NAME="download:int" VALUE="0"
checked
>
Save to file on server
</TD>
</TR>
<TR>
<TD></TD>
<TD><BR>
<INPUT TYPE="SUBMIT" VALUE="Export">
</TD>
<TD><INPUT TYPE="SUBMIT" VALUE="Export"></TD>
</TR>
</TABLE>
</FORM>
<P>
You can import Zope objects which have been previously
exported to a file, by placing the file in Zope's 'Import'
directory on the server.
You may import Zope objects which have been previously
exported to a file, by placing the file in the "Import"
directory of your Zope installation on the server. You should create
the "Import" directory in the root of your Zope installation
if it does not yet exist.
</P>
<FORM ACTION="manage_importObject" METHOD="POST"
...
...
@@ -62,11 +58,16 @@ directory on the server.
</TR>
<TR>
<TD></TD>
<TD><BR>
<INPUT TYPE="SUBMIT" VALUE="Import">
<TD><INPUT TYPE="SUBMIT" VALUE="Import">
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
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