- the default files yacy.init and for the network definition is now moved to the path defaults - the httpProxy.conf is renamed to yacy.conf - the DATA/INDEX/PUBLIC is renamed to the actual network nickname, which should be freeworld or sciencenet more menu entries - added apfelmaennchens alternative search page to the menu - added the new thread dump page to the server log menu point as submenu modifications - modified the thread dump page: sorting by thread type git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4575 6c8d7289-2bf4-0310-a012-ef5d649a1542pull/1/head
parent
54cb097ea4
commit
7150b463ff
@ -0,0 +1,31 @@
|
||||
# Network definition file for the freeworld network
|
||||
# this is the default standard network for fresh YaCy Peers
|
||||
|
||||
# -----------------------------------------------------------------#
|
||||
# for an explanation please see the file yacy.network.readme #
|
||||
# this is a work in progress. disabled properties are not yet used #
|
||||
# -----------------------------------------------------------------#
|
||||
|
||||
# general network definition
|
||||
network.unit.name = freeworld
|
||||
network.unit.description = Public YaCy Community
|
||||
network.unit.domain = global
|
||||
network.unit.search.time = 4
|
||||
network.unit.dht = true
|
||||
network.unit.dhtredundancy.junior = 1
|
||||
network.unit.dhtredundancy.senior = 3
|
||||
network.unit.bootstrap.seedlist0 = http://www.yacy.net/seed.txt
|
||||
network.unit.bootstrap.seedlist1 = http://home.arcor.de/hermens/yacy/seed.txt
|
||||
network.unit.bootstrap.seedlist2 = http://low.audioattack.de/yacy/seed.txt
|
||||
network.unit.bootstrap.seedlist3 = http://www.lulabad.de/seed.txt
|
||||
network.unit.bootstrap.seedlist4 = http://www.marcelhenseler.de/yacy/seed.txt
|
||||
|
||||
# each network may use different yacy distributions.
|
||||
# the auto-updater can access network-specific update locations
|
||||
network.unit.update.location0 = http://yacy.net/index.html
|
||||
network.unit.update.location1 = http://latest.yacy.de
|
||||
network.unit.update.location2 = http://www.findenstattsuchen.info/YaCy/latest/index.php
|
||||
network.unit.update.location3 = http://www.yacystats.de/yacybuild/
|
||||
|
||||
# properties for in-protocol response authentification:
|
||||
network.unit.protocol.control = uncontrolled
|
@ -1,7 +1,7 @@
|
||||
# YaCy Network Group Definition
|
||||
# -----------------------------
|
||||
# This is an addition to the yacy.network.unit configuration file.
|
||||
# This file is addressed by the network.group.definition property in yacy.init
|
||||
# This file is addressed by the network.group.definition property in defaults/yacy.init
|
||||
# The purpose of a group within a network is that some parts of a network may be managed independently,
|
||||
# while the content of the network stays private for the whole network, mostly for a special purpose.
|
||||
# This file needs to be configured if someone wants to participate with several peers to the network,
|
@ -0,0 +1,25 @@
|
||||
# Network definition file for the freeworld network
|
||||
# this is the default standard network for fresh YaCy Peers
|
||||
|
||||
# -----------------------------------------------------------------#
|
||||
# for an explanation please see the file yacy.network.readme #
|
||||
# this is a work in progress. disabled properties are not yet used #
|
||||
# -----------------------------------------------------------------#
|
||||
|
||||
# general network definition
|
||||
network.unit.name = intranet
|
||||
network.unit.description = Private Intranet
|
||||
network.unit.domain = local
|
||||
network.unit.dht = false
|
||||
network.unit.dhtredundancy.junior = 1
|
||||
network.unit.dhtredundancy.senior = 1
|
||||
|
||||
# each network may use different yacy distributions.
|
||||
# the auto-updater can access network-specific update locations
|
||||
network.unit.update.location0 = http://yacy.net/index.html
|
||||
network.unit.update.location1 = http://latest.yacy.de
|
||||
network.unit.update.location2 = http://www.findenstattsuchen.info/YaCy/latest/index.php
|
||||
network.unit.update.location3 = http://www.yacystats.de/yacybuild/
|
||||
|
||||
# properties for in-protocol response authentification:
|
||||
network.unit.protocol.control = uncontrolled
|
@ -0,0 +1,231 @@
|
||||
// opensearchdescriptionReader.java
|
||||
// (C) 2008 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany
|
||||
// first published 11.03.2008 on http://yacy.net
|
||||
//
|
||||
// This is a part of YaCy, a peer-to-peer based web search engine
|
||||
//
|
||||
// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $
|
||||
// $LastChangedRevision: 1986 $
|
||||
// $LastChangedBy: orbiter $
|
||||
//
|
||||
// LICENSE
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
package de.anomic.xml;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
||||
import javax.xml.parsers.SAXParser;
|
||||
import javax.xml.parsers.SAXParserFactory;
|
||||
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.helpers.DefaultHandler;
|
||||
|
||||
import de.anomic.server.serverByteBuffer;
|
||||
import de.anomic.server.logging.serverLog;
|
||||
|
||||
public class opensearchdescriptionReader extends DefaultHandler {
|
||||
|
||||
// statics for item generation and automatic categorization
|
||||
static int guidcount = 0;
|
||||
private static final String recordTag = "OpenSearchDescription";
|
||||
private static final String[] tagsDef = new String[]{
|
||||
"ShortName",
|
||||
"LongName",
|
||||
"Image",
|
||||
"Language",
|
||||
"OutputEncoding",
|
||||
"InputEncoding",
|
||||
"AdultContent",
|
||||
"Description",
|
||||
"Url",
|
||||
"Developer",
|
||||
"Query",
|
||||
"Tags",
|
||||
"Contact",
|
||||
"Attribution",
|
||||
"SyndicationRight"
|
||||
};
|
||||
/*
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
|
||||
<ShortName>YaCy/#[clientname]#</ShortName>
|
||||
<LongName>YaCy.net - #[SearchPageGreeting]#</LongName>
|
||||
<Image type="image/gif">http://#[thisaddress]#/env/grafics/yacy.gif</Image>
|
||||
<Language>en-us</Language>
|
||||
<OutputEncoding>UTF-8</OutputEncoding>
|
||||
<InputEncoding>UTF-8</InputEncoding>
|
||||
<AdultContent>true</AdultContent>
|
||||
<Description>YaCy is an open-source GPL-licensed software that can be used for stand-alone search engine installations or as a client for a multi-user P2P-based web indexing cluster. This is the access to peer '#[clientname]#'.</Description>
|
||||
<Url type="application/rss+xml" method="GET" template="http://#[thisaddress]#/yacysearch.rss?search={searchTerms}&Enter=Search" />
|
||||
<Developer>See http://developer.berlios.de/projects/yacy/</Developer>
|
||||
<Query role="example" searchTerms="yacy" />
|
||||
<Tags>YaCy P2P Web Search</Tags>
|
||||
<Contact>See http://#[thisaddress]#/ViewProfile.html?hash=localhash</Contact>
|
||||
<Attribution>YaCy Software &copy; 2004-2007 by Michael Christen et al., YaCy.net; Content: ask peer owner</Attribution>
|
||||
<SyndicationRight>open</SyndicationRight>
|
||||
</OpenSearchDescription>
|
||||
*/
|
||||
|
||||
private static final HashSet<String> tags = new HashSet<String>();
|
||||
static {
|
||||
for (int i = 0; i < tagsDef.length; i++) {
|
||||
tags.add(tagsDef[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// class variables
|
||||
private Item channel, item;
|
||||
private StringBuffer buffer;
|
||||
private boolean parsingChannel;
|
||||
private String imageURL;
|
||||
private ArrayList<String> itemsGUID; // a list of GUIDs, so the items can be retrieved by a specific order
|
||||
private HashMap<String, Item> items; // a guid:Item map
|
||||
|
||||
|
||||
public opensearchdescriptionReader() {
|
||||
itemsGUID = new ArrayList<String>();
|
||||
items = new HashMap<String, Item>();
|
||||
buffer = new StringBuffer();
|
||||
item = null;
|
||||
channel = null;
|
||||
parsingChannel = false;
|
||||
}
|
||||
|
||||
public opensearchdescriptionReader(String path) {
|
||||
this();
|
||||
try {
|
||||
SAXParserFactory factory = SAXParserFactory.newInstance();
|
||||
SAXParser saxParser = factory.newSAXParser();
|
||||
saxParser.parse(path, this);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public opensearchdescriptionReader(InputStream stream) {
|
||||
this();
|
||||
try {
|
||||
SAXParserFactory factory = SAXParserFactory.newInstance();
|
||||
SAXParser saxParser = factory.newSAXParser();
|
||||
saxParser.parse(stream, this);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static opensearchdescriptionReader parse(byte[] a) {
|
||||
|
||||
// check integrity of array
|
||||
if ((a == null) || (a.length == 0)) {
|
||||
serverLog.logWarning("opensearchdescriptionReader", "response=null");
|
||||
return null;
|
||||
}
|
||||
if (a.length < 100) {
|
||||
serverLog.logWarning("opensearchdescriptionReader", "response=" + new String(a));
|
||||
return null;
|
||||
}
|
||||
if (!serverByteBuffer.equals(a, "<?xml".getBytes())) {
|
||||
serverLog.logWarning("opensearchdescriptionReader", "response does not contain valid xml");
|
||||
return null;
|
||||
}
|
||||
String end = new String(a, a.length - 10, 10);
|
||||
if (end.indexOf("rss") < 0) {
|
||||
serverLog.logWarning("opensearchdescriptionReader", "response incomplete");
|
||||
return null;
|
||||
}
|
||||
|
||||
// make input stream
|
||||
ByteArrayInputStream bais = new ByteArrayInputStream(a);
|
||||
|
||||
// parse stream
|
||||
opensearchdescriptionReader reader = null;
|
||||
try {
|
||||
reader = new opensearchdescriptionReader(bais);
|
||||
} catch (Exception e) {
|
||||
serverLog.logWarning("opensearchdescriptionReader", "parse exception: " + e);
|
||||
return null;
|
||||
}
|
||||
try { bais.close(); } catch (IOException e) {}
|
||||
return reader;
|
||||
}
|
||||
|
||||
public void startElement(String uri, String name, String tag, Attributes atts) throws SAXException {
|
||||
if ("channel".equals(tag)) {
|
||||
channel = new Item();
|
||||
parsingChannel = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void endElement(String uri, String name, String tag) {
|
||||
if (tag == null) return;
|
||||
if ("channel".equals(tag)) {
|
||||
parsingChannel = false;
|
||||
} else if (parsingChannel) {
|
||||
String value = buffer.toString().trim();
|
||||
buffer.setLength(0);
|
||||
if (tags.contains(tag)) channel.setValue(tag, value);
|
||||
}
|
||||
}
|
||||
|
||||
public void characters(char ch[], int start, int length) {
|
||||
if (parsingChannel) {
|
||||
buffer.append(ch, start, length);
|
||||
}
|
||||
}
|
||||
|
||||
public Item getChannel() {
|
||||
return channel;
|
||||
}
|
||||
|
||||
public Item getItem(int i) {
|
||||
// retrieve item by order number
|
||||
return getItem((String) itemsGUID.get(i));
|
||||
}
|
||||
|
||||
public Item getItem(String guid) {
|
||||
// retrieve item by guid
|
||||
return (Item) items.get(guid);
|
||||
}
|
||||
|
||||
public int items() {
|
||||
return items.size();
|
||||
}
|
||||
|
||||
public String getImage() {
|
||||
return this.imageURL;
|
||||
}
|
||||
|
||||
public static class Item {
|
||||
|
||||
private HashMap<String, String> map;
|
||||
|
||||
public Item() {
|
||||
this.map = new HashMap<String, String>();
|
||||
this.map.put("guid", Long.toHexString(System.currentTimeMillis()) + ":" + guidcount++);
|
||||
}
|
||||
|
||||
public void setValue(String name, String value) {
|
||||
map.put(name, value);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue