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 2012/12/13 01:01:07 UTC
[37/52] [partial] ISIS-188: renaming packages in line with
groupId:artifactId
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/profilestore/sql/src/main/java/org/apache/isis/profilestore/sql/SqlUserProfileStore.java
----------------------------------------------------------------------
diff --git a/component/profilestore/sql/src/main/java/org/apache/isis/profilestore/sql/SqlUserProfileStore.java b/component/profilestore/sql/src/main/java/org/apache/isis/profilestore/sql/SqlUserProfileStore.java
new file mode 100755
index 0000000..66114e9
--- /dev/null
+++ b/component/profilestore/sql/src/main/java/org/apache/isis/profilestore/sql/SqlUserProfileStore.java
@@ -0,0 +1,55 @@
+/**
+ * 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.profilestore.sql;
+
+import com.google.inject.Inject;
+
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.runtime.userprofile.UserProfile;
+import org.apache.isis.core.runtime.userprofile.UserProfileStore;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date$
+ */
+public class SqlUserProfileStore implements UserProfileStore {
+
+ @Inject
+ public SqlUserProfileStore(final IsisConfiguration configuration) {
+
+ }
+
+ @Override
+ public boolean isFixturesInstalled() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public void save(final String userName, final UserProfile userProfile) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public UserProfile getUserProfile(final String userName) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/profilestore/sql/src/main/java/org/apache/isis/profilestore/sql/SqlUserProfileStoreInstaller.java
----------------------------------------------------------------------
diff --git a/component/profilestore/sql/src/main/java/org/apache/isis/profilestore/sql/SqlUserProfileStoreInstaller.java b/component/profilestore/sql/src/main/java/org/apache/isis/profilestore/sql/SqlUserProfileStoreInstaller.java
new file mode 100755
index 0000000..10f9b00
--- /dev/null
+++ b/component/profilestore/sql/src/main/java/org/apache/isis/profilestore/sql/SqlUserProfileStoreInstaller.java
@@ -0,0 +1,47 @@
+/**
+ * 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.profilestore.sql;
+
+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;
+
+/**
+ *
+ *
+ * @version $Rev$ $Date$
+ */
+public class SqlUserProfileStoreInstaller extends InstallerAbstract implements UserProfileStoreInstaller {
+
+ public SqlUserProfileStoreInstaller() {
+ super(UserProfileStoreInstaller.TYPE, "sql");
+ }
+
+ @Override
+ public UserProfileStore createUserProfileStore(final IsisConfiguration configuration) {
+ return new SqlUserProfileStore(configuration);
+ }
+
+ @Override
+ public List<Class<?>> getTypes() {
+ return listOf(UserProfileStore.class);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/profilestore/sql/src/main/java/org/apache/isis/runtimes/dflt/profilestores/sql/SqlUserProfileStore.java
----------------------------------------------------------------------
diff --git a/component/profilestore/sql/src/main/java/org/apache/isis/runtimes/dflt/profilestores/sql/SqlUserProfileStore.java b/component/profilestore/sql/src/main/java/org/apache/isis/runtimes/dflt/profilestores/sql/SqlUserProfileStore.java
deleted file mode 100755
index 559c922..0000000
--- a/component/profilestore/sql/src/main/java/org/apache/isis/runtimes/dflt/profilestores/sql/SqlUserProfileStore.java
+++ /dev/null
@@ -1,55 +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.runtimes.dflt.profilestores.sql;
-
-import com.google.inject.Inject;
-
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.runtime.userprofile.UserProfile;
-import org.apache.isis.core.runtime.userprofile.UserProfileStore;
-
-/**
- *
- *
- * @version $Rev$ $Date$
- */
-public class SqlUserProfileStore implements UserProfileStore {
-
- @Inject
- public SqlUserProfileStore(final IsisConfiguration configuration) {
-
- }
-
- @Override
- public boolean isFixturesInstalled() {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public void save(final String userName, final UserProfile userProfile) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public UserProfile getUserProfile(final String userName) {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/profilestore/sql/src/main/java/org/apache/isis/runtimes/dflt/profilestores/sql/SqlUserProfileStoreInstaller.java
----------------------------------------------------------------------
diff --git a/component/profilestore/sql/src/main/java/org/apache/isis/runtimes/dflt/profilestores/sql/SqlUserProfileStoreInstaller.java b/component/profilestore/sql/src/main/java/org/apache/isis/runtimes/dflt/profilestores/sql/SqlUserProfileStoreInstaller.java
deleted file mode 100755
index ce78557..0000000
--- a/component/profilestore/sql/src/main/java/org/apache/isis/runtimes/dflt/profilestores/sql/SqlUserProfileStoreInstaller.java
+++ /dev/null
@@ -1,47 +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.runtimes.dflt.profilestores.sql;
-
-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.runtimes.dflt.runtime.userprofile.UserProfileStoreInstaller;
-
-/**
- *
- *
- * @version $Rev$ $Date$
- */
-public class SqlUserProfileStoreInstaller extends InstallerAbstract implements UserProfileStoreInstaller {
-
- public SqlUserProfileStoreInstaller() {
- super(UserProfileStoreInstaller.TYPE, "sql");
- }
-
- @Override
- public UserProfileStore createUserProfileStore(final IsisConfiguration configuration) {
- return new SqlUserProfileStore(configuration);
- }
-
- @Override
- public List<Class<?>> getTypes() {
- return listOf(UserProfileStore.class);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/profilestore/xml/src/main/java/org/apache/isis/profilestore/xml/XmlUserProfileStore.java
----------------------------------------------------------------------
diff --git a/component/profilestore/xml/src/main/java/org/apache/isis/profilestore/xml/XmlUserProfileStore.java b/component/profilestore/xml/src/main/java/org/apache/isis/profilestore/xml/XmlUserProfileStore.java
new file mode 100644
index 0000000..fb28307
--- /dev/null
+++ b/component/profilestore/xml/src/main/java/org/apache/isis/profilestore/xml/XmlUserProfileStore.java
@@ -0,0 +1,64 @@
+/*
+ * 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.profilestore.xml;
+
+import com.google.inject.Inject;
+
+import org.apache.isis.core.commons.config.ConfigurationConstants;
+import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.commons.xml.XmlFile;
+import org.apache.isis.core.runtime.userprofile.UserProfile;
+import org.apache.isis.core.runtime.userprofile.UserProfileStore;
+import org.apache.isis.profilestore.xml.internal.UserProfileContentWriter;
+import org.apache.isis.profilestore.xml.internal.UserProfileDataHandler;
+import org.apache.isis.profilestore.xml.internal.XmlFileUtil;
+
+public class XmlUserProfileStore implements UserProfileStore {
+
+ private static final String XML_DIR = ConfigurationConstants.ROOT + "xmluserprofile.dir";
+ private final XmlFile xmlFile;
+
+ @Inject
+ public XmlUserProfileStore(final IsisConfiguration configuration) {
+ final String directory = configuration.getString(XML_DIR, "xml/profiles");
+ xmlFile = new XmlFile(XmlFileUtil.lookupCharset(configuration), directory);
+ }
+
+ @Override
+ public UserProfile getUserProfile(final String userName) {
+ final UserProfileDataHandler handler = new UserProfileDataHandler();
+ if (xmlFile.parse(handler, userName)) {
+ return handler.getUserProfile();
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public boolean isFixturesInstalled() {
+ return xmlFile.isFixturesInstalled();
+ }
+
+ @Override
+ public void save(final String userName, final UserProfile userProfile) {
+ xmlFile.writeXml(userName, new UserProfileContentWriter(userProfile));
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/profilestore/xml/src/main/java/org/apache/isis/profilestore/xml/XmlUserProfileStoreInstaller.java
----------------------------------------------------------------------
diff --git a/component/profilestore/xml/src/main/java/org/apache/isis/profilestore/xml/XmlUserProfileStoreInstaller.java b/component/profilestore/xml/src/main/java/org/apache/isis/profilestore/xml/XmlUserProfileStoreInstaller.java
new file mode 100644
index 0000000..d8968e4
--- /dev/null
+++ b/component/profilestore/xml/src/main/java/org/apache/isis/profilestore/xml/XmlUserProfileStoreInstaller.java
@@ -0,0 +1,45 @@
+/*
+ * 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.profilestore.xml;
+
+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 XmlUserProfileStoreInstaller extends InstallerAbstract implements UserProfileStoreInstaller {
+
+ public XmlUserProfileStoreInstaller() {
+ super(UserProfileStoreInstaller.TYPE, "xml");
+ }
+
+ @Override
+ public UserProfileStore createUserProfileStore(final IsisConfiguration configuration) {
+ return new XmlUserProfileStore(configuration);
+ }
+
+ @Override
+ public List<Class<?>> getTypes() {
+ return listOf(UserProfileStore.class);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/profilestore/xml/src/main/java/org/apache/isis/profilestore/xml/internal/UserProfileContentWriter.java
----------------------------------------------------------------------
diff --git a/component/profilestore/xml/src/main/java/org/apache/isis/profilestore/xml/internal/UserProfileContentWriter.java b/component/profilestore/xml/src/main/java/org/apache/isis/profilestore/xml/internal/UserProfileContentWriter.java
new file mode 100644
index 0000000..d38f0d7
--- /dev/null
+++ b/component/profilestore/xml/src/main/java/org/apache/isis/profilestore/xml/internal/UserProfileContentWriter.java
@@ -0,0 +1,119 @@
+/*
+ * 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.profilestore.xml.internal;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.Writer;
+import java.util.Iterator;
+
+import org.apache.commons.lang.StringUtils;
+
+import org.apache.isis.core.commons.encoding.DataOutputStreamExtended;
+import org.apache.isis.core.commons.xml.ContentWriter;
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.metamodel.adapter.oid.OidMarshaller;
+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;
+import org.apache.isis.core.runtime.userprofile.Options;
+import org.apache.isis.core.runtime.userprofile.PerspectiveEntry;
+import org.apache.isis.core.runtime.userprofile.UserProfile;
+
+public class UserProfileContentWriter implements ContentWriter {
+ private final UserProfile userProfile;
+
+ public UserProfileContentWriter(final UserProfile userProfile) {
+ this.userProfile = userProfile;
+ }
+
+ @Override
+ public void write(final Writer writer) throws IOException {
+ final StringBuffer xml = new StringBuffer();
+ xml.append("<profile>\n");
+
+ final Options options = userProfile.getOptions();
+ writeOptions(xml, options, null, 0);
+
+ xml.append(" <perspectives>\n");
+ for (final String perspectiveName : userProfile.list()) {
+ final PerspectiveEntry perspective = userProfile.getPerspective(perspectiveName);
+
+ xml.append(" <perspective" + attribute("name", perspectiveName) + ">\n");
+ xml.append(" <services>\n");
+ for (final Object service : perspective.getServices()) {
+ xml.append(" <service " + attribute("id", ServiceUtil.id(service)) + "/>\n");
+ }
+ xml.append(" </services>\n");
+ xml.append(" <objects>\n");
+ for (final Object object : perspective.getObjects()) {
+ final ObjectAdapter adapter = getPersistenceSession().getAdapterManager().adapterFor(object);
+ xml.append(" <object>" + adapter.getOid().enString(getOidMarshaller()) + "</object>\n");
+ }
+ xml.append(" </objects>\n");
+ xml.append(" </perspective>\n");
+ }
+ xml.append(" </perspectives>\n");
+
+ xml.append("</profile>\n");
+
+ writer.write(xml.toString());
+ }
+
+ private void writeOptions(final StringBuffer xml, final Options options, final String name1, final int level) {
+ final String spaces = StringUtils.repeat(" ", level);
+
+ final Iterator<String> names = options.names();
+ if (level == 0 || names.hasNext()) {
+ xml.append(spaces + " <options");
+ if (name1 != null) {
+ xml.append(" id=\"" + name1 + "\"");
+ }
+ xml.append(">\n");
+ while (names.hasNext()) {
+ final String name = names.next();
+ if (options.isOptions(name)) {
+ writeOptions(xml, options.getOptions(name), name, level + 1);
+ } else {
+ xml.append(spaces + " <option" + attribute("id", name) + ">" + options.getString(name) + "</option>\n");
+ }
+ }
+ xml.append(spaces + " </options>\n");
+ }
+ }
+
+ private String attribute(final String name, final String value) {
+ return " " + name + "=\"" + value + "\"";
+ }
+
+ // ///////////////////////////////////////////////////
+ // Dependencies (from context)
+ // ///////////////////////////////////////////////////
+
+ protected OidMarshaller getOidMarshaller() {
+ return IsisContext.getOidMarshaller();
+ }
+
+ protected static PersistenceSession getPersistenceSession() {
+ return IsisContext.getPersistenceSession();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/profilestore/xml/src/main/java/org/apache/isis/profilestore/xml/internal/UserProfileDataHandler.java
----------------------------------------------------------------------
diff --git a/component/profilestore/xml/src/main/java/org/apache/isis/profilestore/xml/internal/UserProfileDataHandler.java b/component/profilestore/xml/src/main/java/org/apache/isis/profilestore/xml/internal/UserProfileDataHandler.java
new file mode 100644
index 0000000..4fec8d2
--- /dev/null
+++ b/component/profilestore/xml/src/main/java/org/apache/isis/profilestore/xml/internal/UserProfileDataHandler.java
@@ -0,0 +1,145 @@
+/*
+ * 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.profilestore.xml.internal;
+
+import java.util.List;
+import java.util.Stack;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import org.apache.isis.core.metamodel.services.ServiceUtil;
+import org.apache.isis.core.runtime.system.context.IsisContext;
+import org.apache.isis.core.runtime.userprofile.Options;
+import org.apache.isis.core.runtime.userprofile.PerspectiveEntry;
+import org.apache.isis.core.runtime.userprofile.UserProfile;
+
+public class UserProfileDataHandler extends DefaultHandler {
+ private final StringBuffer data = new StringBuffer();
+ private final UserProfile userProfile = new UserProfile();
+ private final Stack<Options> options = new Stack<Options>();
+ private String optionName;
+ private boolean isProfile;
+ private boolean isOptions;
+ private boolean isPerspectives;
+ private PerspectiveEntry perspective;
+ private boolean isServices;
+ private boolean isObjects;
+
+ public UserProfile getUserProfile() {
+ return userProfile;
+ }
+
+ @Override
+ public void characters(final char[] ch, final int start, final int end) throws SAXException {
+ data.append(new String(ch, start, end));
+ }
+
+ @Override
+ public void endElement(final String ns, final String name, final String tagName) throws SAXException {
+ if (tagName.equals("options")) {
+ options.pop();
+ isOptions = options.size() > 0;
+ } else if (tagName.equals("perspectives")) {
+ isPerspectives = false;
+ } else if (tagName.equals("perspective")) {
+ // TODO add perspective to profile
+
+ perspective = null;
+ } else if (tagName.equals("services")) {
+ isServices = false;
+ } else if (tagName.equals("objects")) {
+ isObjects = false;
+ } else if (tagName.equals("option")) {
+ final String value = data.toString();
+ options.peek().addOption(optionName, value);
+ } else if (tagName.equals("name")) {
+ final String value = data.toString();
+ System.out.println(value);
+ }
+ }
+
+ @Override
+ public void startElement(final String ns, final String name, final String tagName, final Attributes attributes) throws SAXException {
+
+ if (isProfile) {
+ if (isOptions) {
+ if (tagName.equals("option")) {
+ optionName = attributes.getValue("id");
+ data.setLength(0);
+ } else if (tagName.equals("options")) {
+ final String optionsName = attributes.getValue("id");
+ final Options newOptions = new Options();
+ options.peek().addOptions(optionsName, newOptions);
+ options.push(newOptions);
+ } else {
+ throw new SAXException("Invalid element in options: " + tagName);
+ }
+ } else if (isPerspectives) {
+ if (perspective != null) {
+ if (isServices) {
+ if (tagName.equals("service")) {
+ final String serviceId = attributes.getValue("id");
+ final List<Object> serviceObjects = IsisContext.getServices();
+ for (final Object service : serviceObjects) {
+ if (ServiceUtil.id(service).equals(serviceId)) {
+ perspective.addToServices(service);
+ break;
+ }
+ }
+ } else {
+ throw new SAXException("Invalid element in services: " + tagName);
+ }
+ } else if (isObjects) {
+ // TODO reload objects
+ } else if (tagName.equals("services")) {
+ isServices = true;
+ } else if (tagName.equals("objects")) {
+ isObjects = true;
+ } else {
+ throw new SAXException("Invalid element in perspective: " + tagName);
+ }
+ } else if (tagName.equals("perspective")) {
+ perspective = userProfile.newPerspective(attributes.getValue("name"));
+ } else {
+ throw new SAXException("Invalid element in perspectives: " + tagName);
+ }
+ } else if (tagName.equals("options")) {
+ isOptions = true;
+ options.push(userProfile.getOptions());
+ } else if (tagName.equals("perspectives") && !isOptions) {
+ isPerspectives = true;
+ } else {
+ throw new SAXException("Invalid element in profile: " + tagName);
+ }
+
+ }
+ /*
+ * else { throw new SAXException("Invalid data"); } }
+ */
+
+ if (tagName.equals("profile")) {
+ isProfile = true;
+ }
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/profilestore/xml/src/main/java/org/apache/isis/profilestore/xml/internal/XmlFileUtil.java
----------------------------------------------------------------------
diff --git a/component/profilestore/xml/src/main/java/org/apache/isis/profilestore/xml/internal/XmlFileUtil.java b/component/profilestore/xml/src/main/java/org/apache/isis/profilestore/xml/internal/XmlFileUtil.java
new file mode 100644
index 0000000..68f9b00
--- /dev/null
+++ b/component/profilestore/xml/src/main/java/org/apache/isis/profilestore/xml/internal/XmlFileUtil.java
@@ -0,0 +1,34 @@
+/*
+ * 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.profilestore.xml.internal;
+
+import org.apache.isis.core.commons.config.ConfigurationConstants;
+import org.apache.isis.core.commons.config.IsisConfiguration;
+
+public class XmlFileUtil {
+
+ public static final String ENCODING_PROPERTY = ConfigurationConstants.ROOT + "xmlos.encoding";
+ public static final String DEFAULT_ENCODING = "ISO-8859-1";
+
+ public static String lookupCharset(final IsisConfiguration configuration) {
+ return configuration.getString(ENCODING_PROPERTY, DEFAULT_ENCODING);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/profilestore/xml/src/main/java/org/apache/isis/runtimes/dflt/profilestores/xml/XmlUserProfileStore.java
----------------------------------------------------------------------
diff --git a/component/profilestore/xml/src/main/java/org/apache/isis/runtimes/dflt/profilestores/xml/XmlUserProfileStore.java b/component/profilestore/xml/src/main/java/org/apache/isis/runtimes/dflt/profilestores/xml/XmlUserProfileStore.java
deleted file mode 100644
index 4e2b01a..0000000
--- a/component/profilestore/xml/src/main/java/org/apache/isis/runtimes/dflt/profilestores/xml/XmlUserProfileStore.java
+++ /dev/null
@@ -1,64 +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.runtimes.dflt.profilestores.xml;
-
-import com.google.inject.Inject;
-
-import org.apache.isis.core.commons.config.ConfigurationConstants;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.commons.xml.XmlFile;
-import org.apache.isis.core.runtime.userprofile.UserProfile;
-import org.apache.isis.core.runtime.userprofile.UserProfileStore;
-import org.apache.isis.runtimes.dflt.profilestores.xml.internal.UserProfileContentWriter;
-import org.apache.isis.runtimes.dflt.profilestores.xml.internal.UserProfileDataHandler;
-import org.apache.isis.runtimes.dflt.profilestores.xml.internal.XmlFileUtil;
-
-public class XmlUserProfileStore implements UserProfileStore {
-
- private static final String XML_DIR = ConfigurationConstants.ROOT + "xmluserprofile.dir";
- private final XmlFile xmlFile;
-
- @Inject
- public XmlUserProfileStore(final IsisConfiguration configuration) {
- final String directory = configuration.getString(XML_DIR, "xml/profiles");
- xmlFile = new XmlFile(XmlFileUtil.lookupCharset(configuration), directory);
- }
-
- @Override
- public UserProfile getUserProfile(final String userName) {
- final UserProfileDataHandler handler = new UserProfileDataHandler();
- if (xmlFile.parse(handler, userName)) {
- return handler.getUserProfile();
- } else {
- return null;
- }
- }
-
- @Override
- public boolean isFixturesInstalled() {
- return xmlFile.isFixturesInstalled();
- }
-
- @Override
- public void save(final String userName, final UserProfile userProfile) {
- xmlFile.writeXml(userName, new UserProfileContentWriter(userProfile));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/profilestore/xml/src/main/java/org/apache/isis/runtimes/dflt/profilestores/xml/XmlUserProfileStoreInstaller.java
----------------------------------------------------------------------
diff --git a/component/profilestore/xml/src/main/java/org/apache/isis/runtimes/dflt/profilestores/xml/XmlUserProfileStoreInstaller.java b/component/profilestore/xml/src/main/java/org/apache/isis/runtimes/dflt/profilestores/xml/XmlUserProfileStoreInstaller.java
deleted file mode 100644
index 7154ee6..0000000
--- a/component/profilestore/xml/src/main/java/org/apache/isis/runtimes/dflt/profilestores/xml/XmlUserProfileStoreInstaller.java
+++ /dev/null
@@ -1,45 +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.runtimes.dflt.profilestores.xml;
-
-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.runtimes.dflt.runtime.userprofile.UserProfileStoreInstaller;
-
-public class XmlUserProfileStoreInstaller extends InstallerAbstract implements UserProfileStoreInstaller {
-
- public XmlUserProfileStoreInstaller() {
- super(UserProfileStoreInstaller.TYPE, "xml");
- }
-
- @Override
- public UserProfileStore createUserProfileStore(final IsisConfiguration configuration) {
- return new XmlUserProfileStore(configuration);
- }
-
- @Override
- public List<Class<?>> getTypes() {
- return listOf(UserProfileStore.class);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/profilestore/xml/src/main/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/UserProfileContentWriter.java
----------------------------------------------------------------------
diff --git a/component/profilestore/xml/src/main/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/UserProfileContentWriter.java b/component/profilestore/xml/src/main/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/UserProfileContentWriter.java
deleted file mode 100644
index 6dcd103..0000000
--- a/component/profilestore/xml/src/main/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/UserProfileContentWriter.java
+++ /dev/null
@@ -1,119 +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.runtimes.dflt.profilestores.xml.internal;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.util.Iterator;
-
-import org.apache.commons.lang.StringUtils;
-
-import org.apache.isis.core.commons.encoding.DataOutputStreamExtended;
-import org.apache.isis.core.commons.xml.ContentWriter;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.adapter.oid.OidMarshaller;
-import org.apache.isis.core.metamodel.services.ServiceUtil;
-import org.apache.isis.core.runtime.userprofile.Options;
-import org.apache.isis.core.runtime.userprofile.PerspectiveEntry;
-import org.apache.isis.core.runtime.userprofile.UserProfile;
-import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
-import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSession;
-
-public class UserProfileContentWriter implements ContentWriter {
- private final UserProfile userProfile;
-
- public UserProfileContentWriter(final UserProfile userProfile) {
- this.userProfile = userProfile;
- }
-
- @Override
- public void write(final Writer writer) throws IOException {
- final StringBuffer xml = new StringBuffer();
- xml.append("<profile>\n");
-
- final Options options = userProfile.getOptions();
- writeOptions(xml, options, null, 0);
-
- xml.append(" <perspectives>\n");
- for (final String perspectiveName : userProfile.list()) {
- final PerspectiveEntry perspective = userProfile.getPerspective(perspectiveName);
-
- xml.append(" <perspective" + attribute("name", perspectiveName) + ">\n");
- xml.append(" <services>\n");
- for (final Object service : perspective.getServices()) {
- xml.append(" <service " + attribute("id", ServiceUtil.id(service)) + "/>\n");
- }
- xml.append(" </services>\n");
- xml.append(" <objects>\n");
- for (final Object object : perspective.getObjects()) {
- final ObjectAdapter adapter = getPersistenceSession().getAdapterManager().adapterFor(object);
- xml.append(" <object>" + adapter.getOid().enString(getOidMarshaller()) + "</object>\n");
- }
- xml.append(" </objects>\n");
- xml.append(" </perspective>\n");
- }
- xml.append(" </perspectives>\n");
-
- xml.append("</profile>\n");
-
- writer.write(xml.toString());
- }
-
- private void writeOptions(final StringBuffer xml, final Options options, final String name1, final int level) {
- final String spaces = StringUtils.repeat(" ", level);
-
- final Iterator<String> names = options.names();
- if (level == 0 || names.hasNext()) {
- xml.append(spaces + " <options");
- if (name1 != null) {
- xml.append(" id=\"" + name1 + "\"");
- }
- xml.append(">\n");
- while (names.hasNext()) {
- final String name = names.next();
- if (options.isOptions(name)) {
- writeOptions(xml, options.getOptions(name), name, level + 1);
- } else {
- xml.append(spaces + " <option" + attribute("id", name) + ">" + options.getString(name) + "</option>\n");
- }
- }
- xml.append(spaces + " </options>\n");
- }
- }
-
- private String attribute(final String name, final String value) {
- return " " + name + "=\"" + value + "\"";
- }
-
- // ///////////////////////////////////////////////////
- // Dependencies (from context)
- // ///////////////////////////////////////////////////
-
- protected OidMarshaller getOidMarshaller() {
- return IsisContext.getOidMarshaller();
- }
-
- protected static PersistenceSession getPersistenceSession() {
- return IsisContext.getPersistenceSession();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/profilestore/xml/src/main/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/UserProfileDataHandler.java
----------------------------------------------------------------------
diff --git a/component/profilestore/xml/src/main/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/UserProfileDataHandler.java b/component/profilestore/xml/src/main/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/UserProfileDataHandler.java
deleted file mode 100644
index b02dfdd..0000000
--- a/component/profilestore/xml/src/main/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/UserProfileDataHandler.java
+++ /dev/null
@@ -1,145 +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.runtimes.dflt.profilestores.xml.internal;
-
-import java.util.List;
-import java.util.Stack;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-import org.apache.isis.core.metamodel.services.ServiceUtil;
-import org.apache.isis.core.runtime.userprofile.Options;
-import org.apache.isis.core.runtime.userprofile.PerspectiveEntry;
-import org.apache.isis.core.runtime.userprofile.UserProfile;
-import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
-
-public class UserProfileDataHandler extends DefaultHandler {
- private final StringBuffer data = new StringBuffer();
- private final UserProfile userProfile = new UserProfile();
- private final Stack<Options> options = new Stack<Options>();
- private String optionName;
- private boolean isProfile;
- private boolean isOptions;
- private boolean isPerspectives;
- private PerspectiveEntry perspective;
- private boolean isServices;
- private boolean isObjects;
-
- public UserProfile getUserProfile() {
- return userProfile;
- }
-
- @Override
- public void characters(final char[] ch, final int start, final int end) throws SAXException {
- data.append(new String(ch, start, end));
- }
-
- @Override
- public void endElement(final String ns, final String name, final String tagName) throws SAXException {
- if (tagName.equals("options")) {
- options.pop();
- isOptions = options.size() > 0;
- } else if (tagName.equals("perspectives")) {
- isPerspectives = false;
- } else if (tagName.equals("perspective")) {
- // TODO add perspective to profile
-
- perspective = null;
- } else if (tagName.equals("services")) {
- isServices = false;
- } else if (tagName.equals("objects")) {
- isObjects = false;
- } else if (tagName.equals("option")) {
- final String value = data.toString();
- options.peek().addOption(optionName, value);
- } else if (tagName.equals("name")) {
- final String value = data.toString();
- System.out.println(value);
- }
- }
-
- @Override
- public void startElement(final String ns, final String name, final String tagName, final Attributes attributes) throws SAXException {
-
- if (isProfile) {
- if (isOptions) {
- if (tagName.equals("option")) {
- optionName = attributes.getValue("id");
- data.setLength(0);
- } else if (tagName.equals("options")) {
- final String optionsName = attributes.getValue("id");
- final Options newOptions = new Options();
- options.peek().addOptions(optionsName, newOptions);
- options.push(newOptions);
- } else {
- throw new SAXException("Invalid element in options: " + tagName);
- }
- } else if (isPerspectives) {
- if (perspective != null) {
- if (isServices) {
- if (tagName.equals("service")) {
- final String serviceId = attributes.getValue("id");
- final List<Object> serviceObjects = IsisContext.getServices();
- for (final Object service : serviceObjects) {
- if (ServiceUtil.id(service).equals(serviceId)) {
- perspective.addToServices(service);
- break;
- }
- }
- } else {
- throw new SAXException("Invalid element in services: " + tagName);
- }
- } else if (isObjects) {
- // TODO reload objects
- } else if (tagName.equals("services")) {
- isServices = true;
- } else if (tagName.equals("objects")) {
- isObjects = true;
- } else {
- throw new SAXException("Invalid element in perspective: " + tagName);
- }
- } else if (tagName.equals("perspective")) {
- perspective = userProfile.newPerspective(attributes.getValue("name"));
- } else {
- throw new SAXException("Invalid element in perspectives: " + tagName);
- }
- } else if (tagName.equals("options")) {
- isOptions = true;
- options.push(userProfile.getOptions());
- } else if (tagName.equals("perspectives") && !isOptions) {
- isPerspectives = true;
- } else {
- throw new SAXException("Invalid element in profile: " + tagName);
- }
-
- }
- /*
- * else { throw new SAXException("Invalid data"); } }
- */
-
- if (tagName.equals("profile")) {
- isProfile = true;
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/profilestore/xml/src/main/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/XmlFileUtil.java
----------------------------------------------------------------------
diff --git a/component/profilestore/xml/src/main/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/XmlFileUtil.java b/component/profilestore/xml/src/main/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/XmlFileUtil.java
deleted file mode 100644
index 2edce0e..0000000
--- a/component/profilestore/xml/src/main/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/XmlFileUtil.java
+++ /dev/null
@@ -1,34 +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.runtimes.dflt.profilestores.xml.internal;
-
-import org.apache.isis.core.commons.config.ConfigurationConstants;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-
-public class XmlFileUtil {
-
- public static final String ENCODING_PROPERTY = ConfigurationConstants.ROOT + "xmlos.encoding";
- public static final String DEFAULT_ENCODING = "ISO-8859-1";
-
- public static String lookupCharset(final IsisConfiguration configuration) {
- return configuration.getString(ENCODING_PROPERTY, DEFAULT_ENCODING);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/profilestore/xml/src/test/java/org/apache/isis/profilestore/xml/internal/TestServiceObject1.java
----------------------------------------------------------------------
diff --git a/component/profilestore/xml/src/test/java/org/apache/isis/profilestore/xml/internal/TestServiceObject1.java b/component/profilestore/xml/src/test/java/org/apache/isis/profilestore/xml/internal/TestServiceObject1.java
new file mode 100644
index 0000000..da30c7e
--- /dev/null
+++ b/component/profilestore/xml/src/test/java/org/apache/isis/profilestore/xml/internal/TestServiceObject1.java
@@ -0,0 +1,28 @@
+/*
+ * 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.profilestore.xml.internal;
+
+public class TestServiceObject1 {
+ public static final String ID = "test service";
+
+ public String getId() {
+ return ID;
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/profilestore/xml/src/test/java/org/apache/isis/profilestore/xml/internal/UserProfileContentWriterTest.java
----------------------------------------------------------------------
diff --git a/component/profilestore/xml/src/test/java/org/apache/isis/profilestore/xml/internal/UserProfileContentWriterTest.java b/component/profilestore/xml/src/test/java/org/apache/isis/profilestore/xml/internal/UserProfileContentWriterTest.java
new file mode 100644
index 0000000..3e5301a
--- /dev/null
+++ b/component/profilestore/xml/src/test/java/org/apache/isis/profilestore/xml/internal/UserProfileContentWriterTest.java
@@ -0,0 +1,106 @@
+/*
+ * 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.profilestore.xml.internal;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.io.StringWriter;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import org.apache.isis.core.runtime.userprofile.Options;
+import org.apache.isis.core.runtime.userprofile.PerspectiveEntry;
+import org.apache.isis.core.runtime.userprofile.UserProfile;
+import org.apache.isis.profilestore.xml.internal.UserProfileContentWriter;
+
+public class UserProfileContentWriterTest {
+
+ private UserProfileContentWriter writer1;
+ private UserProfile profile;
+ private StringWriter writer;
+
+ @Before
+ public void setup() throws Exception {
+ profile = new UserProfile();
+ writer1 = new UserProfileContentWriter(profile);
+ writer = new StringWriter();
+
+ }
+
+ @Test
+ public void emptyStructure() throws Exception {
+ writeContent();
+ assertEquals("<profile>\n <options>\n </options>\n <perspectives>\n </perspectives>\n</profile>\n", writer.toString());
+ }
+
+ @Test
+ public void singleOption() throws Exception {
+ profile.addToOptions("option1", "value1");
+ profile.addToOptions("option2", "value2");
+ assertLine(" <option id=\"option2\">value2</option>", 2);
+ assertLine(" <option id=\"option1\">value1</option>", 3);
+ }
+
+ @Test
+ public void recursiveOptions() throws Exception {
+ final Options options = new Options();
+ options.addOption("option2", "value2");
+ profile.getOptions().addOptions("option1", options);
+ assertLine(" <options id=\"option1\">", 2);
+ assertLine(" <option id=\"option2\">value2</option>", 3);
+ assertLine(" </options>", 4);
+ }
+
+ @Test
+ public void emptyOptionsAreIgnored() throws Exception {
+ final Options options = new Options();
+ profile.getOptions().addOptions("option1", options);
+ debug();
+ assertLine(" </options>", 2);
+ }
+
+ @Test
+ public void perspective() throws Exception {
+ final PerspectiveEntry perspective = new PerspectiveEntry();
+ perspective.setName("test");
+ profile.addToPerspectives(perspective);
+ // debug();
+ writeContent();
+ assertEquals("<profile>\n <options>\n </options>\n <perspectives>\n" + " <perspective name=\"test\">\n <services>\n </services>\n <objects>\n </objects>\n </perspective>\n" + " </perspectives>\n</profile>\n", writer.toString());
+ }
+
+ // // Helpers
+
+ private void assertLine(final String expected, final int line) throws IOException {
+ writeContent();
+ assertEquals(expected, writer.toString().split("\n")[line]);
+ }
+
+ private void debug() throws IOException {
+ writeContent();
+ System.out.println(writer.toString());
+ }
+
+ private void writeContent() throws IOException {
+ writer1.write(writer);
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/profilestore/xml/src/test/java/org/apache/isis/profilestore/xml/internal/UserProfileDataHandlerTest.java
----------------------------------------------------------------------
diff --git a/component/profilestore/xml/src/test/java/org/apache/isis/profilestore/xml/internal/UserProfileDataHandlerTest.java b/component/profilestore/xml/src/test/java/org/apache/isis/profilestore/xml/internal/UserProfileDataHandlerTest.java
new file mode 100644
index 0000000..1fc7ed0
--- /dev/null
+++ b/component/profilestore/xml/src/test/java/org/apache/isis/profilestore/xml/internal/UserProfileDataHandlerTest.java
@@ -0,0 +1,153 @@
+/*
+ * 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.profilestore.xml.internal;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.isis.core.commons.config.IsisConfigurationDefault;
+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.imageloader.TemplateImageLoader;
+import org.apache.isis.core.runtime.system.DeploymentType;
+import org.apache.isis.core.runtime.system.context.IsisContextStatic;
+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.Options;
+import org.apache.isis.core.runtime.userprofile.UserProfile;
+import org.apache.isis.core.runtime.userprofile.UserProfileLoader;
+import org.apache.isis.core.unittestsupport.jmock.auto.Mock;
+import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
+import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
+import org.apache.isis.profilestore.xml.internal.UserProfileDataHandler;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+public class UserProfileDataHandlerTest {
+
+ @Rule
+ public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
+
+ @Mock
+ private TemplateImageLoader mockTemplateImageLoader;
+ @Mock
+ private SpecificationLoaderSpi mockSpecificationLoader;
+ @Mock
+ private AuthenticationManager mockAuthenticationManager;
+ @Mock
+ private AuthorizationManager mockAuthorizationManager;
+ @Mock
+ private UserProfileLoader mockUserProfileLoader;
+ @Mock
+ private PersistenceSessionFactory mockPersistenceSessionFactory;
+
+ private TestServiceObject1 service;
+ private UserProfile profile;
+
+
+ @Before
+ public void setup() throws Exception {
+ Logger.getRootLogger().setLevel(Level.OFF);
+ service = new TestServiceObject1();
+ final IsisSessionFactory executionContextFactory = new IsisSessionFactoryDefault(DeploymentType.EXPLORATION, new IsisConfigurationDefault(), mockTemplateImageLoader, mockSpecificationLoader, mockAuthenticationManager,
+ mockAuthorizationManager, mockUserProfileLoader, mockPersistenceSessionFactory, Arrays.<Object>asList(service), new OidMarshaller());
+
+ IsisContextStatic.createRelaxedInstance(executionContextFactory);
+
+ final XMLReader parser = XMLReaderFactory.createXMLReader();
+ final UserProfileDataHandler handler = new UserProfileDataHandler();
+ parser.setContentHandler(handler);
+ parser.parse(new InputSource(new InputStreamReader(new FileInputStream("test.xml"))));
+
+ profile = handler.getUserProfile();
+ }
+
+ @Test
+ public void stringOption() throws Exception {
+ assertEquals("on", profile.getOptions().getString("power"));
+ }
+
+ @Test
+ public void unknownOptionReturnsNull() throws Exception {
+ assertEquals(null, profile.getOptions().getString("device"));
+ }
+
+ @Test
+ public void integerOption() throws Exception {
+ assertEquals(50, profile.getOptions().getInteger("height", 10));
+ }
+
+ @Test
+ public void unknownIntegerReturnsDefault() throws Exception {
+ assertEquals(30, profile.getOptions().getInteger("width", 30));
+ }
+
+ @Test
+ public void unknownOptionsCreated() throws Exception {
+ final Options options = profile.getOptions().getOptions("");
+ assertNotNull(options);
+ assertEquals(false, options.names().hasNext());
+ }
+
+ @Test
+ public void containedOptions() throws Exception {
+ final Options options = profile.getOptions().getOptions("opts");
+ assertNotNull(options);
+ assertEquals("value1", options.getString("option1"));
+ assertEquals("value2", options.getString("option2"));
+ }
+
+ @Test
+ public void recursiveOptions() throws Exception {
+ Options options = profile.getOptions().getOptions("opts");
+ options = options.getOptions("options3");
+ assertEquals("value4", options.getString("option4"));
+ assertEquals("value5", options.getString("option5"));
+ }
+
+ @Test
+ public void profileNames() throws Exception {
+ final List<String> list = profile.list();
+ assertEquals(2, list.size());
+ assertEquals("Library", list.get(0));
+ assertEquals("Admin", list.get(1));
+ }
+
+ @Test
+ public void perspective() throws Exception {
+ assertEquals("Admin", profile.getPerspective().getName());
+ assertEquals(1, profile.getPerspective().getServices().size());
+ assertEquals(service, profile.getPerspective().getServices().get(0));
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/profilestore/xml/src/test/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/TestServiceObject1.java
----------------------------------------------------------------------
diff --git a/component/profilestore/xml/src/test/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/TestServiceObject1.java b/component/profilestore/xml/src/test/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/TestServiceObject1.java
deleted file mode 100644
index d4fe76d..0000000
--- a/component/profilestore/xml/src/test/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/TestServiceObject1.java
+++ /dev/null
@@ -1,28 +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.runtimes.dflt.profilestores.xml.internal;
-
-public class TestServiceObject1 {
- public static final String ID = "test service";
-
- public String getId() {
- return ID;
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/profilestore/xml/src/test/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/UserProfileContentWriterTest.java
----------------------------------------------------------------------
diff --git a/component/profilestore/xml/src/test/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/UserProfileContentWriterTest.java b/component/profilestore/xml/src/test/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/UserProfileContentWriterTest.java
deleted file mode 100644
index 3d10a7f..0000000
--- a/component/profilestore/xml/src/test/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/UserProfileContentWriterTest.java
+++ /dev/null
@@ -1,105 +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.runtimes.dflt.profilestores.xml.internal;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.IOException;
-import java.io.StringWriter;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import org.apache.isis.core.runtime.userprofile.Options;
-import org.apache.isis.core.runtime.userprofile.PerspectiveEntry;
-import org.apache.isis.core.runtime.userprofile.UserProfile;
-
-public class UserProfileContentWriterTest {
-
- private UserProfileContentWriter writer1;
- private UserProfile profile;
- private StringWriter writer;
-
- @Before
- public void setup() throws Exception {
- profile = new UserProfile();
- writer1 = new UserProfileContentWriter(profile);
- writer = new StringWriter();
-
- }
-
- @Test
- public void emptyStructure() throws Exception {
- writeContent();
- assertEquals("<profile>\n <options>\n </options>\n <perspectives>\n </perspectives>\n</profile>\n", writer.toString());
- }
-
- @Test
- public void singleOption() throws Exception {
- profile.addToOptions("option1", "value1");
- profile.addToOptions("option2", "value2");
- assertLine(" <option id=\"option2\">value2</option>", 2);
- assertLine(" <option id=\"option1\">value1</option>", 3);
- }
-
- @Test
- public void recursiveOptions() throws Exception {
- final Options options = new Options();
- options.addOption("option2", "value2");
- profile.getOptions().addOptions("option1", options);
- assertLine(" <options id=\"option1\">", 2);
- assertLine(" <option id=\"option2\">value2</option>", 3);
- assertLine(" </options>", 4);
- }
-
- @Test
- public void emptyOptionsAreIgnored() throws Exception {
- final Options options = new Options();
- profile.getOptions().addOptions("option1", options);
- debug();
- assertLine(" </options>", 2);
- }
-
- @Test
- public void perspective() throws Exception {
- final PerspectiveEntry perspective = new PerspectiveEntry();
- perspective.setName("test");
- profile.addToPerspectives(perspective);
- // debug();
- writeContent();
- assertEquals("<profile>\n <options>\n </options>\n <perspectives>\n" + " <perspective name=\"test\">\n <services>\n </services>\n <objects>\n </objects>\n </perspective>\n" + " </perspectives>\n</profile>\n", writer.toString());
- }
-
- // // Helpers
-
- private void assertLine(final String expected, final int line) throws IOException {
- writeContent();
- assertEquals(expected, writer.toString().split("\n")[line]);
- }
-
- private void debug() throws IOException {
- writeContent();
- System.out.println(writer.toString());
- }
-
- private void writeContent() throws IOException {
- writer1.write(writer);
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/profilestore/xml/src/test/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/UserProfileDataHandlerTest.java
----------------------------------------------------------------------
diff --git a/component/profilestore/xml/src/test/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/UserProfileDataHandlerTest.java b/component/profilestore/xml/src/test/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/UserProfileDataHandlerTest.java
deleted file mode 100644
index 791ffd3..0000000
--- a/component/profilestore/xml/src/test/java/org/apache/isis/runtimes/dflt/profilestores/xml/internal/UserProfileDataHandlerTest.java
+++ /dev/null
@@ -1,152 +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.runtimes.dflt.profilestores.xml.internal;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.FileInputStream;
-import java.io.InputStreamReader;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.isis.core.commons.config.IsisConfigurationDefault;
-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.imageloader.TemplateImageLoader;
-import org.apache.isis.core.runtime.userprofile.Options;
-import org.apache.isis.core.runtime.userprofile.UserProfile;
-import org.apache.isis.core.runtime.userprofile.UserProfileLoader;
-import org.apache.isis.core.testsupport.jmock.JUnitRuleMockery2;
-import org.apache.isis.core.testsupport.jmock.JUnitRuleMockery2.Mode;
-import org.apache.isis.runtimes.dflt.runtime.system.DeploymentType;
-import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContextStatic;
-import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSessionFactory;
-import org.apache.isis.runtimes.dflt.runtime.system.session.IsisSessionFactory;
-import org.apache.isis.runtimes.dflt.runtime.system.session.IsisSessionFactoryDefault;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.jmock.auto.Mock;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
-
-public class UserProfileDataHandlerTest {
-
- @Rule
- public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
-
- @Mock
- private TemplateImageLoader mockTemplateImageLoader;
- @Mock
- private SpecificationLoaderSpi mockSpecificationLoader;
- @Mock
- private AuthenticationManager mockAuthenticationManager;
- @Mock
- private AuthorizationManager mockAuthorizationManager;
- @Mock
- private UserProfileLoader mockUserProfileLoader;
- @Mock
- private PersistenceSessionFactory mockPersistenceSessionFactory;
-
- private TestServiceObject1 service;
- private UserProfile profile;
-
-
- @Before
- public void setup() throws Exception {
- Logger.getRootLogger().setLevel(Level.OFF);
- service = new TestServiceObject1();
- final IsisSessionFactory executionContextFactory = new IsisSessionFactoryDefault(DeploymentType.EXPLORATION, new IsisConfigurationDefault(), mockTemplateImageLoader, mockSpecificationLoader, mockAuthenticationManager,
- mockAuthorizationManager, mockUserProfileLoader, mockPersistenceSessionFactory, Arrays.<Object>asList(service), new OidMarshaller());
-
- IsisContextStatic.createRelaxedInstance(executionContextFactory);
-
- final XMLReader parser = XMLReaderFactory.createXMLReader();
- final UserProfileDataHandler handler = new UserProfileDataHandler();
- parser.setContentHandler(handler);
- parser.parse(new InputSource(new InputStreamReader(new FileInputStream("test.xml"))));
-
- profile = handler.getUserProfile();
- }
-
- @Test
- public void stringOption() throws Exception {
- assertEquals("on", profile.getOptions().getString("power"));
- }
-
- @Test
- public void unknownOptionReturnsNull() throws Exception {
- assertEquals(null, profile.getOptions().getString("device"));
- }
-
- @Test
- public void integerOption() throws Exception {
- assertEquals(50, profile.getOptions().getInteger("height", 10));
- }
-
- @Test
- public void unknownIntegerReturnsDefault() throws Exception {
- assertEquals(30, profile.getOptions().getInteger("width", 30));
- }
-
- @Test
- public void unknownOptionsCreated() throws Exception {
- final Options options = profile.getOptions().getOptions("");
- assertNotNull(options);
- assertEquals(false, options.names().hasNext());
- }
-
- @Test
- public void containedOptions() throws Exception {
- final Options options = profile.getOptions().getOptions("opts");
- assertNotNull(options);
- assertEquals("value1", options.getString("option1"));
- assertEquals("value2", options.getString("option2"));
- }
-
- @Test
- public void recursiveOptions() throws Exception {
- Options options = profile.getOptions().getOptions("opts");
- options = options.getOptions("options3");
- assertEquals("value4", options.getString("option4"));
- assertEquals("value5", options.getString("option5"));
- }
-
- @Test
- public void profileNames() throws Exception {
- final List<String> list = profile.list();
- assertEquals(2, list.size());
- assertEquals("Library", list.get(0));
- assertEquals("Admin", list.get(1));
- }
-
- @Test
- public void perspective() throws Exception {
- assertEquals("Admin", profile.getPerspective().getName());
- assertEquals(1, profile.getPerspective().getServices().size());
- assertEquals(service, profile.getPerspective().getServices().get(0));
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/progmodel/wrapper/wrapper-metamodel/src/main/java/org/apache/isis/progmodel/wrapper/metamodel/internal/DelegatingInvocationHandlerDefault.java
----------------------------------------------------------------------
diff --git a/component/progmodel/wrapper/wrapper-metamodel/src/main/java/org/apache/isis/progmodel/wrapper/metamodel/internal/DelegatingInvocationHandlerDefault.java b/component/progmodel/wrapper/wrapper-metamodel/src/main/java/org/apache/isis/progmodel/wrapper/metamodel/internal/DelegatingInvocationHandlerDefault.java
index a13d6cb..e8cb309 100644
--- a/component/progmodel/wrapper/wrapper-metamodel/src/main/java/org/apache/isis/progmodel/wrapper/metamodel/internal/DelegatingInvocationHandlerDefault.java
+++ b/component/progmodel/wrapper/wrapper-metamodel/src/main/java/org/apache/isis/progmodel/wrapper/metamodel/internal/DelegatingInvocationHandlerDefault.java
@@ -24,10 +24,10 @@ import java.lang.reflect.Method;
import org.apache.isis.applib.events.InteractionEvent;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.core.runtime.persistence.container.DomainObjectContainerObjectChanged;
+import org.apache.isis.core.runtime.persistence.container.DomainObjectContainerResolve;
import org.apache.isis.progmodel.wrapper.applib.WrapperFactory;
import org.apache.isis.progmodel.wrapper.applib.WrapperFactory.ExecutionMode;
-import org.apache.isis.runtimes.dflt.runtime.persistence.container.DomainObjectContainerObjectChanged;
-import org.apache.isis.runtimes.dflt.runtime.persistence.container.DomainObjectContainerResolve;
public class DelegatingInvocationHandlerDefault<T> implements DelegatingInvocationHandler<T> {
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/progmodel/wrapper/wrapper-metamodel/src/test/java/org/apache/isis/progmodel/wrapper/WrappedFactoryDefaultTest_wrappedObject.java
----------------------------------------------------------------------
diff --git a/component/progmodel/wrapper/wrapper-metamodel/src/test/java/org/apache/isis/progmodel/wrapper/WrappedFactoryDefaultTest_wrappedObject.java b/component/progmodel/wrapper/wrapper-metamodel/src/test/java/org/apache/isis/progmodel/wrapper/WrappedFactoryDefaultTest_wrappedObject.java
index ba2c219..12c3c99 100644
--- a/component/progmodel/wrapper/wrapper-metamodel/src/test/java/org/apache/isis/progmodel/wrapper/WrappedFactoryDefaultTest_wrappedObject.java
+++ b/component/progmodel/wrapper/wrapper-metamodel/src/test/java/org/apache/isis/progmodel/wrapper/WrappedFactoryDefaultTest_wrappedObject.java
@@ -28,16 +28,16 @@ import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
-import org.apache.isis.core.testsupport.jmock.JUnitRuleMockery2;
-import org.apache.isis.core.testsupport.jmock.JUnitRuleMockery2.Mode;
+import org.apache.isis.core.tck.dom.claimapp.employees.Employee;
+import org.apache.isis.core.tck.dom.claimapp.employees.EmployeeRepository;
+import org.apache.isis.core.tck.dom.claimapp.employees.EmployeeRepositoryImpl;
+import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
+import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
import org.apache.isis.progmodel.wrapper.applib.DisabledException;
import org.apache.isis.progmodel.wrapper.applib.HiddenException;
import org.apache.isis.progmodel.wrapper.applib.InvalidException;
import org.apache.isis.progmodel.wrapper.applib.WrapperFactory;
import org.apache.isis.progmodel.wrapper.metamodel.internal.WrapperFactoryDefault;
-import org.apache.isis.tck.dom.claimapp.employees.Employee;
-import org.apache.isis.tck.dom.claimapp.employees.EmployeeRepository;
-import org.apache.isis.tck.dom.claimapp.employees.EmployeeRepositoryImpl;
public class WrappedFactoryDefaultTest_wrappedObject {
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/progmodel/wrapper/wrapper-metamodel/src/test/java/org/apache/isis/progmodel/wrapper/WrappedFactoryDefaultTest_wrappedObject_transient.java
----------------------------------------------------------------------
diff --git a/component/progmodel/wrapper/wrapper-metamodel/src/test/java/org/apache/isis/progmodel/wrapper/WrappedFactoryDefaultTest_wrappedObject_transient.java b/component/progmodel/wrapper/wrapper-metamodel/src/test/java/org/apache/isis/progmodel/wrapper/WrappedFactoryDefaultTest_wrappedObject_transient.java
index 3d1a1e4..61574b2 100644
--- a/component/progmodel/wrapper/wrapper-metamodel/src/test/java/org/apache/isis/progmodel/wrapper/WrappedFactoryDefaultTest_wrappedObject_transient.java
+++ b/component/progmodel/wrapper/wrapper-metamodel/src/test/java/org/apache/isis/progmodel/wrapper/WrappedFactoryDefaultTest_wrappedObject_transient.java
@@ -28,7 +28,6 @@ import java.util.Collections;
import java.util.List;
import org.jmock.Expectations;
-import org.jmock.auto.Mock;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -56,11 +55,12 @@ import org.apache.isis.core.progmodel.facets.members.disabled.staticmethod.Disab
import org.apache.isis.core.progmodel.facets.properties.accessor.PropertyAccessorFacetViaAccessor;
import org.apache.isis.core.progmodel.facets.properties.modify.PropertySetterFacetViaSetterMethod;
import org.apache.isis.core.runtime.authentication.standard.SimpleSession;
-import org.apache.isis.core.testsupport.jmock.JUnitRuleMockery2;
-import org.apache.isis.core.testsupport.jmock.JUnitRuleMockery2.Mode;
+import org.apache.isis.core.tck.dom.claimapp.employees.Employee;
+import org.apache.isis.core.unittestsupport.jmock.auto.Mock;
+import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
+import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
import org.apache.isis.progmodel.wrapper.applib.DisabledException;
import org.apache.isis.progmodel.wrapper.metamodel.internal.WrapperFactoryDefault;
-import org.apache.isis.tck.dom.claimapp.employees.Employee;
public class WrappedFactoryDefaultTest_wrappedObject_transient {
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/security/file/src/main/java/org/apache/isis/security/file/authentication/FileAuthenticationManagerInstaller.java
----------------------------------------------------------------------
diff --git a/component/security/file/src/main/java/org/apache/isis/security/file/authentication/FileAuthenticationManagerInstaller.java b/component/security/file/src/main/java/org/apache/isis/security/file/authentication/FileAuthenticationManagerInstaller.java
index 356af52..0c27e3b 100644
--- a/component/security/file/src/main/java/org/apache/isis/security/file/authentication/FileAuthenticationManagerInstaller.java
+++ b/component/security/file/src/main/java/org/apache/isis/security/file/authentication/FileAuthenticationManagerInstaller.java
@@ -24,8 +24,8 @@ import java.util.List;
import com.google.common.collect.Lists;
import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.runtime.authentication.AuthenticationManagerStandardInstallerAbstractForDfltRuntime;
import org.apache.isis.core.runtime.authentication.standard.Authenticator;
-import org.apache.isis.runtimes.dflt.runtime.authentication.AuthenticationManagerStandardInstallerAbstractForDfltRuntime;
public class FileAuthenticationManagerInstaller extends AuthenticationManagerStandardInstallerAbstractForDfltRuntime {
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/security/ldap/src/main/java/org/apache/isis/security/ldap/authentication/LdapAuthenticationManagerInstaller.java
----------------------------------------------------------------------
diff --git a/component/security/ldap/src/main/java/org/apache/isis/security/ldap/authentication/LdapAuthenticationManagerInstaller.java b/component/security/ldap/src/main/java/org/apache/isis/security/ldap/authentication/LdapAuthenticationManagerInstaller.java
index e5bb343..4f8abd3 100644
--- a/component/security/ldap/src/main/java/org/apache/isis/security/ldap/authentication/LdapAuthenticationManagerInstaller.java
+++ b/component/security/ldap/src/main/java/org/apache/isis/security/ldap/authentication/LdapAuthenticationManagerInstaller.java
@@ -24,8 +24,8 @@ import java.util.List;
import com.google.common.collect.Lists;
import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.runtime.authentication.AuthenticationManagerStandardInstallerAbstractForDfltRuntime;
import org.apache.isis.core.runtime.authentication.standard.Authenticator;
-import org.apache.isis.runtimes.dflt.runtime.authentication.AuthenticationManagerStandardInstallerAbstractForDfltRuntime;
public class LdapAuthenticationManagerInstaller extends AuthenticationManagerStandardInstallerAbstractForDfltRuntime {
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/security/ldap/src/test/java/org/apache/isis/security/ldap/authentication/LdapAuthenticatorTester.java
----------------------------------------------------------------------
diff --git a/component/security/ldap/src/test/java/org/apache/isis/security/ldap/authentication/LdapAuthenticatorTester.java b/component/security/ldap/src/test/java/org/apache/isis/security/ldap/authentication/LdapAuthenticatorTester.java
index 69c9995..e84ec1c 100644
--- a/component/security/ldap/src/test/java/org/apache/isis/security/ldap/authentication/LdapAuthenticatorTester.java
+++ b/component/security/ldap/src/test/java/org/apache/isis/security/ldap/authentication/LdapAuthenticatorTester.java
@@ -20,7 +20,7 @@
package org.apache.isis.security.ldap.authentication;
import org.apache.isis.core.runtime.authentication.AuthenticationRequestPassword;
-import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
+import org.apache.isis.core.runtime.system.context.IsisContext;
public class LdapAuthenticatorTester {
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/security/sql/src/main/java/org/apache/isis/security/sql/authentication/SqlAuthenticationManagerInstaller.java
----------------------------------------------------------------------
diff --git a/component/security/sql/src/main/java/org/apache/isis/security/sql/authentication/SqlAuthenticationManagerInstaller.java b/component/security/sql/src/main/java/org/apache/isis/security/sql/authentication/SqlAuthenticationManagerInstaller.java
index 03baff9..9dc53e2 100755
--- a/component/security/sql/src/main/java/org/apache/isis/security/sql/authentication/SqlAuthenticationManagerInstaller.java
+++ b/component/security/sql/src/main/java/org/apache/isis/security/sql/authentication/SqlAuthenticationManagerInstaller.java
@@ -26,8 +26,8 @@ import com.google.common.collect.Lists;
import org.apache.isis.applib.ApplicationException;
import org.apache.isis.core.commons.config.IsisConfiguration;
+import org.apache.isis.core.runtime.authentication.AuthenticationManagerStandardInstallerAbstractForDfltRuntime;
import org.apache.isis.core.runtime.authentication.standard.Authenticator;
-import org.apache.isis.runtimes.dflt.runtime.authentication.AuthenticationManagerStandardInstallerAbstractForDfltRuntime;
public class SqlAuthenticationManagerInstaller extends AuthenticationManagerStandardInstallerAbstractForDfltRuntime {
http://git-wip-us.apache.org/repos/asf/isis/blob/951a0fe4/component/security/sql/src/main/java/org/apache/isis/security/sql/authentication/SqlAuthenticator.java
----------------------------------------------------------------------
diff --git a/component/security/sql/src/main/java/org/apache/isis/security/sql/authentication/SqlAuthenticator.java b/component/security/sql/src/main/java/org/apache/isis/security/sql/authentication/SqlAuthenticator.java
index ca89521..63df436 100755
--- a/component/security/sql/src/main/java/org/apache/isis/security/sql/authentication/SqlAuthenticator.java
+++ b/component/security/sql/src/main/java/org/apache/isis/security/sql/authentication/SqlAuthenticator.java
@@ -40,7 +40,7 @@ import org.apache.isis.core.commons.ensure.Assert;
import org.apache.isis.core.runtime.authentication.AuthenticationRequest;
import org.apache.isis.core.runtime.authentication.AuthenticationRequestPassword;
import org.apache.isis.core.runtime.authentication.standard.PasswordRequestAuthenticatorAbstract;
-import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
+import org.apache.isis.core.runtime.system.context.IsisContext;
public class SqlAuthenticator extends PasswordRequestAuthenticatorAbstract {
private static final Logger LOG = Logger.getLogger(SqlAuthenticator.class);