From 10f6cb40e6f6b6738403768049e23323be7df9ef Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Tue, 30 Jul 2013 11:38:35 +0200 Subject: [PATCH] Improve View concept. --- src/fr/devinsy/xidyn/views/CharterView.java | 20 +++++++++ src/fr/devinsy/xidyn/views/View.java | 48 +-------------------- 2 files changed, 22 insertions(+), 46 deletions(-) create mode 100644 src/fr/devinsy/xidyn/views/CharterView.java diff --git a/src/fr/devinsy/xidyn/views/CharterView.java b/src/fr/devinsy/xidyn/views/CharterView.java new file mode 100644 index 0000000..d5d3c39 --- /dev/null +++ b/src/fr/devinsy/xidyn/views/CharterView.java @@ -0,0 +1,20 @@ +package fr.devinsy.xidyn.views; + +import java.util.Locale; + +/** + * + */ +public interface CharterView extends View +{ + /** + * + * @param userId + * @param lang + * @param content + * @return + */ + public StringBuffer getHtml(final Long userId, final Locale lang, final String content) throws Exception; +} + +// //////////////////////////////////////////////////////////////////////// \ No newline at end of file diff --git a/src/fr/devinsy/xidyn/views/View.java b/src/fr/devinsy/xidyn/views/View.java index 8f555a5..24ef458 100644 --- a/src/fr/devinsy/xidyn/views/View.java +++ b/src/fr/devinsy/xidyn/views/View.java @@ -1,58 +1,14 @@ package fr.devinsy.xidyn.views; -import fr.devinsy.xidyn.presenters.Presenter; - /** * */ -public class View { +public interface View { /** * */ - public StringBuffer getHtml() { - StringBuffer result; + public StringBuffer getHtml() throws Exception; - result = null; - - // - return (result); - } - - /** - * - */ - public StringBuffer getHtmlBody() { - StringBuffer result; - - StringBuffer html = this.getHtml(); - - if (html == null) { - result = new StringBuffer(); - } else { - String body = Presenter.extractBodyContent(html); - - if (body == null) { - result = new StringBuffer(); - } else { - result = new StringBuffer(body); - } - } - - // - return (result); - } - - /** - * - */ - public boolean isDeprecated() { - boolean result; - - result = true; - - // - return result; - } } // //////////////////////////////////////////////////////////////////////// \ No newline at end of file