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
a753f4c9
Commit
a753f4c9
authored
Mar 08, 1999
by
Michel Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed Sessions to Versions.
parent
788b35e3
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
33 additions
and
717 deletions
+33
-717
lib/python/Products/OFSP/Draft.py
lib/python/Products/OFSP/Draft.py
+19
-19
lib/python/Products/OFSP/Session.py
lib/python/Products/OFSP/Session.py
+0
-206
lib/python/Products/OFSP/Version.py
lib/python/Products/OFSP/Version.py
+0
-206
lib/python/Products/OFSP/__init__.py
lib/python/Products/OFSP/__init__.py
+13
-13
lib/python/Products/OFSP/draftAdd.dtml
lib/python/Products/OFSP/draftAdd.dtml
+1
-1
lib/python/Products/OFSP/session.dtml
lib/python/Products/OFSP/session.dtml
+0
-66
lib/python/Products/OFSP/sessionAdd.dtml
lib/python/Products/OFSP/sessionAdd.dtml
+0
-36
lib/python/Products/OFSP/sessionEdit.dtml
lib/python/Products/OFSP/sessionEdit.dtml
+0
-34
lib/python/Products/OFSP/version.dtml
lib/python/Products/OFSP/version.dtml
+0
-66
lib/python/Products/OFSP/versionAdd.dtml
lib/python/Products/OFSP/versionAdd.dtml
+0
-36
lib/python/Products/OFSP/versionEdit.dtml
lib/python/Products/OFSP/versionEdit.dtml
+0
-34
No files found.
lib/python/Products/OFSP/Draft.py
View file @
a753f4c9
...
...
@@ -97,7 +97,7 @@ def manage_addPrincipiaDraft(self, id, baseid, PATH_INFO, REQUEST=None):
class
Draft
(
Persistent
,
Implicit
,
SimpleItem
.
Item
):
"Daft objects"
_refid
=
''
_
session
=
'/ses
sion'
_
version
=
'/ver
sion'
icon
=
'misc_/OFSP/draft'
meta_type
=
'Principia Draft'
...
...
@@ -111,10 +111,10 @@ class Draft(Persistent, Implicit, SimpleItem.Item):
def
__init__
(
self
,
id
,
baseid
,
PATH_INFO
):
self
.
id
=
id
self
.
_refid
=
baseid
ses
sion
=
PATH_INFO
l
=
rfind
(
ses
sion
,
'/'
)
if
l
>=
0
:
session
=
ses
sion
[:
l
]
self
.
_
session
=
"%s/%s"
%
(
ses
sion
,
id
)
ver
sion
=
PATH_INFO
l
=
rfind
(
ver
sion
,
'/'
)
if
l
>=
0
:
version
=
ver
sion
[:
l
]
self
.
_
version
=
"%s/%s"
%
(
ver
sion
,
id
)
self
.
users__draft__
=
uf
=
AccessControl
.
User
.
UserFolder
()
self
.
__allow_groups__
=
uf
...
...
@@ -149,24 +149,24 @@ class Draft(Persistent, Implicit, SimpleItem.Item):
def
__bobo_traverse__
(
self
,
REQUEST
,
name
):
if
name
[
-
9
:]
==
'__draft__'
:
return
getattr
(
self
,
name
)
dself
=
getdraft
(
self
,
self
.
_
ses
sion
)
dself
=
getdraft
(
self
,
self
.
_
ver
sion
)
ref
=
getattr
(
dself
.
aq_parent
.
aq_base
,
dself
.
_refid
).
aq_base
.
__of__
(
dself
)
if
hasattr
(
ref
,
name
):
return
dself
,
ref
,
getattr
(
ref
,
name
)
return
getattr
(
self
,
name
)
def
nonempty
(
self
):
return
Globals
.
SessionBase
[
self
.
_ses
sion
].
nonempty
()
def
nonempty
(
self
):
return
Globals
.
VersionBase
[
self
.
_ver
sion
].
nonempty
()
manage_approve__draft__
=
Globals
.
HTMLFile
(
'draftApprove'
,
globals
())
def
manage_Save__draft__
(
self
,
remark
,
REQUEST
=
None
):
"""Make
ses
sion changes permanent"""
Globals
.
SessionBase
[
self
.
_ses
sion
].
commit
(
remark
)
"""Make
ver
sion changes permanent"""
Globals
.
VersionBase
[
self
.
_ver
sion
].
commit
(
remark
)
if
REQUEST
:
REQUEST
[
'RESPONSE'
].
redirect
(
REQUEST
[
'URL2'
]
+
'/manage_main'
)
def
manage_Discard__draft__
(
self
,
REQUEST
=
None
):
'Discard changes made during the
ses
sion'
Globals
.
SessionBase
[
self
.
_ses
sion
].
abort
()
'Discard changes made during the
ver
sion'
Globals
.
VersionBase
[
self
.
_ver
sion
].
abort
()
if
REQUEST
:
REQUEST
[
'RESPONSE'
].
redirect
(
REQUEST
[
'URL2'
]
+
'/manage_main'
)
...
...
@@ -180,19 +180,19 @@ class Draft(Persistent, Implicit, SimpleItem.Item):
def
_postCopy
(
self
,
container
,
op
=
0
):
try
:
ses
sion
=
self
.
REQUEST
[
'PATH_INFO'
]
l
=
rfind
(
ses
sion
,
'/'
)
if
l
>=
0
:
session
=
ses
sion
[:
l
]
self
.
_
session
=
"%s/%s"
%
(
ses
sion
,
self
.
id
)
ver
sion
=
self
.
REQUEST
[
'PATH_INFO'
]
l
=
rfind
(
ver
sion
,
'/'
)
if
l
>=
0
:
version
=
ver
sion
[:
l
]
self
.
_
version
=
"%s/%s"
%
(
ver
sion
,
self
.
id
)
finally
:
if
0
:
raise
'Copy Error'
,
(
"This object can only be copied through the web.<p>"
)
def
getdraft
(
ob
,
ses
sion
):
def
getdraft
(
ob
,
ver
sion
):
if
hasattr
(
ob
,
'aq_parent'
):
return
getdraft
(
ob
.
aq_self
,
ses
sion
).
__of__
(
getdraft
(
ob
.
aq_parent
,
ses
sion
))
return
getdraft
(
ob
.
aq_self
,
ver
sion
).
__of__
(
getdraft
(
ob
.
aq_parent
,
ver
sion
))
if
hasattr
(
ob
,
'_p_oid'
):
ob
=
Globals
.
SessionBase
[
ses
sion
].
jar
[
ob
.
_p_oid
]
ob
=
Globals
.
VersionBase
[
ver
sion
].
jar
[
ob
.
_p_oid
]
return
ob
lib/python/Products/OFSP/Session.py
deleted
100644 → 0
View file @
788b35e3
##############################################################################
#
# Zope Public License (ZPL) Version 0.9.4
# ---------------------------------------
#
# Copyright (c) Digital Creations. All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions in source code must retain the above
# copyright notice, this list of conditions, and the following
# disclaimer.
#
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions, and the following
# disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# 3. Any use, including use of the Zope software to operate a
# website, must either comply with the terms described below
# under "Attribution" or alternatively secure a separate
# license from Digital Creations.
#
# 4. All advertising materials, documentation, or technical papers
# mentioning features derived from or use of this software must
# display the following acknowledgement:
#
# "This product includes software developed by Digital
# Creations for use in the Z Object Publishing Environment
# (http://www.zope.org/)."
#
# 5. Names associated with Zope or Digital Creations must not be
# used to endorse or promote products derived from this
# software without prior written permission from Digital
# Creations.
#
# 6. Redistributions of any form whatsoever must retain the
# following acknowledgment:
#
# "This product includes software developed by Digital
# Creations for use in the Z Object Publishing Environment
# (http://www.zope.org/)."
#
# 7. Modifications are encouraged but must be packaged separately
# as patches to official Zope releases. Distributions that do
# not clearly separate the patches from the original work must
# be clearly labeled as unofficial distributions.
#
# Disclaimer
#
# THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS ``AS IS'' AND
# ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
# SHALL DIGITAL CREATIONS OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.
#
# Attribution
#
# Individuals or organizations using this software as a web site
# must provide attribution by placing the accompanying "button"
# and a link to the accompanying "credits page" on the website's
# main entry point. In cases where this placement of
# attribution is not feasible, a separate arrangment must be
# concluded with Digital Creations. Those using the software
# for purposes other than web sites must provide a corresponding
# attribution in locations that include a copyright using a
# manner best suited to the application environment.
#
# This software consists of contributions made by Digital
# Creations and many individuals on behalf of Digital Creations.
# Specific attributions are listed in the accompanying credits
# file.
#
##############################################################################
"""Session object"""
__version__
=
'$Revision: 1.24 $'
[
11
:
-
2
]
import
Globals
,
time
from
AccessControl.Role
import
RoleManager
from
Globals
import
MessageDialog
from
Globals
import
Persistent
from
Acquisition
import
Implicit
from
OFS.SimpleItem
import
Item
from
string
import
rfind
from
Globals
import
HTML
from
App.Dialogs
import
MessageDialog
manage_addSessionForm
=
Globals
.
HTMLFile
(
'sessionAdd'
,
globals
())
def
manage_addSession
(
self
,
id
,
title
,
REQUEST
=
None
):
""" """
self
.
_setObject
(
id
,
Session
(
id
,
title
,
REQUEST
))
return
self
.
manage_main
(
self
,
REQUEST
)
class
Session
(
Persistent
,
Implicit
,
RoleManager
,
Item
):
""" """
meta_type
=
'Session'
icon
=
'misc_/OFSP/session'
manage_options
=
({
'label'
:
'Join/Leave'
,
'action'
:
'manage_main'
},
{
'label'
:
'Properties'
,
'action'
:
'manage_editForm'
},
{
'label'
:
'Security'
,
'action'
:
'manage_access'
},
)
__ac_permissions__
=
(
(
'View management screens'
,
[
'manage'
,
'manage_tabs'
,
'manage_editForm'
,
''
]),
(
'Change permissions'
,
[
'manage_access'
]),
(
'Change Sessions'
,
[
'manage_edit'
]),
(
'Join/leave Sessions'
,
[
'enter'
,
'leave'
,
'leave_another'
]),
(
'Save/discard Session changes'
,
[
'save'
,
'discard'
]),
)
def
__init__
(
self
,
id
,
title
,
REQUEST
):
self
.
id
=
id
self
.
title
=
title
cookie
=
REQUEST
[
'PATH_INFO'
]
l
=
rfind
(
cookie
,
'/'
)
if
l
>=
0
:
cookie
=
cookie
[:
l
]
self
.
cookie
=
"%s/%s"
%
(
cookie
,
id
)
manage
=
manage_main
=
Globals
.
HTMLFile
(
'session'
,
globals
())
manage_editForm
=
Globals
.
HTMLFile
(
'sessionEdit'
,
globals
())
def
title_and_id
(
self
):
r
=
Session
.
inheritedAttribute
(
'title_and_id'
)(
self
)
if
Globals
.
SessionBase
[
self
.
cookie
].
nonempty
():
return
'%s *'
%
r
return
r
def
manage_edit
(
self
,
title
,
REQUEST
=
None
):
""" """
self
.
title
=
title
if
REQUEST
:
return
MessageDialog
(
title
=
'Success!'
,
message
=
'Your changes have been saved'
,
action
=
'manage_main'
)
def
enter
(
self
,
REQUEST
,
RESPONSE
):
"""Begin working in a session"""
RESPONSE
.
setCookie
(
Globals
.
SessionNameName
,
self
.
cookie
,
#expires="Mon, 27-Dec-99 23:59:59 GMT",
path
=
REQUEST
[
'SCRIPT_NAME'
],
)
if
(
REQUEST
.
has_key
(
'SERVER_SOFTWARE'
)
and
REQUEST
[
'SERVER_SOFTWARE'
][:
9
]
==
'Microsoft'
):
# IIS doesn't handle redirect headers correctly
return
MessageDialog
(
action
=
REQUEST
[
'URL1'
]
+
'/manage_main'
,
message
=
(
'If cookies are enabled by your browser, then '
'you should have joined session %s.'
%
self
.
id
)
)
return
RESPONSE
.
redirect
(
REQUEST
[
'URL1'
]
+
'/manage_main'
)
def
leave
(
self
,
REQUEST
,
RESPONSE
):
"""Temporarily stop working in a session"""
RESPONSE
.
setCookie
(
Globals
.
SessionNameName
,
'No longer active'
,
expires
=
"Mon, 27-Aug-84 23:59:59 GMT"
,
path
=
REQUEST
[
'SCRIPT_NAME'
],
)
if
(
REQUEST
.
has_key
(
'SERVER_SOFTWARE'
)
and
REQUEST
[
'SERVER_SOFTWARE'
][:
9
]
==
'Microsoft'
):
# IIS doesn't handle redirect headers correctly
return
MessageDialog
(
action
=
REQUEST
[
'URL1'
]
+
'/manage_main'
,
message
=
(
'If cookies are enabled by your browser, then '
'you should have left session %s.'
%
self
.
id
)
)
return
RESPONSE
.
redirect
(
REQUEST
[
'URL1'
]
+
'/manage_main'
)
def
leave_another
(
self
,
REQUEST
,
RESPONSE
):
"""Leave a session that may not be the current session"""
return
self
.
leave
(
REQUEST
,
RESPONSE
)
def
save
(
self
,
remark
,
REQUEST
=
None
):
"""Make session changes permanent"""
Globals
.
SessionBase
[
self
.
cookie
].
commit
(
remark
)
if
REQUEST
:
return
self
.
manage_main
(
self
,
REQUEST
)
def
discard
(
self
,
REQUEST
=
None
):
'Discard changes made during the session'
Globals
.
SessionBase
[
self
.
cookie
].
abort
()
if
REQUEST
:
return
self
.
manage_main
(
self
,
REQUEST
)
def
nonempty
(
self
):
return
Globals
.
SessionBase
[
self
.
cookie
].
nonempty
()
def
_notifyOfCopyTo
(
self
,
container
,
isMove
=
0
):
if
isMove
and
self
.
nonempty
():
raise
'Copy Error'
,
(
"You cannot copy a %s object with <b>unsaved</b> changes.
\
n
"
"You must <b>save</b> the changes first."
%
self
.
meta_type
)
lib/python/Products/OFSP/Version.py
deleted
100644 → 0
View file @
788b35e3
##############################################################################
#
# Zope Public License (ZPL) Version 0.9.4
# ---------------------------------------
#
# Copyright (c) Digital Creations. All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions in source code must retain the above
# copyright notice, this list of conditions, and the following
# disclaimer.
#
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions, and the following
# disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# 3. Any use, including use of the Zope software to operate a
# website, must either comply with the terms described below
# under "Attribution" or alternatively secure a separate
# license from Digital Creations.
#
# 4. All advertising materials, documentation, or technical papers
# mentioning features derived from or use of this software must
# display the following acknowledgement:
#
# "This product includes software developed by Digital
# Creations for use in the Z Object Publishing Environment
# (http://www.zope.org/)."
#
# 5. Names associated with Zope or Digital Creations must not be
# used to endorse or promote products derived from this
# software without prior written permission from Digital
# Creations.
#
# 6. Redistributions of any form whatsoever must retain the
# following acknowledgment:
#
# "This product includes software developed by Digital
# Creations for use in the Z Object Publishing Environment
# (http://www.zope.org/)."
#
# 7. Modifications are encouraged but must be packaged separately
# as patches to official Zope releases. Distributions that do
# not clearly separate the patches from the original work must
# be clearly labeled as unofficial distributions.
#
# Disclaimer
#
# THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS ``AS IS'' AND
# ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
# SHALL DIGITAL CREATIONS OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.
#
# Attribution
#
# Individuals or organizations using this software as a web site
# must provide attribution by placing the accompanying "button"
# and a link to the accompanying "credits page" on the website's
# main entry point. In cases where this placement of
# attribution is not feasible, a separate arrangment must be
# concluded with Digital Creations. Those using the software
# for purposes other than web sites must provide a corresponding
# attribution in locations that include a copyright using a
# manner best suited to the application environment.
#
# This software consists of contributions made by Digital
# Creations and many individuals on behalf of Digital Creations.
# Specific attributions are listed in the accompanying credits
# file.
#
##############################################################################
"""Session object"""
__version__
=
'$Revision: 1.24 $'
[
11
:
-
2
]
import
Globals
,
time
from
AccessControl.Role
import
RoleManager
from
Globals
import
MessageDialog
from
Globals
import
Persistent
from
Acquisition
import
Implicit
from
OFS.SimpleItem
import
Item
from
string
import
rfind
from
Globals
import
HTML
from
App.Dialogs
import
MessageDialog
manage_addSessionForm
=
Globals
.
HTMLFile
(
'sessionAdd'
,
globals
())
def
manage_addSession
(
self
,
id
,
title
,
REQUEST
=
None
):
""" """
self
.
_setObject
(
id
,
Session
(
id
,
title
,
REQUEST
))
return
self
.
manage_main
(
self
,
REQUEST
)
class
Session
(
Persistent
,
Implicit
,
RoleManager
,
Item
):
""" """
meta_type
=
'Session'
icon
=
'misc_/OFSP/session'
manage_options
=
({
'label'
:
'Join/Leave'
,
'action'
:
'manage_main'
},
{
'label'
:
'Properties'
,
'action'
:
'manage_editForm'
},
{
'label'
:
'Security'
,
'action'
:
'manage_access'
},
)
__ac_permissions__
=
(
(
'View management screens'
,
[
'manage'
,
'manage_tabs'
,
'manage_editForm'
,
''
]),
(
'Change permissions'
,
[
'manage_access'
]),
(
'Change Sessions'
,
[
'manage_edit'
]),
(
'Join/leave Sessions'
,
[
'enter'
,
'leave'
,
'leave_another'
]),
(
'Save/discard Session changes'
,
[
'save'
,
'discard'
]),
)
def
__init__
(
self
,
id
,
title
,
REQUEST
):
self
.
id
=
id
self
.
title
=
title
cookie
=
REQUEST
[
'PATH_INFO'
]
l
=
rfind
(
cookie
,
'/'
)
if
l
>=
0
:
cookie
=
cookie
[:
l
]
self
.
cookie
=
"%s/%s"
%
(
cookie
,
id
)
manage
=
manage_main
=
Globals
.
HTMLFile
(
'session'
,
globals
())
manage_editForm
=
Globals
.
HTMLFile
(
'sessionEdit'
,
globals
())
def
title_and_id
(
self
):
r
=
Session
.
inheritedAttribute
(
'title_and_id'
)(
self
)
if
Globals
.
SessionBase
[
self
.
cookie
].
nonempty
():
return
'%s *'
%
r
return
r
def
manage_edit
(
self
,
title
,
REQUEST
=
None
):
""" """
self
.
title
=
title
if
REQUEST
:
return
MessageDialog
(
title
=
'Success!'
,
message
=
'Your changes have been saved'
,
action
=
'manage_main'
)
def
enter
(
self
,
REQUEST
,
RESPONSE
):
"""Begin working in a session"""
RESPONSE
.
setCookie
(
Globals
.
SessionNameName
,
self
.
cookie
,
#expires="Mon, 27-Dec-99 23:59:59 GMT",
path
=
REQUEST
[
'SCRIPT_NAME'
],
)
if
(
REQUEST
.
has_key
(
'SERVER_SOFTWARE'
)
and
REQUEST
[
'SERVER_SOFTWARE'
][:
9
]
==
'Microsoft'
):
# IIS doesn't handle redirect headers correctly
return
MessageDialog
(
action
=
REQUEST
[
'URL1'
]
+
'/manage_main'
,
message
=
(
'If cookies are enabled by your browser, then '
'you should have joined session %s.'
%
self
.
id
)
)
return
RESPONSE
.
redirect
(
REQUEST
[
'URL1'
]
+
'/manage_main'
)
def
leave
(
self
,
REQUEST
,
RESPONSE
):
"""Temporarily stop working in a session"""
RESPONSE
.
setCookie
(
Globals
.
SessionNameName
,
'No longer active'
,
expires
=
"Mon, 27-Aug-84 23:59:59 GMT"
,
path
=
REQUEST
[
'SCRIPT_NAME'
],
)
if
(
REQUEST
.
has_key
(
'SERVER_SOFTWARE'
)
and
REQUEST
[
'SERVER_SOFTWARE'
][:
9
]
==
'Microsoft'
):
# IIS doesn't handle redirect headers correctly
return
MessageDialog
(
action
=
REQUEST
[
'URL1'
]
+
'/manage_main'
,
message
=
(
'If cookies are enabled by your browser, then '
'you should have left session %s.'
%
self
.
id
)
)
return
RESPONSE
.
redirect
(
REQUEST
[
'URL1'
]
+
'/manage_main'
)
def
leave_another
(
self
,
REQUEST
,
RESPONSE
):
"""Leave a session that may not be the current session"""
return
self
.
leave
(
REQUEST
,
RESPONSE
)
def
save
(
self
,
remark
,
REQUEST
=
None
):
"""Make session changes permanent"""
Globals
.
SessionBase
[
self
.
cookie
].
commit
(
remark
)
if
REQUEST
:
return
self
.
manage_main
(
self
,
REQUEST
)
def
discard
(
self
,
REQUEST
=
None
):
'Discard changes made during the session'
Globals
.
SessionBase
[
self
.
cookie
].
abort
()
if
REQUEST
:
return
self
.
manage_main
(
self
,
REQUEST
)
def
nonempty
(
self
):
return
Globals
.
SessionBase
[
self
.
cookie
].
nonempty
()
def
_notifyOfCopyTo
(
self
,
container
,
isMove
=
0
):
if
isMove
and
self
.
nonempty
():
raise
'Copy Error'
,
(
"You cannot copy a %s object with <b>unsaved</b> changes.
\
n
"
"You must <b>save</b> the changes first."
%
self
.
meta_type
)
lib/python/Products/OFSP/__init__.py
View file @
a753f4c9
...
...
@@ -83,10 +83,10 @@
#
##############################################################################
__doc__
=
'''Base Principia
$Id: __init__.py,v 1.
19 1999/02/22 20:51:44 jim
Exp $'''
__version__
=
'$Revision: 1.
19
$'
[
11
:
-
2
]
$Id: __init__.py,v 1.
20 1999/03/08 21:25:02 michel
Exp $'''
__version__
=
'$Revision: 1.
20
$'
[
11
:
-
2
]
import
Ses
sion
,
Draft
,
ZClasses
import
Ver
sion
,
Draft
,
ZClasses
import
OFS.Image
,
OFS
.
Folder
,
AccessControl
.
User
import
OFS.DTMLMethod
,
OFS
.
DTMLDocument
from
ImageFile
import
ImageFile
...
...
@@ -94,7 +94,7 @@ from ImageFile import ImageFile
product_name
=
'Zope built-in objects'
classes
=
(
'OFS.DTMLMethod.DTMLMethod'
,
'OFS.DTMLDocument.DTMLDocument'
,
'
Session.Ses
sion'
,
'OFS.Image.File'
,
'OFS.Image.Image'
,
'
Version.Ver
sion'
,
'OFS.Image.File'
,
'OFS.Image.Image'
,
)
klasses
=
(
'OFS.Folder.Folder'
,
'AccessControl.User.UserFolder'
)
...
...
@@ -105,8 +105,8 @@ meta_types=(
'action'
:
'manage_addPrincipiaDraftForm'
},
{
'name'
:
'User Folder'
,
'action'
:
'manage_addUserFolder'
},
{
'name'
:
'
Ses
sion'
,
'action'
:
'manage_add
Ses
sionForm'
},
{
'name'
:
'
Ver
sion'
,
'action'
:
'manage_add
Ver
sionForm'
},
{
'name'
:
'File'
,
'action'
:
'manage_addFileForm'
},
{
'name'
:
'Image'
,
...
...
@@ -137,8 +137,8 @@ methods={
'manage_addImageForm'
:
OFS
.
Image
.
manage_addImageForm
,
'manage_addFile'
:
OFS
.
Image
.
manage_addFile
,
'manage_addFileForm'
:
OFS
.
Image
.
manage_addFileForm
,
'manage_add
SessionForm'
:
Session
.
manage_addSes
sionForm
,
'manage_add
Session'
:
Session
.
manage_addSes
sion
,
'manage_add
VersionForm'
:
Version
.
manage_addVer
sionForm
,
'manage_add
Version'
:
Version
.
manage_addVer
sion
,
'PUT'
:
PUT
,
'PUT__roles__'
:
(
'Manager'
,),
'manage_addUserFolder'
:
AccessControl
.
User
.
manage_addUserFolder
,
...
...
@@ -148,14 +148,14 @@ methods={
methods
.
update
(
ZClasses
.
methods
)
misc_
=
{
'
session'
:
ImageFile
(
'images/ses
sion.gif'
,
globals
()),
'
version'
:
ImageFile
(
'images/ver
sion.gif'
,
globals
()),
}
misc_
.
update
(
ZClasses
.
misc_
)
__ac_permissions__
=
(
ZClasses
.
__ac_permissions__
+
(
(
'Add
Sessions'
,(
'manage_addSessionForm'
,
'manage_addSes
sion'
)),
(
'Add
Versions'
,(
'manage_addVersionForm'
,
'manage_addVer
sion'
)),
(
'Add Documents, Images, and Files'
,
(
'manage_addDTMLDocumentForm'
,
'manage_addDTMLDocument'
,
'manage_addDTMLMethodForm'
,
'manage_addDTMLMethod'
,
...
...
@@ -169,9 +169,9 @@ __ac_permissions__=(
(
'Change DTML Methods'
,
()),
(
'Change Images and Files'
,
()),
(
'Change proxy roles'
,
()),
(
'Change
Ses
sions'
,
()),
(
'Join/leave
Ses
sions'
,
()),
(
'Save/discard
Ses
sion changes'
,
()),
(
'Change
Ver
sions'
,
()),
(
'Join/leave
Ver
sions'
,
()),
(
'Save/discard
Ver
sion changes'
,
()),
(
'Manage users'
,
()),
#('Add DraftFolders',
# ('manage_addDraftFolderForm', 'manage_addDraftFolder')),
...
...
lib/python/Products/OFSP/draftAdd.dtml
View file @
a753f4c9
...
...
@@ -16,7 +16,7 @@
<TD ALIGN="LEFT" VALIGN="TOP">
<SELECT NAME=baseid size=7>
<!--#in objectValues sort=title_or_id-->
<!--#unless "meta_type in ('
Ses
sion', 'Principia Draft', 'User Folder')"-->
<!--#unless "meta_type in ('
Ver
sion', 'Principia Draft', 'User Folder')"-->
<OPTION VALUE="<!--#var id-->">
<!--#if title-->
<!--#var title size=25--> (<!--#var id-->)
...
...
lib/python/Products/OFSP/session.dtml
deleted
100644 → 0
View file @
788b35e3
<HTML>
<HEAD>
<TITLE><!--#var title_or_id--></TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555">
<!--#var manage_tabs-->
<!--#if Principia-Session-->
<!--#if expr="_vars['Principia-Session'] != cookie"-->
<h2>Another session is active!</h2>
You cannot start working in this session while another session,
<strong><!--#var Principia-Session--></strong> is active.
Leave <strong><!--#var Principia-Session--></strong> first and then
you may work in this session.
<form action=leave_another>
<input type=submit value="Quit Working in <!--#var Principia-Session-->">
</form>
<!--#else-->
<h2>Active <!--#var title_or_id--> Session Operations</h2>
<form action=leave>
You <strong>are</strong> currently working in the
<!--#var Principia-Session--> session. To
<strong>quit</strong> working in this session click on this button:
<input type=submit value="Quit Working in <!--#var Principia-Session-->">
</form>
<!--#/if-->
<!--#else-->
<h2>Inactive <!--#var title_or_id--> Session Operations</h2>
<form action=enter>
You <strong>are not</strong> currently working in the
<!--#var title_and_id-->
session. To <strong>start</strong> working in this session click
on this button:
<input type=submit value="Start Working in <!--#var title_or_id-->">
</form>
<!--#endif-->
<!--#if nonempty-->
<hr>
<p><form action=save>
You can make work done in <!--#var title_and_id--> permanent by
entering a remark in the space below and then
clicking on the "Save" button.<br>
<textarea name=remark rows=10 cols=50></textarea><br>
<input type=submit value="Save">
</form>
<hr>
<p><form action=discard>
You can throw away work done in <!--#var title_and_id--> by
clicking on the "Discard" button.
<input type=submit value="Discard">
</form>
<!--#endif-->
</body> </html>
lib/python/Products/OFSP/sessionAdd.dtml
deleted
100644 → 0
View file @
788b35e3
<HTML>
<HEAD>
<TITLE>Add Session</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555">
<H2>Add Session</H2>
<FORM ACTION="manage_addSession" METHOD="POST">
<TABLE CELLSPACING="2">
<TR>
<TD ALIGN="LEFT" VALIGN="TOP">
<STRONG>Id</STONG>
</TD>
<TD ALIGN="LEFT" VALIGN="TOP">
<INPUT TYPE="TEXT" NAME="id" SIZE="40">
</TD>
</TR>
<TR>
<TD ALIGN="LEFT" VALIGN="TOP">
<EM><STRONG>Title</STRONG></EM>
</TD>
<TD ALIGN="LEFT" VALIGN="TOP">
<INPUT TYPE="TEXT" NAME="title" SIZE="40">
</TD>
</TR>
<TR>
<TD></TD>
<TD>
<BR><INPUT TYPE="SUBMIT" VALUE=" Add ">
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
lib/python/Products/OFSP/sessionEdit.dtml
deleted
100644 → 0
View file @
788b35e3
<HTML>
<HEAD>
<TITLE>Edit</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555">
<!--#var manage_tabs-->
<FORM ACTION="manage_edit" METHOD="POST">
<TABLE CELLSPACING="2">
<TR>
<TD ALIGN="LEFT" VALIGN="TOP">
<STRONG>Id</STRONG>
</TD>
<TD ALIGN="LEFT" VALIGN="TOP">
<!--#var id-->
</TD>
</TR>
<TR>
<TD ALIGN="LEFT" VALIGN="TOP">
<EM><STRONG>Title</STRONG></EM>
</TD>
<TD ALIGN="LEFT" VALIGN="TOP">
<INPUT TYPE="TEXT" NAME="title" SIZE="40" VALUE="<!--#var title-->">
</TD>
</TR>
<TR>
<TD></TD>
<TD><BR><INPUT TYPE="SUBMIT" VALUE="Edit"></TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
lib/python/Products/OFSP/version.dtml
deleted
100644 → 0
View file @
788b35e3
<HTML>
<HEAD>
<TITLE><!--#var title_or_id--></TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555">
<!--#var manage_tabs-->
<!--#if Principia-Session-->
<!--#if expr="_vars['Principia-Session'] != cookie"-->
<h2>Another session is active!</h2>
You cannot start working in this session while another session,
<strong><!--#var Principia-Session--></strong> is active.
Leave <strong><!--#var Principia-Session--></strong> first and then
you may work in this session.
<form action=leave_another>
<input type=submit value="Quit Working in <!--#var Principia-Session-->">
</form>
<!--#else-->
<h2>Active <!--#var title_or_id--> Session Operations</h2>
<form action=leave>
You <strong>are</strong> currently working in the
<!--#var Principia-Session--> session. To
<strong>quit</strong> working in this session click on this button:
<input type=submit value="Quit Working in <!--#var Principia-Session-->">
</form>
<!--#/if-->
<!--#else-->
<h2>Inactive <!--#var title_or_id--> Session Operations</h2>
<form action=enter>
You <strong>are not</strong> currently working in the
<!--#var title_and_id-->
session. To <strong>start</strong> working in this session click
on this button:
<input type=submit value="Start Working in <!--#var title_or_id-->">
</form>
<!--#endif-->
<!--#if nonempty-->
<hr>
<p><form action=save>
You can make work done in <!--#var title_and_id--> permanent by
entering a remark in the space below and then
clicking on the "Save" button.<br>
<textarea name=remark rows=10 cols=50></textarea><br>
<input type=submit value="Save">
</form>
<hr>
<p><form action=discard>
You can throw away work done in <!--#var title_and_id--> by
clicking on the "Discard" button.
<input type=submit value="Discard">
</form>
<!--#endif-->
</body> </html>
lib/python/Products/OFSP/versionAdd.dtml
deleted
100644 → 0
View file @
788b35e3
<HTML>
<HEAD>
<TITLE>Add Session</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555">
<H2>Add Session</H2>
<FORM ACTION="manage_addSession" METHOD="POST">
<TABLE CELLSPACING="2">
<TR>
<TD ALIGN="LEFT" VALIGN="TOP">
<STRONG>Id</STONG>
</TD>
<TD ALIGN="LEFT" VALIGN="TOP">
<INPUT TYPE="TEXT" NAME="id" SIZE="40">
</TD>
</TR>
<TR>
<TD ALIGN="LEFT" VALIGN="TOP">
<EM><STRONG>Title</STRONG></EM>
</TD>
<TD ALIGN="LEFT" VALIGN="TOP">
<INPUT TYPE="TEXT" NAME="title" SIZE="40">
</TD>
</TR>
<TR>
<TD></TD>
<TD>
<BR><INPUT TYPE="SUBMIT" VALUE=" Add ">
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
lib/python/Products/OFSP/versionEdit.dtml
deleted
100644 → 0
View file @
788b35e3
<HTML>
<HEAD>
<TITLE>Edit</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555">
<!--#var manage_tabs-->
<FORM ACTION="manage_edit" METHOD="POST">
<TABLE CELLSPACING="2">
<TR>
<TD ALIGN="LEFT" VALIGN="TOP">
<STRONG>Id</STRONG>
</TD>
<TD ALIGN="LEFT" VALIGN="TOP">
<!--#var id-->
</TD>
</TR>
<TR>
<TD ALIGN="LEFT" VALIGN="TOP">
<EM><STRONG>Title</STRONG></EM>
</TD>
<TD ALIGN="LEFT" VALIGN="TOP">
<INPUT TYPE="TEXT" NAME="title" SIZE="40" VALUE="<!--#var title-->">
</TD>
</TR>
<TR>
<TD></TD>
<TD><BR><INPUT TYPE="SUBMIT" VALUE="Edit"></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