Start preparing refactoring of CmsApplication
authorMathieu Baudier <mbaudier@argeo.org>
Tue, 28 Apr 2015 08:51:30 +0000 (08:51 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Tue, 28 Apr 2015 08:51:30 +0000 (08:51 +0000)
git-svn-id: https://svn.argeo.org/commons/trunk@8082 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

org.argeo.cms/src/org/argeo/cms/CmsApplication.java

index 9c7b5b3447ac707863a53047587ea36407f8fa85..fdf2e0270d2214da402030197fcb369c75fa5957 100644 (file)
@@ -122,8 +122,11 @@ public class CmsApplication implements CmsConstants, ApplicationConfiguration,
                                if (!properties.containsKey(WebClient.BODY_HTML))
                                        properties.put(WebClient.BODY_HTML, DEFAULT_LOADING_BODY);
 
+                               //
+                               // ADD ENTRY POINT
+                               //
                                application.addEntryPoint("/" + page, new CmsEntryPointFactory(
-                                               page), properties);
+                                               pages.get(page), repository, workspace), properties);
                                log.info("Registered entry point /" + page);
                        }
 
@@ -256,16 +259,21 @@ public class CmsApplication implements CmsConstants, ApplicationConfiguration,
        }
 
        private class CmsEntryPointFactory implements EntryPointFactory {
-               private final String page;
+               private final CmsUiProvider page;
+               private final Repository repository;
+               private final String workspace;
 
-               public CmsEntryPointFactory(String page) {
+               public CmsEntryPointFactory(CmsUiProvider page, Repository repository,
+                               String workspace) {
                        this.page = page;
+                       this.repository = repository;
+                       this.workspace = workspace;
                }
 
                @Override
                public EntryPoint create() {
                        CmsEntryPoint entryPoint = new CmsEntryPoint(repository, workspace,
-                                       pages.get(page));
+                                       page);
                        entryPoint.setState("");
                        CmsSession.current.set(entryPoint);
                        return entryPoint;