package hirondelle.fish.translate.refresh;
import hirondelle.web4j.action.ActionTemplateShowAndApply;
import hirondelle.web4j.action.ResponsePage;
import hirondelle.web4j.config.TranslatorImpl;
import hirondelle.web4j.model.AppException;
import hirondelle.web4j.request.RequestParser;
public final class RefreshTranslations extends ActionTemplateShowAndApply {
public RefreshTranslations(RequestParser aRequestParser){
super(FORWARD, REDIRECT, aRequestParser);
}
protected void show() throws AppException {
addToRequest(NUM_TRANSLATION_RECORDS, TranslatorImpl.getNumTranslations());
}
protected void validateUserInput() throws AppException {
}
protected void apply() throws AppException {
TranslatorImpl.read();
}
private static final ResponsePage FORWARD = new ResponsePage(
"Refresh Translations", "RefreshTranslations.jsp", RefreshTranslations.class
);
private static final ResponsePage REDIRECT = new ResponsePage(
"RefreshTranslations.do?Operation=Show"
);
private static final String NUM_TRANSLATION_RECORDS = "numTranslations";
}