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>
<head><title><!--#var title_or_id--> tables</title></head>
<body bgcolor="#FFFFFF" link="#000099" vlink="#555555" alink="#77003B">
<!--#var manage_tabs-->
<!--#tree header=info-->
<IMG SRC="<!--#var BASEPATH1-->/misc_/ZMySQLDA/<!--#var icon-->"
ALT="<!--#var Type-->" BORDER="0">
<!--#var Name--><!--#var Description-->
<!--#/tree-->
</body>
</html>
<dtml-var manage_page_header>
<dtml-with "_(management_view='Browse')">
<dtml-var manage_tabs>
</dtml-with>
<main class="container-fluid">
<dtml-tree header=info>
<img src="&dtml-SCRIPT_NAME;/misc_/ZMySQLDA/&dtml-icon;" alt="&dtml-Type;" title="&dtml-Type;" style="height:16px;width:20px;" />
<b><dtml-var Name></b>&nbsp;&nbsp;<code><dtml-var description></code>
</dtml-tree>
</main>
<style>
img:not([alt=table]) {
opacity:.35;
}
</style>
<dtml-var manage_page_footer>
\ No newline at end of file
<html>
<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>
<dtml-var manage_page_header>
<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>
<dd>
<p>
The connection string used for Z MySQL Database Connection
is of the form:
<pre>
[~] [*lock] [+|-][database][@unix_socket|@host[:port]] [user [password]]
</pre>
or typically:
<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>
<form action="manage_addZMySQLConnection" method="post">
<div class="form-group row">
<label for="id" class="col-sm-4 col-md-3">
Id
</label>
<div class="col-sm-8 col-md-9">
<input id="id" name="id" class="form-control" value="" />
</div>
</div>
</body>
</html>
<div class="form-group row">
<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">
<html lang="en">
<head><title>Edit <dtml-var title_or_id></title></head>
<body bgcolor="#FFFFFF" link="#000099" vlink="#555555" alink="#77003B">
<dtml-var manage_tabs>
<h2>Edit <dtml-var title_or_id></h2>
<form action="manage_edit" method="POST">
<table cellspacing="2">
<tr>
<th align="LEFT" valign="TOP">Id</th>
<td align="LEFT" valign="TOP"><dtml-var id></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="<dtml-var title html_quote>">
</td>
</tr>
<tr>
<th align="LEFT" valign="TOP">Database Connection String</th>
<td align="LEFT" valign="TOP">
<input type="TEXT" name="connection_string" size="40"
value="<dtml-var connection_string html_quote>">
</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="Change"></td>
</tr>
</table>
</form>
</body>
</html>
<dtml-var manage_page_header>
<dtml-var manage_tabs>
<main class="container-fluid">
<div class="form-group row">
<label for="status" class="col-sm-4 col-md-3">
Status
</label>
<div class="col-sm-8 col-md-9">
<div id="status" class="btn-group">
<button type="button" class="form-control mr-2" disabled="disabled">
The database connection is &nbsp;
<dtml-if connected>
<span class="badge badge-success">OPEN</span>
<dtml-else>
<span class="badge badge-danger">CLOSED</span>
</dtml-if>
</button>
<dtml-if connected>
<form action="manage_close_connection" method="get">
<input class="btn btn-primary" type="submit" name="submit" value="Close Connection" />
</form>
<dtml-else>
<form action="manage_open_connection" method="get">
<input class="btn btn-primary" type="submit" name="submit" value="Open Connection" />
</form>
</dtml-if>
</div>
</div>
</div>
<form action="manage_edit" method="post" title="">
<div class="form-group row">
<label for="id" class="col-sm-4 col-md-3">
Id
</label>
<div class="col-sm-8 col-md-9">
<input id="id" class="form-control" disabled="disabled" value="<dtml-var id>" />
</div>
</div>
<div class="form-group row">
<label for="title" class="col-sm-4 col-md-3">
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 TABLE_TYPE><dtml-if TABLE_OWNER>
owned by <dtml-var TABLE_OWNER></dtml-if>
<dtml-if REMARKS><br><dtml-var REMARKS></dtml-if>
<dtml-var Type><dtml-if table_owner>
owned by <dtml-var table_owner></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