fix for vocabulary on/off setting

pull/1/head
Michael Peter Christen 10 years ago
parent a3c5995bde
commit 6390454652

@ -233,7 +233,7 @@ public class Vocabulary_p {
}
// check the isFacet property
if (vocabulary != null) {
if (vocabulary != null && post.containsKey("set")) {
vocabulary.setFacet(post.getBoolean("isFacet"));
}
}

@ -63,7 +63,7 @@ public class snapshot {
private final static int DEFAULT_QUALITY = 75;
private final static String DEFAULT_EXT = "jpg";
public static Object respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {
public static Object respond(final RequestHeader header, serverObjects post, final serverSwitch env) {
final Switchboard sb = (Switchboard) env;
final boolean authenticated = sb.adminAuthenticated(header) >= 2;
@ -101,7 +101,7 @@ public class snapshot {
}
// for the following methods we (mostly) need an url or a url hash
if (post == null) return null;
if (post == null) post = new serverObjects();
final boolean xml = ext.equals("xml");
final boolean pdf = ext.equals("pdf");
if (pdf && !authenticated) return null;

@ -41,6 +41,7 @@ import net.yacy.cora.geo.GeoLocation;
import net.yacy.cora.geo.Locations;
import net.yacy.cora.storage.Files;
import net.yacy.cora.util.CommonPattern;
import net.yacy.cora.util.ConcurrentLog;
public class Tagging {
@ -203,6 +204,9 @@ public class Tagging {
this.predicate = this.namespace + this.navigatorName;
this.objectspace = null;
ConcurrentLog.info("Tagging", "Started Vocabulary Initialization for " + this.propFile);
long start = System.currentTimeMillis();
long count = 0;
BlockingQueue<String> list = Files.concurentLineReader(this.propFile, 1000);
String term, v;
String[] tags;
@ -212,6 +216,7 @@ public class Tagging {
try {
String[] pl;
vocloop: while ((line = list.take()) != Files.POISON_LINE) {
count++;
line = line.trim();
p = line.indexOf('#');
if (p >= 0) {
@ -263,6 +268,7 @@ public class Tagging {
}
} catch (final InterruptedException e) {
}
ConcurrentLog.info("Tagging", "Finished Vocabulary Initialization for " + this.propFile + "; " + count + " lines; " + (System.currentTimeMillis() - start) + " milliseconds");
}
public boolean isFacet() {

Loading…
Cancel
Save