fix some hard coded page titles and messages

This commit is contained in:
Stefan Wolff 2016-09-23 17:25:05 +02:00
parent 5539034f00
commit 8c8985bdc2
6 changed files with 32 additions and 12 deletions

View file

@ -16,6 +16,7 @@ import edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServ
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues;
import edu.cornell.mannlib.vitro.webapp.i18n.I18n;
/** /**
* Offer the user the ability to apply a RestrictedAuthenticator or revert to a * Offer the user the ability to apply a RestrictedAuthenticator or revert to a
@ -80,7 +81,7 @@ public class RestrictLoginsController extends FreemarkerHttpServlet {
boolean restricted = figureCurrentlyState() == State.RESTRICTED; boolean restricted = figureCurrentlyState() == State.RESTRICTED;
Map<String, Object> body = new HashMap<String, Object>(); Map<String, Object> body = new HashMap<String, Object>();
body.put("title", "Restrict Logins"); body.put("title", I18n.text(vreq, "restrict_logins"));
body.put("restricted", restricted); body.put("restricted", restricted);
if (!MESSAGE_NO_MESSAGE.equals(messageCode)) { if (!MESSAGE_NO_MESSAGE.equals(messageCode)) {
body.put(messageCode, Boolean.TRUE); body.put(messageCode, Boolean.TRUE);

View file

@ -11,6 +11,7 @@ import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues;
import edu.cornell.mannlib.vitro.webapp.i18n.I18n;
import edu.cornell.mannlib.vitro.webapp.startup.StartupStatus; import edu.cornell.mannlib.vitro.webapp.startup.StartupStatus;
/** /**
@ -27,7 +28,7 @@ public class StartupStatusController extends FreemarkerHttpServlet {
protected ResponseValues processRequest(VitroRequest vreq) { protected ResponseValues processRequest(VitroRequest vreq) {
Map<String, Object> body = new HashMap<String, Object>(); Map<String, Object> body = new HashMap<String, Object>();
body.put("title", "Startup Status"); body.put("title", I18n.text(vreq, "startup_status"));
body.put("status", StartupStatus.getBean(getServletContext())); body.put("status", StartupStatus.getBean(getServletContext()));
body.put("contextPath", getContextPath()); body.put("contextPath", getContextPath());
body.put("applicationName", getApplicationName(vreq)); body.put("applicationName", getApplicationName(vreq));

View file

@ -27,6 +27,7 @@ import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues;
import edu.cornell.mannlib.vitro.webapp.dao.DisplayVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.DisplayVocabulary;
import edu.cornell.mannlib.vitro.webapp.i18n.I18n;
import edu.cornell.mannlib.vitro.webapp.utils.dataGetter.DataGetter; import edu.cornell.mannlib.vitro.webapp.utils.dataGetter.DataGetter;
import edu.cornell.mannlib.vitro.webapp.utils.dataGetter.DataGetterUtils; import edu.cornell.mannlib.vitro.webapp.utils.dataGetter.DataGetterUtils;
/** /**
@ -188,23 +189,23 @@ public class PageController extends FreemarkerHttpServlet{
private ResponseValues doError(VitroRequest vreq) { private ResponseValues doError(VitroRequest vreq) {
Map<String, Object> body = new HashMap<String, Object>(); Map<String, Object> body = new HashMap<String, Object>();
body.put("title","Page could not be created"); body.put("title", I18n.text(vreq, "page_not_created"));
body.put("errorMessage", "There was an error while creating the page, please check the logs."); body.put("errorMessage", I18n.text(vreq, "page_not_created_msg"));
return new TemplateResponseValues(Template.TITLED_ERROR_MESSAGE.toString(), body, HttpServletResponse.SC_INTERNAL_SERVER_ERROR); return new TemplateResponseValues(Template.TITLED_ERROR_MESSAGE.toString(), body, HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
} }
private ResponseValues doNotFound(VitroRequest vreq) { private ResponseValues doNotFound(VitroRequest vreq) {
Map<String, Object> body = new HashMap<String, Object>(); Map<String, Object> body = new HashMap<String, Object>();
body.put("title","Page Not Found"); body.put("title", I18n.text(vreq, "page_not_found"));
body.put("errorMessage", "The page was not found in the system."); body.put("errorMessage", I18n.text(vreq, "page_not_found_msg"));
return new TemplateResponseValues(Template.TITLED_ERROR_MESSAGE.toString(), body, HttpServletResponse.SC_NOT_FOUND); return new TemplateResponseValues(Template.TITLED_ERROR_MESSAGE.toString(), body, HttpServletResponse.SC_NOT_FOUND);
} }
private ResponseValues doNoPageSpecified(VitroRequest vreq) { private ResponseValues doNoPageSpecified(VitroRequest vreq) {
Map<String, Object> body = new HashMap<String, Object>(); Map<String, Object> body = new HashMap<String, Object>();
body.put("title","No page URI specified"); body.put("title",I18n.text(vreq, "page_uri_missing"));
body.put("errorMessage", "Could not generate page beacause it was unclear what page was being requested. A URL mapping may be missing."); body.put("errorMessage", I18n.text(vreq, "page_uri_missing_msg"));
return new TemplateResponseValues(Template.TITLED_ERROR_MESSAGE.toString(), body, HttpServletResponse.SC_NOT_FOUND); return new TemplateResponseValues(Template.TITLED_ERROR_MESSAGE.toString(), body, HttpServletResponse.SC_NOT_FOUND);
} }

View file

@ -21,6 +21,7 @@ import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.Exc
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.RedirectResponseValues; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.RedirectResponseValues;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues;
import edu.cornell.mannlib.vitro.webapp.i18n.I18n;
/** /**
* Handles requests for entity information. * Handles requests for entity information.
@ -74,7 +75,7 @@ public class IndividualController extends FreemarkerHttpServlet {
* If we can't figure out what individual you want, or if there * If we can't figure out what individual you want, or if there
* is no such individual, show an informative error page. * is no such individual, show an informative error page.
*/ */
return doNotFound(); return doNotFound(vreq);
case BYTESTREAM_REDIRECT: case BYTESTREAM_REDIRECT:
/* /*
* If the Individual requested is a FileBytestream, redirect * If the Individual requested is a FileBytestream, redirect
@ -116,10 +117,10 @@ public class IndividualController extends FreemarkerHttpServlet {
new IndividualRequestAnalysisContextImpl(vreq)).analyze(); new IndividualRequestAnalysisContextImpl(vreq)).analyze();
} }
private ResponseValues doNotFound() { private ResponseValues doNotFound(VitroRequest vreq) {
Map<String, Object> body = new HashMap<String, Object>(); Map<String, Object> body = new HashMap<String, Object>();
body.put("title", "Individual Not Found"); body.put("title", I18n.text(vreq, "individual_not_found"));
body.put("errorMessage", "The individual was not found in the system."); body.put("errorMessage", I18n.text(vreq, "individual_not_found_msg"));
return new TemplateResponseValues(TEMPLATE_HELP, body, return new TemplateResponseValues(TEMPLATE_HELP, body,
HttpServletResponse.SC_NOT_FOUND); HttpServletResponse.SC_NOT_FOUND);

View file

@ -234,6 +234,7 @@ verbose_turn_off = Apagar
resource_uri = URI de recursos resource_uri = URI de recursos
individual_not_found = Individual no encontrado individual_not_found = Individual no encontrado
individual_not_found_msg = El individuo no se encontró en el sistema.
entity_to_query_for = Este id es el identificador de la entidad para consultar. netid también funciona. entity_to_query_for = Este id es el identificador de la entidad para consultar. netid también funciona.
menu_ordering = Menú pedidos menu_ordering = Menú pedidos
@ -423,6 +424,13 @@ run_sdb_setup = Ejecutar la instalación SDB
unrecognized_user = Usuario no reconocido unrecognized_user = Usuario no reconocido
no_individual_associated_with_id = Por alguna razón, no hay ninguna persona en VIVO que se asocia con su ID de red. Tal vez usted debería ponerse en contacto con el administrador de VIVO. no_individual_associated_with_id = Por alguna razón, no hay ninguna persona en VIVO que se asocia con su ID de red. Tal vez usted debería ponerse en contacto con el administrador de VIVO.
page_not_created = página no pudo ser creado
page_not_created_msg = Se ha producido un error al crear la página, por favor, compruebe los registros.
page_not_found = Página no encontrada
page_not_found_msg = La página no se ha encontrado en el sistema.
page_uri_missing = No se especifica la página URI
page_uri_missing_msg = No se pudo generar la página pd no estaba claro en qué página se está solicitando. Una asignación de dirección URL es posible que falte.
# #
# site admin templates ( /templates/freemarker/body/siteAdmin ) # site admin templates ( /templates/freemarker/body/siteAdmin )
# #

View file

@ -246,6 +246,7 @@ verbose_turn_off = Turn off
resource_uri = Resource URI resource_uri = Resource URI
individual_not_found = Individual not found individual_not_found = Individual not found
individual_not_found_msg = The individual was not found in the system.
entity_to_query_for = This id is the id of the entity to query for. netid also works. entity_to_query_for = This id is the id of the entity to query for. netid also works.
menu_ordering = Menu Ordering menu_ordering = Menu Ordering
@ -435,6 +436,13 @@ run_sdb_setup = Run SDB Setup
unrecognized_user = Unrecognized user unrecognized_user = Unrecognized user
no_individual_associated_with_id = For some reason, there is no individual in VIVO that is associated with your Net ID. Perhaps you should contact your VIVO administrator. no_individual_associated_with_id = For some reason, there is no individual in VIVO that is associated with your Net ID. Perhaps you should contact your VIVO administrator.
page_not_created = Page could not be created
page_not_created_msg = There was an error while creating the page, please check the logs.
page_not_found = Page Not Found
page_not_found_msg = The page was not found in the system.
page_uri_missing = No page URI specified
page_uri_missing_msg = Could not generate page beacause it was unclear what page was being requested. A URL mapping may be missing.
# #
# site admin templates ( /templates/freemarker/body/siteAdmin ) # site admin templates ( /templates/freemarker/body/siteAdmin )
# #