]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - rap/org.argeo.cms.e4.rap/src/org/argeo/cms/e4/rap/CmsLoginLifecycle.java
Refactor CMS UX API
[lgpl/argeo-commons.git] / rap / org.argeo.cms.e4.rap / src / org / argeo / cms / e4 / rap / CmsLoginLifecycle.java
index 3ee8df1ef76c27a9b44a672c16354d4b3fe0cf8a..471cdeca546f6a809107395df345d11b5e948bc1 100644 (file)
@@ -7,12 +7,11 @@ import javax.security.auth.Subject;
 import javax.security.auth.login.LoginContext;
 import javax.security.auth.login.LoginException;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.argeo.api.NodeConstants;
-import org.argeo.api.cms.CmsImageManager;
-import org.argeo.api.cms.CmsView;
-import org.argeo.api.cms.UxContext;
+import org.argeo.api.cms.CmsAuth;
+import org.argeo.api.cms.CmsLog;
+import org.argeo.api.cms.ux.CmsImageManager;
+import org.argeo.api.cms.ux.CmsView;
+import org.argeo.api.cms.ux.UxContext;
 import org.argeo.cms.auth.CurrentUser;
 import org.argeo.cms.swt.CmsSwtUtils;
 import org.argeo.cms.swt.SimpleSwtUxContext;
@@ -33,7 +32,7 @@ import org.osgi.service.event.EventHandler;
 
 @SuppressWarnings("restriction")
 public class CmsLoginLifecycle implements CmsView {
-       private final static Log log = LogFactory.getLog(CmsLoginLifecycle.class);
+       private final static CmsLog log = CmsLog.getLog(CmsLoginLifecycle.class);
 
        private UxContext uxContext;
        private CmsImageManager imageManager;
@@ -63,12 +62,13 @@ public class CmsLoginLifecycle implements CmsView {
                Subject subject = Subject.getSubject(AccessController.getContext());
                Display display = Display.getCurrent();
 //             UiContext.setData(CmsView.KEY, this);
-               CmsLoginShell loginShell = new CmsLoginShell(this);
+               // FIXME get CMS context
+               CmsLoginShell loginShell = new CmsLoginShell(this, null);
                CmsSwtUtils.registerCmsView(loginShell.getShell(), this);
                loginShell.setSubject(subject);
                try {
                        // try pre-auth
-                       loginContext = new LoginContext(NodeConstants.LOGIN_CONTEXT_USER, subject, loginShell);
+                       loginContext = new LoginContext(CmsAuth.LOGIN_CONTEXT_USER, subject, loginShell);
                        loginContext.login();
                } catch (LoginException e) {
                        loginShell.createUi();