Merge branch 'master' of git@github.com:yacy/yacy_search_server.git

pull/8/head
Michael Peter Christen 10 years ago
commit 75879e051b

@ -36,7 +36,7 @@
<classpathentry kind="lib" path="lib/httpcore-4.4.1.jar"/>
<classpathentry kind="lib" path="lib/httpmime-4.4.jar"/>
<classpathentry kind="lib" path="lib/noggit-0.5.jar"/>
<classpathentry kind="lib" path="lib/metadata-extractor-2.7.0.jar"/>
<classpathentry kind="lib" path="lib/metadata-extractor-2.8.1.jar"/>
<classpathentry kind="lib" path="lib/xmpcore-5.1.2.jar"/>
<classpathentry kind="lib" path="lib/jcifs-1.3.17.jar"/>
<classpathentry kind="lib" path="lib/guava-18.0.jar"/>

@ -220,7 +220,7 @@
<pathelement location="${lib}/lucene-queryparser-4.10.3.jar" />
<pathelement location="${lib}/lucene-spatial-4.10.3.jar" />
<pathelement location="${lib}/lucene-suggest-4.10.3.jar" />
<pathelement location="${lib}/metadata-extractor-2.7.0.jar" />
<pathelement location="${lib}/metadata-extractor-2.8.1.jar" />
<pathelement location="${lib}/noggit-0.5.jar" />
<pathelement location="${lib}/org.restlet.jar" />
<pathelement location="${lib}/pdfbox-1.8.9.jar" />

@ -251,6 +251,7 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
<a href="#[link]#" class="bookmarkTitle">#[title]#</a>
</h4>
<p class="bookmarkDescription">#[description]#</p>
#(hasquery)#::<p class="bookmarkDescription">query=#[query]#</p>#(/hasquery)#
<p class="tags">Tagged with | #{tags}#<a href="Bookmarks.html?tag=#[tag]#" class="bookmarkTags">#[tag]#</a> | #{/tags}#</p>
<p class="bookmarkActions">
<a href="Bookmarks.html?edit=#[hash]#" class="bookmarkAction">Edit</a>
@ -258,6 +259,10 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
<a href="Bookmarks.html?delete=#[hash]#" class="bookmarkAction" onclick="return confirm('Confirm deletion')">Delete</a>
/
<a href="api/getpageinfo_p.xml?url=#[link]#" class="bookmarkAction">Info</a>
#(hasquery)#::
/
<a href="yacysearch.html?query=#[query]#" class="bookmarkAction">search</a>
#(/hasquery)#
</p>
</div>
#{/bookmarks}#

@ -152,7 +152,7 @@ public class Bookmarks {
}
tagsString = tagsString + "," + pathString;
final Set<String> tags=ListManager.string2set(BookmarkHelper.cleanTagsString(tagsString));
final BookmarksDB.Bookmark bookmark = sb.bookmarksDB.createBookmark(url, username);
final BookmarksDB.Bookmark bookmark = sb.bookmarksDB.createorgetBookmark(url, username);
if (bookmark != null) {
bookmark.setProperty(BookmarksDB.Bookmark.BOOKMARK_TITLE, title);
@ -326,6 +326,12 @@ public class Bookmarks {
}
prop.putHTML("display_bookmarks_"+count+"_title", bookmark.getTitle());
prop.putHTML("display_bookmarks_"+count+"_description", bookmark.getDescription());
if (bookmark.getQuery() == null) {
prop.put("display_bookmarks_"+count+"_hasquery", false);
} else {
prop.put("display_bookmarks_"+count+"_hasquery", true);
prop.put("display_bookmarks_"+count+"_hasquery_query", bookmark.getQuery());
}
prop.put("display_bookmarks_"+count+"_date", ISO8601Formatter.FORMATTER.format(new Date(bookmark.getTimeStamp())));
prop.put("display_bookmarks_"+count+"_rfc822date", HeaderFramework.formatRFC1123(new Date(bookmark.getTimeStamp())));
prop.put("display_bookmarks_"+count+"_public", (bookmark.getPublic() ? "1" : "0"));
@ -477,7 +483,7 @@ public class Bookmarks {
bookmark = sb.bookmarksDB.getBookmark(bit.next());
} catch (final IOException e) {
}
if (bookmark == null) break;
if (bookmark == null) break;
prop.put("display_folderlist_" + count + "_folder", "<li><a href=\"" + bookmark.getUrl() + "\" title=\"" + bookmark.getDescription() + "\">" + bookmark.getTitle() + "</a></li>");
count++;
}

