Class AbstractPageHandler
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.controller.AbstractPageHandler
-
- Direct Known Subclasses:
ManageProxiesCreatePage,ManageProxiesEditPage,ManageProxiesListPage,UserAccountsPage
public abstract class AbstractPageHandler extends Object
A base class with some utility routines for page handler (created by controller classes. The controller logic is often complicated by the fact that the servlet must be multi-threaded. If a "page handler" instance is created for each request, it may share instance variables among its methods, which frequently makes for clearer logic.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractPageHandler.InvalidParametersExceptionIndicates that parameters have failed validation.static classAbstractPageHandler.MessageSet one of these on the session, so it can be interpreted and displayed at the next request.
-
Field Summary
Fields Modifier and Type Field Description protected javax.servlet.ServletContextctxprotected DataPropertyStatementDaodpsDaoprotected I18nBundlei18nprotected IndividualDaoindDaoprotected ObjectPropertyStatementDaoopsDaoprotected org.apache.jena.ontology.OntModelunionModelprotected UserAccountsDaouserAccountsDaoprotected org.apache.jena.ontology.OntModeluserAccountsModelprotected VClassDaovclassDaoprotected VitroRequestvreq
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractPageHandler(VitroRequest vreq)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapplyMessage(javax.servlet.http.HttpServletRequest req, Map<String,Object> body)If a Message has been set in the session, get it, store its info in the body map under "message", and remove it from the session, so it will not be displayed again.protected intgetIntegerParameter(String key, int defaultValue)protected StringgetStringParameter(String key, String defaultValue)protected List<String>getStringParameters(String key)protected booleanisFlagOnRequest(String key)Check for the presence of a parameter, regardless of its value, even if it's an empty string.protected booleanisParameterAsExpected(String key, String expected)Treat the presence of a certain parameter, with a desired value, as a boolean flag.
-
-
-
Field Detail
-
vreq
protected final VitroRequest vreq
-
i18n
protected final I18nBundle i18n
-
ctx
protected final javax.servlet.ServletContext ctx
-
userAccountsModel
protected final org.apache.jena.ontology.OntModel userAccountsModel
-
unionModel
protected final org.apache.jena.ontology.OntModel unionModel
-
userAccountsDao
protected final UserAccountsDao userAccountsDao
-
vclassDao
protected final VClassDao vclassDao
-
indDao
protected final IndividualDao indDao
-
dpsDao
protected final DataPropertyStatementDao dpsDao
-
opsDao
protected final ObjectPropertyStatementDao opsDao
-
-
Constructor Detail
-
AbstractPageHandler
protected AbstractPageHandler(VitroRequest vreq)
-
-
Method Detail
-
getIntegerParameter
protected int getIntegerParameter(String key, int defaultValue)
-
isFlagOnRequest
protected boolean isFlagOnRequest(String key)
Check for the presence of a parameter, regardless of its value, even if it's an empty string.
-
isParameterAsExpected
protected boolean isParameterAsExpected(String key, String expected)
Treat the presence of a certain parameter, with a desired value, as a boolean flag. An example would be radio buttons with values of "yes" and "no". The expected value would be "yes".
-
-