]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - org.argeo.cms/src/org/argeo/cms/AbstractCmsEntryPoint.java
Enhance comments, remove typos
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / AbstractCmsEntryPoint.java
index 6043980e90f8b58a927e45da360027dab298cad2..cd7eae42346104197264428562d6768bf26da6a1 100644 (file)
@@ -11,6 +11,7 @@ import javax.jcr.nodetype.NodeType;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.argeo.cms.i18n.Msg;
 import org.argeo.jcr.JcrUtils;
 import org.eclipse.rap.rwt.RWT;
 import org.eclipse.rap.rwt.application.AbstractEntryPoint;
@@ -22,8 +23,8 @@ import org.eclipse.swt.widgets.Shell;
 import org.springframework.security.core.context.SecurityContextHolder;
 
 /** Manages history and navigation */
-public abstract class AbstractCmsEntryPoint extends AbstractEntryPoint
-               implements CmsSession {
+abstract class AbstractCmsEntryPoint extends AbstractEntryPoint implements
+               CmsSession {
        private final Log log = LogFactory.getLog(AbstractCmsEntryPoint.class);
 
        private Repository repository;
@@ -39,8 +40,17 @@ public abstract class AbstractCmsEntryPoint extends AbstractEntryPoint
        private BrowserNavigation history;
 
        public AbstractCmsEntryPoint(Repository repository, String workspace) {
-               if (SecurityContextHolder.getContext().getAuthentication() == null)
-                       logAsAnonymous();
+               // if (SecurityContextHolder.getContext().getAuthentication() == null) {
+               // HttpSession httpSession = RWT.getRequest().getSession();
+               // // log.debug("Session: " + httpSession.getId());
+               // SecurityContext contextFromSessionObject = (SecurityContext)
+               // httpSession
+               // .getAttribute(SPRING_SECURITY_CONTEXT_KEY);
+               // if (contextFromSessionObject != null)
+               // SecurityContextHolder.setContext(contextFromSessionObject);
+               // else
+               // logAsAnonymous();
+               // }
 
                this.repository = repository;
                this.workspace = workspace;
@@ -200,15 +210,12 @@ public abstract class AbstractCmsEntryPoint extends AbstractEntryPoint
                                page = prefix;
                        } else {
                                node = getDefaultNode(session);
-                               if (state.equals("~"))
-                                       page = "";
-                               else
-                                       page = state;
+                               page = state;
                        }
 
                        if (log.isTraceEnabled())
-                               log.trace("page=" + page + ", node=" + node + ", state="
-                                               + state);
+                               log.trace("node=" + node + ", state=" + state + " (page="
+                                               + page);
 
                } catch (RepositoryException e) {
                        throw new CmsException("Cannot retrieve node", e);
@@ -231,9 +238,9 @@ public abstract class AbstractCmsEntryPoint extends AbstractEntryPoint
                return state;
        }
 
-       protected String getPage() {
-               return page;
-       }
+       // String getPage() {
+       // return page;
+       // }
 
        protected Throwable getException() {
                return exception;