From 589cbd8cbf10f71ef36f80258d33c61318e35491 Mon Sep 17 00:00:00 2001 From: theli Date: Wed, 21 Mar 2007 11:09:15 +0000 Subject: [PATCH] *) replacing all yacy-news-category strings with corresponding constants Note: please use these constants from now on git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3495 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/Blog.java | 3 +- htroot/Bookmarks.java | 3 +- htroot/ConfigProfile_p.java | 5 +- htroot/DetailedSearch.java | 2 +- htroot/IndexCreate_p.java | 4 +- htroot/Network.java | 8 +- htroot/Surftips.java | 22 +- htroot/ViewProfile.java | 2 +- htroot/WatchCrawler_p.java | 3 +- htroot/Wiki.java | 3 +- htroot/yacysearch.java | 6 +- .../de/anomic/soap/services/AdminService.java | 3 +- .../anomic/soap/services/BookmarkService.java | 3 +- source/de/anomic/yacy/yacyNewsPool.java | 199 +++++++++++++++--- 14 files changed, 209 insertions(+), 57 deletions(-) diff --git a/htroot/Blog.java b/htroot/Blog.java index 57b254f6f..cef677cb3 100644 --- a/htroot/Blog.java +++ b/htroot/Blog.java @@ -63,6 +63,7 @@ import de.anomic.server.serverObjects; import de.anomic.server.serverSwitch; import de.anomic.server.logging.serverLog; import de.anomic.yacy.yacyCore; +import de.anomic.yacy.yacyNewsPool; import de.anomic.yacy.yacyNewsRecord; public class Blog { @@ -183,7 +184,7 @@ public class Blog { map.put("page", pagename); map.put("subject", StrSubject.replace(',', ' ')); map.put("author", StrAuthor.replace(',', ' ')); - yacyCore.newsPool.publishMyNews(new yacyNewsRecord("blog_add", map)); + yacyCore.newsPool.publishMyNews(new yacyNewsRecord(yacyNewsPool.CATEGORY_BLOG_ADD, map)); } page = switchboard.blogDB.read(pagename); //maybe "if(page == null)" diff --git a/htroot/Bookmarks.java b/htroot/Bookmarks.java index 228a6f33c..0f750bce4 100644 --- a/htroot/Bookmarks.java +++ b/htroot/Bookmarks.java @@ -65,6 +65,7 @@ import de.anomic.plasma.plasmaSwitchboard; import de.anomic.server.serverObjects; import de.anomic.server.serverSwitch; import de.anomic.yacy.yacyCore; +import de.anomic.yacy.yacyNewsPool; import de.anomic.yacy.yacyNewsRecord; public class Bookmarks { @@ -304,7 +305,7 @@ public class Bookmarks { map.put("title", title.replace(',', ' ')); map.put("description", description.replace(',', ' ')); map.put("tags", tagsString.replace(',', ' ')); - yacyCore.newsPool.publishMyNews(new yacyNewsRecord("bkmrkadd", map)); + yacyCore.newsPool.publishMyNews(new yacyNewsRecord(yacyNewsPool.CATEGORY_BOOKMARK_ADD, map)); } } diff --git a/htroot/ConfigProfile_p.java b/htroot/ConfigProfile_p.java index d01db1034..03315f40f 100644 --- a/htroot/ConfigProfile_p.java +++ b/htroot/ConfigProfile_p.java @@ -58,6 +58,7 @@ import de.anomic.http.httpHeader; import de.anomic.server.serverObjects; import de.anomic.server.serverSwitch; import de.anomic.yacy.yacyCore; +import de.anomic.yacy.yacyNewsPool; import de.anomic.yacy.yacyNewsRecord; public class ConfigProfile_p { @@ -112,8 +113,8 @@ public class ConfigProfile_p { // generate a news message Properties news = profile; news.remove("comment"); - yacyCore.newsPool.publishMyNews(new yacyNewsRecord("prfleupd", news)); - //yacyCore.newsPool.publishMyNews(new yacyNewsRecord("prfleupd", profile)); + yacyCore.newsPool.publishMyNews(new yacyNewsRecord(yacyNewsPool.CATEGORY_PROFILE_UPDATE, news)); + //yacyCore.newsPool.publishMyNews(new yacyNewsRecord(yacyNewsRecord.CATEGORY_PROFILE_UPDATE, profile)); } catch(IOException e) { } finally { if (fileOut != null) try { fileOut.close(); } catch (Exception e) {} diff --git a/htroot/DetailedSearch.java b/htroot/DetailedSearch.java index 29c7b83bb..faac9f2c5 100644 --- a/htroot/DetailedSearch.java +++ b/htroot/DetailedSearch.java @@ -264,7 +264,7 @@ public class DetailedSearch { for(int i=0;i 0 && !page.page().equals(content)) - yacyCore.newsPool.publishMyNews(new yacyNewsRecord("wiki_upd", map)); + yacyCore.newsPool.publishMyNews(new yacyNewsRecord(yacyNewsPool.CATEGORY_WIKI_UPDATE, map)); page = newEntry; prop.put("LOCATION", "/Wiki.html?page=" + pagename); } diff --git a/htroot/yacysearch.java b/htroot/yacysearch.java index 3ad0b180b..25059d1e4 100644 --- a/htroot/yacysearch.java +++ b/htroot/yacysearch.java @@ -217,7 +217,7 @@ public class yacysearch { map.put("urlhash", delHash); map.put("vote", "negative"); map.put("refid", ""); - yacyCore.newsPool.publishMyNews(new yacyNewsRecord("stippavt", map)); + yacyCore.newsPool.publishMyNews(new yacyNewsRecord(yacyNewsPool.CATEGORY_SURFTIPP_VOTE_ADD, map)); } // if aplus-button was hit, create new voting message @@ -240,7 +240,7 @@ public class yacysearch { map.put("description", ((document == null) ? comp.title() : document.getTitle()).replace(',', ' ')); map.put("author", ((document == null) ? "" : document.getAuthor())); map.put("tags", ((document == null) ? "" : document.getKeywords(' '))); - yacyCore.newsPool.publishMyNews(new yacyNewsRecord("stippadd", map)); + yacyCore.newsPool.publishMyNews(new yacyNewsRecord(yacyNewsPool.CATEGORY_SURFTIPP_ADD, map)); document.close(); } } @@ -287,7 +287,7 @@ public class yacysearch { for(int i=0;i (3 * day))) { return true; } - if ((record.category().equals("blog_add")) && + if ((record.category().equals(CATEGORY_BLOG_ADD)) && ((System.currentTimeMillis() - record.created().getTime()) > (3 * day))) { return true; } - if ((record.category().equals("prfleupd")) && + if ((record.category().equals(CATEGORY_PROFILE_UPDATE)) && ((System.currentTimeMillis() - record.created().getTime()) > (7 * day))) { return true; } - if ((record.category().equals("crwlstrt")) && + if ((record.category().equals(CATEGORY_CRAWL_START)) && ((System.currentTimeMillis() - record.created().getTime()) > (2 * day))) { yacySeed seed = yacyCore.seedDB.get(record.originator()); if (seed == null) return false;