|
|
|
@ -40,7 +40,8 @@ public class webstructure {
|
|
|
|
|
final plasmaSwitchboard sb = (plasmaSwitchboard) env;
|
|
|
|
|
final boolean latest = ((post == null) ? false : post.containsKey("latest"));
|
|
|
|
|
String about = ((post == null) ? null : post.get("about", null));
|
|
|
|
|
|
|
|
|
|
prop.put("out", 0);
|
|
|
|
|
prop.put("in", 0);
|
|
|
|
|
if (about != null) {
|
|
|
|
|
yacyURL url = null;
|
|
|
|
|
if (about.length() > 6) {
|
|
|
|
@ -52,16 +53,24 @@ public class webstructure {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (url != null && about != null) {
|
|
|
|
|
|
|
|
|
|
plasmaWebStructure.structureEntry sentry = sb.webStructure.references(about);
|
|
|
|
|
plasmaWebStructure.structureEntry sentry = sb.webStructure.outgoingReferences(about);
|
|
|
|
|
if (sentry != null) {
|
|
|
|
|
reference(prop, "out", 0, sentry, sb.webStructure);
|
|
|
|
|
prop.put("out_domains", 1);
|
|
|
|
|
prop.put("out", 1);
|
|
|
|
|
} else {
|
|
|
|
|
prop.put("out_domains", 0);
|
|
|
|
|
prop.put("out", 1);
|
|
|
|
|
}
|
|
|
|
|
sentry = sb.webStructure.incomingReferences(about);
|
|
|
|
|
if (sentry != null) {
|
|
|
|
|
reference(prop, 0, sentry, sb.webStructure);
|
|
|
|
|
prop.put("domains", 1);
|
|
|
|
|
reference(prop, "in", 0, sentry, sb.webStructure);
|
|
|
|
|
prop.put("in_domains", 1);
|
|
|
|
|
prop.put("in", 1);
|
|
|
|
|
} else {
|
|
|
|
|
prop.put("domains", 0);
|
|
|
|
|
prop.put("in_domains", 0);
|
|
|
|
|
prop.put("in", 1);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
prop.put("domains", 0);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
final Iterator<plasmaWebStructure.structureEntry> i = sb.webStructure.structureEntryIterator(latest);
|
|
|
|
@ -69,22 +78,24 @@ public class webstructure {
|
|
|
|
|
plasmaWebStructure.structureEntry sentry;
|
|
|
|
|
while (i.hasNext()) {
|
|
|
|
|
sentry = i.next();
|
|
|
|
|
reference(prop, c, sentry, sb.webStructure);
|
|
|
|
|
reference(prop, "out", c, sentry, sb.webStructure);
|
|
|
|
|
c++;
|
|
|
|
|
}
|
|
|
|
|
prop.put("domains", c);
|
|
|
|
|
prop.put("out_domains", c);
|
|
|
|
|
prop.put("out", 1);
|
|
|
|
|
if (latest) sb.webStructure.joinOldNew();
|
|
|
|
|
}
|
|
|
|
|
prop.put("maxref", plasmaWebStructure.maxref);
|
|
|
|
|
prop.put("out_maxref", plasmaWebStructure.maxref);
|
|
|
|
|
prop.put("maxhosts", plasmaWebStructure.maxhosts);
|
|
|
|
|
|
|
|
|
|
// return rewrite properties
|
|
|
|
|
return prop;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void reference(serverObjects prop, int c, plasmaWebStructure.structureEntry sentry, plasmaWebStructure ws) {
|
|
|
|
|
prop.put("domains_" + c + "_hash", sentry.domhash);
|
|
|
|
|
prop.put("domains_" + c + "_domain", sentry.domain);
|
|
|
|
|
prop.put("domains_" + c + "_date", sentry.date);
|
|
|
|
|
public static void reference(serverObjects prop, String prefix, int c, plasmaWebStructure.structureEntry sentry, plasmaWebStructure ws) {
|
|
|
|
|
prop.put(prefix + "_domains_" + c + "_hash", sentry.domhash);
|
|
|
|
|
prop.put(prefix + "_domains_" + c + "_domain", sentry.domain);
|
|
|
|
|
prop.put(prefix + "_domains_" + c + "_date", sentry.date);
|
|
|
|
|
Iterator<Map.Entry<String, Integer>> k = sentry.references.entrySet().iterator();
|
|
|
|
|
Map.Entry<String, Integer> refentry;
|
|
|
|
|
String refdom, refhash;
|
|
|
|
@ -95,12 +106,12 @@ public class webstructure {
|
|
|
|
|
refhash = refentry.getKey();
|
|
|
|
|
refdom = ws.resolveDomHash2DomString(refhash);
|
|
|
|
|
if (refdom == null) continue refloop;
|
|
|
|
|
prop.put("domains_" + c + "_citations_" + d + "_refhash", refhash);
|
|
|
|
|
prop.put("domains_" + c + "_citations_" + d + "_refdom", refdom);
|
|
|
|
|
prop.put(prefix + "_domains_" + c + "_citations_" + d + "_refhash", refhash);
|
|
|
|
|
prop.put(prefix + "_domains_" + c + "_citations_" + d + "_refdom", refdom);
|
|
|
|
|
refcount = refentry.getValue();
|
|
|
|
|
prop.put("domains_" + c + "_citations_" + d + "_refcount", refcount.intValue());
|
|
|
|
|
prop.put(prefix + "_domains_" + c + "_citations_" + d + "_refcount", refcount.intValue());
|
|
|
|
|
d++;
|
|
|
|
|
}
|
|
|
|
|
prop.put("domains_" + c + "_citations", d);
|
|
|
|
|
prop.put(prefix + "_domains_" + c + "_citations", d);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|