@ -47,7 +47,7 @@ public class add_p {
final String pathString = post.get("path","/unsorted");
tagsString= tagsString + "," + pathString;
final Set<String> tags = ListManager.string2set(BookmarkHelper.cleanTagsString(tagsString));
final BookmarksDB.Bookmark bookmark = sb.bookmarksDB.createBookmark(url, username);
final BookmarksDB.Bookmark bookmark = sb.bookmarksDB.createorgetBookmark(url, username);
if(bookmark != null){
bookmark.setProperty(BookmarksDB.Bookmark.BOOKMARK_TITLE, title);
bookmark.setProperty(BookmarksDB.Bookmark.BOOKMARK_DESCRIPTION, description);

@ -16,7 +16,7 @@
</script>
#(/topmenu)#
<div id="api">
<div id="api" style="top:58px;">
<script type="text/javascript">
document.write("\<a id=\"rsslink\" href=\"/solr/select?hl=false&wt=opensearch&facet=true&facet.mincount=1&facet.field=url_file_ext_s&start=0&rows=10&query=" + window.location.search.substring(1) + "\"\><img src=\"env/grafics/api.png\" width=\"60\" height=\"40\" alt=\"API\" /></a>");
</script>
@ -31,11 +31,12 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
<fieldset class="yacys">
<input type="hidden" name="maximumRecords" value="#[maximumRecords]#" />
<input type="hidden" name="startRecord" value="#[startRecord]#" />
<input type="hidden" name="contentdom", value="all" />
<input id="search" class="searchinput" name="query" type="text" placeholder="Search..." value="#[query]#" size="40" maxlength="80" onFocus="this.select()" />
#(allowrealtime)#
<input id="Enter" type="submit" name="Enter" value="Search" />::
#(/allowrealtime)#
<input type="hidden" name="contentdom" value="all" />
<div class="input-group">
<input id="search" class="form-control searchinput typeahead" name="query" type="text" placeholder="Search..." value="#[query]#" size="40" maxlength="80" onFocus="this.select()" />
#(allowrealtime)#<input class="btn btn-default" id="Enter" type="submit" name="Enter" value="Search" />::
#(/allowrealtime)#
</div>
</fieldset>
<!--<pre>Raw JSON String: <div id="raw"></div></pre>-->
</form>

@ -594,9 +594,8 @@ public class yacysearch {
final String urlstr = crypt.simpleDecode(post.get("bookmarkurl"));
if (urlstr != null) {
try {
final Bookmark bmk = sb.bookmarksDB.createBookmark(urlstr, YMarkTables.USER_ADMIN);
bmk.setProperty(Bookmark.BOOKMARK_DESCRIPTION, "query="+querystring);
//bmk.setProperty(Bookmark.BOOKMARK_QUERY, originalquerystring);
final Bookmark bmk = sb.bookmarksDB.createorgetBookmark(urlstr, YMarkTables.USER_ADMIN);
bmk.setProperty(Bookmark.BOOKMARK_QUERY, querystring);
bmk.addTag("/search"); // add to bookmark folder
bmk.addTag("searchresult"); // add tag
String urlhash = post.get("bookmarkref");

Binary file not shown.

Binary file not shown.

@ -83,7 +83,7 @@
<compilation-unit>
<package-root>source</package-root>
<package-root>htroot</package-root>
<classpath mode="compile">lib/J7Zip-modified.jar;lib/apache-mime4j-0.6.jar;lib/bcmail-jdk15-1.46.jar;lib/bcprov-jdk15-1.46.jar;lib/chardet.jar;lib/commons-codec-1.10.jar;lib/commons-compress-1.9.jar;lib/commons-fileupload-1.3.1.jar;lib/commons-io-2.3.jar;lib/commons-jxpath-1.3.jar;lib/commons-lang-2.6.jar;lib/commons-logging-1.2.jar;lib/fontbox-1.8.9.jar;lib/geronimo-stax-api_1.0_spec-1.0.1.jar;lib/guava-18.0.jar;lib/htmllexer.jar;lib/httpclient-4.4.jar;lib/httpcore-4.4.1.jar;lib/httpmime-4.4.jar;lib/icu4j-core.jar;lib/jakarta-oro-2.0.8.jar;lib/jaudiotagger-2.0.4-20111207.115108-15.jar;lib/javax.servlet-api-3.1.0.jar;lib/jcifs-1.3.17.jar;lib/jcl-over-slf4j-1.7.9.jar;lib/jempbox-1.8.9.jar;lib/jetty-client-9.2.10.v20150310.jar;lib/jetty-continuation-9.2.10.v20150310.jar;lib/jetty-deploy-9.2.10.v20150310.jar;lib/jetty-http-9.2.10.v20150310.jar;lib/jetty-io-9.2.10.v20150310.jar;lib/jetty-jmx-9.2.10.v20150310.jar;lib/jetty-proxy-9.2.10.v20150310.jar;lib/jetty-security-9.2.10.v20150310.jar;lib/jetty-server-9.2.10.v20150310.jar;lib/jetty-servlet-9.2.10.v20150310.jar;lib/jetty-servlets-9.2.10.v20150310.jar;lib/jetty-util-9.2.10.v20150310.jar;lib/jetty-webapp-9.2.10.v20150310.jar;lib/jetty-xml-9.2.10.v20150310.jar;lib/jsch-0.1.51.jar;lib/json-simple-1.1.1.jar;lib/jsoup-1.8.2.jar;lib/log4j-over-slf4j-1.7.9.jar;lib/lucene-analyzers-common-4.10.3.jar;lib/lucene-analyzers-phonetic-4.10.3.jar;lib/lucene-classification-4.10.3.jar;lib/lucene-codecs-4.10.3.jar;lib/lucene-core-4.10.3.jar;lib/lucene-facet-4.10.3.jar;lib/lucene-grouping-4.10.3.jar;lib/lucene-highlighter-4.10.3.jar;lib/lucene-join-4.10.3.jar;lib/lucene-memory-4.10.3.jar;lib/lucene-misc-4.10.3.jar;lib/lucene-queries-4.10.3.jar;lib/lucene-queryparser-4.10.3.jar;lib/lucene-spatial-4.10.3.jar;lib/lucene-suggest-4.10.3.jar;lib/metadata-extractor-2.7.0.jar;lib/noggit-0.5.jar;lib/org.restlet.jar;lib/pdfbox-1.8.9.jar;lib/poi-3.11-20141221.jar;lib/poi-scratchpad-3.11-20141221.jar;lib/slf4j-api-1.7.9.jar;lib/slf4j-jdk14-1.7.9.jar;lib/solr-core-4.10.3.jar;lib/solr-solrj-4.10.3.jar;lib/spatial4j-0.4.1.jar;lib/webcat-0.1-swf.jar;lib/weupnp-0.1.2.jar;lib/wstx-asl-3.2.9.jar;lib/xercesImpl.jar;lib/xml-apis.jar;lib/xmpcore-5.1.2.jar;lib/zookeeper-3.4.6.jar</classpath>
<classpath mode="compile">lib/J7Zip-modified.jar;lib/apache-mime4j-0.6.jar;lib/bcmail-jdk15-1.46.jar;lib/bcprov-jdk15-1.46.jar;lib/chardet.jar;lib/commons-codec-1.10.jar;lib/commons-compress-1.9.jar;lib/commons-fileupload-1.3.1.jar;lib/commons-io-2.3.jar;lib/commons-jxpath-1.3.jar;lib/commons-lang-2.6.jar;lib/commons-logging-1.2.jar;lib/fontbox-1.8.9.jar;lib/geronimo-stax-api_1.0_spec-1.0.1.jar;lib/guava-18.0.jar;lib/htmllexer.jar;lib/httpclient-4.4.jar;lib/httpcore-4.4.1.jar;lib/httpmime-4.4.jar;lib/icu4j-core.jar;lib/jakarta-oro-2.0.8.jar;lib/jaudiotagger-2.0.4-20111207.115108-15.jar;lib/javax.servlet-api-3.1.0.jar;lib/jcifs-1.3.17.jar;lib/jcl-over-slf4j-1.7.9.jar;lib/jempbox-1.8.9.jar;lib/jetty-client-9.2.10.v20150310.jar;lib/jetty-continuation-9.2.10.v20150310.jar;lib/jetty-deploy-9.2.10.v20150310.jar;lib/jetty-http-9.2.10.v20150310.jar;lib/jetty-io-9.2.10.v20150310.jar;lib/jetty-jmx-9.2.10.v20150310.jar;lib/jetty-proxy-9.2.10.v20150310.jar;lib/jetty-security-9.2.10.v20150310.jar;lib/jetty-server-9.2.10.v20150310.jar;lib/jetty-servlet-9.2.10.v20150310.jar;lib/jetty-servlets-9.2.10.v20150310.jar;lib/jetty-util-9.2.10.v20150310.jar;lib/jetty-webapp-9.2.10.v20150310.jar;lib/jetty-xml-9.2.10.v20150310.jar;lib/jsch-0.1.51.jar;lib/json-simple-1.1.1.jar;lib/jsoup-1.8.2.jar;lib/log4j-over-slf4j-1.7.9.jar;lib/lucene-analyzers-common-4.10.3.jar;lib/lucene-analyzers-phonetic-4.10.3.jar;lib/lucene-classification-4.10.3.jar;lib/lucene-codecs-4.10.3.jar;lib/lucene-core-4.10.3.jar;lib/lucene-facet-4.10.3.jar;lib/lucene-grouping-4.10.3.jar;lib/lucene-highlighter-4.10.3.jar;lib/lucene-join-4.10.3.jar;lib/lucene-memory-4.10.3.jar;lib/lucene-misc-4.10.3.jar;lib/lucene-queries-4.10.3.jar;lib/lucene-queryparser-4.10.3.jar;lib/lucene-spatial-4.10.3.jar;lib/lucene-suggest-4.10.3.jar;lib/metadata-extractor-2.8.1.jar;lib/noggit-0.5.jar;lib/org.restlet.jar;lib/pdfbox-1.8.9.jar;lib/poi-3.11-20141221.jar;lib/poi-scratchpad-3.11-20141221.jar;lib/slf4j-api-1.7.9.jar;lib/slf4j-jdk14-1.7.9.jar;lib/solr-core-4.10.3.jar;lib/solr-solrj-4.10.3.jar;lib/spatial4j-0.4.1.jar;lib/webcat-0.1-swf.jar;lib/weupnp-0.1.2.jar;lib/wstx-asl-3.2.9.jar;lib/xercesImpl.jar;lib/xml-apis.jar;lib/xmpcore-5.1.2.jar;lib/zookeeper-3.4.6.jar</classpath>
<built-to>lib/yacycore.jar</built-to>
<source-level>1.7</source-level>
</compilation-unit>

@ -506,7 +506,7 @@
<dependency>
<groupId>com.drewnoakes</groupId>
<artifactId>metadata-extractor</artifactId>
<version>2.7.0</version>
<version>2.8.1</version>
</dependency>
<dependency>
<groupId>oro</groupId>

@ -35,6 +35,8 @@ import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.yacy.cora.document.encoding.ASCII;
import net.yacy.cora.document.encoding.UTF8;
@ -126,11 +128,25 @@ public class BookmarksDB {
// bookmarksDB's functions for bookmarksTable / bookmarkCache
// -----------------------------------------------------------
public Bookmark createBookmark(final String url, final String user){
/**
* create or get existing bookmark
* @param url
* @param user
* @return
*/
public Bookmark createorgetBookmark(final String url, final String user){
if (url == null || url.isEmpty()) return null;
Bookmark bk;
try {
bk = new Bookmark(url);
try {
DigestURL durl = new DigestURL((url.indexOf("://") < 0) ? "http://" + url : url);
bk = this.getBookmark(ASCII.String(durl.hash()));
} catch (IOException ex) {
bk = null;
}
if (bk == null) {
bk = new Bookmark(url);
}
bk.setOwner(user);
return (bk.getUrlHash() == null || bk.toMap() == null) ? null : bk;
} catch (final MalformedURLException e) {
@ -461,6 +477,7 @@ public class BookmarksDB {
private static final String BOOKMARK_TIMESTAMP = "bookmarkTimestamp";
private static final String BOOKMARK_OWNER = "bookmarkOwner";
private static final String BOOKMARK_IS_FEED = "bookmarkIsFeed";
public static final String BOOKMARK_QUERY = "bookmarkQuery"; // tag for original search string if bookmark was created from search result
private final String urlHash;
private Set<String> tagNames;
private long timestamp;
@ -587,6 +604,18 @@ public class BookmarksDB {
return false;
}
/**
* get the original query string (if bookmark was created from a search result original query is stored as a bookmark property)
* or null if not exist
* @return query-string or null
*/
public String getQuery() {
if (this.entry.containsKey(BOOKMARK_QUERY)) {
return this.entry.get(BOOKMARK_QUERY);
}
return null;
}
public void setPublic(final boolean isPublic){
if(isPublic){
this.entry.put(BOOKMARK_PUBLIC, "public");

@ -166,12 +166,12 @@ public class AutoSearch extends AbstractBusyThread {
if (bmk.getFoldersString().startsWith("/search")) {
// take only new created or edited bookmarks
if (bmk.getTimeStamp() >= this.lastInitTime) {
final String query = bmk.getDescription();
if (!query.isEmpty() && query.startsWith("query=")) {
final String query = bmk.getQuery();
if (query != null && !query.isEmpty()) {
{
querystack.add(query.substring(6));
querystack.add(query);
added++;
ConcurrentLog.info(AutoSearch.class.getName(), "add query from Bookmarks " + query);
ConcurrentLog.info(AutoSearch.class.getName(), "add query from Bookmarks: query=" + query);
}
}
}

@ -3113,11 +3113,10 @@ public final class Switchboard extends serverSwitch {
if (tagStr.length() > 2 && tagStr.startsWith("[") && tagStr.endsWith("]")) tagStr = tagStr.substring(1, tagStr.length() - 2);
// we will create always a bookmark to use this to track crawled hosts
final BookmarksDB.Bookmark bookmark = this.bookmarksDB.createBookmark(url.toNormalform(true), "admin");
final BookmarksDB.Bookmark bookmark = this.bookmarksDB.createorgetBookmark(url.toNormalform(true), "admin");
if (bookmark != null) {
bookmark.setProperty(BookmarksDB.Bookmark.BOOKMARK_TITLE, title);
bookmark.setProperty(BookmarksDB.Bookmark.BOOKMARK_DESCRIPTION, description);
bookmark.setOwner("admin");
bookmark.setPublic(false);
bookmark.setTags(tags, true);
this.bookmarksDB.saveBookmark(bookmark);

@ -117,6 +117,7 @@ public class ReferenceOrder {
p++;
if (System.currentTimeMillis() > timeout) {
ConcurrentLog.warn("NormalizeDistributor", "adding of decoded rows to workers ended with timeout = " + this.maxtime);
break;
}
}
} catch (final InterruptedException e) {

Loading…
Cancel
Save