Adding title to menu pages NIHVIVO-1579
This commit is contained in:
parent
f37838eb2a
commit
f1ec7240bd
1 changed files with 8 additions and 4 deletions
|
@ -36,8 +36,8 @@ public class PageController extends FreemarkerHttpServlet{
|
||||||
protected final static String DEFAULT_TITLE = "Page";
|
protected final static String DEFAULT_TITLE = "Page";
|
||||||
protected final static String DEFAULT_BODY_TEMPLATE = "menupage.ftl";
|
protected final static String DEFAULT_BODY_TEMPLATE = "menupage.ftl";
|
||||||
|
|
||||||
protected static Map<String,PageDataGetter> typeToDataGetter;
|
protected static Map<String,PageDataGetter> typeToDataGetter;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ResponseValues processRequest(VitroRequest vreq) {
|
protected ResponseValues processRequest(VitroRequest vreq) {
|
||||||
try {
|
try {
|
||||||
|
@ -50,7 +50,10 @@ public class PageController extends FreemarkerHttpServlet{
|
||||||
try {
|
try {
|
||||||
pageUri = getPageUri( vreq , url );
|
pageUri = getPageUri( vreq , url );
|
||||||
page = getMapForPage( vreq, pageUri );
|
page = getMapForPage( vreq, pageUri );
|
||||||
mapForTemplate.put( "page", page);
|
mapForTemplate.put( "page", page);
|
||||||
|
if( page.containsKey("title") ){
|
||||||
|
mapForTemplate.put("title", page.get("title"));
|
||||||
|
}
|
||||||
} catch (Throwable th) {
|
} catch (Throwable th) {
|
||||||
return doNotFound(vreq);
|
return doNotFound(vreq);
|
||||||
}
|
}
|
||||||
|
@ -62,7 +65,8 @@ public class PageController extends FreemarkerHttpServlet{
|
||||||
return doError(vreq);
|
return doError(vreq);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new TemplateResponseValues(getTemplate( mapForTemplate ), mapForTemplate);
|
ResponseValues rv = new TemplateResponseValues(getTemplate( mapForTemplate ), mapForTemplate);
|
||||||
|
return rv;
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
log.error(e);
|
log.error(e);
|
||||||
return new ExceptionResponseValues(e);
|
return new ExceptionResponseValues(e);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue