]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - org.argeo.cms/src/org/argeo/cms/util/SimpleApp.java
Simplify authentication
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / util / SimpleApp.java
index be764e975b10ca8bb9f978ae6b2e715e15ba9079..9f0e32037f7c9c78c3080ba8c97325f4a1d0a1ec 100644 (file)
@@ -19,7 +19,6 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.argeo.cms.CmsConstants;
 import org.argeo.cms.CmsException;
-import org.argeo.cms.CmsSession;
 import org.argeo.cms.CmsUiProvider;
 import org.argeo.cms.LifeCycleUiProvider;
 import org.argeo.jcr.JcrUtils;
@@ -60,6 +59,8 @@ public class SimpleApp implements CmsConstants, ApplicationConfiguration,
        public void configure(Application application) {
                try {
                        application.setOperationMode(OperationMode.SWT_COMPATIBILITY);
+                       // application.setOperationMode(OperationMode.JEE_COMPATIBILITY);
+
                        application.setExceptionHandler(new CmsExceptionHandler());
 
                        // loading animated gif
@@ -97,11 +98,13 @@ public class SimpleApp implements CmsConstants, ApplicationConfiguration,
                                }
 
                                // page title
-                               if (!properties.containsKey(WebClient.PAGE_TITLE))
-                                       properties.put(
-                                                       WebClient.PAGE_TITLE,
-                                                       Character.toUpperCase(page.charAt(0))
-                                                                       + page.substring(1));
+                               if (!properties.containsKey(WebClient.PAGE_TITLE)) {
+                                       if (page.length() > 0)
+                                               properties.put(
+                                                               WebClient.PAGE_TITLE,
+                                                               Character.toUpperCase(page.charAt(0))
+                                                                               + page.substring(1));
+                               }
 
                                // default body HTML
                                if (!properties.containsKey(WebClient.BODY_HTML))
@@ -233,7 +236,7 @@ public class SimpleApp implements CmsConstants, ApplicationConfiguration,
 
                @Override
                public void handleException(Throwable throwable) {
-                       CmsSession.current.get().exception(throwable);
+                       CmsUtils.getCmsView().exception(throwable);
                }
 
        }
@@ -259,7 +262,7 @@ public class SimpleApp implements CmsConstants, ApplicationConfiguration,
                        // entryPoint.setState("");
                        entryPoint.setHeader(header);
                        entryPoint.setHeaderHeight(headerHeight);
-                       CmsSession.current.set(entryPoint);
+                       // CmsSession.current.set(entryPoint);
                        return entryPoint;
                }