]> source.dussan.org Git - gitblit.git/commitdiff
Fix intermittent Wicket page expirations on EditNNN pages
authorJames Moger <james.moger@gitblit.com>
Tue, 30 Oct 2012 21:04:47 +0000 (17:04 -0400)
committerJames Moger <james.moger@gitblit.com>
Tue, 30 Oct 2012 21:04:47 +0000 (17:04 -0400)
src/com/gitblit/wicket/pages/EditRepositoryPage.java
src/com/gitblit/wicket/pages/EditTeamPage.java
src/com/gitblit/wicket/pages/EditUserPage.java
src/com/gitblit/wicket/pages/RootSubPage.java

index f791cf608e3c99b9b276dcf6858f30ccf144d6b9..cc0db68028580c0040afd52183be8387fa902acd 100644 (file)
@@ -115,6 +115,11 @@ public class EditRepositoryPage extends RootSubPage {
                setStatelessHint(false);\r
                setOutputMarkupId(true);\r
        }\r
+       \r
+       @Override\r
+       protected boolean requiresPageMap() {\r
+               return true;\r
+       }\r
 \r
        protected void setupPage(RepositoryModel model) {\r
                this.repositoryModel = model;\r
index 8ced03c24dc9fb63877ba419682b536e88513640..a22361f1611efb2719b5535b0e57db1d3e0f948d 100644 (file)
@@ -75,6 +75,11 @@ public class EditTeamPage extends RootSubPage {
                setOutputMarkupId(true);\r
        }\r
 \r
+       @Override\r
+       protected boolean requiresPageMap() {\r
+               return true;\r
+       }\r
+\r
        protected void setupPage(final TeamModel teamModel) {\r
                if (isCreate) {\r
                        super.setupPage(getString("gb.newTeam"), "");\r
index 19d297b1478605589062e49a381a4e8fcb000732..7942d6fab020271a2da93070cca3d674a66c93f2 100644 (file)
@@ -76,6 +76,11 @@ public class EditUserPage extends RootSubPage {
                setStatelessHint(false);\r
                setOutputMarkupId(true);\r
        }\r
+       \r
+       @Override\r
+       protected boolean requiresPageMap() {\r
+               return true;\r
+       }\r
 \r
        protected void setupPage(final UserModel userModel) {\r
                if (isCreate) {\r
index 891c892af5594c45d6c7be3d07b2d7a7a9c7c6c9..e7e12ccc67102e7062aec635c69ac0731c1b1c79 100644 (file)
@@ -19,6 +19,7 @@ import java.util.ArrayList;
 import java.util.List;\r
 \r
 import org.apache.wicket.PageParameters;\r
+import org.apache.wicket.Session;\r
 import org.apache.wicket.markup.html.basic.Label;\r
 \r
 import com.gitblit.Constants.AccessRestrictionType;\r
@@ -38,10 +39,27 @@ public abstract class RootSubPage extends RootPage {
 \r
        public RootSubPage() {\r
                super();\r
+               createPageMapIfNeeded();\r
        }\r
 \r
        public RootSubPage(PageParameters params) {\r
                super(params);\r
+               createPageMapIfNeeded();\r
+       }\r
+       \r
+       protected boolean requiresPageMap() {\r
+               return false;\r
+       }\r
+       \r
+       protected void createPageMapIfNeeded() {\r
+               if (requiresPageMap()) {\r
+                       // because Gitblit strives for page-statelessness\r
+                       // Wicket seems to get confused as to when it really should\r
+                       // generate a page map for complex pages.  Conditionally ensure we\r
+                       // have a page map for complex AJAX pages like the EditNNN pages.\r
+                       Session.get().pageMapForName(null, true);\r
+                       setVersioned(true);\r
+               }\r
        }\r
 \r
        @Override\r