yacy_search_server/htroot/api/push_p.html
Michael Peter Christen 36e623d8bf enhanced metadata enrichment for media file type search:
- Web servers may now deliver YaCy-specific http header field with a
title and keywords. The new http header fields are:
X-YaCy-Media-Title - to be used for media (image, audio, video) titles
X-YaCy-Media-Keywords - to be used for media (image, audio, video)
keywords
- both fields are written to document fields title and keywords and are
searched also during image search.
- to make the usage of arbitrary http header fields (including this new
fields) possible in the /api/push_p.json servlet, a new POST argument is
also introduced to push http header fields. The new POST attribute is
named "responseHeader-X" (where X is the counter). It is allowed to use
this attribute as multi-attribute several times, each can be filled with
a http header line.
- see /api/push_p.html for examples
2014-06-26 13:02:35 +02:00

85 lines
3.7 KiB
HTML

<html>
<head>
</head>
<body>
<h1>File Upload</h1>
#(mode)#
<!-- mode = 0 - display an upload form -->
<p>This form can be used to upload a file and assign it to an url.
Example usage is the direct attachment of a content management system to YaCy to push newly changed files directly to the YaCy indexer.</p>
<form id="push" action="push_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
<dl>
<dt>File Count</dt>
<dd><input name="count" type="hidden" value="#[count]#">#[count]#</dd>
<dt>synchronous</dt>
<dd><input name="synchronous" value="true" type="checkbox"></dd>
<dt>commit</dt>
<dd><input name="commit" value="true" type="checkbox"></dd>
<dt>&nbsp;<dt><dd>&nbsp;</dd>
<dt>Files to process:<dt>
#{input}#
<dt>&nbsp;<dt><dd>&nbsp;</dd>
<dd>
<dl>
<dt>File Number</dt>
<dd>#[count]#</dd>
<dt>Data</dt>
<dd>data-#[count]#=<input name="data-#[count]#" type="file"></dd>
<dt>URL</dt>
<dd>url-#[count]#=<input name="url-#[count]#" type="text" value="http://nowhere.cc/example.txt" size="80" maxlength="512"></dd>
<dt>Collection</dt>
<dd>collection-#[count]#=<input name="collection-#[count]#" type="text" value="push" size="80" maxlength="512"></dd>
<dt>Last-Modified</dt><!-- see: http://tools.ietf.org/html/rfc2616#section-14.29 -->
<!--<dd><input name="lastModified-#[count]#" type="text" value="Tue, 15 Nov 1994 12:45:26 GMT" size="30" maxlength="40"></dd>-->
<dd>responseHeader-#[count]#=<input name="responseHeader-#[count]#" type="text" value="Last-Modified:Tue, 15 Nov 1994 12:45:26 GMT" size="80" maxlength="80"></dd>
<dt>Content-Type</dt><!-- see: http://www.iana.org/assignments/media-types/media-types.xhtml -->
<!--<dd><input name="contentType-#[count]#" type="text" value="text/plain" size="30" maxlength="80"></dd>-->
<dd>responseHeader-#[count]#=<input name="responseHeader-#[count]#" type="text" value="Content-Type:text/plain" size="80" maxlength="80"></dd>
<dt></dt><dd>The following attributes are only used for media type content</dd>
<dt>Media-Title</dt>
<dd>responseHeader-#[count]#=<input name="responseHeader-#[count]#" type="text" value="X-YaCy-Media-Title:Hello Pictureworld" size="80" maxlength="200"></dd>
<dt>Media-Keywords ()</dt>
<dd>responseHeader-#[count]#=<input name="responseHeader-#[count]#" type="text" value="X-YaCy-Media-Keywords:uno dos tres cuatro cinco" size="80" maxlength="200"></dd>
</dl>
</dd>
#{/input}#
</dl>
<input type="submit" value="Submit">
</form>
::
<!-- mode 1 - display the push results -->
Result for the recently submitted file(s). You can also submit the same form using the servlet push_p.json to get push confirmations in json format.
<dl>
<dt>count</dt><dd>#[count]#</dd>
<dt>successall</dt><dd>#(successall)#false::true#(/successall)#</dd>
<dt>countsuccess</dt><dd>#[countsuccess]#</dd>
<dt>countfail</dt><dd>#[countfail]#</dd>
</dl>
<table border="1">
<tr><th>Item</th><th>URL</th><th>Success</th><th>Message</th></tr>
#{results}#
<tr>
<td>#[item]#</td>
<td><a href="#[url]#">#[url]#</a></td>
<td>#(success)#fail::ok#(/success)#</td>
<td>#(success)##[message]#::<a href="#[message]#" target="_blank">#[message]#</a>#(/success)#</td>
</tr>
#{/results}#
</table>
<p>
If you want to push again files, use this form to pre-define a number of upload forms:
<form id="push" action="push_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
<input name="c" type="text" value="1" size="4" maxlength="8"><input type="submit" value="Submit">
</form>
</p>
#(/mode)#
</body>
</html>