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 // check the isFacet property
if (vocabulary != null) { if (vocabulary != null && post.containsKey("set")) {
vocabulary.setFacet(post.getBoolean("isFacet")); vocabulary.setFacet(post.getBoolean("isFacet"));
} }
} }

@ -63,7 +63,7 @@ public class snapshot {
private final static int DEFAULT_QUALITY = 75; private final static int DEFAULT_QUALITY = 75;
private final static String DEFAULT_EXT = "jpg"; 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 Switchboard sb = (Switchboard) env;
final boolean authenticated = sb.adminAuthenticated(header) >= 2; 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 // 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 xml = ext.equals("xml");
final boolean pdf = ext.equals("pdf"); final boolean pdf = ext.equals("pdf");
if (pdf && !authenticated) return null; 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.geo.Locations;
import net.yacy.cora.storage.Files; import net.yacy.cora.storage.Files;
import net.yacy.cora.util.CommonPattern; import net.yacy.cora.util.CommonPattern;
import net.yacy.cora.util.ConcurrentLog;
public class Tagging { public class Tagging {
@ -203,6 +204,9 @@ public class Tagging {
this.predicate = this.namespace + this.navigatorName; this.predicate = this.namespace + this.navigatorName;
this.objectspace = null; 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); BlockingQueue<String> list = Files.concurentLineReader(this.propFile, 1000);
String term, v; String term, v;
String[] tags; String[] tags;
@ -212,6 +216,7 @@ public class Tagging {
try { try {
String[] pl; String[] pl;
vocloop: while ((line = list.take()) != Files.POISON_LINE) { vocloop: while ((line = list.take()) != Files.POISON_LINE) {
count++;
line = line.trim(); line = line.trim();
p = line.indexOf('#'); p = line.indexOf('#');
if (p >= 0) { if (p >= 0) {
@ -263,6 +268,7 @@ public class Tagging {
} }
} catch (final InterruptedException e) { } catch (final InterruptedException e) {
} }
ConcurrentLog.info("Tagging", "Finished Vocabulary Initialization for " + this.propFile + "; " + count + " lines; " + (System.currentTimeMillis() - start) + " milliseconds");
} }
public boolean isFacet() { public boolean isFacet() {

Loading…
Cancel
Save