Skip to content

Commit

Permalink
- added another network definition for personal web portals (replacin…
Browse files Browse the repository at this point in the history
…g robinson peers in freeworld) for default use case selection. This solves the problem that the public network freeworld can spoil the personal web index during configuration phase with index entries that the user does not want for his personal web portal

- changed network selection to new network 'webportal' in ConfigBasic servlet
- removed unused servlets from yacy/ui


git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4837 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed May 23, 2008
1 parent 2f8c180 commit e4d9359
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 717 deletions.
22 changes: 22 additions & 0 deletions defaults/yacy.network.webportal.unit
@@ -0,0 +1,22 @@
# Network definition file for a private web index
# to be used as a network without any other peers
# for a personal web portal

# general network definition
network.unit.name = webportal
network.unit.description = Personal Web Portal
network.unit.domain = global
network.unit.search.time = 4
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
1 change: 1 addition & 0 deletions defaults/yacy.networks
@@ -1,2 +1,3 @@
defaults/yacy.network.freeworld.unit
defaults/yacy.network.webportal.unit
defaults/yacy.network.intranet.unit
55 changes: 19 additions & 36 deletions htroot/ConfigBasic.java
Expand Up @@ -151,59 +151,42 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
// set a use case
String networkName = sb.getConfig("network.unit.name", "");
if (post != null && post.containsKey("usecase")) {
boolean indexDistribute = sb.getConfig(plasmaSwitchboard.INDEX_DIST_ALLOW, "true").equals("true");
boolean indexReceive = sb.getConfig(plasmaSwitchboard.INDEX_RECEIVE_ALLOW, "true").equals("true");

if (post.get("usecase", "").equals("freeworld")) {
if (networkName.equals("freeworld")) {
if (!indexDistribute && !indexReceive) {
// switch from robinson mode to p2p mode
sb.setConfig(plasmaSwitchboard.INDEX_DIST_ALLOW, true);
sb.setConfig(plasmaSwitchboard.INDEX_RECEIVE_ALLOW, true);
}
} else {
// switch from intranet to p2p mode
if (!networkName.equals("freeworld")) {
// switch to freeworld network
sb.switchNetwork("defaults/yacy.network.freeworld.unit");
sb.setConfig(plasmaSwitchboard.INDEX_DIST_ALLOW, true);
sb.setConfig(plasmaSwitchboard.INDEX_RECEIVE_ALLOW, true);
}
// switch to p2p mode
sb.setConfig(plasmaSwitchboard.INDEX_DIST_ALLOW, true);
sb.setConfig(plasmaSwitchboard.INDEX_RECEIVE_ALLOW, true);
}
if (post.get("usecase", "").equals("portal")) {
if (networkName.equals("freeworld")) {
if (indexDistribute || indexReceive) {
// switch from p2p mode to robinson mode
sb.setConfig(plasmaSwitchboard.INDEX_DIST_ALLOW, false);
sb.setConfig(plasmaSwitchboard.INDEX_RECEIVE_ALLOW, false);
}
} else {
// switch from intranet to robinson mode
sb.switchNetwork("defaults/yacy.network.freeworld.unit");
sb.setConfig(plasmaSwitchboard.INDEX_DIST_ALLOW, false);
sb.setConfig(plasmaSwitchboard.INDEX_RECEIVE_ALLOW, false);
if (!networkName.equals("webportal")) {
// switch to webportal network
sb.switchNetwork("defaults/yacy.network.webportal.unit");
}
// switch to robinson mode
sb.setConfig(plasmaSwitchboard.INDEX_DIST_ALLOW, false);
sb.setConfig(plasmaSwitchboard.INDEX_RECEIVE_ALLOW, false);
}
if (post.get("usecase", "").equals("intranet")) {
if (!networkName.equals("intranet")) {
// switch from p2p or robinson mode to intranet mode
// switch to intranet network
sb.switchNetwork("defaults/yacy.network.intranet.unit");
sb.setConfig(plasmaSwitchboard.INDEX_DIST_ALLOW, true);
sb.setConfig(plasmaSwitchboard.INDEX_RECEIVE_ALLOW, true);
}
// switch to p2p mode: enable ad-hoc networks between intranet users
sb.setConfig(plasmaSwitchboard.INDEX_DIST_ALLOW, true);
sb.setConfig(plasmaSwitchboard.INDEX_RECEIVE_ALLOW, true);
}
}

networkName = sb.getConfig("network.unit.name", "");
if (networkName.equals("freeworld")) {
prop.put("setUseCase", 1);
boolean indexDistribute = sb.getConfig(plasmaSwitchboard.INDEX_DIST_ALLOW, "true").equals("true");
boolean indexReceive = sb.getConfig(plasmaSwitchboard.INDEX_RECEIVE_ALLOW, "true").equals("true");
if (indexDistribute || indexReceive) {
// p2p mode
prop.put("setUseCase_freeworldChecked", 1);
} else {
// robinson mode
prop.put("setUseCase_portalChecked", 1);
}
prop.put("setUseCase_freeworldChecked", 1);
} else if (networkName.equals("webportal")) {
prop.put("setUseCase", 1);
prop.put("setUseCase_portalChecked", 1);
} else if (networkName.equals("intranet")) {
prop.put("setUseCase", 1);
prop.put("setUseCase_intranetChecked", 1);
Expand Down
84 changes: 0 additions & 84 deletions htroot/yacy/ui/result.html

This file was deleted.

0 comments on commit e4d9359

Please sign in to comment.