Improve View concept.

This commit is contained in:
Christian P. MOMON 2013-07-30 11:38:35 +02:00
parent 27e8c74721
commit 10f6cb40e6
2 changed files with 22 additions and 46 deletions

View file

@ -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;
}
// ////////////////////////////////////////////////////////////////////////

View file

@ -1,58 +1,14 @@
package fr.devinsy.xidyn.views; package fr.devinsy.xidyn.views;
import fr.devinsy.xidyn.presenters.Presenter;
/** /**
* *
*/ */
public class View { public interface View {
/** /**
* *
*/ */
public StringBuffer getHtml() { public StringBuffer getHtml() throws Exception;
StringBuffer result;
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;
}
} }
// //////////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////////////