X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms%2Fsrc%2Forg%2Fargeo%2Fcms%2FAbstractCmsEntryPoint.java;h=cd7eae42346104197264428562d6768bf26da6a1;hb=3dd2fac453c0268721370c009d4b1515a9b02cd8;hp=6043980e90f8b58a927e45da360027dab298cad2;hpb=f26fa850fab8c3666e6cc27683991f2d11378e5b;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.cms/src/org/argeo/cms/AbstractCmsEntryPoint.java b/org.argeo.cms/src/org/argeo/cms/AbstractCmsEntryPoint.java index 6043980e9..cd7eae423 100644 --- a/org.argeo.cms/src/org/argeo/cms/AbstractCmsEntryPoint.java +++ b/org.argeo.cms/src/org/argeo/cms/AbstractCmsEntryPoint.java @@ -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;