\r
@Override\r
protected void setupPage(String repositoryName, String pageName) {\r
+ \r
+ //This method should only be called once in the page lifecycle.\r
+ //However, it must be called after the constructor has run, hence not in onInitialize\r
+ //It may be attempted to be called again if an info or error message is displayed.\r
+ if (get("projectTitle") != null) { return; }\r
+ \r
String projectName = StringUtils.getFirstPathElement(repositoryName);\r
ProjectModel project = app().projects().getProjectModel(projectName);\r
+\r
if (project.isUserProject()) {\r
// user-as-project\r
add(new LinkPanel("projectTitle", null, project.getDisplayName(),\r
}\r
}\r
\r
- @Override\r
- protected void onInitialize() {\r
-\r
- super.onInitialize();\r
\r
- // setup page header and footer\r
- setupPage(getRepositoryName(), "/ " + getPageName());\r
- }\r
- \r
@Override\r
protected void onBeforeRender() {\r
// dispose of repository object\r
r.close();\r
r = null;\r
}\r
+ \r
+ // setup page header and footer\r
+ setupPage(getRepositoryName(), "/ " + getPageName());\r
\r
super.onBeforeRender();\r
}\r