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
9cb8712d
Commit
9cb8712d
authored
Dec 23, 1997
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
up to date with product and security layout
parent
bbef28ee
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
14 deletions
+28
-14
lib/python/Products/ExternalMethod/ExternalMethod.py
lib/python/Products/ExternalMethod/ExternalMethod.py
+18
-9
lib/python/Products/ExternalMethod/__init__.py
lib/python/Products/ExternalMethod/__init__.py
+7
-3
lib/python/Products/ExternalMethod/methodAdd.dtml
lib/python/Products/ExternalMethod/methodAdd.dtml
+1
-1
lib/python/Products/ExternalMethod/methodEdit.dtml
lib/python/Products/ExternalMethod/methodEdit.dtml
+2
-1
No files found.
lib/python/Products/ExternalMethod/ExternalMethod.py
View file @
9cb8712d
...
@@ -7,25 +7,25 @@ domain-specific customization of web environments.
...
@@ -7,25 +7,25 @@ domain-specific customization of web environments.
from
Acquisition
import
Implicit
from
Acquisition
import
Implicit
from
Globals
import
Persistent
,
HTMLFile
,
MessageDialog
from
Globals
import
Persistent
,
HTMLFile
,
MessageDialog
import
OFS.SimpleItem
import
OFS.SimpleItem
,
os
from
string
import
split
,
join
from
string
import
split
,
join
import
AccessControl.Role
import
AccessControl.Role
braindir
=
SOFTWARE_HOME
+
'/Extensions'
braindir
=
SOFTWARE_HOME
+
'/Extensions'
modules
=
{}
modules
=
{}
addForm
=
HTMLFile
(
'
ExternalMethod/methodAdd'
)
addForm
=
HTMLFile
(
'
methodAdd'
,
globals
()
)
def
add
(
self
,
id
,
title
,
external_name
,
acl_type
=
'A'
,
acl_roles
=
[],
REQUEST
=
None
):
def
add
(
self
,
id
,
title
,
external_name
,
REQUEST
=
None
):
"""Add an external method to a folder"""
"""Add an external method to a folder"""
names
=
split
(
external_name
,
'.'
)
names
=
split
(
external_name
,
'.'
)
module
,
function
=
join
(
names
[:
-
1
],
'.'
),
names
[
-
1
]
module
,
function
=
join
(
names
[:
-
1
],
'.'
),
names
[
-
1
]
i
=
ExternalMethod
(
id
,
title
,
module
,
function
)
i
=
ExternalMethod
(
id
,
title
,
module
,
function
)
i
.
_setRoles
(
acl_type
,
acl_roles
)
self
.
_setObject
(
id
,
i
)
self
.
_setObject
(
id
,
i
)
return
self
.
manage_main
(
self
,
REQUEST
)
return
self
.
manage_main
(
self
,
REQUEST
)
class
ExternalMethod
(
OFS
.
SimpleItem
.
Item
,
Persistent
,
AccessControl
.
Role
.
RoleManager
):
class
ExternalMethod
(
OFS
.
SimpleItem
.
Item
,
Persistent
,
AccessControl
.
Role
.
RoleManager
):
"""An external method is a web-callable function that encapsulates
"""An external method is a web-callable function that encapsulates
an external function."""
an external function."""
...
@@ -34,6 +34,17 @@ class ExternalMethod(OFS.SimpleItem.Item, Persistent, AccessControl.Role.RoleMan
...
@@ -34,6 +34,17 @@ class ExternalMethod(OFS.SimpleItem.Item, Persistent, AccessControl.Role.RoleMan
func_defaults
=
()
func_defaults
=
()
func_code
=
None
func_code
=
None
manage_options
=
(
{
'icon'
:
icon
,
'label'
:
'Properties'
,
'action'
:
'manage_main'
,
'target'
:
'manage_main'
},
{
'icon'
:
icon
,
'label'
:
'Try It'
,
'action'
:
''
,
'target'
:
'manage_main'
},
{
'icon'
:
'AccessControl/AccessControl_icon.gif'
,
'label'
:
'Access Control'
,
'action'
:
'manage_rolesForm'
,
'target'
:
'manage_main'
},
)
def
__init__
(
self
,
id
=
''
,
title
=
''
,
module
=
''
,
function
=
''
):
def
__init__
(
self
,
id
=
''
,
title
=
''
,
module
=
''
,
function
=
''
):
if
id
:
if
id
:
self
.
id
=
id
self
.
id
=
id
...
@@ -43,9 +54,8 @@ class ExternalMethod(OFS.SimpleItem.Item, Persistent, AccessControl.Role.RoleMan
...
@@ -43,9 +54,8 @@ class ExternalMethod(OFS.SimpleItem.Item, Persistent, AccessControl.Role.RoleMan
self
.
getFunction
()
self
.
getFunction
()
self
.
_p_atime
=
1
self
.
_p_atime
=
1
manage
=
HTMLFile
(
'ExternalMethod/methodEdit'
)
manage_main
=
HTMLFile
(
'methodEdit'
,
globals
())
def
manage_edit
(
self
,
title
,
external_name
,
acl_type
=
'A'
,
acl_roles
=
[],
def
manage_edit
(
self
,
title
,
REQUEST
=
None
):
REQUEST
=
None
):
"Change the external method"
"Change the external method"
self
.
title
=
title
self
.
title
=
title
names
=
split
(
external_name
,
'.'
)
names
=
split
(
external_name
,
'.'
)
...
@@ -53,7 +63,6 @@ class ExternalMethod(OFS.SimpleItem.Item, Persistent, AccessControl.Role.RoleMan
...
@@ -53,7 +63,6 @@ class ExternalMethod(OFS.SimpleItem.Item, Persistent, AccessControl.Role.RoleMan
self
.
_module
=
module
self
.
_module
=
module
self
.
_function
=
function
self
.
_function
=
function
self
.
getFunction
()
self
.
getFunction
()
self
.
_setRoles
(
acl_type
,
acl_roles
)
if
REQUEST
:
return
MessageDialog
(
if
REQUEST
:
return
MessageDialog
(
title
=
'Changed %s'
%
self
.
id
,
title
=
'Changed %s'
%
self
.
id
,
message
=
'%s has been updated'
%
self
.
id
,
message
=
'%s has been updated'
%
self
.
id
,
...
...
lib/python/Products/ExternalMethod/__init__.py
View file @
9cb8712d
...
@@ -8,8 +8,8 @@
...
@@ -8,8 +8,8 @@
#
#
##############################################################################
##############################################################################
__doc__
=
'''External Method Product Initialization
__doc__
=
'''External Method Product Initialization
$Id: __init__.py,v 1.
3 1997/12/22 15:18:13 jeffrey
Exp $'''
$Id: __init__.py,v 1.
4 1997/12/23 22:15:34 jim
Exp $'''
__version__
=
'$Revision: 1.
3
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
4
$'
[
11
:
-
2
]
import
ExternalMethod
import
ExternalMethod
from
ImageFile
import
ImageFile
from
ImageFile
import
ImageFile
...
@@ -23,13 +23,17 @@ methods={
...
@@ -23,13 +23,17 @@ methods={
'manage_addExternalMethod'
:
ExternalMethod
.
add
,
'manage_addExternalMethod'
:
ExternalMethod
.
add
,
}
}
misc_
=
{
'function_icon'
:
ImageFile
(
'function.gif'
,
globals
())}
misc_
=
{
'function_icon'
:
ImageFile
(
'www/function.gif'
,
globals
())}
##############################################################################
##############################################################################
#
#
# $Log: __init__.py,v $
# $Log: __init__.py,v $
# Revision 1.4 1997/12/23 22:15:34 jim
# up to date with product and security layout
#
# Revision 1.3 1997/12/22 15:18:13 jeffrey
# Revision 1.3 1997/12/22 15:18:13 jeffrey
# typo fix
# typo fix
#
#
...
...
lib/python/Products/ExternalMethod/methodAdd.dtml
View file @
9cb8712d
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
<TITLE>New External Method</TITLE>
<TITLE>New External Method</TITLE>
</HEAD>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555" ALINK="#77003B">
<BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555" ALINK="#77003B">
<h2>New External Method</h2>
<h2>New External Method</h2>
<FORM ACTION="manage_addExternalMethod" METHOD="POST">
<FORM ACTION="manage_addExternalMethod" METHOD="POST">
...
@@ -15,7 +16,6 @@
...
@@ -15,7 +16,6 @@
<TD ALIGN="LEFT" VALIGN="TOP"><B>Title</B></TD>
<TD ALIGN="LEFT" VALIGN="TOP"><B>Title</B></TD>
<TD ALIGN="LEFT" VALIGN="TOP"><INPUT TYPE="TEXT" NAME="title" SIZE="50"></TD>
<TD ALIGN="LEFT" VALIGN="TOP"><INPUT TYPE="TEXT" NAME="title" SIZE="50"></TD>
</TR>
</TR>
<!--#var smallRolesWidget-->
<TR>
<TR>
<TD ALIGN="LEFT" VALIGN="TOP"><B>External name</B></TD>
<TD ALIGN="LEFT" VALIGN="TOP"><B>External name</B></TD>
<TD ALIGN="LEFT" VALIGN="TOP">
<TD ALIGN="LEFT" VALIGN="TOP">
...
...
lib/python/Products/ExternalMethod/methodEdit.dtml
View file @
9cb8712d
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
<TITLE>Edit <!--#var title_or_id--></TITLE>
<TITLE>Edit <!--#var title_or_id--></TITLE>
</HEAD>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555" ALINK="#77003B">
<BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555" ALINK="#77003B">
<!--#var manage_tabs-->
<h2>Edit <!--#var title_or_id--></h2>
<h2>Edit <!--#var title_or_id--></h2>
<FORM ACTION="manage_edit" METHOD="POST">
<FORM ACTION="manage_edit" METHOD="POST">
...
@@ -17,7 +19,6 @@
...
@@ -17,7 +19,6 @@
<INPUT TYPE="TEXT" NAME="title" SIZE="50" VALUE="<!--#var title-->">
<INPUT TYPE="TEXT" NAME="title" SIZE="50" VALUE="<!--#var title-->">
</TD>
</TD>
</TR>
</TR>
<!--#var smallRolesWidget-->
<TR>
<TR>
<TD ALIGN="LEFT" VALIGN="TOP"><B>External name</B></TD>
<TD ALIGN="LEFT" VALIGN="TOP"><B>External name</B></TD>
<TD ALIGN="LEFT" VALIGN="TOP">
<TD ALIGN="LEFT" VALIGN="TOP">
...
...
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