X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Flibrary%2FWebLibraryServerHtml.java;h=a534b4cdafbbdd8ec1c4c6b373bb7fc2953ec58c;hb=f70bcacf8bfccfff405d4fdaaa38b0e322945125;hp=e79d6f5ea4ad0a736dbaea826447d61682b50ad6;hpb=e4b1b70c5388573bda8ae28f9391ee3831e53feb;p=nikiroo-utils.git diff --git a/src/be/nikiroo/fanfix/library/WebLibraryServerHtml.java b/src/be/nikiroo/fanfix/library/WebLibraryServerHtml.java index e79d6f5..a534b4c 100644 --- a/src/be/nikiroo/fanfix/library/WebLibraryServerHtml.java +++ b/src/be/nikiroo/fanfix/library/WebLibraryServerHtml.java @@ -47,6 +47,9 @@ abstract class WebLibraryServerHtml implements Runnable { abstract protected Response getStoryPart(String uri, WLoginResult login); + abstract protected Response setStoryPart(String uri, String value, + WLoginResult login) throws IOException; + abstract protected Response getCover(String uri, WLoginResult login) throws IOException; @@ -59,6 +62,11 @@ abstract class WebLibraryServerHtml implements Runnable { abstract protected Story story(String luid, WLoginResult login) throws IOException; + protected abstract Response imprt(String uri, String url, + WLoginResult login) throws IOException; + + protected abstract Response imprtProgress(String uri, WLoginResult login); + public WebLibraryServerHtml(boolean secure) throws IOException { Integer port = Instance.getInstance().getConfig() .getInteger(Config.SERVER_PORT); @@ -178,13 +186,25 @@ abstract class WebLibraryServerHtml implements Runnable { } else if (WebLibraryUrls.isListUrl(uri)) { rep = getList(uri, login); } else if (WebLibraryUrls.isStoryUrl(uri)) { - rep = getStoryPart(uri, login); + String value = params.get("value"); + if (value != null) { + rep = setStoryPart(uri, value, login); + } else { + rep = getStoryPart(uri, login); + } } else if (WebLibraryUrls.isViewUrl(uri)) { rep = getViewer(cookies, uri, login); } else if (WebLibraryUrls.LOGOUT_URL.equals(uri)) { session.getCookies().delete("cookie"); cookies.remove("cookie"); rep = loginPage(login(false, false), uri); + } else if (WebLibraryUrls.isImprtUrl(uri)) { + String url = params.get("url"); + if (url != null) { + rep = imprt(uri, url, login); + } else { + rep = imprtProgress(uri, login); + } } else { getTraceHandler().error( "Supported URL was not processed: "