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 2017/10/25 14:37:18 UTC
[isis] 04/08: ISIS-1742: deletes ObjectFixtureService,
ObjectFixtureFilePersistor, ObjectLoaderFixture.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch ISIS-1632-meta-annotations
in repository https://gitbox.apache.org/repos/asf/isis.git
commit bd4118af53694007d00ace95573f100b2a3fb331
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sun Oct 22 14:49:41 2017 +0100
ISIS-1742: deletes ObjectFixtureService, ObjectFixtureFilePersistor, ObjectLoaderFixture.
Also:
- removes support for SERVICES_PREFIX_KEY (common package prefix for services) from ServicesInstallerFromConfiguration
---
.../fixturedomainservice/FixtureException.java | 43 ----
.../ObjectFixtureFilePersistor.java | 243 -------------------
.../fixturedomainservice/ObjectFixtureService.java | 264 ---------------------
.../FixturesInstallerFromConfiguration.java | 4 -
.../domainservice/ObjectLoaderFixture.java | 45 ----
.../ServicesInstallerFromConfiguration.java | 59 +----
todo-deprecation-list.txt | 9 +-
7 files changed, 5 insertions(+), 662 deletions(-)
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/fixturedomainservice/FixtureException.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/fixturedomainservice/FixtureException.java
deleted file mode 100644
index ff91921..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/fixturedomainservice/FixtureException.java
+++ /dev/null
@@ -1,43 +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.fixturedomainservice;
-
-import org.apache.isis.core.commons.exceptions.IsisException;
-
-public class FixtureException extends IsisException {
- private static final long serialVersionUID = 1L;
-
- public FixtureException() {
- super();
- }
-
- public FixtureException(final String msg, final Throwable cause) {
- super(msg, cause);
- }
-
- public FixtureException(final String msg) {
- super(msg);
- }
-
- public FixtureException(final Throwable cause) {
- super(cause);
- }
-
-}
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/fixturedomainservice/ObjectFixtureFilePersistor.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/fixturedomainservice/ObjectFixtureFilePersistor.java
deleted file mode 100644
index 8c5780a..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/fixturedomainservice/ObjectFixtureFilePersistor.java
+++ /dev/null
@@ -1,243 +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.fixturedomainservice;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.Reader;
-import java.io.Writer;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.inject.Inject;
-
-import com.google.common.collect.Maps;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.consent.InteractionInitiatedBy;
-import org.apache.isis.core.metamodel.facets.collections.modify.CollectionFacet;
-import org.apache.isis.core.metamodel.facets.collections.modify.CollectionFacetUtils;
-import org.apache.isis.core.metamodel.facets.object.parseable.ParseableFacet;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.spec.ObjectSpecificationException;
-import org.apache.isis.core.metamodel.spec.feature.Contributed;
-import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
-import org.apache.isis.core.metamodel.spec.feature.OneToOneAssociation;
-import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
-import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
-import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
-
-public class ObjectFixtureFilePersistor {
-
- private static final Logger LOG = LoggerFactory.getLogger(ObjectFixtureFilePersistor.class);
-
- public Set<Object> loadData(final Reader reader) throws IOException {
- final Set<Object> objects = new HashSet<Object>();
-
- final BufferedReader buffer = new BufferedReader(reader);
- final LoadedObjects loaded = new LoadedObjects(objects, specificationLoader, getPersistenceSession());
- String line;
- ObjectAdapter object = null;
- int lineNo = 0;
- try {
- while ((line = buffer.readLine()) != null) {
- lineNo++;
- if (line.trim().startsWith("#")) {
- continue;
- } else if (line.startsWith(" ")) {
- loadFieldData(object, loaded, line);
- } else {
- if (object != null && !object.representsPersistent()) {
- getPersistenceSession().makePersistentInTransaction(object);
- }
- object = loaded.get(line);
- }
- }
-
- if (object != null && !object.representsPersistent()) {
- getPersistenceSession().makePersistentInTransaction(object);
- }
- } catch (final Exception e) {
- throw new FixtureException("failed to load data at line " + lineNo, e);
- }
-
- return objects;
- }
-
- private void loadFieldData(final ObjectAdapter object, final LoadedObjects loaded, final String line) {
- final int pos = line.indexOf(':');
- if (pos == -1) {
- throw new FixtureException("no colon (:) in: " + line.trim());
- }
- final String name = line.substring(0, pos).trim();
- String data = line.substring(pos + 1).trim();
- try {
- final ObjectAssociation association = object.getSpecification().getAssociation(name);
- if (data.trim().length() == 0) {
- if ( association instanceof OneToOneAssociation &&
- !association.isEmpty(object, InteractionInitiatedBy.FRAMEWORK)) {
- final OneToOneAssociation property = (OneToOneAssociation) association;
- property.set(object, null, InteractionInitiatedBy.FRAMEWORK);
- }
- } else {
- if (association.isOneToManyAssociation()) {
- final String[] ids = data.split(" ");
- final ObjectAdapter[] elements = new ObjectAdapter[ids.length];
- for (int i = 0; i < ids.length; i++) {
- elements[i] = loaded.get(ids[i]);
- }
- final ObjectAdapter collection = association.get(object, InteractionInitiatedBy.FRAMEWORK);
- final CollectionFacet facet = CollectionFacetUtils.getCollectionFacetFromSpec(collection);
- facet.init(collection, elements);
- } else if (association.getSpecification().isParseable()) {
- data = data.replaceAll("\\n", "\n");
- final ParseableFacet facet = association.getSpecification().getFacet(ParseableFacet.class);
- final ObjectAdapter value = facet.parseTextEntry(null, data, InteractionInitiatedBy.FRAMEWORK);
- ((OneToOneAssociation) association).initAssociation(object, value);
- } else if (association.isOneToOneAssociation()) {
- final ObjectAdapter value = loaded.get(data);
- ((OneToOneAssociation) association).initAssociation(object, value);
- }
- }
- } catch (final ObjectSpecificationException e) {
- LOG.info("no field for '" + name + "', skipping entry: " + data);
- }
- }
-
- public void save(final Set<Object> objects, final Writer out) throws IOException {
- final PrintWriter writer = new PrintWriter(out);
- final SavedObjects saved = new SavedObjects();
- for (final Object object : objects) {
- final ObjectAdapter adapter = getPersistenceSession().adapterFor(object);
- saveData(writer, adapter, saved);
- }
- out.close();
- }
-
- private void saveData(final PrintWriter writer, final ObjectAdapter adapter, final SavedObjects saved) {
- final String id = saved.getId(adapter);
- writer.println(adapter.getSpecification().getFullIdentifier() + "#" + id);
-
- final ObjectSpecification adapterSpec = adapter.getSpecification();
- final List<ObjectAssociation> associations = adapterSpec.getAssociations(Contributed.EXCLUDED);
- for (final ObjectAssociation association : associations) {
- if (association.isNotPersisted()) {
- continue;
- }
-
- final ObjectAdapter associatedObject = association.get(adapter, InteractionInitiatedBy.FRAMEWORK);
- final boolean isEmpty = association.isEmpty(adapter, InteractionInitiatedBy.FRAMEWORK);
- final String associationId = association.getId();
- writer.write(" " + associationId + ": ");
- if (isEmpty) {
- writer.println();
- continue;
- }
-
- if (association.isOneToManyAssociation()) {
- final CollectionFacet facet = associatedObject.getSpecification().getFacet(CollectionFacet.class);
- for (final ObjectAdapter element : facet.iterable(associatedObject)) {
- final String refId = saved.getId(element);
- final String cls = element.getSpecification().getFullIdentifier();
- writer.print(cls + "#" + refId + " ");
- }
- writer.println();
- } else if (association.getSpecification().isParseable()) {
- final ParseableFacet facet = associatedObject.getSpecification().getFacet(ParseableFacet.class);
- String encodedValue = facet.parseableTitle(associatedObject);
- encodedValue = encodedValue.replaceAll("\n", "\\n");
- writer.println(encodedValue);
- } else if (association.isOneToOneAssociation()) {
- final String refId = saved.getId(associatedObject);
- final String cls = associatedObject.getSpecification().getFullIdentifier();
- writer.println(cls + "#" + refId);
- }
- }
- }
-
-
- @javax.inject.Inject
- IsisSessionFactory isisSessionFactory;
-
- protected PersistenceSession getPersistenceSession() {
- return isisSessionFactory.getCurrentSession().getPersistenceSession();
- }
-
- @javax.inject.Inject
- SpecificationLoader specificationLoader;
-
-}
-
-
-class LoadedObjects {
- private final Map<String, ObjectAdapter> idMap = Maps.newHashMap();
- private final Set<Object> objects;
- private final SpecificationLoader specificationLoader;
- private final PersistenceSession persistenceSession;
-
- public LoadedObjects(
- final Set<Object> objects,
- final SpecificationLoader specificationLoader,
- final PersistenceSession persistenceSession) {
- this.objects = objects;
- this.specificationLoader = specificationLoader;
- this.persistenceSession = persistenceSession;
- }
-
- public ObjectAdapter get(final String data) {
- final int pos = data.indexOf('#');
- if (pos == -1) {
- throw new FixtureException("load failed - trying to read non-reference data as a reference: " + data);
- }
- final String id = data.substring(pos + 1);
- ObjectAdapter object = idMap.get(id);
- if (object == null) {
- final String className = data.substring(0, pos);
- final ObjectSpecification specification = specificationLoader.loadSpecification(className);
- object = persistenceSession.createTransientInstance(specification);
- idMap.put(id, object);
- objects.add(object.getObject());
- }
- return object;
- }
-}
-
-class SavedObjects {
- private int id = 1;
- private final Map<ObjectAdapter, String> idMap = new HashMap<ObjectAdapter, String>();
-
- public String getId(final ObjectAdapter object) {
- String idString = idMap.get(object);
- if (idString == null) {
- id++;
- idMap.put(object, "" + id);
- idString = "" + id;
- }
- return idString;
- }
-}
-
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/fixturedomainservice/ObjectFixtureService.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/fixturedomainservice/ObjectFixtureService.java
deleted file mode 100644
index f26b7c5..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/fixturedomainservice/ObjectFixtureService.java
+++ /dev/null
@@ -1,264 +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.fixturedomainservice;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.List;
-import java.util.Set;
-
-import javax.annotation.PostConstruct;
-
-import com.google.common.collect.Sets;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.isis.applib.AbstractService;
-import org.apache.isis.applib.annotation.Action;
-import org.apache.isis.applib.annotation.ActionLayout;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.annotation.RestrictTo;
-import org.apache.isis.applib.services.registry.ServiceRegistry;
-import org.apache.isis.core.commons.config.ConfigurationConstants;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.commons.exceptions.IsisException;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.consent.InteractionInitiatedBy;
-import org.apache.isis.core.metamodel.facets.collections.modify.CollectionFacet;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.spec.feature.Contributed;
-import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
-import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
-import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
-
-public class ObjectFixtureService {
-
- private static final Logger LOG = LoggerFactory.getLogger(ObjectFixtureService.class);
- private static final String DATA_FILEPATH = ConfigurationConstants.ROOT + "exploration-objects.file";
- private static final String DEFAULT_FILEPATH = "fixture-data";
-
- private ObjectFixtureFilePersistor persistor;
-
- private Set<Object> objects = Sets.newHashSet();
-
-
- @PostConstruct
- public void init() {
- persistor = new ObjectFixtureFilePersistor();
- serviceRegistry.injectServicesInto(persistor);
- }
-
- // {{ title, Id
- public String title() {
- return "Fixture Objects";
- }
-
- public String getId() {
- return "fixtures";
- }
-
- public String iconName() {
- return "Fixture";
- }
-
- // }}
-
- // {{ action: save
- @Action(
- restrictTo = RestrictTo.PROTOTYPING
- )
- @ActionLayout(
- describedAs = "Add this object to the set of saved objects"
- )
- @MemberOrder(sequence = "1")
- public void save(final Object object) {
- final ObjectAdapter adapter = getPersistenceSession().adapterFor(object);
- LOG.info("Saving object for fixture: " + adapter);
- addObjectAndAssociates(adapter);
- saveAll();
- }
-
- private void addObjectAndAssociates(final ObjectAdapter adapter) {
- if (objects.contains(adapter.getObject())) {
- return;
- }
- objects.add(adapter.getObject());
-
- final ObjectSpecification adapterSpec = adapter.getSpecification();
- final List<ObjectAssociation> associations = adapterSpec.getAssociations(Contributed.EXCLUDED);
- for (final ObjectAssociation association : associations) {
- if (association.isNotPersisted()) {
- continue;
- }
-
- final ObjectAdapter associatedObject = association.get(adapter, InteractionInitiatedBy.FRAMEWORK);
- final boolean isEmpty = association.isEmpty(adapter, InteractionInitiatedBy.FRAMEWORK);
- if (isEmpty) {
- continue;
- }
- if (association.isOneToManyAssociation()) {
- final CollectionFacet facet = associatedObject.getSpecification().getFacet(CollectionFacet.class);
- for (final ObjectAdapter element : facet.iterable(associatedObject)) {
- addObjectAndAssociates(element);
- }
- } else if (association.isOneToOneAssociation() && !association.getSpecification().isParseable()) {
- addObjectAndAssociates(associatedObject);
- }
- }
- }
-
- public String validateSave(final Object object) {
- if (object == this || object instanceof AbstractService) {
- return "Can't add/remove a service";
- }
- return objects.contains(object) ? "This object has already been saved" : null;
- }
-
- // }}
-
- // {{ action: remove
- @Action(
- restrictTo = RestrictTo.PROTOTYPING
- )
- @ActionLayout(
- describedAs = "Remove this object from the set of saved objects"
- )
- @MemberOrder(sequence = "2")
- public void remove(final Object object) {
- objects.remove(object);
- saveAll();
- }
-
- public String validateRemove(final Object object) {
- if (object == this || object instanceof AbstractService) {
- return "Can't add/remove a service";
- }
- return objects.contains(object) ? null : "Can't remove an object that has not been saved";
- }
-
- // }}
-
- // {{ action: all Saved Objects
- @Action(
- restrictTo = RestrictTo.PROTOTYPING
- )
- @ActionLayout(
- describedAs = "Retrieved all the saved objects"
- )
- @MemberOrder(sequence = "4")
- public Set<Object> allSavedObjects() {
- return objects;
- }
-
- // }}
-
- // {{ action: saveAll
- @Action(
- restrictTo = RestrictTo.PROTOTYPING
- )
- @ActionLayout(
- describedAs = "Save the current state of the saved objects"
- )
- @MemberOrder(sequence = "3")
- public void saveAll() {
- FileWriter out = null;
- try {
- final File file = file(true);
- out = new FileWriter(file);
- persistor.save(objects, out);
- } catch (final IOException e) {
- throw new IsisException(e);
- } finally {
- if (out != null) {
- try {
- out.close();
- } catch (final IOException e) {
- throw new IsisException(e);
- }
- }
- }
- }
-
- // }}
-
- // {{ loadFile (programmtic)
- @Programmatic
- public void loadFile() {
- FileReader reader = null;
- try {
- final File file = file(false);
- reader = new FileReader(file);
- objects = persistor.loadData(reader);
- } catch (final FileNotFoundException e) {
- return;
- } catch (final IOException e) {
- throw new IsisException(e);
- } finally {
- if (reader != null) {
- try {
- reader.close();
- } catch (final IOException e) {
- throw new IsisException(e);
- }
- }
- }
- }
-
- private File file(final boolean createFileIfDoesntExist) throws IOException {
- final String fixturePath = configuration.getString(DATA_FILEPATH, DEFAULT_FILEPATH);
- final File file = new File(fixturePath);
- final File directory = file.getParentFile();
- mkdirIfRequired(directory);
- if (!file.exists() && createFileIfDoesntExist) {
- createFile(file);
- }
- return file;
- }
-
- private void mkdirIfRequired(final File directory) {
- if (directory != null && !directory.exists()) {
- directory.mkdirs();
- }
- }
-
- private void createFile(final File file) throws IOException {
- file.createNewFile();
- }
- // }}
-
- @javax.inject.Inject
- IsisSessionFactory isisSessionFactory;
-
- protected PersistenceSession getPersistenceSession() {
- return isisSessionFactory.getCurrentSession().getPersistenceSession();
- }
-
- @javax.inject.Inject
- IsisConfiguration configuration;
-
- @javax.inject.Inject
- ServiceRegistry serviceRegistry;
-
-}
\ No newline at end of file
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/fixtures/FixturesInstallerFromConfiguration.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/fixtures/FixturesInstallerFromConfiguration.java
index 285adb0..6dafc8b 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/fixtures/FixturesInstallerFromConfiguration.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/fixtures/FixturesInstallerFromConfiguration.java
@@ -25,7 +25,6 @@ import org.slf4j.LoggerFactory;
import org.apache.isis.core.commons.config.ConfigurationConstants;
import org.apache.isis.core.commons.exceptions.IsisException;
import org.apache.isis.core.commons.factory.InstanceUtil;
-import org.apache.isis.core.runtime.fixtures.domainservice.ObjectLoaderFixture;
import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
public class FixturesInstallerFromConfiguration extends FixturesInstallerAbstract {
@@ -60,9 +59,6 @@ public class FixturesInstallerFromConfiguration extends FixturesInstallerAbstrac
fixtureLoaded = true;
delegate.addFixture(fixture);
}
- if (configuration.getBoolean(EXPLORATION_OBJECTS)) {
- delegate.addFixture(new ObjectLoaderFixture());
- }
if (!fixtureLoaded) {
LOG.debug("No fixtures loaded from configuration");
}
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/fixtures/domainservice/ObjectLoaderFixture.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/fixtures/domainservice/ObjectLoaderFixture.java
deleted file mode 100644
index 2d6a245..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/fixtures/domainservice/ObjectLoaderFixture.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.core.runtime.fixtures.domainservice;
-
-import org.apache.isis.applib.fixtures.FixtureType;
-import org.apache.isis.applib.fixtures.InstallableFixture;
-import org.apache.isis.core.runtime.fixturedomainservice.ObjectFixtureService;
-
-public class ObjectLoaderFixture implements InstallableFixture {
-
- private ObjectFixtureService service;
-
- public void setService(final ObjectFixtureService service) {
- this.service = service;
- }
-
- @Override
- public void install() {
- if (service != null) {
- service.loadFile();
- }
- }
-
- @Override
- public FixtureType getType() {
- return FixtureType.DOMAIN_OBJECTS;
- }
-}
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromConfiguration.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromConfiguration.java
index 5fb1b17..b582ce6 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromConfiguration.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/ServicesInstallerFromConfiguration.java
@@ -26,19 +26,14 @@ import java.util.StringTokenizer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import com.google.common.base.Strings;
import com.google.common.collect.Maps;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.isis.core.commons.config.ConfigurationConstants;
-import org.apache.isis.core.commons.config.IsisConfiguration;
import org.apache.isis.core.commons.config.IsisConfigurationDefault;
import org.apache.isis.core.metamodel.util.DeweyOrderComparator;
-import org.apache.isis.core.runtime.fixturedomainservice.ObjectFixtureService;
-import org.apache.isis.core.runtime.system.DeploymentType;
-import org.apache.isis.core.runtime.system.SystemConstants;
public class ServicesInstallerFromConfiguration extends ServicesInstallerAbstract {
@@ -49,23 +44,6 @@ public class ServicesInstallerFromConfiguration extends ServicesInstallerAbstrac
private static final String SERVICES = "services";
public static final String SERVICES_KEY = ConfigurationConstants.ROOT + SERVICES;
- /**
- * @deprecated
- */
- @Deprecated
- private static final String EXPLORATION_OBJECTS = "exploration-objects";
-
- /**
- * @deprecated - just adds to the cognitive load...
- */
- @Deprecated
- private static final String SERVICES_PREFIX = "services.prefix";
- /**
- * @deprecated
- */
- @Deprecated
- private static final String SERVICES_PREFIX_KEY = ConfigurationConstants.ROOT + SERVICES_PREFIX;
-
private final static Pattern POSITIONED_SERVICE_REGEX = Pattern.compile("((\\d+):)(.*)");
private final ServiceInstantiator serviceInstantiator;
@@ -129,17 +107,15 @@ public class ServicesInstallerFromConfiguration extends ServicesInstallerAbstrac
// //////////////////////////////////////
- public void appendServices(
+ void appendServices(
final SortedMap<String, SortedSet<String>> positionedServices) {
appendConfiguredServices(positionedServices);
- appendObjectFixtureService(positionedServices, getConfiguration());
}
private void appendConfiguredServices(
final SortedMap<String, SortedSet<String>> positionedServices) {
- String servicePrefix = getConfiguration().getString(SERVICES_PREFIX_KEY);
final String configuredServices = getConfiguration().getString(SERVICES_KEY);
if (configuredServices == null) {
return;
@@ -158,38 +134,7 @@ public class ServicesInstallerFromConfiguration extends ServicesInstallerAbstrac
serviceName = matcher.group(3);
}
- final String service = fullyQualifiedServiceName(servicePrefix, serviceName);
- ServicesInstallerUtils.appendInPosition(positionedServices, "" + order, service);
- }
- }
-
- static String fullyQualifiedServiceName(String servicePrefix, String serviceName) {
- final StringBuilder buf = new StringBuilder();
-
- if(!Strings.isNullOrEmpty(servicePrefix)) {
- buf.append(servicePrefix);
- if(!servicePrefix.endsWith(".")) {
- buf.append(".");
- }
- }
-
- buf.append(serviceName);
- return buf.toString();
- }
-
- /**
- * @deprecated
- */
- @Deprecated
- private static void appendObjectFixtureService(
- final SortedMap<String, SortedSet<String>> positionedServices, final IsisConfiguration configuration) {
-
- if (configuration.getBoolean(ConfigurationConstants.ROOT + EXPLORATION_OBJECTS)) {
- final DeploymentType explorationDeploymentType = DeploymentType.lookup(configuration.getString(
- SystemConstants.DEPLOYMENT_TYPE_KEY));
- if (explorationDeploymentType.isExploring()) {
- ServicesInstallerUtils.appendInPosition(positionedServices, "" + Integer.MAX_VALUE, ObjectFixtureService.class.getName());
- }
+ ServicesInstallerUtils.appendInPosition(positionedServices, "" + order, serviceName);
}
}
diff --git a/todo-deprecation-list.txt b/todo-deprecation-list.txt
index 246576a..cd99195 100644
--- a/todo-deprecation-list.txt
+++ b/todo-deprecation-list.txt
@@ -41,13 +41,10 @@ OTHER STUFF:
+ObjectFixtureService + supporting classes
-debug() stuff
-
-DebugDataInputExtended & DebugDataOutputExtended .... seem to be unused
-
-
-ObjectFixtureService
+SwitchUserService
+AbstractFixtureSusa
--
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.