mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-21 00:00:13 +02:00
05f34a3fa7
Please see this example: list all database tables: http://localhost:8090/api/table_p.xml now create a new table and insert some values into 'mytable' http://localhost:8090/api/table_p.xml?table=mytable&pk=&commitrow=&col_termin=Release%20Machen&col_datum=24.11.2011&col_status=ongoing list the table content: http://localhost:8090/api/table_p.xml?table=mytable&pk= update the table and change a single value inside. You must refer to the row using a primary key 'pk' http://localhost:8090/api/table_p.xml?table=mytable&pk=000000000001&commitrow=&col_datum=29.11.2011 you can also select rows using a search operator http://localhost:8090/api/table_p.xml?table=mytable&pk=&count=10&search= now lets delete the row: http://localhost:8090/api/table_p.xml?table=mytable&pk=&deleterows=pk_000000000001 and we can also delete the complete table: http://localhost:8090/api/table_p.xml?table=mytable&deletetable= You can use this to administrate the robots, bookmarks and API steering using an outside application! git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@8071 6c8d7289-2bf4-0310-a012-ef5d649a1542
131 lines
4.8 KiB
HTML
131 lines
4.8 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<title>YaCy '#[clientname]#': Table Viewer</title>
|
|
#(showtable)#::
|
|
<link rel="alternate" type="application/xml" title="Tables" href="Tables.rss?table=#[table]#" />
|
|
#(/showtable)#
|
|
#%env/templates/metas.template%#
|
|
<script type="text/javascript">
|
|
<!--
|
|
function setall(name, check){
|
|
var selectForm = document.forms.namedItem(name);
|
|
var count = selectForm.elements["num"].value;
|
|
if (check) for(i = 0; i < count; i++) {
|
|
if (selectForm.elements["item_" + i].checked) {
|
|
check = false;
|
|
break;
|
|
}
|
|
}
|
|
for(i = 0; i < count; i++) {
|
|
selectForm.elements["item_" + i].checked = check;
|
|
}
|
|
}
|
|
-->
|
|
</script>
|
|
<script type="text/javascript" src="/js/sorttable.js"></script>
|
|
</head>
|
|
<body id="Tables">
|
|
|
|
<script type="text/javascript">
|
|
//<![CDATA[
|
|
if (window.location.search.length > 1) {
|
|
document.write("<div id=\"api\">\<a href=\"/api/table_p.xml" + window.location.search + "\"\><img src=\"env/grafics/api.png\" width=\"60\" height=\"40\" alt=\"API\"/></a></div>");
|
|
}
|
|
//]]>
|
|
</script>
|
|
|
|
#%env/templates/header.template%#
|
|
#%env/templates/submenuConfig.template%#
|
|
#(showselection)#::
|
|
<h2>Table Administration</h2>
|
|
<form action="Tables_p.html" method="get" accept-charset="UTF-8">
|
|
<fieldset><legend>Table Selection</legend>
|
|
<dl>
|
|
<dt class="TableCellDark">Select Table:
|
|
<select name="table" onchange='this.form.submit()'>
|
|
#{tables}#
|
|
<option value="#[name]#" #(selected)#::selected="selected"#(/selected)#>#[name]#</option>
|
|
#{/tables}#
|
|
</select>
|
|
</dt>
|
|
<dd> </dd>
|
|
<dt>
|
|
show max.
|
|
<select name="count" onchange='this.form.submit()'>
|
|
<option value="10">10</option>
|
|
<option value="100" selected="selected">100</option>
|
|
<option value="1000">1000</option>
|
|
<option value="all">all</option>
|
|
</select>
|
|
entries,
|
|
</dt>
|
|
<dd> </dd>
|
|
<dt>
|
|
search rows for
|
|
<input type="text" name="search" value="#[pattern]#" />
|
|
</dt>
|
|
<dd><input type="submit" name="edittable" value="Search" /></dd>
|
|
</dl>
|
|
</fieldset>
|
|
</form>
|
|
#(/showselection)#
|
|
#(showtable)#::
|
|
<form action="Tables_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8" id="tablelisting">
|
|
<fieldset>
|
|
<legend><label for="tablelisting">Table Editor: showing table '#[table]#'</label></legend>
|
|
<table class="sortable" border="0" cellpadding="2" cellspacing="1">
|
|
<tr class="TableHeader" valign="bottom">
|
|
<td><input type="checkbox" name="allswitch" onclick="setall(this.form.name, this.value)" /></td>
|
|
<td>PK</td>
|
|
#{columns}#
|
|
<td>#[header]#</td>
|
|
#{/columns}#
|
|
</tr>
|
|
#{list}#
|
|
<tr class="TableCell#(dark)#Light::Dark::Summary#(/dark)#">
|
|
<td align="left"><input type="checkbox" name="item_#[count]#" value="pk_#[pk]#" /></td>
|
|
<td>#[pk]#</td>
|
|
#{columns}#
|
|
<td align="left">#[cell]#</td>
|
|
#{/columns}#
|
|
</tr>
|
|
#{/list}#
|
|
</table>
|
|
<p>
|
|
<input type="hidden" name="table" value="#[table]#" />
|
|
<input type="hidden" name="num" value="#[num]#" />
|
|
<input type="submit" name="editrow" value="Edit Selected Row" />
|
|
<input type="submit" name="addrow" value="Add a new Row" />
|
|
<input type="submit" name="deleterows" value="Delete Selected Rows" />
|
|
<input type="submit" name="deletetable" value="Delete Table" />
|
|
</p>
|
|
</fieldset>
|
|
</form>
|
|
#(/showtable)#
|
|
#(showedit)#::
|
|
<form action="Tables_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
|
|
<fieldset><legend>Row Editor</legend>
|
|
<dl>
|
|
<dt class="TableCellLight">Primary Key</dt>
|
|
<dd>#[pk]#</dd>
|
|
#{list}#
|
|
<dt class="TableCellLight">#[key]#</dt>
|
|
<dd>
|
|
<input type="text" name="col_#[key]#" value="#[value]#" size="80"/>
|
|
</dd>
|
|
#{/list}#
|
|
<dt class="TableCellDark"></dt>
|
|
<dd>
|
|
<input type="hidden" name="table" value="#[table]#" />
|
|
<input type="hidden" name="pk" value="#[pk]#" />
|
|
<input type="submit" name="commitrow" value="Commit" />
|
|
</dd>
|
|
</dl>
|
|
</fieldset>
|
|
</form>
|
|
#(/showedit)#
|
|
#%env/templates/footer.template%#
|
|
</body>
|
|
</html>
|