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/09 17:06:31 UTC
[isis] branch dev/2.0.0/ISIS-1742-remove-deprecations updated:
ISIS-1742: deletes @NotInServiceMenu annotation + facets + factory. Updates
.adoc
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch dev/2.0.0/ISIS-1742-remove-deprecations
in repository https://gitbox.apache.org/repos/asf/isis.git
The following commit(s) were added to refs/heads/dev/2.0.0/ISIS-1742-remove-deprecations by this push:
new 9f5ab37 ISIS-1742: deletes @NotInServiceMenu annotation + facets + factory. Updates .adoc
9f5ab37 is described below
commit 9f5ab376ebcdc83666b743a54e28235c8823d437
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Mon Oct 9 18:06:25 2017 +0100
ISIS-1742: deletes @NotInServiceMenu annotation + facets + factory. Updates .adoc
---
.../guides/rgant/_rgant_aaa_deprecated.adoc | 7 ---
.../isis/applib/annotation/NotInServiceMenu.java | 46 --------------
.../NotInServiceMenuFacetAnnotation.java | 42 -------------
.../NotInServiceMenuFacetAnnotationFactory.java | 72 ----------------------
.../dflt/ProgrammingModelFacetsJava5.java | 3 -
...NotInServiceMenuAnnotationFacetFactoryTest.java | 65 -------------------
todo-deprecation-list.txt | 9 ++-
7 files changed, 6 insertions(+), 238 deletions(-)
diff --git a/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant_aaa_deprecated.adoc b/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant_aaa_deprecated.adoc
index 192e221..23c7c52 100644
--- a/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant_aaa_deprecated.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/rgant/_rgant_aaa_deprecated.adoc
@@ -23,13 +23,6 @@ The annotations listed in the table below are still supported by Apache Isis, bu
|xref:../ugvw/ugvw.adoc#_ugvw_layout_file-based[File-based layout]?
-
-|`@NotInServiceMenu`
-|Indicates that a domain service should not be rendered in the application menu (at top of page in Wicket viewer).
-|xref:../rgant/rgant.adoc#_rgant-DomainService_nature[`@DomainService#nature()`] to signify that none of the actions in a domain service should appear in the menu bars
-|UI
-|
-
|`@NotPersisted`
|Indicates that an object property is not persisted (meaning it is excluded from view model mementos, and should not be audited).
|`#notPersisted()` attribute of xref:../rgant/rgant.adoc#_rgant-Property_notPersisted[`@Property`] and xref:../rgant/rgant.adoc#_rgant-Collection_notPersisted[`@Collection`]
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/NotInServiceMenu.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/NotInServiceMenu.java
deleted file mode 100644
index f06c93b..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/NotInServiceMenu.java
+++ /dev/null
@@ -1,46 +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.applib.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Indicates the (service) action should be not be displayed in the menu.
- *
- * <p>
- * It may still be contributed (unless it has been annotated as
- * {@link NotContributed}). If {@link Hidden}, then also implies that the menu
- * should not appear in the service menu.
- *
- * <p>
- * Has no meaning if annotated on an action of a regular entity.
- *
- * @deprecated - instead move such actions into a separate domain service and specify nature of {@link org.apache.isis.applib.annotation.NatureOfService#VIEW_CONTRIBUTIONS_ONLY contributions} or {@link org.apache.isis.applib.annotation.NatureOfService#DOMAIN domain} using {@link DomainService#nature()}.
- */
-@Deprecated
-@Inherited
-@Target({ ElementType.METHOD })
-@Retention(RetentionPolicy.RUNTIME)
-public @interface NotInServiceMenu {
-}
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/notinservicemenu/annotation/NotInServiceMenuFacetAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/notinservicemenu/annotation/NotInServiceMenuFacetAnnotation.java
deleted file mode 100644
index b75f907..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/notinservicemenu/annotation/NotInServiceMenuFacetAnnotation.java
+++ /dev/null
@@ -1,42 +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.facets.actions.notinservicemenu.annotation;
-
-import org.apache.isis.applib.events.VisibilityEvent;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.interactions.VisibilityContext;
-import org.apache.isis.core.metamodel.facets.actions.notinservicemenu.NotInServiceMenuFacetAbstract;
-
-/**
- * @deprecated
- */
-@Deprecated
-public class NotInServiceMenuFacetAnnotation extends NotInServiceMenuFacetAbstract {
-
- public NotInServiceMenuFacetAnnotation(final FacetHolder holder) {
- super(holder);
- }
-
- @Override
- public String hides(final VisibilityContext<? extends VisibilityEvent> ic) {
- return "@NotInServiceMenu annotation present";
- }
-
-}
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/notinservicemenu/annotation/NotInServiceMenuFacetAnnotationFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/notinservicemenu/annotation/NotInServiceMenuFacetAnnotationFactory.java
deleted file mode 100644
index 4f9fcff..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/notinservicemenu/annotation/NotInServiceMenuFacetAnnotationFactory.java
+++ /dev/null
@@ -1,72 +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.facets.actions.notinservicemenu.annotation;
-
-import org.apache.isis.applib.annotation.NotInServiceMenu;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facetapi.FacetUtil;
-import org.apache.isis.core.metamodel.facetapi.FeatureType;
-import org.apache.isis.core.metamodel.facetapi.MetaModelValidatorRefiner;
-import org.apache.isis.core.metamodel.facets.Annotations;
-import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
-import org.apache.isis.core.metamodel.facets.actions.notinservicemenu.NotInServiceMenuFacet;
-import org.apache.isis.core.metamodel.progmodel.DeprecatedMarker;
-import org.apache.isis.core.metamodel.services.ServicesInjector;
-import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidatorComposite;
-import org.apache.isis.core.metamodel.specloader.validator.MetaModelValidatorForDeprecatedAnnotation;
-
-/**
- * @deprecated
- */
-@Deprecated
-public class NotInServiceMenuFacetAnnotationFactory extends FacetFactoryAbstract implements MetaModelValidatorRefiner, DeprecatedMarker {
-
- private final MetaModelValidatorForDeprecatedAnnotation validator = new MetaModelValidatorForDeprecatedAnnotation(NotInServiceMenu.class);
-
- public NotInServiceMenuFacetAnnotationFactory() {
- super(FeatureType.ACTIONS_ONLY);
- }
-
- @Override
- public void process(final ProcessMethodContext processMethodContext) {
- final NotInServiceMenu annotation = Annotations.getAnnotation(processMethodContext.getMethod(), NotInServiceMenu.class);
- final NotInServiceMenuFacet facet = create(annotation, processMethodContext.getFacetHolder());
- FacetUtil.addFacet(validator.flagIfPresent(facet, processMethodContext));
- }
-
- private NotInServiceMenuFacet create(final NotInServiceMenu annotation, final FacetHolder holder) {
- return annotation == null ? null : new NotInServiceMenuFacetAnnotation(holder);
- }
-
- @Override
- public void refineMetaModelValidator(final MetaModelValidatorComposite metaModelValidator, final IsisConfiguration configuration) {
- metaModelValidator.add(validator);
- }
-
- @Override
- public void setServicesInjector(final ServicesInjector servicesInjector) {
- super.setServicesInjector(servicesInjector);
- IsisConfiguration configuration = servicesInjector.getConfigurationServiceInternal();
- validator.setConfiguration(configuration);
- }
-
-
-}
diff --git a/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java b/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java
index f46a478..840ffd3 100644
--- a/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java
+++ b/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java
@@ -25,7 +25,6 @@ import org.apache.isis.core.metamodel.facets.actions.homepage.annotation.HomePag
import org.apache.isis.core.metamodel.facets.actions.layout.ActionLayoutFacetFactory;
import org.apache.isis.core.metamodel.facets.actions.notcontributed.derived.NotContributedFacetDerivedFromDomainServiceFacetFactory;
import org.apache.isis.core.metamodel.facets.actions.notcontributed.derived.NotContributedFacetDerivedFromMixinFacetFactory;
-import org.apache.isis.core.metamodel.facets.actions.notinservicemenu.annotation.NotInServiceMenuFacetAnnotationFactory;
import org.apache.isis.core.metamodel.facets.actions.notinservicemenu.derived.NotInServiceMenuFacetDerivedFromDomainServiceFacetFactory;
import org.apache.isis.core.metamodel.facets.actions.notinservicemenu.method.NotInServiceMenuFacetViaMethodFactory;
import org.apache.isis.core.metamodel.facets.actions.validate.method.ActionValidationFacetViaMethodFactory;
@@ -290,8 +289,6 @@ public final class ProgrammingModelFacetsJava5 extends ProgrammingModelAbstract
addFactory(new EncodableFacetAnnotationElseConfigurationFactory());
- addFactory(new NotInServiceMenuFacetAnnotationFactory());
-
addFactory(new NotInServiceMenuFacetViaMethodFactory());
addFactory(new NotContributedFacetDerivedFromDomainServiceFacetFactory());
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/actions/notinservicemenu/annotation/NotInServiceMenuAnnotationFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/actions/notinservicemenu/annotation/NotInServiceMenuAnnotationFacetFactoryTest.java
deleted file mode 100644
index 0554ac5..0000000
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/actions/notinservicemenu/annotation/NotInServiceMenuAnnotationFacetFactoryTest.java
+++ /dev/null
@@ -1,65 +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.facets.actions.notinservicemenu.annotation;
-
-import java.lang.reflect.Method;
-import org.apache.isis.applib.annotation.NotInServiceMenu;
-import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.metamodel.facets.FacetFactory.ProcessMethodContext;
-import org.apache.isis.core.metamodel.facets.actions.notinservicemenu.NotInServiceMenuFacet;
-import org.apache.isis.core.metamodel.facets.actions.notinservicemenu.NotInServiceMenuFacetAbstract;
-
-public class NotInServiceMenuAnnotationFacetFactoryTest extends AbstractFacetFactoryTest {
-
- private NotInServiceMenuFacetAnnotationFactory facetFactory;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- facetFactory = new NotInServiceMenuFacetAnnotationFactory();
- }
-
- @Override
- protected void tearDown() throws Exception {
- facetFactory = null;
- super.tearDown();
- }
-
- public void testAnnotationPickedUp() {
- class CustomerRepository {
- @SuppressWarnings("unused")
- @NotInServiceMenu
- public void someAction() {
- }
- }
- final Method actionMethod = findMethod(CustomerRepository.class, "someAction");
-
- facetFactory.process(new ProcessMethodContext(CustomerRepository.class, null, actionMethod, methodRemover, facetedMethod));
-
- final Facet facet = facetedMethod.getFacet(NotInServiceMenuFacet.class);
- assertNotNull(facet);
- assertTrue(facet instanceof NotInServiceMenuFacetAbstract);
-
- assertNoMethodsRemoved();
- }
-
-}
diff --git a/todo-deprecation-list.txt b/todo-deprecation-list.txt
index 1c5607f..d978917 100644
--- a/todo-deprecation-list.txt
+++ b/todo-deprecation-list.txt
@@ -17,9 +17,6 @@ org.apache.isis.applib.annotation
RegEx.java - entire annotation, use @Property(regexPatternFlags=...) or @Parameter(regexPatternFlags=...) instead; or alternatively NEW SUPPORT for JSR-303 @Pattern annotation (http://beanvalidation.org/1.0/spec/, chapter 6).
- NotContributed.java - entire annotation, use @DomainService(nature=...) or mixins instead.
- NotInServiceMenu.java - entire annotation, use @DomainService(nature=...) or mixins instead.
-
NotPersisted.java - entire annotation, use @Property(notPersisted=...) instead
ObjectType.java - entire annotation, use @DomainObject(objectType=...) or @javax.jdo.annotations.Discriminator instead.
@@ -148,6 +145,9 @@ Also propose:
remove support for contributed services (use mixins instead)
+ remove support for "notInServiceMenu" prefix
+
+
Also for 2.0.0, new features/deprecations:
automatically wrap domain services (perhaps behind a config property)
automatically infer \@Programmatic for all \@DomainService(nature=DOMAIN)
@@ -377,6 +377,9 @@ org.apache.isis.applib.annotation
TypeOf.java - entire annotation, use @Collection(typeOf=...) or @Action(typeOf=...) instead.
+ NotInServiceMenu.java - entire annotation, use @DomainService(nature=...) or mixins instead.
+
+ NotContributed.java - entire annotation, use @DomainService(nature=...) or mixins instead.
NotPersistable.java - entire annotation, not supported and does nothing
--
To stop receiving notification emails like this one, please contact
['"commits@isis.apache.org" <co...@isis.apache.org>'].