Improve View concept.
This commit is contained in:
parent
27e8c74721
commit
10f6cb40e6
2 changed files with 22 additions and 46 deletions
20
src/fr/devinsy/xidyn/views/CharterView.java
Normal file
20
src/fr/devinsy/xidyn/views/CharterView.java
Normal 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;
|
||||
}
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////
|
Loading…
Reference in a new issue