Commit 3acad336 authored by Jérome Perrin's avatar Jérome Perrin

ZMySQLDA: fixes for Zope4 ZMI

Update ZMI pages with the design of Products.ZMySQLDA and with the
usage of manage_page_header, which sets the content-type to html
parent 1c3e53ce
<html> <dtml-var manage_page_header>
<head><title><!--#var title_or_id--> tables</title></head>
<body bgcolor="#FFFFFF" link="#000099" vlink="#555555" alink="#77003B"> <dtml-with "_(management_view='Browse')">
<!--#var manage_tabs--> <dtml-var manage_tabs>
<!--#tree header=info--> </dtml-with>
<IMG SRC="<!--#var BASEPATH1-->/misc_/ZMySQLDA/<!--#var icon-->"
ALT="<!--#var Type-->" BORDER="0"> <main class="container-fluid">
<!--#var Name--><!--#var Description-->
<!--#/tree--> <dtml-tree header=info>
<img src="&dtml-SCRIPT_NAME;/misc_/ZMySQLDA/&dtml-icon;" alt="&dtml-Type;" title="&dtml-Type;" style="height:16px;width:20px;" />
</body> <b><dtml-var Name></b>&nbsp;&nbsp;<code><dtml-var description></code>
</html> </dtml-tree>
</main>
<style>
img:not([alt=table]) {
opacity:.35;
}
</style>
<dtml-var manage_page_footer>
\ No newline at end of file
<html> <dtml-var manage_page_header>
<head><title>Add Z MySQL Database Connection</title></head>
<body bgcolor="#FFFFFF" link="#000099" vlink="#555555" alink="#77003B">
<h2>Add Z MySQL Database Connection</h2>
<form action="manage_addZMySQLConnection" method="POST">
<table cellspacing="2">
<tr>
<th align="LEFT" valign="TOP">Id</th>
<td align="LEFT" valign="TOP">
<input type="TEXT" name="id" size="40"
value="MySQL_database_connection">
</td>
</tr>
<tr>
<th align="LEFT" valign="TOP"><em>Title</em></th>
<td align="LEFT" valign="TOP">
<input type="TEXT" name="title" size="40"
value="Z MySQL Database Connection">
</td>
</tr>
<tr>
<th align="LEFT" valign="TOP">
Enter a Database Connection String
<a href="#1"><sup>1</sup></a></th>
<td align="LEFT" valign="TOP">
<input type="TEXT" name="connection_string" size="40">
</td>
</tr>
<tr>
<th align="LEFT" valign="TOP">Create Deferred Connection</th>
<td align="LEFT" valign="TOP">
<input name="deferred:int" type="CHECKBOX" value="1">
</td>
</tr>
<tr>
<th align="LEFT" valign="TOP">Connect immediately</th>
<td align="LEFT" valign="TOP">
<input name="check:int" type="CHECKBOX" value="1" CHECKED>
</td>
</tr>
<tr>
<td></td>
<td><br><input type="SUBMIT" value="Add"></td>
</tr>
</table>
</form>
<main class="container-fluid">
<dtml-var "manage_form_title(this(), _, form_title='Add Z MySQL Database Connection')">
<dt><a hname="1"><sup>1</sup></a> Connection Strings</dt> <form action="manage_addZMySQLConnection" method="post">
<dd> <div class="form-group row">
<p> <label for="id" class="col-sm-4 col-md-3">
The connection string used for Z MySQL Database Connection Id
is of the form: </label>
<pre> <div class="col-sm-8 col-md-9">
[~] [*lock] [+|-][database][@unix_socket|@host[:port]] [user [password]] <input id="id" name="id" class="form-control" value="" />
</pre> </div>
or typically: </div>
<pre>
database user password
</pre>
to use a MySQL server on localhost via the standard UNIX socket.
Only specify host if the server is on a remote system. You can
use a non-standard port, if necessary. Hint: To use a non-standard
port on the local system, use 127.0.0.1 for the host instead of
localhost.
<p>
IPv6 are supported and must be surrounded with brackets.
A UNIX socket absolute path can be specified in place of a TCP address.
<p>
A '-' in front of the database tells ZMySQLDA to not use Zope's
Transaction Manager, even if the server supports transactions. A
'+' in front of the database tells ZMySQLDA that it must use
transactions; an exception will be raised if they are not
supported by the server. If neither '-' or '+' are present, then
transactions will be enabled if the server supports them. If you
are using non-transaction safe tables (TSTs) on a server that
supports TSTs, use '-'. If you require transactions, use '+'. If
you aren't sure, don't use either.
<p>
A '~' at the begining of the connection string enables client-server
exchange compression (if supported by both client and server).
<p>
*<em>lock</em> means to
psuedo-transactional. When the transaction begins, it will acquire
a lock on the server named <em>lock</em> (i.e. MYLOCK). When the
transaction commits, the lock will be released. If the transaction
is aborted and restarted, which can happen due to a ConflictError,
you'll get an error in the logs, and inconsistent data. In this
respect, it's equivalent to transactions turned off.
<p>
Transactions are highly recommended. Using a named lock in
conjunctions with transactions is probably pointless.
</dd></dl>
</body> <div class="form-group row">
</html> <label for="title" class="col-sm-4 col-md-3">
Title
</label>
<div class="col-sm-8 col-md-9">
<input id="title" name="title" type="text" class="form-control" value="" />
</div>
</div>
<div class="form-group row">
<label for="connection_string" class="col-sm-4 col-md-3">
Database Connection String&nbsp;<a href="#1"><sup>1</sup></a>
</label>
<div class="col-sm-8 col-md-9">
<input id="connection_string" name="connection_string" type="text" class="form-control" value="" />
</div>
</div>
<div class="form-group row">
<label for="check" class="col-sm-4 col-md-3">
Connect immediately
</label>
<div class="col-sm-8 col-md-9">
<input name="check" type="checkbox" value="yes" checked="checked" class="mr-1" />
<small>Open the database connection after instantiation.</small>
</div>
</div>
<div class="zmi-controls">
<input type="submit" class="btn btn-primary" value="Add" />
</div>
</form>
<hr class="my-5" />
<dl>
<dt><a name="1"><sup>1</sup></a>
Database Connection String
</dt>
<dd>
The connection string used for Z MySQL Database Connection is of the form:
<br />
<code>[*lock] [+/-][database][@host[:port]] [user [password [unix_socket]]]</code>
<br />
or typically:
<br />
<code>database user password</code>
<br />
to use a MySQL server on localhost via the standard UNIX socket.
Only specify host if the server is on a remote system. You can
use a non-standard port, if necessary. Hint: To use a non-standard
port on the local system, use 127.0.0.1 for the host instead of
localhost.
</dd>
<dd>
Either a database or a host or both must be specified.
If the UNIX socket is in a non-standard location, you can specify
the full path to it after the password.
</dd>
<dd>
A '-' in front of the database tells ZMySQLDA to not use Zope's
Transaction Manager, even if the server supports transactions. A
'+' in front of the database tells ZMySQLDA that it must use
transactions; an exception will be raised if they are not
supported by the server. If neither '-' or '+' are present, then
transactions will be enabled if the server supports them. If you
are using non-transaction safe tables (TSTs) on a server that
supports TSTs, use '-'. If you require transactions, use '+'. If
you aren't sure, don't use either.
</dd>
<dd>
*<em>lock</em> at the begining of the connection string means to
pseudo-transactional. When the transaction begins, it will acquire
a lock on the server named <em>lock</em> (i.e. MYLOCK). When the
transaction commits, the lock will be released. If the transaction
is aborted and restarted, which can happen due to a ConflictError,
you'll get an error in the logs, and inconsistent data. In this
respect, it's equivalent to transactions turned off.
</dd>
<dd>
Transactions are highly recommended. Using a named lock in
conjunctions with transactions is probably pointless.
</dd>
<dl>
</main>
<dtml-var manage_page_footer>
\ No newline at end of file
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <dtml-var manage_page_header>
<html lang="en">
<head><title>Edit <dtml-var title_or_id></title></head> <dtml-var manage_tabs>
<body bgcolor="#FFFFFF" link="#000099" vlink="#555555" alink="#77003B">
<dtml-var manage_tabs> <main class="container-fluid">
<h2>Edit <dtml-var title_or_id></h2> <div class="form-group row">
<label for="status" class="col-sm-4 col-md-3">
<form action="manage_edit" method="POST"> Status
<table cellspacing="2"> </label>
<div class="col-sm-8 col-md-9">
<tr> <div id="status" class="btn-group">
<th align="LEFT" valign="TOP">Id</th> <button type="button" class="form-control mr-2" disabled="disabled">
<td align="LEFT" valign="TOP"><dtml-var id></td> The database connection is &nbsp;
</tr> <dtml-if connected>
<span class="badge badge-success">OPEN</span>
<tr> <dtml-else>
<th align="LEFT" valign="TOP"><em>Title</em></th> <span class="badge badge-danger">CLOSED</span>
<td align="LEFT" valign="TOP"> </dtml-if>
<input type="TEXT" name="title" size="40" </button>
value="<dtml-var title html_quote>"> <dtml-if connected>
</td> <form action="manage_close_connection" method="get">
</tr> <input class="btn btn-primary" type="submit" name="submit" value="Close Connection" />
</form>
<tr> <dtml-else>
<th align="LEFT" valign="TOP">Database Connection String</th> <form action="manage_open_connection" method="get">
<td align="LEFT" valign="TOP"> <input class="btn btn-primary" type="submit" name="submit" value="Open Connection" />
<input type="TEXT" name="connection_string" size="40" </form>
value="<dtml-var connection_string html_quote>"> </dtml-if>
</td> </div>
</tr> </div>
<tr> </div>
<th align="LEFT" valign="TOP">Connect immediately</th>
<td align="LEFT" valign="TOP">
<input name="check:int" type="CHECKBOX" value="1" CHECKED> <form action="manage_edit" method="post" title="">
</td>
</tr> <div class="form-group row">
<label for="id" class="col-sm-4 col-md-3">
<tr> Id
<td></td> </label>
<td><br><input type="SUBMIT" value="Change"></td> <div class="col-sm-8 col-md-9">
</tr> <input id="id" class="form-control" disabled="disabled" value="<dtml-var id>" />
</div>
</table> </div>
</form>
<div class="form-group row">
</body> <label for="title" class="col-sm-4 col-md-3">
</html> Title
</label>
<div class="col-sm-8 col-md-9">
<input name="title" id="title" type="text" class="form-control"
value="<dtml-var title html_quote>" />
</div>
</div>
<div class="form-group row">
<label for="connection_string" class="col-sm-4 col-md-3">
Database Connection String&nbsp;<a href="#1"><sup>1</sup></a>
</label>
<div class="col-sm-8 col-md-9">
<input id="connection_string" type="text" name="connection_string" class="form-control"
value="<dtml-var connection_string html_quote>" />
</div>
</div>
<div class="form-group row">
<label for="check" class="col-sm-4 col-md-3">
Connect immediately
</label>
<div class="col-sm-8 col-md-9">
<input name="check" type="checkbox" value="yes" checked="checked" />
</div>
</div>
<div class="zmi-controls">
<input type="submit" class="btn btn-primary" value="Change">
</div>
</form>
<hr class="my-5" />
<dl>
<dt><a name="1"><sup>1</sup></a>
Database Connection String
</dt>
<dd>
Information about how to format the connection string can be found
in the <a href="https://zmysqlda.readthedocs.io/en/latest/connstring.html">
documentation</a>.
</dd>
<dl>
</main>
<dtml-var manage_page_footer>
\ No newline at end of file
<dtml-var standard_html_header> <dtml-var standard_html_header>
<dtml-var TABLE_TYPE><dtml-if TABLE_OWNER> <dtml-var Type><dtml-if table_owner>
owned by <dtml-var TABLE_OWNER></dtml-if> owned by <dtml-var table_owner></dtml-if>
<dtml-if REMARKS><br><dtml-var REMARKS></dtml-if> <dtml-if remarks><br><dtml-var remarks></dtml-if>
<dtml-var standard_html_footer> <dtml-var standard_html_footer>
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment