You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2014/10/04 14:31:46 UTC
[11/12] ISIS-802: removing UserProfileStore, Perspective,
Options. Localization reverted to using the server default (since was
only ever populated in Scimpi,
and there are other JIRA issues already raised to implement client-side i18n).
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerUserProfileStore.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerUserProfileStore.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerUserProfileStore.java
deleted file mode 100644
index 9c0fa8a..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/runner/opts/OptionHandlerUserProfileStore.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.core.runtime.runner.opts;
-
-import static org.apache.isis.core.runtime.runner.Constants.USER_PROFILE_STORE_LONG_OPT;
-import static org.apache.isis.core.runtime.runner.Constants.USER_PROFILE_STORE_OPT;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.OptionBuilder;
-import org.apache.commons.cli.Options;
-
-import org.apache.isis.core.commons.config.IsisConfigurationBuilder;
-import org.apache.isis.core.runtime.installerregistry.InstallerRepository;
-import org.apache.isis.core.runtime.optionhandler.BootPrinter;
-import org.apache.isis.core.runtime.optionhandler.OptionHandlerAbstract;
-import org.apache.isis.core.runtime.runner.Constants;
-import org.apache.isis.core.runtime.system.SystemConstants;
-import org.apache.isis.core.runtime.userprofile.UserProfileStoreInstaller;
-
-public class OptionHandlerUserProfileStore extends OptionHandlerAbstract {
-
- private final InstallerRepository installerRepository;
- private String userProfileStoreName;
-
- public OptionHandlerUserProfileStore(final InstallerRepository installerRepository) {
- this.installerRepository = installerRepository;
- }
-
- @Override
- @SuppressWarnings("static-access")
- public void addOption(final Options options) {
- final Object[] persistenceMechanisms = installerRepository.getInstallers(UserProfileStoreInstaller.class);
- final Option option = OptionBuilder.withArgName("name|class name").hasArg().withLongOpt(USER_PROFILE_STORE_LONG_OPT).withDescription("user profile store to use: " + availableInstallers(persistenceMechanisms) + "; or class name").create(USER_PROFILE_STORE_OPT);
- options.addOption(option);
- }
-
- @Override
- public boolean handle(final CommandLine commandLine, final BootPrinter bootPrinter, final Options options) {
- userProfileStoreName = commandLine.getOptionValue(Constants.USER_PROFILE_STORE_OPT);
- return true;
- }
-
- @Override
- public void primeConfigurationBuilder(final IsisConfigurationBuilder isisConfigurationBuilder) {
- isisConfigurationBuilder.add(SystemConstants.PROFILE_PERSISTOR_INSTALLER_KEY, userProfileStoreName);
- }
-
- public String getUserProfileStoreName() {
- return userProfileStoreName;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystemFixturesHookAbstract.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystemFixturesHookAbstract.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystemFixturesHookAbstract.java
index b9c849c..2f6be7b 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystemFixturesHookAbstract.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/IsisSystemFixturesHookAbstract.java
@@ -51,7 +51,6 @@ import org.apache.isis.core.runtime.system.session.IsisSession;
import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
import org.apache.isis.core.runtime.system.transaction.IsisTransactionManager;
import org.apache.isis.core.runtime.system.transaction.IsisTransactionManagerException;
-import org.apache.isis.core.runtime.userprofile.UserProfileStore;
/**
* An implementation of {@link IsisSystem} that has a hook for installing
@@ -285,9 +284,9 @@ public abstract class IsisSystemFixturesHookAbstract implements IsisSystem {
* The {@link LogonFixture}, if any, obtained by running fixtures.
*
* <p>
- * Intended to be used when for {@link DeploymentType#EXPLORATION
+ * Intended to be used when for {@link DeploymentType#SERVER_EXPLORATION
* exploration} (instead of an {@link ExplorationSession}) or
- * {@link DeploymentType#PROTOTYPE prototype} deployments (saves logging
+ * {@link DeploymentType#SERVER_PROTOTYPE prototype} deployments (saves logging
* in). Should be <i>ignored</i> in other {@link DeploymentType}s.
*
* <p>
@@ -316,12 +315,6 @@ public abstract class IsisSystemFixturesHookAbstract implements IsisSystem {
protected abstract AuthorizationManager obtainAuthorizationManager(final DeploymentType deploymentType);
// ///////////////////////////////////////////
- // UserProfileLoader
- // ///////////////////////////////////////////
-
- protected abstract UserProfileStore obtainUserProfileStore();
-
- // ///////////////////////////////////////////
// Container & Services
// ///////////////////////////////////////////
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/core/runtime/src/main/java/org/apache/isis/core/runtime/system/SystemConstants.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/SystemConstants.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/SystemConstants.java
index 49803aa..62a2bee 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/SystemConstants.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/SystemConstants.java
@@ -31,8 +31,6 @@ import org.apache.isis.core.runtime.fixtures.FixturesInstaller;
import org.apache.isis.core.runtime.installerregistry.installerapi.PersistenceMechanismInstaller;
import org.apache.isis.core.runtime.services.ServicesInstaller;
import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
-import org.apache.isis.core.runtime.userprofile.UserProfileStore;
-import org.apache.isis.core.runtime.userprofile.UserProfileStoreInstaller;
public final class SystemConstants {
@@ -73,20 +71,6 @@ public final class SystemConstants {
// TODO: move to being a responsibility of DeploymentType instead
public static final String OBJECT_PERSISTOR_PRODUCTION_DEFAULT = "datanucleus";
- /**
- * Key used to lookup {@link UserProfileStore user profile store} (via
- * command line) in {@link IsisConfiguration}, and root for any
- * {@link UserProfileStoreInstaller user profile store} -specific
- * configuration keys.
- */
- public final static String PROFILE_PERSISTOR_INSTALLER_KEY = ConfigurationConstants.ROOT + UserProfileStoreInstaller.TYPE;
-
- // TODO: inline
- public static final String USER_PROFILE_STORE_KEY = PROFILE_PERSISTOR_INSTALLER_KEY;
- // TODO: move to being a responsibility of DeploymentType instead
- public static final String USER_PROFILE_STORE_NON_PRODUCTION_DEFAULT = "in-memory";
- // TODO: move to being a responsibility of DeploymentType instead
- public static final String USER_PROFILE_STORE_PRODUCTION_DEFAULT = "in-memory";
/**
* Key used to lookup {@link AuthenticationManager authentication manager}
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/core/runtime/src/main/java/org/apache/isis/core/runtime/system/context/IsisContext.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/context/IsisContext.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/context/IsisContext.java
index adbc41f..2b139a4 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/context/IsisContext.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/context/IsisContext.java
@@ -20,10 +20,8 @@
package org.apache.isis.core.runtime.system.context;
import java.util.List;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
import org.apache.isis.applib.profiles.Localization;
import org.apache.isis.core.commons.authentication.AuthenticationSession;
import org.apache.isis.core.commons.components.TransactionScopedComponent;
@@ -33,10 +31,10 @@ import org.apache.isis.core.commons.debug.DebugBuilder;
import org.apache.isis.core.commons.debug.DebugList;
import org.apache.isis.core.commons.debug.DebuggableWithTitle;
import org.apache.isis.core.commons.exceptions.IsisException;
+import org.apache.isis.core.metamodel.adapter.LocalizationDefault;
import org.apache.isis.core.metamodel.adapter.oid.OidMarshaller;
import org.apache.isis.core.metamodel.spec.SpecificationLoaderSpi;
import org.apache.isis.core.runtime.authentication.AuthenticationManager;
-import org.apache.isis.core.runtime.authorization.AuthorizationManager;
import org.apache.isis.core.runtime.system.DeploymentType;
import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
import org.apache.isis.core.runtime.system.session.IsisSession;
@@ -45,8 +43,6 @@ import org.apache.isis.core.runtime.system.transaction.IsisTransaction;
import org.apache.isis.core.runtime.system.transaction.IsisTransactionManager;
import org.apache.isis.core.runtime.system.transaction.MessageBroker;
import org.apache.isis.core.runtime.system.transaction.UpdateNotifier;
-import org.apache.isis.core.runtime.userprofile.UserProfile;
-import org.apache.isis.core.runtime.userprofile.UserProfileLoader;
/**
* Provides singleton <i>access to</i> the current (session scoped)
@@ -364,10 +360,6 @@ public abstract class IsisContext implements DebuggableWithTitle {
return getSessionFactory().getAuthenticationManager();
}
- public static UserProfileLoader getUserProfileLoader() {
- return getSessionFactory().getUserProfileLoader();
- }
-
public static List<Object> getServices() {
return getSessionFactory().getServices();
}
@@ -430,21 +422,9 @@ public abstract class IsisContext implements DebuggableWithTitle {
/**
* Convenience method.
- *
- * @see IsisSession#getUserProfile()
- */
- public static UserProfile getUserProfile() {
- return getSession().getUserProfile();
- }
-
- /**
- * Convenience method.
- *
- * @see IsisSession#getUserProfile()
- * @see UserProfile#getLocalization()
*/
public static Localization getLocalization() {
- return getUserProfile().getLocalization();
+ return new LocalizationDefault();
}
/**
@@ -507,7 +487,6 @@ public abstract class IsisContext implements DebuggableWithTitle {
debugList.add(" Authentication manager", getSessionFactory().getAuthenticationManager());
debugList.add(" Authorization manager", getSessionFactory().getAuthorizationManager());
debugList.add(" Persistence session factory", getSessionFactory().getPersistenceSessionFactory());
- debugList.add("User profile loader", getUserProfileLoader());
debugList.add("Reflector", getSpecificationLoader());
@@ -522,7 +501,6 @@ public abstract class IsisContext implements DebuggableWithTitle {
final DebugList debugList = new DebugList("Apache Isis Session");
debugList.add("Apache Isis session", getSession());
debugList.add("Authentication session", getAuthenticationSession());
- debugList.add("User profile", getUserProfile());
debugList.add("Persistence Session", getPersistenceSession());
debugList.add("Transaction Manager", getTransactionManager());
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/ObjectStore.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/ObjectStore.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/ObjectStore.java
index e104454..539b393 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/ObjectStore.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/persistence/ObjectStore.java
@@ -20,10 +20,7 @@
package org.apache.isis.core.runtime.system.persistence;
import java.util.List;
-
-import org.apache.isis.core.commons.authentication.AuthenticationSession;
import org.apache.isis.core.commons.components.SessionScopedComponent;
-import org.apache.isis.core.commons.config.IsisConfiguration;
import org.apache.isis.core.commons.debug.DebuggableWithTitle;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
@@ -49,9 +46,8 @@ public interface ObjectStore extends DebuggableWithTitle, SessionScopedComponent
* up objects.
*
* <p>
- * This method is called only once after the {@link #openSession(TestProxyReflector, IsisConfiguration, TestProxyPersistenceSessionFactory, TestProxyPersistenceSession, TestUserProfileStore, AuthenticationSession)} has been
- * called. If it returns <code>false</code> then the framework will run the
- * fixtures to initialise the object store.
+ * This method is called only once after the session is opened called. If it returns <code>false</code> then the
+ * framework will run the fixtures to initialise the object store.
*/
boolean isFixturesInstalled();
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSession.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSession.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSession.java
index 19b00f9..a06be35 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSession.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSession.java
@@ -24,10 +24,8 @@ import org.apache.isis.core.commons.authentication.AuthenticationSession;
import org.apache.isis.core.commons.components.ApplicationScopedComponent;
import org.apache.isis.core.commons.components.SessionScopedComponent;
import org.apache.isis.core.commons.debug.DebugBuilder;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
import org.apache.isis.core.runtime.system.transaction.IsisTransaction;
-import org.apache.isis.core.runtime.userprofile.UserProfile;
/**
* Analogous to (and in essence a wrapper for) a JDO <code>PersistenceManager</code>;
@@ -94,16 +92,6 @@ public interface IsisSession extends SessionScopedComponent {
*/
public PersistenceSession getPersistenceSession();
- // //////////////////////////////////////////////////////
- // Perspective
- // //////////////////////////////////////////////////////
-
- /**
- * Returns the {@link ObjectAdapter adapted} <tt>Perspective</tt> for the
- * user who is using this {@link IsisSession} .
- */
-
- public UserProfile getUserProfile();
// //////////////////////////////////////////////////////
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionDefault.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionDefault.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionDefault.java
index 0a15be7..aaa6583 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionDefault.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionDefault.java
@@ -41,7 +41,6 @@ import org.apache.isis.core.runtime.system.DeploymentType;
import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
import org.apache.isis.core.runtime.system.transaction.IsisTransaction;
import org.apache.isis.core.runtime.system.transaction.IsisTransactionManager;
-import org.apache.isis.core.runtime.userprofile.UserProfile;
import static org.apache.isis.core.commons.ensure.Ensure.ensureThatArg;
import static org.hamcrest.CoreMatchers.*;
@@ -68,15 +67,16 @@ public class IsisSessionDefault implements IsisSession {
private final AuthenticationSession authenticationSession;
private PersistenceSession persistenceSession; // only non-final so can be
// replaced in tests.
- private final UserProfile userProfile;
-
private final int id;
private long accessTime;
private String debugSnapshot;
private EventBus eventBus;
- public IsisSessionDefault(final IsisSessionFactory sessionFactory, final AuthenticationSession authenticationSession, final PersistenceSession persistenceSession, final UserProfile userProfile) {
+ public IsisSessionDefault(
+ final IsisSessionFactory sessionFactory,
+ final AuthenticationSession authenticationSession,
+ final PersistenceSession persistenceSession) {
// global context
ensureThatArg(sessionFactory, is(not(nullValue())), "execution context factory is required");
@@ -84,13 +84,11 @@ public class IsisSessionDefault implements IsisSession {
// session
ensureThatArg(authenticationSession, is(not(nullValue())), "authentication session is required");
ensureThatArg(persistenceSession, is(not(nullValue())), "persistence session is required");
- ensureThatArg(userProfile, is(not(nullValue())), "user profile is required");
this.isisSessionFactory = sessionFactory;
this.authenticationSession = authenticationSession;
this.persistenceSession = persistenceSession;
- this.userProfile = userProfile;
setSessionOpenTime(System.currentTimeMillis());
@@ -227,14 +225,6 @@ public class IsisSessionDefault implements IsisSession {
return persistenceSession;
}
- // //////////////////////////////////////////////////////
- // Perspective
- // //////////////////////////////////////////////////////
-
- @Override
- public UserProfile getUserProfile() {
- return userProfile;
- }
// //////////////////////////////////////////////////////
// Session Open Time
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactory.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactory.java
index 6627fcb..696b2d6 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactory.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactory.java
@@ -33,7 +33,6 @@ import org.apache.isis.core.runtime.authorization.AuthorizationManager;
import org.apache.isis.core.runtime.system.DeploymentType;
import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
-import org.apache.isis.core.runtime.userprofile.UserProfileLoader;
/**
* Analogous (and in essence a wrapper for) a JDO <code>PersistenceManagerFactory</code>
@@ -86,8 +85,6 @@ public interface IsisSessionFactory extends ApplicationScopedComponent {
*/
public PersistenceSessionFactory getPersistenceSessionFactory();
- public UserProfileLoader getUserProfileLoader();
-
public DomainObjectContainer getContainer();
public List<Object> getServices();
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryDefault.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryDefault.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryDefault.java
index 9f833c0..393c00f 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryDefault.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryDefault.java
@@ -44,8 +44,6 @@ import org.apache.isis.core.runtime.installerregistry.InstallerLookup;
import org.apache.isis.core.runtime.system.DeploymentType;
import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
-import org.apache.isis.core.runtime.userprofile.UserProfile;
-import org.apache.isis.core.runtime.userprofile.UserProfileLoader;
import static org.apache.isis.core.commons.ensure.Ensure.ensureThatArg;
import static org.hamcrest.CoreMatchers.*;
@@ -74,7 +72,6 @@ public class IsisSessionFactoryDefault implements IsisSessionFactory {
private final AuthenticationManager authenticationManager;
private final AuthorizationManager authorizationManager;
private final PersistenceSessionFactory persistenceSessionFactory;
- private final UserProfileLoader userProfileLoader;
private final DomainObjectContainer container;
private final List<Object> serviceList;
private final OidMarshaller oidMarshaller;
@@ -85,7 +82,6 @@ public class IsisSessionFactoryDefault implements IsisSessionFactory {
final SpecificationLoaderSpi specificationLoader,
final AuthenticationManager authenticationManager,
final AuthorizationManager authorizationManager,
- final UserProfileLoader userProfileLoader,
final PersistenceSessionFactory persistenceSessionFactory,
final DomainObjectContainer container,
final List<Object> serviceList,
@@ -96,7 +92,6 @@ public class IsisSessionFactoryDefault implements IsisSessionFactory {
ensureThatArg(specificationLoader, is(not(nullValue())));
ensureThatArg(authenticationManager, is(not(nullValue())));
ensureThatArg(authorizationManager, is(not(nullValue())));
- ensureThatArg(userProfileLoader, is(not(nullValue())));
ensureThatArg(persistenceSessionFactory, is(not(nullValue())));
ensureThatArg(serviceList, is(not(nullValue())));
@@ -105,7 +100,6 @@ public class IsisSessionFactoryDefault implements IsisSessionFactory {
this.specificationLoaderSpi = specificationLoader;
this.authenticationManager = authenticationManager;
this.authorizationManager = authorizationManager;
- this.userProfileLoader = userProfileLoader;
this.persistenceSessionFactory = persistenceSessionFactory;
this.container = container;
this.serviceList = serviceList;
@@ -202,7 +196,6 @@ public class IsisSessionFactoryDefault implements IsisSessionFactory {
specificationLoaderSpi.injectInto(persistenceSessionFactory);
persistenceSessionFactory.setContainer(container);
persistenceSessionFactory.setServices(serviceList);
- userProfileLoader.setServices(serviceList);
authenticationManager.init();
authorizationManager.init();
@@ -218,7 +211,6 @@ public class IsisSessionFactoryDefault implements IsisSessionFactory {
persistenceSessionFactory.shutdown();
authenticationManager.shutdown();
specificationLoaderSpi.shutdown();
- userProfileLoader.shutdown();
}
@@ -227,19 +219,18 @@ public class IsisSessionFactoryDefault implements IsisSessionFactory {
final PersistenceSession persistenceSession = persistenceSessionFactory.createPersistenceSession();
ensureThatArg(persistenceSession, is(not(nullValue())));
- final UserProfile userProfile = userProfileLoader.getProfile(authenticationSession);
- ensureThatArg(userProfile, is(not(nullValue())));
-
// inject into persistenceSession any/all application-scoped components
// that it requires
getSpecificationLoader().injectInto(persistenceSession);
- final IsisSessionDefault isisSessionDefault = newIsisSessionDefault(authenticationSession, persistenceSession, userProfile);
+ final IsisSessionDefault isisSessionDefault = newIsisSessionDefault(authenticationSession, persistenceSession);
return isisSessionDefault;
}
- protected IsisSessionDefault newIsisSessionDefault(AuthenticationSession authenticationSession, PersistenceSession persistenceSession, UserProfile userProfile) {
- return new IsisSessionDefault(this, authenticationSession, persistenceSession, userProfile);
+ protected IsisSessionDefault newIsisSessionDefault(
+ final AuthenticationSession authenticationSession,
+ final PersistenceSession persistenceSession) {
+ return new IsisSessionDefault(this, authenticationSession, persistenceSession);
}
@Override
@@ -272,11 +263,6 @@ public class IsisSessionFactoryDefault implements IsisSessionFactory {
return persistenceSessionFactory;
}
- @Override
- public UserProfileLoader getUserProfileLoader() {
- return userProfileLoader;
- }
-
public DomainObjectContainer getContainer() {
return container;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemAbstract.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemAbstract.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemAbstract.java
index 42dabb9..8217133 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemAbstract.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemAbstract.java
@@ -52,8 +52,6 @@ import org.apache.isis.core.runtime.system.internal.IsisTimeZoneInitializer;
import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
import org.apache.isis.core.runtime.system.session.IsisSessionFactoryDefault;
-import org.apache.isis.core.runtime.userprofile.UserProfileLoader;
-import org.apache.isis.core.runtime.userprofile.UserProfileLoaderDefault;
/**
*
@@ -132,9 +130,9 @@ public abstract class IsisSystemAbstract extends IsisSystemFixturesHookAbstract
* The {@link LogonFixture}, if any, obtained by running fixtures.
*
* <p>
- * Intended to be used when for {@link DeploymentType#EXPLORATION
+ * Intended to be used when for {@link DeploymentType#SERVER_EXPLORATION
* exploration} (instead of an {@link ExplorationSession}) or
- * {@link DeploymentType#PROTOTYPE prototype} deployments (saves logging
+ * {@link DeploymentType#SERVER_PROTOTYPE prototype} deployments (saves logging
* in). Should be <i>ignored</i> in other {@link DeploymentType}s.
*/
@Override
@@ -156,8 +154,7 @@ public abstract class IsisSystemAbstract extends IsisSystemFixturesHookAbstract
@Override
public IsisSessionFactory doCreateSessionFactory(final DeploymentType deploymentType) throws IsisSystemException {
final PersistenceSessionFactory persistenceSessionFactory = obtainPersistenceSessionFactory(deploymentType);
- final UserProfileLoader userProfileLoader = new UserProfileLoaderDefault(obtainUserProfileStore());
- return createSessionFactory(deploymentType, userProfileLoader, persistenceSessionFactory);
+ return createSessionFactory(deploymentType, persistenceSessionFactory);
}
/**
@@ -169,7 +166,9 @@ public abstract class IsisSystemAbstract extends IsisSystemFixturesHookAbstract
* <i>from</i> the {@link #doCreateSessionFactory(DeploymentType) hook
* method}.
*/
- protected final IsisSessionFactory createSessionFactory(final DeploymentType deploymentType, final UserProfileLoader userProfileLoader, final PersistenceSessionFactory persistenceSessionFactory) throws IsisSystemException {
+ protected final IsisSessionFactory createSessionFactory(
+ final DeploymentType deploymentType,
+ final PersistenceSessionFactory persistenceSessionFactory) throws IsisSystemException {
final IsisConfiguration configuration = getConfiguration();
final AuthenticationManager authenticationManager = obtainAuthenticationManager(deploymentType);
@@ -187,7 +186,7 @@ public abstract class IsisSystemAbstract extends IsisSystemFixturesHookAbstract
runtimeContext.injectInto(reflector);
return newIsisSessionFactory(
- deploymentType, userProfileLoader,
+ deploymentType,
persistenceSessionFactory,
configuration,
authenticationManager, authorizationManager,
@@ -201,14 +200,14 @@ public abstract class IsisSystemAbstract extends IsisSystemFixturesHookAbstract
}
protected IsisSessionFactoryDefault newIsisSessionFactory(
- final DeploymentType deploymentType, final UserProfileLoader userProfileLoader,
+ final DeploymentType deploymentType,
final PersistenceSessionFactory persistenceSessionFactory,
final IsisConfiguration configuration,
final AuthenticationManager authenticationManager, final AuthorizationManager authorizationManager,
final OidMarshaller oidMarshaller,
final SpecificationLoaderSpi reflector,
final DomainObjectContainer container, final List<Object> services) {
- return new IsisSessionFactoryDefault(deploymentType, configuration, reflector, authenticationManager, authorizationManager, userProfileLoader, persistenceSessionFactory, container, services, oidMarshaller);
+ return new IsisSessionFactoryDefault(deploymentType, configuration, reflector, authenticationManager, authorizationManager, persistenceSessionFactory, container, services, oidMarshaller);
}
private static Collection<MetaModelRefiner> refiners(Object... possibleRefiners ) {
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemThatUsesInstallersFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemThatUsesInstallersFactory.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemThatUsesInstallersFactory.java
index 206382b..19de635 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemThatUsesInstallersFactory.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemThatUsesInstallersFactory.java
@@ -68,7 +68,6 @@ public class IsisSystemThatUsesInstallersFactory implements IsisSystemFactory {
final IsisSystemUsingInstallers system = new IsisSystemUsingInstallers(deploymentType, installerLookup);
system.lookupAndSetAuthenticatorAndAuthorization(deploymentType);
- system.lookupAndSetUserProfileFactoryInstaller();
system.lookupAndSetFixturesInstaller();
return system;
}
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemUsingInstallers.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemUsingInstallers.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemUsingInstallers.java
index 6fae368..0e800cc 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemUsingInstallers.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/systemusinginstallers/IsisSystemUsingInstallers.java
@@ -42,8 +42,6 @@ import org.apache.isis.core.runtime.system.SystemConstants;
import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
import org.apache.isis.core.runtime.systemdependencyinjector.SystemDependencyInjector;
import org.apache.isis.core.runtime.transaction.facetdecorator.standard.TransactionFacetDecoratorInstaller;
-import org.apache.isis.core.runtime.userprofile.UserProfileStore;
-import org.apache.isis.core.runtime.userprofile.UserProfileStoreInstaller;
import static org.apache.isis.core.commons.ensure.Ensure.ensureThatArg;
import static org.apache.isis.core.commons.ensure.Ensure.ensureThatState;
@@ -59,7 +57,6 @@ public class IsisSystemUsingInstallers extends IsisSystemAbstract {
private AuthorizationManagerInstaller authorizationInstaller;
private ObjectReflectorInstaller reflectorInstaller;
private ServicesInstaller servicesInstaller;
- private UserProfileStoreInstaller userProfileStoreInstaller;
private PersistenceMechanismInstaller persistenceMechanismInstaller;
private FixturesInstaller fixtureInstaller;
@@ -211,29 +208,6 @@ public class IsisSystemUsingInstallers extends IsisSystemAbstract {
}
-// ///////////////////////////////////////////
- // User Profile Loader/Store
- // ///////////////////////////////////////////
-
- public void lookupAndSetUserProfileFactoryInstaller() {
- final IsisConfiguration configuration = getConfiguration();
- final String persistor = configuration.getString(SystemConstants.PROFILE_PERSISTOR_INSTALLER_KEY);
-
- final UserProfileStoreInstaller userProfilePersistenceMechanismInstaller = installerLookup.userProfilePersistenceMechanismInstaller(persistor, getDeploymentType());
- if (userProfilePersistenceMechanismInstaller != null) {
- setUserProfileStoreInstaller(userProfilePersistenceMechanismInstaller);
- }
- }
-
- public void setUserProfileStoreInstaller(final UserProfileStoreInstaller userProfilestoreInstaller) {
- this.userProfileStoreInstaller = userProfilestoreInstaller;
- }
-
- @Override
- protected UserProfileStore obtainUserProfileStore() {
- return userProfileStoreInstaller.createUserProfileStore(getConfiguration());
- }
-
// ///////////////////////////////////////////
// PersistenceSessionFactory
// ///////////////////////////////////////////
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/core/runtime/src/main/java/org/apache/isis/core/runtime/userprofile/UserProfileLoaderDefault.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/userprofile/UserProfileLoaderDefault.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/userprofile/UserProfileLoaderDefault.java
deleted file mode 100644
index 5c802b0..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/userprofile/UserProfileLoaderDefault.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.core.runtime.userprofile;
-
-import java.util.List;
-
-import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.isis.core.commons.authentication.AuthenticationSession;
-import org.apache.isis.core.commons.debug.DebugBuilder;
-import org.apache.isis.core.commons.debug.DebuggableWithTitle;
-import org.apache.isis.core.commons.exceptions.IsisException;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.runtime.services.RequestScopedService;
-import org.apache.isis.core.runtime.system.context.IsisContext;
-import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
-import org.apache.isis.core.runtime.system.session.IsisSession;
-
-/**
- * Acts like a bridge, loading the profile from the underlying store.
- */
-public class UserProfileLoaderDefault implements UserProfileLoader, DebuggableWithTitle {
-
- private static final String DEFAULT_PERSPECTIVE_NAME = "Apache Isis";
- private static final String EXPLORATION = " Exploration";
-
- private final Logger LOG = LoggerFactory.getLogger(UserProfile.class);
-
- public static enum Mode {
- /**
- * Must provide some services.
- */
- STRICT,
- /**
- * For testing only, no services is okay.
- */
- RELAXED
- }
-
- private final UserProfileStore store;
- private final Mode mode;
-
- private UserProfile userProfile;
-
- private List<Object> serviceList;
-
- // //////////////////////////////////////////////////////
- // Constructor
- // //////////////////////////////////////////////////////
-
- public UserProfileLoaderDefault(final UserProfileStore store) {
- this(store, Mode.STRICT);
- }
-
- /**
- * for testing purposes, explicitly specify the Mode.
- */
- public UserProfileLoaderDefault(final UserProfileStore store, final Mode mode) {
- this.store = store;
- this.mode = mode;
- }
-
- // //////////////////////////////////////////////////////
- // init, shutdown
- // //////////////////////////////////////////////////////
-
- /**
- * Does nothing.
- */
- @Override
- public void init() {
- }
-
- /**
- * Does nothing.
- */
- @Override
- public void shutdown() {
- }
-
- // //////////////////////////////////////////////////////
- // Fixtures
- // //////////////////////////////////////////////////////
-
- /**
- * @see PersistenceSession#isFixturesInstalled()
- */
- @Override
- public boolean isFixturesInstalled() {
- return store.isFixturesInstalled();
- }
-
- // //////////////////////////////////////////////////////
- // saveAs...
- // //////////////////////////////////////////////////////
-
- @Override
- public void saveAsDefault(final UserProfile userProfile) {
- store.save("_default", userProfile);
- }
-
- @Override
- public void saveForUser(final String userName, final UserProfile userProfile) {
- store.save(userName, userProfile);
- }
-
- // //////////////////////////////////////////////////////
- // saveSession
- // //////////////////////////////////////////////////////
-
- @Override
- public void saveSession(final List<ObjectAdapter> objects) {
- loadOrCreateProfile();
- userProfile.saveObjects(objects);
- save(userProfile);
- }
-
- private void save(final UserProfile userProfile) {
- saveForUser(userName(), userProfile);
- }
-
- // //////////////////////////////////////////////////////
- // getProfile
- // //////////////////////////////////////////////////////
-
- @Override
- public UserProfile getProfile(final AuthenticationSession session) {
- final String userName = session.getUserName();
- final UserProfile profile = store.getUserProfile(userName);
- userProfile = profile != null ? profile : createUserProfile(userName);
- return userProfile;
- }
-
- @Override
- @Deprecated
- public UserProfile getProfile() {
- loadOrCreateProfile();
- return userProfile;
- }
-
- // //////////////////////////////////////////////////////
- // Helpers: (for getProfile)
- // //////////////////////////////////////////////////////
-
- private void loadOrCreateProfile() {
- if (userProfile == null) {
- final String userName = userName();
- final UserProfile profile = store.getUserProfile(userName);
- userProfile = profile != null ? profile : createUserProfile(userName);
- }
- }
-
- private UserProfile createUserProfile(final String userName) {
- final UserProfile template = store.getUserProfile("_default");
- if (template == null) {
- return createDefaultProfile(userName);
- } else {
- return createProfileFromTemplate(userName, template);
- }
- }
-
- private UserProfile createDefaultProfile(final String userName) {
- final UserProfile profile = new UserProfile();
- profile.newPerspective(DEFAULT_PERSPECTIVE_NAME + (IsisContext.getDeploymentType().isExploring() ? EXPLORATION : ""));
-
- final List<Object> singletonServices = Lists.newArrayList(Iterables.filter(
- getServices(),
- Predicates.not(RequestScopedService.Predicates.instanceOf())));
- if (singletonServices.size() == 0 && mode == Mode.STRICT) {
- throw new IsisException("No known (singleton) services");
- }
- for (final Object service : singletonServices) {
- profile.getPerspective().addToServices(service);
- }
- LOG.debug("creating exploration UserProfile for " + userName);
- return profile;
- }
-
- private UserProfile createProfileFromTemplate(final String userName, final UserProfile template) {
- final UserProfile userProfile = new UserProfile();
- userProfile.copy(template);
- LOG.info("creating UserProfile, from template, for " + userName);
- return userProfile;
- }
-
- // //////////////////////////////////////////////////////
- // Debugging
- // //////////////////////////////////////////////////////
-
- @Override
- public void debugData(final DebugBuilder debug) {
- debug.appendln("Store", store.toString());
- debug.appendln("Mode", mode);
-
- debug.appendln("Store", store);
- debug.appendln("User Profile", userProfile);
- }
-
- @Override
- public String debugTitle() {
- return "User Profile Service";
- }
-
- // //////////////////////////////////////////////////////
- // Dependencies (injected via setters)
- // //////////////////////////////////////////////////////
-
- @Override
- public List<Object> getServices() {
- return serviceList;
- }
-
- @Override
- public void setServices(final List<Object> serviceList) {
- this.serviceList = serviceList;
- }
-
- // //////////////////////////////////////////////////////
- // Dependencies (from context)
- // //////////////////////////////////////////////////////
-
- private static AuthenticationSession getAuthenticationSession() {
- return getSession().getAuthenticationSession();
- }
-
- private static String userName() {
- return getAuthenticationSession().getUserName();
- }
-
- private static IsisSession getSession() {
- return IsisContext.getSession();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/core/runtime/src/main/java/org/apache/isis/core/runtime/userprofile/UserProfileStoreInstaller.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/userprofile/UserProfileStoreInstaller.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/userprofile/UserProfileStoreInstaller.java
deleted file mode 100644
index f25b6f5..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/userprofile/UserProfileStoreInstaller.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.core.runtime.userprofile;
-
-import org.apache.isis.core.commons.components.Installer;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-
-public interface UserProfileStoreInstaller extends Installer {
-
- public static String TYPE = "user-profile-store";
-
- UserProfileStore createUserProfileStore(final IsisConfiguration objectConfiguration);
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/core/runtime/src/main/java/org/apache/isis/core/runtime/userprofile/UserProfilesDebugUtil.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/userprofile/UserProfilesDebugUtil.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/userprofile/UserProfilesDebugUtil.java
deleted file mode 100644
index 94eb0eb..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/userprofile/UserProfilesDebugUtil.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.core.runtime.userprofile;
-
-import org.apache.isis.core.commons.debug.DebugBuilder;
-import org.apache.isis.core.commons.debug.DebuggableWithTitle;
-import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
-import org.apache.isis.core.metamodel.services.ServiceUtil;
-import org.apache.isis.core.runtime.system.context.IsisContext;
-import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
-
-/**
- * Introduced in order to remove the dependency between {@link UserProfile} and
- * {@link PerspectiveEntry} on <tt>runtimes:dflt</tt>.
- */
-public final class UserProfilesDebugUtil {
-
- public static DebuggableWithTitle asDebuggableWithTitle(final UserProfile userProfile) {
- return new DebuggableWithTitle() {
-
- @Override
- public void debugData(final DebugBuilder debug) {
- debug.appendTitle("Options");
- debug.indent();
- debug.append(userProfile.getOptions());
- debug.unindent();
-
- debug.appendTitle("Perspectives");
- for (final PerspectiveEntry entry : userProfile.getEntries()) {
- asDebuggableWithTitle(entry).debugData(debug);
- }
- }
-
- @Override
- public String debugTitle() {
- return toString();
- }
- };
- }
-
- public static DebuggableWithTitle asDebuggableWithTitle(final PerspectiveEntry perspectiveEntry) {
- return new DebuggableWithTitle() {
-
- @Override
- public void debugData(final DebugBuilder debug) {
- debug.appendln("Name", perspectiveEntry.getName());
- debug.blankLine();
- debug.appendTitle("Services (Ids)");
- debug.indent();
- for (final Object service : perspectiveEntry.getServices()) {
- debug.appendln(ServiceUtil.id(service));
- }
- debug.unindent();
-
- debug.blankLine();
- debug.appendTitle("Objects");
- debug.indent();
- final AdapterManager adapterManager = getAdapterManager();
- for (final Object obj : perspectiveEntry.getObjects()) {
- debug.appendln(adapterManager.adapterFor(obj).toString());
- }
- debug.unindent();
- }
-
- @Override
- public String debugTitle() {
- return "Perspective";
- }
- };
- }
-
- // ///////////////////////////////////////////////////////
- // Dependencies (from Context)
- // ///////////////////////////////////////////////////////
-
- protected static AdapterManager getAdapterManager() {
- return getPersistenceSession().getAdapterManager();
- }
-
- protected static PersistenceSession getPersistenceSession() {
- return IsisContext.getPersistenceSession();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/core/runtime/src/main/resources/org/apache/isis/core/runtime/installer-registry.properties
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/resources/org/apache/isis/core/runtime/installer-registry.properties b/core/runtime/src/main/resources/org/apache/isis/core/runtime/installer-registry.properties
index 104f6d6..8a59b0a 100644
--- a/core/runtime/src/main/resources/org/apache/isis/core/runtime/installer-registry.properties
+++ b/core/runtime/src/main/resources/org/apache/isis/core/runtime/installer-registry.properties
@@ -62,9 +62,6 @@ org.apache.isis.core.runtime.services.ServicesInstallerFromConfigurationAndAnnot
org.apache.isis.core.objectstore.InMemoryPersistenceMechanismInstaller # "in-memory"
org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller # datanucleus
-# profilestores
-org.apache.isis.core.profilestore.InMemoryUserProfileStoreInstaller # "in-memory"
-
# reflector decorators
org.apache.isis.core.runtime.transaction.facetdecorator.standard.TransactionFacetDecoratorInstaller # "transaction"
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/core/runtime/src/test/java/org/apache/isis/core/runtime/context/IsisContextTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/isis/core/runtime/context/IsisContextTest.java b/core/runtime/src/test/java/org/apache/isis/core/runtime/context/IsisContextTest.java
index ebef359..cdbd45b 100644
--- a/core/runtime/src/test/java/org/apache/isis/core/runtime/context/IsisContextTest.java
+++ b/core/runtime/src/test/java/org/apache/isis/core/runtime/context/IsisContextTest.java
@@ -46,7 +46,6 @@ import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
import org.apache.isis.core.runtime.system.session.IsisSessionFactoryDefault;
-import org.apache.isis.core.runtime.userprofile.UserProfileLoader;
import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
@@ -67,8 +66,6 @@ public class IsisContextTest {
@Mock
protected PersistenceSessionFactory mockPersistenceSessionFactory;
@Mock
- private UserProfileLoader mockUserProfileLoader;
- @Mock
protected AuthenticationManager mockAuthenticationManager;
@Mock
protected AuthorizationManager mockAuthorizationManager;
@@ -104,7 +101,6 @@ public class IsisContextTest {
ignoring(mockPersistenceSession);
ignoring(mockSpecificationLoader);
ignoring(mockPersistenceSessionFactory);
- ignoring(mockUserProfileLoader);
ignoring(mockAuthenticationManager);
ignoring(mockAuthorizationManager);
@@ -112,7 +108,7 @@ public class IsisContextTest {
}
});
- sessionFactory = new IsisSessionFactoryDefault(DeploymentType.UNIT_TESTING, configuration, mockSpecificationLoader, mockAuthenticationManager, mockAuthorizationManager, mockUserProfileLoader, mockPersistenceSessionFactory, mockContainer, servicesList, oidMarshaller);
+ sessionFactory = new IsisSessionFactoryDefault(DeploymentType.UNIT_TESTING, configuration, mockSpecificationLoader, mockAuthenticationManager, mockAuthorizationManager, mockPersistenceSessionFactory, mockContainer, servicesList, oidMarshaller);
authSession = new SimpleSession("tester", Collections.<String>emptyList());
IsisContext.setConfiguration(configuration);
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/core/runtime/src/test/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryAbstractTest_init_and_shutdown.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryAbstractTest_init_and_shutdown.java b/core/runtime/src/test/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryAbstractTest_init_and_shutdown.java
index 9070933..c2d86a1 100644
--- a/core/runtime/src/test/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryAbstractTest_init_and_shutdown.java
+++ b/core/runtime/src/test/java/org/apache/isis/core/runtime/system/session/IsisSessionFactoryAbstractTest_init_and_shutdown.java
@@ -33,7 +33,6 @@ import org.apache.isis.core.runtime.authentication.AuthenticationManager;
import org.apache.isis.core.runtime.authorization.AuthorizationManager;
import org.apache.isis.core.runtime.system.DeploymentType;
import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
-import org.apache.isis.core.runtime.userprofile.UserProfileLoader;
import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
@@ -59,8 +58,6 @@ public class IsisSessionFactoryAbstractTest_init_and_shutdown {
@Mock
private AuthorizationManager mockAuthorizationManager;
@Mock
- private UserProfileLoader mockUserProfileLoader;
- @Mock
private PersistenceSessionFactory mockPersistenceSessionFactory;
@Mock
private OidMarshaller mockOidMarshaller;
@@ -79,7 +76,7 @@ public class IsisSessionFactoryAbstractTest_init_and_shutdown {
configuration.add("foo", "bar");
serviceList = Lists.newArrayList();
- context.ignoring(mockDeploymentType, mockSpecificationLoader, mockAuthenticationManager, mockAuthorizationManager, mockUserProfileLoader, mockContainer, mockPersistenceSessionFactory, mockOidMarshaller);
+ context.ignoring(mockDeploymentType, mockSpecificationLoader, mockAuthenticationManager, mockAuthorizationManager, mockContainer, mockPersistenceSessionFactory, mockOidMarshaller);
}
@@ -87,7 +84,7 @@ public class IsisSessionFactoryAbstractTest_init_and_shutdown {
public void validate_DomainServicesWithDuplicateIds() {
serviceList.add(new DomainServiceWithSomeId());
serviceList.add(new DomainServiceWithDuplicateId());
- isf = new IsisSessionFactoryDefault(mockDeploymentType, configuration, mockSpecificationLoader, mockAuthenticationManager, mockAuthorizationManager, mockUserProfileLoader, mockPersistenceSessionFactory, mockContainer, serviceList, mockOidMarshaller) {
+ isf = new IsisSessionFactoryDefault(mockDeploymentType, configuration, mockSpecificationLoader, mockAuthenticationManager, mockAuthorizationManager, mockPersistenceSessionFactory, mockContainer, serviceList, mockOidMarshaller) {
};
}
}
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/core/runtime/src/test/java/org/apache/isis/core/runtime/userprofile/OptionsTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/isis/core/runtime/userprofile/OptionsTest.java b/core/runtime/src/test/java/org/apache/isis/core/runtime/userprofile/OptionsTest.java
deleted file mode 100644
index 3b953e0..0000000
--- a/core/runtime/src/test/java/org/apache/isis/core/runtime/userprofile/OptionsTest.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.core.runtime.userprofile;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Iterator;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import org.apache.isis.core.commons.debug.DebugString;
-
-public class OptionsTest {
-
- private Options options;
- private Options suboptions;
-
- @Before
- public void setup() throws Exception {
- suboptions = new Options();
- suboptions.addOption("name-3", "value-2");
-
- options = new Options();
- options.addOption("test", "value");
- options.addOption("anInt", "23");
- options.addOptions("suboptions", suboptions);
- }
-
- @Test
- public void savedValueIsRetrieved() throws Exception {
- assertEquals("value", options.getString("test"));
- }
-
- @Test
- public void unknownNameIsNull() throws Exception {
- assertNull(options.getString("unknown"));
- }
-
- @Test
- public void intValue() throws Exception {
- assertEquals(23, options.getInteger("anInt", 0));
- }
-
- @Test
- public void intDefault() throws Exception {
- assertEquals(10, options.getInteger("unknown", 10));
- }
-
- @Test
- public void stringDefault() throws Exception {
- assertEquals("def", options.getString("unknown", "def"));
- }
-
- @Test
- public void debug() throws Exception {
- final DebugString debug = new DebugString();
- options.debugData(debug);
- assertNotNull(debug.toString());
- }
-
- @Test
- public void names() throws Exception {
- final Iterator<String> names = options.names();
- assertTrue(names.hasNext());
- }
-
- @Test
- public void copy() throws Exception {
- final Options copy = new Options();
- copy.copy(options);
- assertEquals("value", copy.getString("test"));
- }
-
- @Test
- public void addOptions() throws Exception {
- final Options suboptions = options.getOptions("suboptions");
- assertEquals("value-2", suboptions.getString("name-3"));
- }
-
- @Test
- public void emptyWhenOptionsWhenNotFound() throws Exception {
- final Options suboptions = options.getOptions("unkown");
- assertFalse(suboptions.names().hasNext());
- }
-
- @Test
- public void newEmptyOptionsAdded() throws Exception {
- final Options suboptions = options.getOptions("unknown");
- suboptions.addOption("test", "value");
- assertSame(suboptions, options.getOptions("unknown"));
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/core/tck/tck-viewer-restfulobjects/pom.xml
----------------------------------------------------------------------
diff --git a/core/tck/tck-viewer-restfulobjects/pom.xml b/core/tck/tck-viewer-restfulobjects/pom.xml
index c0d0f65..8a5960a 100644
--- a/core/tck/tck-viewer-restfulobjects/pom.xml
+++ b/core/tck/tck-viewer-restfulobjects/pom.xml
@@ -92,10 +92,6 @@
</dependency>
<dependency>
<groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-profilestore</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.isis.core</groupId>
<artifactId>isis-core-security</artifactId>
</dependency>
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/core/tck/tck-viewer-restfulobjects/src/main/webapp/WEB-INF/isis.properties
----------------------------------------------------------------------
diff --git a/core/tck/tck-viewer-restfulobjects/src/main/webapp/WEB-INF/isis.properties b/core/tck/tck-viewer-restfulobjects/src/main/webapp/WEB-INF/isis.properties
index 4407ca7..e6bf541 100644
--- a/core/tck/tck-viewer-restfulobjects/src/main/webapp/WEB-INF/isis.properties
+++ b/core/tck/tck-viewer-restfulobjects/src/main/webapp/WEB-INF/isis.properties
@@ -18,7 +18,6 @@
isis.authentication=bypass
isis.authorization=bypass
-isis.user-profile-store=in-memory
isis.persistor=in-memory
isis.services-installer=configuration-and-annotation
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/example/application/simpleapp/webapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/webapp/pom.xml b/example/application/simpleapp/webapp/pom.xml
index f5cbbd3..8849ff4 100644
--- a/example/application/simpleapp/webapp/pom.xml
+++ b/example/application/simpleapp/webapp/pom.xml
@@ -190,10 +190,6 @@
</dependency>
<dependency>
<groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-profilestore</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.isis.core</groupId>
<artifactId>isis-core-security</artifactId>
</dependency>
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
index e49101a..d9bdc98 100644
--- a/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
+++ b/example/application/simpleapp/webapp/src/main/webapp/WEB-INF/isis.properties
@@ -66,11 +66,6 @@ isis.authentication=shiro
isis.authorization=shiro
-#
-# configure the user profile store to use.
-#
-isis.user-profile-store=in-memory
-
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/example/application/todoapp/webapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/pom.xml b/example/application/todoapp/webapp/pom.xml
index dba37d0..8d53998 100644
--- a/example/application/todoapp/webapp/pom.xml
+++ b/example/application/todoapp/webapp/pom.xml
@@ -190,10 +190,6 @@
</dependency>
<dependency>
<groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-profilestore</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.isis.core</groupId>
<artifactId>isis-core-security</artifactId>
</dependency>
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/example/application/todoapp/webapp/src/main/webapp/WEB-INF/isis.properties
----------------------------------------------------------------------
diff --git a/example/application/todoapp/webapp/src/main/webapp/WEB-INF/isis.properties b/example/application/todoapp/webapp/src/main/webapp/WEB-INF/isis.properties
index c6269a3..179adab 100644
--- a/example/application/todoapp/webapp/src/main/webapp/WEB-INF/isis.properties
+++ b/example/application/todoapp/webapp/src/main/webapp/WEB-INF/isis.properties
@@ -66,11 +66,6 @@ isis.authentication=shiro
isis.authorization=shiro
-#
-# configure the user profile store to use.
-#
-isis.user-profile-store=in-memory
-
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/mothballed/profilestore-inmemory/pom.xml
----------------------------------------------------------------------
diff --git a/mothballed/profilestore-inmemory/pom.xml b/mothballed/profilestore-inmemory/pom.xml
new file mode 100644
index 0000000..c152a57
--- /dev/null
+++ b/mothballed/profilestore-inmemory/pom.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis</artifactId>
+ <version>1.7.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>isis-core-profilestore</artifactId>
+ <name>Isis Core (In-memory) ProfileStore</name>
+
+ <properties>
+ <siteBaseDir>..</siteBaseDir>
+ <relativeUrl>profilestore-inmemory/</relativeUrl>
+ </properties>
+
+ <!-- used in Site generation for relative references. -->
+ <url>http://isis.apache.org/${relativeUrl}</url>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <inherited>false</inherited>
+ <configuration>
+ <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
+ </configuration>
+ <reportSets>
+ <reportSet>
+ <inherited>false</inherited>
+ <reports>
+ <report>dependencies</report>
+ <report>dependency-convergence</report>
+ <report>plugins</report>
+ <report>summary</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ </plugins>
+ </reporting>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-unittestsupport</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-metamodel</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-runtime</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-runtime</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/mothballed/profilestore-inmemory/src/main/java/org/apache/isis/core/profilestore/InMemoryUserProfileStore.java
----------------------------------------------------------------------
diff --git a/mothballed/profilestore-inmemory/src/main/java/org/apache/isis/core/profilestore/InMemoryUserProfileStore.java b/mothballed/profilestore-inmemory/src/main/java/org/apache/isis/core/profilestore/InMemoryUserProfileStore.java
new file mode 100644
index 0000000..477ef6c
--- /dev/null
+++ b/mothballed/profilestore-inmemory/src/main/java/org/apache/isis/core/profilestore/InMemoryUserProfileStore.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.core.profilestore;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.isis.core.commons.debug.DebugBuilder;
+import org.apache.isis.core.commons.debug.DebuggableWithTitle;
+import org.apache.isis.core.runtime.userprofile.UserProfile;
+import org.apache.isis.core.runtime.userprofile.UserProfileStore;
+
+public class InMemoryUserProfileStore implements UserProfileStore, DebuggableWithTitle {
+
+ private static final Map<String, UserProfile> profiles = new HashMap<String, UserProfile>();
+
+ @Override
+ public boolean isFixturesInstalled() {
+ return false;
+ }
+
+ @Override
+ public UserProfile getUserProfile(final String name) {
+ return profiles.get(name);
+ }
+
+ @Override
+ public void save(final String name, final UserProfile userProfile) {
+ profiles.put(name, userProfile);
+ }
+
+ @Override
+ public void debugData(final DebugBuilder debug) {
+ for (final String name : profiles.keySet()) {
+ debug.appendln(name, profiles.get(name));
+ }
+ }
+
+ @Override
+ public String debugTitle() {
+ return "InMemoryUserProfileStore";
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/e8c66fba/mothballed/profilestore-inmemory/src/main/java/org/apache/isis/core/profilestore/InMemoryUserProfileStoreInstaller.java
----------------------------------------------------------------------
diff --git a/mothballed/profilestore-inmemory/src/main/java/org/apache/isis/core/profilestore/InMemoryUserProfileStoreInstaller.java b/mothballed/profilestore-inmemory/src/main/java/org/apache/isis/core/profilestore/InMemoryUserProfileStoreInstaller.java
new file mode 100644
index 0000000..5dbba1c
--- /dev/null
+++ b/mothballed/profilestore-inmemory/src/main/java/org/apache/isis/core/profilestore/InMemoryUserProfileStoreInstaller.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.core.profilestore;
+
+import java.util.List;
+
+import org.apache.isis.core.commons.config.InstallerAbstract;
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.runtime.userprofile.UserProfileStore;
+import org.apache.isis.core.runtime.userprofile.UserProfileStoreInstaller;
+
+public class InMemoryUserProfileStoreInstaller extends InstallerAbstract implements UserProfileStoreInstaller {
+
+ public InMemoryUserProfileStoreInstaller() {
+ super(UserProfileStoreInstaller.TYPE, "in-memory");
+ }
+
+ @Override
+ public UserProfileStore createUserProfileStore(final IsisConfiguration objectConfiguration) {
+ return new InMemoryUserProfileStore();
+ }
+
+ @Override
+ public List<Class<?>> getTypes() {
+ return listOf(UserProfileStore.class);
+ }
+}