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
2c846b92
Commit
2c846b92
authored
Jan 07, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split out Database Methods
parent
212b2a7f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
219 additions
and
0 deletions
+219
-0
lib/python/Products/ZSQLMethods/SQL.py
lib/python/Products/ZSQLMethods/SQL.py
+63
-0
lib/python/Products/ZSQLMethods/__init__.py
lib/python/Products/ZSQLMethods/__init__.py
+49
-0
lib/python/Products/ZSQLMethods/add.dtml
lib/python/Products/ZSQLMethods/add.dtml
+47
-0
lib/python/Products/ZSQLMethods/edit.dtml
lib/python/Products/ZSQLMethods/edit.dtml
+60
-0
No files found.
lib/python/Products/ZSQLMethods/SQL.py
0 → 100644
View file @
2c846b92
#!/bin/env python
##############################################################################
#
# Copyright
#
# Copyright 1996 Digital Creations, L.C., 910 Princess Anne
# Street, Suite 300, Fredericksburg, Virginia 22401 U.S.A. All
# rights reserved.
#
##############################################################################
__doc__
=
'''SQL Methods
$Id: SQL.py,v 1.1 1998/01/07 16:29:29 jim Exp $'''
__version__
=
'$Revision: 1.1 $'
[
11
:
-
2
]
import
AqueductDA.DA
from
Globals
import
HTMLFile
def
SQLConnectionIDs
(
self
):
ids
=
{}
have_id
=
ids
.
has_key
StringType
=
type
(
''
)
while
self
is
not
None
:
if
hasattr
(
self
,
'objectValues'
):
for
o
in
self
.
objectValues
():
if
(
hasattr
(
o
,
'_isAnSQLConnection'
)
and
o
.
_isAnSQLConnection
and
hasattr
(
o
,
'id'
)):
id
=
o
.
id
if
type
(
id
)
is
not
StringType
:
id
=
id
()
if
not
have_id
(
id
):
if
hasattr
(
o
,
'title_and_id'
):
o
=
o
.
title_and_id
()
else
:
o
=
id
ids
[
id
]
=
id
if
hasattr
(
self
,
'aq_parent'
):
self
=
self
.
aq_parent
else
:
self
=
None
ids
=
map
(
lambda
item
:
(
item
[
1
],
item
[
0
]),
ids
.
items
())
ids
.
sort
()
return
ids
addForm
=
HTMLFile
(
'add'
,
globals
())
def
add
(
self
,
id
,
title
,
connection_id
,
arguments
,
template
,
REQUEST
=
None
):
"""Add a SQL Method to a folder"""
self
.
_setObject
(
id
,
SQL
(
id
,
title
,
connection_id
,
arguments
,
template
))
if
REQUEST
is
not
None
:
return
self
.
manage_main
(
self
,
REQUEST
)
class
SQL
(
AqueductDA
.
DA
.
DA
):
meta_type
=
'Aqueduct SQL Database Method'
icon
=
'misc_/AqueductSQLMethods/icon'
manage_main
=
HTMLFile
(
'edit'
,
globals
())
##############################################################################
#
# $Log: SQL.py,v $
# Revision 1.1 1998/01/07 16:29:29 jim
# Split out Database Methods
#
#
lib/python/Products/ZSQLMethods/__init__.py
0 → 100644
View file @
2c846b92
#!/bin/env python
##############################################################################
#
# Copyright
#
# Copyright 1996 Digital Creations, L.C., 910 Princess Anne
# Street, Suite 300, Fredericksburg, Virginia 22401 U.S.A. All
# rights reserved.
#
##############################################################################
__doc__
=
'''SQL Method Product
$Id: __init__.py,v 1.1 1998/01/07 16:29:29 jim Exp $'''
__version__
=
'$Revision: 1.1 $'
[
11
:
-
2
]
from
ImageFile
import
ImageFile
import
Aqueduct.Search
,
SQL
meta_types
=
(
{
'name'
:
'Aqueduct SQL Database Method'
,
'action'
:
'manage_addAqueductSQLMethodForm'
,
},
{
'name'
:
'Aqueduct Search Interface'
,
'action'
:
'manage_addAqueductSearchForm'
},
)
methods
=
{
'manage_addAqueductSQLMethod'
:
SQL
.
add
,
'manage_addAqueductSQLMethodForm'
:
SQL
.
addForm
,
'SQLConnectionIDs'
:
SQL
.
SQLConnectionIDs
,
'manage_addAqueductSearchForm'
:
Aqueduct
.
Search
.
addForm
,
'manage_addAqueductSearch'
:
Aqueduct
.
Search
.
add
,
'aqueductQueryIds'
:
Aqueduct
.
Search
.
aqueductQueryIds
,
}
misc_
=
{
'icon'
:
ImageFile
(
'AqueductDA/www/DBAdapter_icon.gif'
),
}
##############################################################################
#
# $Log: __init__.py,v $
# Revision 1.1 1998/01/07 16:29:29 jim
# Split out Database Methods
#
#
lib/python/Products/ZSQLMethods/add.dtml
0 → 100644
View file @
2c846b92
<HTML><HEAD><TITLE>New SQL Method</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555">
<H2>New SQL Method</H2>
<!--#if SQLConnectionIDs-->
<form action="manage_addAqueductSQLMethod" method="post">
<table>
<tr> <th>Id</th>
<td><input name="id" size="40"></td></tr>
<tr> <th><em>Title<em></th>
<td><input name="title" size="40"></td></tr>
<tr> <th>Connection id</th>
<td><select name="connection_id">
<!--#in SQLConnectionIDs-->
<option value="<!--#var sequence-item-->">
<!--#var sequence-key--></option>
<!--#/in-->
</select></td></tr>
<tr> <th><em>Arguments<em></th>
<td><input name="arguments" size="40"></td></tr>
<tr> <td colspan=2><strong>Query template</strong><br>
<textarea name="template:text" rows=9 cols=50>
select *
from data
</textarea></td></tr>
<tr><td><input type="hidden" name="key" value=""></td><td>
<input type="SUBMIT" name="SUBMIT" value="Add">
</td></tr>
</table>
</form>
<!--#else-->
<em><strong>Warning:</strong>
There are no SQL database connections. You need
to add an Aqueduct SQL database connection
before you can use an Aqueduct SQL database adapter.
</em>
<!--#/if-->
</body></html>
lib/python/Products/ZSQLMethods/edit.dtml
0 → 100644
View file @
2c846b92
<HTML><HEAD><TITLE>Edit <!--#var title_or_id--></TITLE></HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555">
<!--#var manage_tabs-->
<H2>Edit <!--#var title_or_id--></H2>
<!--#if SQLConnectionIDs-->
<!--#if connectionIsValid-->
<!--#if connected--><!--#else-->
<strong>Warning:</strong>
The database connection used by this method is currently not
open.
<!--#/if-->
<!--#else-->
<strong>Warning:</strong>
The database connection for this method cannot be found!
<!--#/if-->
<form action="manage_edit" method="POST">
<table>
<tr> <th>ID</th>
<td><!--#var id--></td></tr>
<tr> <th><em>Title</em></th>
<td><input name="title" size="40"
value="<!--#var title-->"></td></tr>
<tr> <th>Connection id</th>
<td><select name="connection_id">
<!--#in SQLConnectionIDs-->
<option value="<!--#var sequence-item-->"
<!--#if expr="connection_id==_vars['sequence-item']"-->
SELECTED<!--#/if-->>
<!--#var sequence-key--></option>
<!--#/in-->
</select></td></tr>
<tr> <th><em>Arguments</em></th>
<td><input name="arguments" size="40"
value="<!--#var arguments_src-->"></td>
</tr>
<tr> <td colspan=2><strong>Query template</strong><br>
<textarea name="template:text" rows=10 cols=50>
<!--#var src fmt=html-quote-->
</textarea></td></tr>
<tr><td></td><td><input type="SUBMIT" name="SUBMIT" value="Change"></td></tr>
</table>
</form>
<!--#else-->
<em><strong>Warning:</strong>
There are no SQL database connections. You need
to add an Aqueduct SQL database connection
before you can use an Aqueduct SQL database adapter.
</em>
<!--#/if-->
</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