You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2021/04/16 13:59:34 UTC
[isis] branch master updated: ISIS-2569: remove all OID legacy
This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
The following commit(s) were added to refs/heads/master by this push:
new 9bccbb3 ISIS-2569: remove all OID legacy
9bccbb3 is described below
commit 9bccbb3f566fde0d19eb35645b9f41d6b5d38ad6
Author: Andi Huber <ah...@apache.org>
AuthorDate: Fri Apr 16 15:59:25 2021 +0200
ISIS-2569: remove all OID legacy
---
.../isis/core/metamodel/adapter/oid/Oid.java | 108 ------------
.../core/metamodel/adapter/oid/_OidMarshaller.java | 193 ---------------------
.../core/metamodel/adapter/oid/_SimpleOid.java | 89 ----------
.../adapter/oid/OidMarshallerTest_marshall.java | 41 -----
.../oid/OidMarshallerTest_roundtripping.java | 49 ------
.../adapter/oid/OidMarshallerTest_unmarshal.java | 109 ------------
.../core/metamodel/adapter/oid/OidVersionTest.java | 62 -------
...dDefaultTest_valueSemantics_whenPersistent.java | 45 -----
.../metamodel/adapter/oid/RootOidTest_create.java | 38 ----
.../specloader/SpecificationCacheDefaultTest.java | 5 +-
.../_LogicalTypeTestFactory.java} | 4 +-
.../wicket/model/mementos/PageParameterNames.java | 6 +-
12 files changed, 7 insertions(+), 742 deletions(-)
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/Oid.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/Oid.java
deleted file mode 100644
index 8e528a9..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/Oid.java
+++ /dev/null
@@ -1,108 +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.metamodel.adapter.oid;
-
-import java.io.Serializable;
-import java.util.Optional;
-
-import org.apache.isis.applib.annotation.Value;
-import org.apache.isis.applib.id.LogicalType;
-import org.apache.isis.applib.services.bookmark.Bookmark;
-import org.apache.isis.commons.internal.codec._UrlDecoderUtil;
-import org.apache.isis.core.metamodel.context.MetaModelContext;
-import org.apache.isis.core.metamodel.objectmanager.load.ObjectLoader;
-import org.apache.isis.core.metamodel.spec.ManagedObject;
-import org.apache.isis.schema.common.v2.OidDto;
-
-import lombok.NonNull;
-import lombok.val;
-
-/**
- * An immutable identifier for a root object.
- *
- * @apiNote value objects (strings, ints, {@link Value}s etc) do not have a
- * semantically meaningful {@link Oid}, but as an implementation detail
- * might have a placeholder {@link Oid}.
- */
-@Deprecated
-public interface Oid extends Serializable {
-
- // -- FACTORIES
-
- public static Oid of(final LogicalType logicalType, final String identifier) {
- return _SimpleOid.of(
- logicalType.getLogicalTypeName(),
- identifier);
- }
-
- // -- PARTS THAT MAKE UP THE OID
-
- /**
- * The logical-type-name of the domain object this instance is representing.
- * When representing a value returns {@code null}.
- */
- String getLogicalTypeName();
-
-
- String getIdentifier();
-
- // -- STRINGIFY
-
- /**
- * A string representation of this {@link Oid}.
- */
- default String stringify() {
- return _OidMarshaller.marshal(this);
- }
-
- // -- PARSING
-
- public static Oid parseUrlEncoded(final String urlEncodedOidStr) {
- final String oidStr = _UrlDecoderUtil.urlDecode(urlEncodedOidStr);
- return parse(oidStr);
- }
-
- public static Oid parse(final String oidStr) {
- return _OidMarshaller.unmarshal(oidStr);
- }
-
- // -- OBJECT LOADING
-
- default public Optional<ManagedObject> loadObject(final @NonNull MetaModelContext mmc) {
-
- val objectId = this.getIdentifier();
- val specLoader = mmc.getSpecificationLoader();
- val objManager = mmc.getObjectManager();
-
- return specLoader
- .specForLogicalTypeName(this.getLogicalTypeName())
- .map(spec->objManager.loadObject(
- ObjectLoader.Request.of(spec, objectId)));
-
- }
-
- // -- CONVERSION
-
- public default Bookmark asBookmark() {
- return Bookmark.forLogicalTypeNameAndIdentifier(getLogicalTypeName(), getIdentifier());
- }
-
-
-}
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/_OidMarshaller.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/_OidMarshaller.java
deleted file mode 100644
index 2a50c6e..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/_OidMarshaller.java
+++ /dev/null
@@ -1,193 +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.metamodel.adapter.oid;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.stream.Stream;
-
-import org.apache.isis.commons.internal.base._Casts;
-import org.apache.isis.commons.internal.base._Strings;
-import org.apache.isis.commons.internal.collections._Lists;
-import org.apache.isis.commons.internal.exceptions._Exceptions;
-
-import static org.apache.isis.commons.internal.base._Strings.splitThenStream;
-
-import lombok.NonNull;
-
-/**
- * Factory for subtypes of {@link Oid}, based on their oid str.
- *
- * <p>
- * Examples
- * <dl>
- * <dt>CUS:123</dt>
- * <dd>persistent root</dd>
- * <dt>!CUS:123</dt>
- * <dd>transient root</dd>
- * <dt>*CUS:123</dt>
- * <dd>view model root</dd>
- * <dt>CUS:123$items</dt>
- * <dd>collection of persistent root</dd>
- * <dt>!CUS:123$items</dt>
- * <dd>collection of transient root</dd>
- * <dt>CUS:123~NME:2</dt>
- * <dd>aggregated object within persistent root</dd>
- * <dt>!CUS:123~NME:2</dt>
- * <dd>aggregated object within transient root</dd>
- * <dt>CUS:123~NME:2~CTY:LON</dt>
- * <dd>aggregated object within aggregated object within root</dd>
- * <dt>CUS:123~NME:2$items</dt>
- * <dd>collection of an aggregated object within root</dd>
- * <dt>CUS:123~NME:2~CTY:LON$streets</dt>
- * <dd>collection of an aggregated object within aggregated object within root</dd>
- * </dl>
- *
- * <p>
- * Separators:
- * <dl>
- * <dt>!</dt>
- * <dd>precedes root object type, indicates transient</dd>
- * <dt>*</dt>
- * <dd>precedes root object type, indicates transient</dd>
- * <dt>:</dt>
- * <dd>precedes root object identifier</dd>
- * <dt>~</dt>
- * <dd>precedes aggregate oid</dd>
- * <dt>$</dt>
- * <dd>precedes collection name</dd>
- * <dt>^</dt>
- * <dd>precedes version</dd>
- * </dl>
- *
- * <p>
- * Note that # and ; were not chosen as separators to minimize noise when URL encoding OIDs.
- */
-final class _OidMarshaller {
-
- @Deprecated
- private static final String VIEWMODEL_INDICATOR = "*";
- @Deprecated
- private static final String TRANSIENT_INDICATOR = "!";
-
- private static final String SEPARATOR = ":";
- private static final String SEPARATOR_NESTING = "~";
- private static final String SEPARATOR_PARENTED = "$";
- private static final String SEPARATOR_VERSION = "^"; // legacy
-
- private static final String WORD = "[^" + SEPARATOR + SEPARATOR_NESTING + SEPARATOR_PARENTED + "\\" + SEPARATOR_VERSION + "#" + "]+";
-
- private static final String WORD_GROUP = "(" + WORD + ")";
-
- private static Pattern OIDSTR_PATTERN =
- Pattern.compile(
- "^(" +
- "(" +
- "([" + TRANSIENT_INDICATOR + VIEWMODEL_INDICATOR + "])?" +
- WORD_GROUP + SEPARATOR + WORD_GROUP +
- ")" +
- "(" +
- "(" + SEPARATOR_NESTING + WORD + SEPARATOR + WORD + ")*+" + // nesting of aggregates
- ")" +
- ")" +
- "(" + "[" + SEPARATOR_PARENTED + "]" + WORD + ")?" + // optional collection name
- "([\\" + SEPARATOR_VERSION + "].*)?" + // to be compatible with previous patterns, that optionally included version information
- "$");
-
- // -- MARSHAL / STRINGIFY
-
- static final String marshal(final @NonNull Oid oid) {
- return oid.getLogicalTypeName() + SEPARATOR + oid.getIdentifier();
- }
-
- // -- UNMARSHAL / PARSE
-
- static <T extends Oid> T unmarshal(String oidStr) {
-
- final Matcher matcher = OIDSTR_PATTERN.matcher(oidStr);
- if (!matcher.matches()) {
- throw _Exceptions.illegalArgument("Could not parse OID '" + oidStr + "'; should match pattern: " + OIDSTR_PATTERN.pattern());
- }
-
- //final String isTransientOrViewModelStr = getGroup(matcher, 3); // deprecated
-
- final String rootObjectType = getGroup(matcher, 4);
- if(_Strings.isEmpty(rootObjectType)) {
- throw _Exceptions.illegalArgument("cannot parse OID, must have an 'ObjectType'");
- }
-
- final String rootIdentifier = getGroup(matcher, 5);
-
- final String aggregateOidPart = getGroup(matcher, 6);
- final List<AggregateOidPart> aggregateOidParts = _Lists.newArrayList();
-
- if(aggregateOidPart != null) {
- final Stream<String> tildaSplitted = splitThenStream(aggregateOidPart, SEPARATOR_NESTING);
-
- tildaSplitted.forEach(str->{
- if(_Strings.isNullOrEmpty(str)) {
- return; // leading "~"
- }
- final Iterator<String> colonSplitIter = splitThenStream(str, SEPARATOR).iterator();
- final String objectType = colonSplitIter.next();
- final String localId = colonSplitIter.next();
- aggregateOidParts.add(new AggregateOidPart(objectType, localId));
- });
-
- }
- final String collectionPart = getGroup(matcher, 8);
- final String oneToManyId = collectionPart != null ? collectionPart.substring(1) : null;
-
- if(oneToManyId == null) {
- if(aggregateOidParts.isEmpty()) {
- return _Casts.uncheckedCast(
- _SimpleOid.of(rootObjectType, rootIdentifier));
- } else {
- throw _Exceptions.illegalArgument("Aggregated OIDs are no longer supported");
- }
- } else {
- throw _Exceptions.illegalArgument("Parented OIDs are no longer supported.");
- }
- }
-
- private static class AggregateOidPart {
- AggregateOidPart(String objectType, String localId) {
- this.objectType = objectType;
- this.localId = localId;
- }
- String objectType;
- String localId;
- @Override
- public String toString() {
- return SEPARATOR_NESTING + objectType + SEPARATOR + localId;
- }
- }
-
- private static String getGroup(final Matcher matcher, final int group) {
- final int groupCount = matcher.groupCount();
- if(group > groupCount) {
- return null;
- }
- final String val = matcher.group(group);
- return _Strings.emptyToNull(val);
- }
-
-}
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/_SimpleOid.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/_SimpleOid.java
deleted file mode 100644
index df730ad..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/oid/_SimpleOid.java
+++ /dev/null
@@ -1,89 +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.metamodel.adapter.oid;
-
-import java.util.Objects;
-
-import lombok.Getter;
-import lombok.NonNull;
-
-final class _SimpleOid implements Oid {
-
- private static final long serialVersionUID = 3L;
-
- @Getter(onMethod_ = {@Override}) private final String logicalTypeName;
- @Getter(onMethod_ = {@Override}) private final String identifier;
-
- private final int hashCode;
-
- static _SimpleOid of(
- final @NonNull String logicalTypeName,
- final @NonNull String identifier) {
- return new _SimpleOid(logicalTypeName, identifier);
- }
-
- private _SimpleOid(
- final String logicalTypeName,
- final String identifier) {
-
- this.logicalTypeName = logicalTypeName;
- this.identifier = identifier;
- this.hashCode = calculateHash();
-
- }
-
- // -- OBJECT CONTRACT
-
- @Override
- public boolean equals(final Object other) {
- if (other == null) {
- return false;
- }
- if (other == this) {
- return true;
- }
- if (getClass() != other.getClass()) {
- return false;
- }
- return equals((_SimpleOid) other);
- }
-
- public boolean equals(final _SimpleOid other) {
- return Objects.equals(logicalTypeName, other.getLogicalTypeName())
- && Objects.equals(identifier, other.getIdentifier());
- }
-
- @Override
- public int hashCode() {
- return hashCode;
- }
-
- @Override
- public String toString() {
- return stringify();
- }
-
- // -- HELPER
-
- private int calculateHash() {
- return Objects.hash(logicalTypeName, identifier);
- }
-
-}
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/OidMarshallerTest_marshall.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/OidMarshallerTest_marshall.java
deleted file mode 100644
index f01b64e..0000000
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/OidMarshallerTest_marshall.java
+++ /dev/null
@@ -1,41 +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.metamodel.adapter.oid;
-
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-public class OidMarshallerTest_marshall {
-
- @Test
- public void oid() {
- final String marshal = _OidMarshaller.marshal(Oid.of(LogicalTypeTestFactory.cus(), "123"));
- assertThat(marshal, equalTo("CUS:123"));
- }
-
-//deprecated
-// @Test
-// public void oid_transient() {
-// final String marshal = oidMarshaller.marshal(Oid.Factory.transientOf(ObjectSpecId.of("CUS"), "123"));
-// assertThat(marshal, equalTo("!CUS:123"));
-// }
-
-}
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/OidMarshallerTest_roundtripping.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/OidMarshallerTest_roundtripping.java
deleted file mode 100644
index 844d99a..0000000
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/OidMarshallerTest_roundtripping.java
+++ /dev/null
@@ -1,49 +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.metamodel.adapter.oid;
-
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-import lombok.val;
-
-public class OidMarshallerTest_roundtripping {
-
- @Test
- public void oid() {
- val oid = Oid.of(LogicalTypeTestFactory.cus(), "123");
-
- final String enString = oid.stringify();
- final Oid deString = Oid.parse(enString);
- assertThat(deString, is(oid));
- }
-
- @Test
- public void oid_withLegacyVersionIgnored() {
- val oid = Oid.of(LogicalTypeTestFactory.cus(), "123");
-
- final String enString = oid.stringify();
- final Oid deString = Oid.parse(enString + "^" + 90807L);
- assertThat(deString, is(oid));
- }
-
-}
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/OidMarshallerTest_unmarshal.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/OidMarshallerTest_unmarshal.java
deleted file mode 100644
index dd8ea7d..0000000
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/OidMarshallerTest_unmarshal.java
+++ /dev/null
@@ -1,109 +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.metamodel.adapter.oid;
-
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-/**
- * <dt>CUS:123</dt>
- * <dd>persistent root</dd>
- * <dt>!CUS:123</dt>
- * <dd>transient root</dd>
- * <dt>CUS:123$items</dt>
- * <dd>collection of persistent root</dd>
- * <dt>!CUS:123$items</dt>
- * <dd>collection of transient root</dd>
- * <dt>CUS:123~NME:2</dt>
- * <dd>aggregated object within persistent root</dd>
- * <dt>!CUS:123~NME:2</dt>
- * <dd>aggregated object within transient root</dd>
- * <dt>CUS:123~NME:2~CTY:LON</dt>
- * <dd>aggregated object within aggregated object within root</dd>
- * <dt>CUS:123~NME:2$items</dt>
- * <dd>collection of an aggregated object within root</dd>
- * <dt>CUS:123~NME:2~CTY:LON$streets</dt>
- * <dd>collection of an aggregated object within aggregated object within root</dd>
- * <dt>CUS:123^90809::</dt>
- * <dd>persistent root with version info (sequence, no user or utc)</dd>
- * <dt>CUS:123^90809:joebloggs:</dt>
- * <dd>persistent root with version info (sequence, user but no utc)</dd>
- * <dt>CUS:123^90809:joebloggs:1231334545123</dt>
- * <dd>persistent root with version info (sequence, user, utc)</dd>
- * <dt>CUS:123^90809::1231334545123</dt>
- * <dd>persistent root with version info (sequence, utc but no user)</dd>
- */
-public class OidMarshallerTest_unmarshal {
-
- @Test
- public void persistentRoot() {
- final String oidStr = "CUS:123";
-
- final Oid oid = _OidMarshaller.unmarshal(oidStr);
- assertThat(oid.getLogicalTypeName(), is("CUS"));
- assertThat(oid.getIdentifier(), is("123"));
-
- final Oid oid2 = _OidMarshaller.unmarshal(oidStr);
- assertThat(oid, equalTo(oid2));
- }
-
- @Test
- public void persistentRootWithFullyQualifiedSpecId() {
- final String oidStr = "com.planchase.ClassName:8";
-
- final Oid oid = _OidMarshaller.unmarshal(oidStr);
- assertThat(oid.getLogicalTypeName(), is("com.planchase.ClassName"));
- assertThat(oid.getIdentifier(), is("8"));
-
- final Oid oid2 = _OidMarshaller.unmarshal(oidStr);
- assertThat(oid, equalTo(oid2));
- }
-
-// we simply ignore this since 2.0.0
-// @Test(expected=IllegalArgumentException.class)
-// public void persistentRootWithNonNumericVersion() {
-// final String oidStr = "CUS:123^d0809";
-//
-// oidMarshaller.unmarshal(oidStr, RootOid.class);
-// }
-
-
- @Test
- public void transientRoot() {
- final String oidStr = "!CUS:123";
-
- final Oid oid = _OidMarshaller.unmarshal(oidStr);
- assertThat(oid.getLogicalTypeName(), is("CUS"));
- assertThat(oid.getIdentifier(), is("123"));
-
- final Oid oid2 = _OidMarshaller.unmarshal(oidStr);
- assertThat(oid, equalTo(oid2));
- }
-
-
- @Test(expected=IllegalArgumentException.class)
- public void badPattern() {
- _OidMarshaller.unmarshal("xxx");
- }
-
-
-}
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/OidVersionTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/OidVersionTest.java
deleted file mode 100644
index 0a12db6..0000000
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/OidVersionTest.java
+++ /dev/null
@@ -1,62 +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.metamodel.adapter.oid;
-
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-import org.apache.isis.applib.id.LogicalType;
-
-public class OidVersionTest {
-
- private LogicalType cus = LogicalTypeTestFactory.cus();
- private LogicalType ord = LogicalTypeTestFactory.ord();
-
- private Oid oid1, oid2;
-
- @Test
- public void whenEquivalent() throws Exception {
- oid1 = Oid.of(cus, "123");
- oid2 = Oid.of(cus, "123");
-
- assertThat(oid1, is(equalTo(oid2)));
- }
-
- @Test
- public void whenNotEquivalentById() throws Exception {
- oid1 = Oid.of(cus, "123");
- oid2 = Oid.of(cus, "124");
-
- assertThat(oid1, is(not(equalTo(oid2))));
- }
-
- @Test
- public void whenNotEquivalentByObjectSpecId() throws Exception {
- oid1 = Oid.of(cus, "123");
- oid2 = Oid.of(ord, "123");
-
- assertThat(oid1, is(not(equalTo(oid2))));
- }
-
-
-}
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/RootOidDefaultTest_valueSemantics_whenPersistent.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/RootOidDefaultTest_valueSemantics_whenPersistent.java
deleted file mode 100644
index effcfb4..0000000
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/RootOidDefaultTest_valueSemantics_whenPersistent.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.metamodel.adapter.oid;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.isis.core.internaltestsupport.contract.ValueTypeContractTestAbstract;
-
-public class RootOidDefaultTest_valueSemantics_whenPersistent
-extends ValueTypeContractTestAbstract<Oid> {
-
- @Override
- protected List<Oid> getObjectsWithSameValue() {
- return Arrays.asList(
- Oid.of(LogicalTypeTestFactory.cus(), "123"),
- Oid.of(LogicalTypeTestFactory.cus(), "123"),
- Oid.of(LogicalTypeTestFactory.cus(), "123"));
- }
-
- @Override
- protected List<Oid> getObjectsWithDifferentValue() {
- return Arrays.asList(
- //Oid.Factory.of(ObjectSpecId.of("CUS"), "123"),
- Oid.of(LogicalTypeTestFactory.cus(), "124"),
- Oid.of(LogicalTypeTestFactory.cux(), "123"));
- }
-
-}
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/RootOidTest_create.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/RootOidTest_create.java
deleted file mode 100644
index 4b515ef..0000000
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/RootOidTest_create.java
+++ /dev/null
@@ -1,38 +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.metamodel.adapter.oid;
-
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-import lombok.val;
-
-public class RootOidTest_create {
-
- @Test
- public void create() throws Exception {
- val logicalType = LogicalTypeTestFactory.cus();
- Oid oid = Oid.of(logicalType, "123");
- assertThat(oid.getLogicalTypeName(), is(logicalType.getLogicalTypeName()));
- assertThat(oid.getIdentifier(), is("123"));
- }
-
-}
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/SpecificationCacheDefaultTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/SpecificationCacheDefaultTest.java
index 96d2850..c5aedef 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/SpecificationCacheDefaultTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/SpecificationCacheDefaultTest.java
@@ -33,15 +33,14 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
import org.apache.isis.applib.id.LogicalType;
import org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery2;
import org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery2.Mode;
-import org.apache.isis.core.metamodel.adapter.oid.LogicalTypeTestFactory;
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
import lombok.val;
public class SpecificationCacheDefaultTest {
- private LogicalType cus = LogicalTypeTestFactory.cus();
- private LogicalType ord = LogicalTypeTestFactory.ord();
+ private LogicalType cus = _LogicalTypeTestFactory.cus();
+ private LogicalType ord = _LogicalTypeTestFactory.ord();
@Rule
public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_ONLY);
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/LogicalTypeTestFactory.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/_LogicalTypeTestFactory.java
similarity index 93%
rename from core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/LogicalTypeTestFactory.java
rename to core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/_LogicalTypeTestFactory.java
index cac40e7..bfe250c 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/oid/LogicalTypeTestFactory.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/_LogicalTypeTestFactory.java
@@ -16,11 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.isis.core.metamodel.adapter.oid;
+package org.apache.isis.core.metamodel.specloader;
import org.apache.isis.applib.id.LogicalType;
-public class LogicalTypeTestFactory {
+final class _LogicalTypeTestFactory {
public static LogicalType cus() {
return LogicalType.lazy(Customer.class, ()->"CUS");
diff --git a/viewers/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/mementos/PageParameterNames.java b/viewers/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/mementos/PageParameterNames.java
index 40dce8e..0582eec 100644
--- a/viewers/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/mementos/PageParameterNames.java
+++ b/viewers/wicket/model/src/main/java/org/apache/isis/viewer/wicket/model/mementos/PageParameterNames.java
@@ -24,14 +24,14 @@ import java.util.List;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.util.string.StringValue;
+import org.apache.isis.applib.services.bookmark.Bookmark;
import org.apache.isis.commons.internal.collections._Lists;
-import org.apache.isis.core.metamodel.adapter.oid.Oid;
import org.apache.isis.core.metamodel.commons.StringExtensions;
public enum PageParameterNames {
/**
- * The object's {@link Oid}.
+ * The object's {@link Bookmark}.
*
* <p>
* Also encodes the object's spec, and whether the object is persistent or not.
@@ -47,7 +47,7 @@ public enum PageParameterNames {
* Owning type of an action.
*
* <p>
- * Whereas {@link #OBJECT_SPEC} is the concrete runtime type of the adapter,
+ * Whereas {@link #OBJECT_OID} is the concrete runtime type of the adapter,
* the owning type could be some superclass if the action has been
* inherited.
*/