Skip to content

Commit

Permalink
Merged mgmt interface quick fix branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Unknown committed Jan 8, 2001
1 parent f617368 commit 92e96b2
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 94 deletions.
19 changes: 9 additions & 10 deletions ExternalMethod.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,17 @@
This product provides support for external methods, which allow
domain-specific customization of web environments.
"""
__version__='$Revision: 1.40 $'[11:-2]
__version__='$Revision: 1.41 $'[11:-2]
from Globals import Persistent, HTMLFile, MessageDialog, HTML
import OFS.SimpleItem, Acquisition
from string import split, join, find, lower
import AccessControl.Role, sys, os, stat, traceback
from OFS.SimpleItem import pretty_tb
from App.Extensions import getObject, getPath, FuncCode
from Globals import DevelopmentMode
from App.Management import Navigation

manage_addExternalMethodForm=HTMLFile('methodAdd', globals())
manage_addExternalMethodForm=HTMLFile('dtml/methodAdd', globals())

def manage_addExternalMethod(self, id, title, module, function, REQUEST=None):
"""Add an external method to a folder
Expand Down Expand Up @@ -132,7 +133,7 @@ def manage_addExternalMethod(self, id, title, module, function, REQUEST=None):
return self.manage_main(self,REQUEST)

class ExternalMethod(OFS.SimpleItem.Item, Persistent, Acquisition.Explicit,
AccessControl.Role.RoleManager):
AccessControl.Role.RoleManager, Navigation):
"""Web-callable functions that encapsulate external python functions.
The function is defined in an external file. This file is treated
Expand All @@ -155,7 +156,7 @@ class ExternalMethod(OFS.SimpleItem.Item, Persistent, Acquisition.Explicit,

ZopeTime=Acquisition.Acquired
HelpSys=Acquisition.Acquired

manage_options=(
(
{'label':'Properties', 'action':'manage_main',
Expand All @@ -177,7 +178,7 @@ def __init__(self, id, title, module, function):
self.id=id
self.manage_edit(title, module, function)

manage_main=HTMLFile('methodEdit', globals())
manage_main=HTMLFile('dtml/methodEdit', globals())
def manage_edit(self, title, module, function, REQUEST=None):
"""Change the external method
Expand All @@ -199,11 +200,9 @@ def manage_edit(self, title, module, function, REQUEST=None):
self._module=module
self._function=function
self.getFunction(1,1)
if REQUEST: return MessageDialog(
title ='Changed %s' % self.id,
message='%s has been updated' % self.id,
action =REQUEST['URL1']+'/manage_main',
target ='manage_main')
if REQUEST:
message="External Method Uploaded."
return self.manage_main(self,REQUEST,manage_tabs_message=message)

def getFunction(self, check=0, reload=0):

Expand Down
72 changes: 72 additions & 0 deletions dtml/methodAdd.dtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<dtml-var manage_page_header>

<dtml-var "manage_form_title(this(), _,
form_title='Add External Method',
help_product='ExternalMethod',
help_topic='External-Method_Add.stx'
)">

<p class="form-help">
External Methods allow you to add functionality to Zope by writing Python
functions which are exposed as callable Zope objects. The <em>module name</em>
should give the name of the Python module without the &quot;.py&quot;
file extension. The <em>function name</em> should name a callable object
found in the module.
</p>

<form action="manage_addExternalMethod" method="post">
<table cellspacing="0" cellpadding="2" border="0">
<tr>
<td align="left" valign="top">
<div class="form-label">
Id
</div>
</td>
<td align="left" valign="top">
<input type="text" name="id" size="40" />
</td>
</tr>
<tr>
<td align="left" valign="top">
<div class="form-optional">
Title
</div>
</td>
<td align="left" valign="top">
<input type="text" name="title" size="40" />
</td>
</tr>
<tr>
<td align="left" valign="top">
<div class="form-label">
Module Name
</div>
</td>
<td align="left" valign="top">
<input type="text" name="module" size="40" />
</td>
</tr>
<tr>
<td align="left" valign="top">
<div class="form-label">
Function Name
</div>
</td>
<td align="left" valign="top">
<input type="text" name="function" size="40" />
</td>
</tr>
<tr>
<td align="left" valign="top">
</td>
<td align="left" valign="top">
<div class="form-element">
<input class="form-element" type="submit" name="submit"
value=" Add " />
</div>
</td>
</tr>
</table>
</form>

<dtml-var manage_page_footer>
63 changes: 63 additions & 0 deletions dtml/methodEdit.dtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<dtml-var manage_page_header>
<dtml-var manage_tabs>

<form action="manage_edit" method="post">
<table cellspacing="0" cellpadding="2" border="0">
<tr>
<td align="left" valign="top">
<div class="form-label">
Id
</div>
</td>
<td align="left" valign="top">
<input type="text" name="id" size="40"
value="<dtml-var id html_quote>" />
</td>
</tr>
<tr>
<td align="left" valign="top">
<div class="form-optional">
Title
</div>
</td>
<td align="left" valign="top">
<input type="text" name="title" size="40"
value="<dtml-var title html_quote>" />
</td>
</tr>
<tr>
<td align="left" valign="top">
<div class="form-label">
Module Name
</div>
</td>
<td align="left" valign="top">
<input type="text" name="module" size="40"
value="<dtml-var module html_quote>" />
</td>
</tr>
<tr>
<td align="left" valign="top">
<div class="form-label">
Function Name
</div>
</td>
<td align="left" valign="top">
<input type="text" name="function" size="40"
value="<dtml-var function html_quote>" />
</td>
</tr>
<tr>
<td align="left" valign="top">
</td>
<td align="left" valign="top">
<div class="form-element">
<input class="form-element" type="submit" name="submit"
value="Save Changes" />
</div>
</td>
</tr>
</table>
</form>

<dtml-var manage_page_footer>
47 changes: 0 additions & 47 deletions methodAdd.dtml

This file was deleted.

37 changes: 0 additions & 37 deletions methodEdit.dtml

This file was deleted.

0 comments on commit 92e96b2

Please sign in to comment.