From 49fbb688df2a01be5dc3ed6ab24c66e12f669d6c Mon Sep 17 00:00:00 2001 From: theli Date: Tue, 26 Sep 2006 15:14:33 +0000 Subject: [PATCH] *) SOAP: old urlInfo renamed to urlInfoByHash, new urlInfo Function added. git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2662 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- .../anomic/soap/services/SearchService.java | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/source/de/anomic/soap/services/SearchService.java b/source/de/anomic/soap/services/SearchService.java index 1174a3f66..69cd1c435 100644 --- a/source/de/anomic/soap/services/SearchService.java +++ b/source/de/anomic/soap/services/SearchService.java @@ -45,9 +45,13 @@ package de.anomic.soap.services; +import java.net.MalformedURLException; + import org.apache.axis.AxisFault; import org.w3c.dom.Document; +import de.anomic.index.indexURL; +import de.anomic.net.URL; import de.anomic.plasma.plasmaSearchPreOrder; import de.anomic.server.serverObjects; import de.anomic.soap.AbstractService; @@ -161,9 +165,30 @@ public class SearchService extends AbstractService } } + /** + * @param url the url + * @param viewMode one of (VIEW_MODE_AS_PLAIN_TEXT = 1, + * VIEW_MODE_AS_PARSED_TEXT = 2, + * VIEW_MODE_AS_PARSED_SENTENCES = 3) [Source: ViewFile.java] + * @return an xml document containing the url info. * - * + * @throws AxisFault if the service could not be executed propery. + */ + public Document urlInfo(String urlStr, int viewMode) throws AxisFault { + try { + // getting the url hash for this url + URL url = new URL(urlStr); + String urlHash = indexURL.urlHash(url); + + // fetch urlInfo + return this.urlInfoByHash(urlHash, viewMode); + } catch (Exception e) { + throw new AxisFault(e.getMessage()); + } + } + + /** * @param urlHash the url hash * @param viewMode one of (VIEW_MODE_AS_PLAIN_TEXT = 1, * VIEW_MODE_AS_PARSED_TEXT = 2, @@ -172,7 +197,7 @@ public class SearchService extends AbstractService * * @throws AxisFault if the service could not be executed propery. */ - public Document urlInfo(String urlHash, int viewMode) throws AxisFault { + public Document urlInfoByHash(String urlHash, int viewMode) throws AxisFault { try { // extracting the message context extractMessageContext(true);