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 2020/08/15 09:30:48 UTC
[isis] branch ISIS-2222 updated (c04d7af -> acaa9dc)
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a change to branch ISIS-2222
in repository https://gitbox.apache.org/repos/asf/isis.git.
discard c04d7af ISIS-2222: wip @Action#hidden
add b3bb21f ISIS-2340: fx: refactor binding converter for reuse
add 4091b7b ISIS-2340: remove ObjectBinding
add 91600f2 ISIS-2340: move BindingConverter to UI Commons
add 518e66a ISIS-2340: fx: naive double type ui binding
add 897c6b8 ISIS-2340: Common UI: DoubleOrFloatConverter for text-based UI Component
add 1bb8b68 ISIS-2340: use one binding converter for all the java numbers
add 684837a ISIS-2340: fx: naive LocalDate support
add 1800957 ISIS-2340: fx: prepare for temporal value format
new b3dea47 ISIS-2222: wip @Action#hidden
new acaa9dc ISIS-2222: wip Property#command
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (c04d7af)
\
N -- N -- N refs/heads/ISIS-2222 (acaa9dc)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../core/metamodel/IsisModuleCoreMetamodel.java | 6 +-
.../facets/schema/InteractionDtoValueFacet.java | 12 +-
...DtoValueFacetUsingSemanticsProviderFactory.java | 41 +++++
.../InteractionDtoValueSemanticsProvider.java | 107 +++++++++++
.../facets/schema/IsisSchemaMetaModelRefiner.java | 20 +-
.../facets/schema/IsisSchemaValueTypeProvider.java | 24 ++-
.../isis/core/metamodel/spec/ManagedObjects.java | 2 +-
.../dom/annotDomain/Property/PropertyMenu.java | 10 +
.../dom/annotDomain/Property/publishing/.gitkeep | 0
.../PropertyPublishingJdo-description.adoc | 74 ++++++++
.../Property/publishing/PropertyPublishingJdo.java | 111 +++++++++++
.../publishing/PropertyPublishingJdo.layout.xml | 57 ++++++
.../publishing/PropertyPublishingJdoEntities.java | 31 ++++
.../PropertyPublishingJdoSeedService.java | 39 ++++
.../PublishingDisabledMetaAnnotation.java | 22 +++
.../PublishingEnabledMetaAnnotation.java | 23 +++
...ropertyPublishingJdo_interactionExecutions.java | 30 +++
.../PropertyPublishingJdo_publishedObjects.java | 32 ++++
.../spiimpl/PublisherServiceSpiForProperties.java | 49 +++++
.../src/main/java/demoapp/dom/menubars.layout.xml | 3 +-
.../strings/jdo/JavaLangStringJdoEntities.java | 3 +-
.../viewer/javafx/model/binding/BindingsFx.java} | 135 ++++----------
.../javafx/ui/IsisModuleIncViewerJavaFxUi.java | 4 +
.../javafx/ui/components/UiComponentFactoryFx.java | 2 +-
.../javafx/ui/components/UiComponentHandlerFx.java | 23 ++-
.../ui/components/markup/MarkupFieldFactory.java | 2 +-
.../NumberFieldFactory.java} | 60 +++---
.../javafx/ui/components/object/ObjectViewFx.java | 21 +--
.../objectref/ObjectReferenceFieldFactory.java | 2 +-
.../ui/components/other/FallbackFieldFactory.java | 2 +-
.../TemporalFieldFactory.java} | 65 ++++---
.../ui/components/text/TextFieldFactory.java | 203 ++-------------------
.../viewer/javafx/ui/main/UiActionHandler.java | 2 +-
.../viewer/vaadin/ui/binding/BinderUtil.java | 2 +-
.../ui/components/UiComponentFactoryVaa.java | 2 +-
.../ui/components/UiComponentHandlerVaa.java | 2 +-
.../ui/components/blob/BlobFieldFactory.java | 2 +-
.../ui/components/clob/ClobFieldFactory.java | 2 +-
.../ui/components/markup/MarkupFieldFactory.java | 2 +-
.../vaadin/ui/components/object/ObjectViewVaa.java | 14 +-
.../ui/components/other/FallbackFieldFactory.java | 2 +-
.../components/temporal/TemporalFieldFactory.java | 2 +-
.../ui/components/text/TextFieldFactory.java | 2 +-
.../ui/components/text/uuid/UuidFieldFactory.java | 2 +-
.../ui/vaa/components/AsciiDocFieldFactoryVaa.java | 2 +-
.../common/model/binding/BindingConverter.java | 67 +++++++
.../binding/NumberConverterForStringComponent.java | 90 +++++++++
.../TemporalConverterForLocalDateComponent.java | 85 +++++++++
.../model/binding/interaction/ObjectBinding.java | 81 --------
.../UiComponentFactory.java | 12 +-
50 files changed, 1108 insertions(+), 480 deletions(-)
copy incubator/viewers/javafx/ui/src/main/java/org/apache/isis/incubator/viewer/javafx/ui/components/UiComponentHandlerFx.java => core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/schema/InteractionDtoValueFacet.java (70%)
create mode 100644 core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/schema/InteractionDtoValueFacetUsingSemanticsProviderFactory.java
create mode 100644 core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/schema/InteractionDtoValueSemanticsProvider.java
copy incubator/viewers/javafx/ui/src/main/java/org/apache/isis/incubator/viewer/javafx/ui/components/UiComponentHandlerFx.java => core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/schema/IsisSchemaMetaModelRefiner.java (55%)
copy incubator/viewers/javafx/ui/src/main/java/org/apache/isis/incubator/viewer/javafx/ui/components/UiComponentHandlerFx.java => core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/schema/IsisSchemaValueTypeProvider.java (50%)
delete mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/.gitkeep
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PropertyPublishingJdo-description.adoc
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PropertyPublishingJdo.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PropertyPublishingJdo.layout.xml
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PropertyPublishingJdoEntities.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PropertyPublishingJdoSeedService.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PublishingDisabledMetaAnnotation.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PublishingEnabledMetaAnnotation.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/spiimpl/PropertyPublishingJdo_interactionExecutions.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/spiimpl/PropertyPublishingJdo_publishedObjects.java
create mode 100644 examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/spiimpl/PublisherServiceSpiForProperties.java
copy incubator/viewers/javafx/{ui/src/main/java/org/apache/isis/incubator/viewer/javafx/ui/components/text/TextFieldFactory.java => model/src/main/java/org/apache/isis/incubator/viewer/javafx/model/binding/BindingsFx.java} (65%)
copy incubator/viewers/javafx/ui/src/main/java/org/apache/isis/incubator/viewer/javafx/ui/components/{objectref/ObjectReferenceFieldFactory.java => number/NumberFieldFactory.java} (60%)
copy incubator/viewers/javafx/ui/src/main/java/org/apache/isis/incubator/viewer/javafx/ui/components/{objectref/ObjectReferenceFieldFactory.java => temporal/TemporalFieldFactory.java} (58%)
create mode 100644 viewers/common/src/main/java/org/apache/isis/viewer/common/model/binding/BindingConverter.java
create mode 100644 viewers/common/src/main/java/org/apache/isis/viewer/common/model/binding/NumberConverterForStringComponent.java
create mode 100644 viewers/common/src/main/java/org/apache/isis/viewer/common/model/binding/TemporalConverterForLocalDateComponent.java
delete mode 100644 viewers/common/src/main/java/org/apache/isis/viewer/common/model/binding/interaction/ObjectBinding.java
rename viewers/common/src/main/java/org/apache/isis/viewer/common/model/{binding => components}/UiComponentFactory.java (92%)
[isis] 02/02: ISIS-2222: wip Property#command
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch ISIS-2222
in repository https://gitbox.apache.org/repos/asf/isis.git
commit acaa9dc14ce4a3e9fa43001196c6426581733633
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Sat Aug 15 10:30:21 2020 +0100
ISIS-2222: wip Property#command
---
.../core/metamodel/IsisModuleCoreMetamodel.java | 6 +-
.../facets/schema/InteractionDtoValueFacet.java | 30 ++++++
...DtoValueFacetUsingSemanticsProviderFactory.java | 41 ++++++++
.../InteractionDtoValueSemanticsProvider.java | 107 ++++++++++++++++++++
.../facets/schema/IsisSchemaMetaModelRefiner.java | 38 +++++++
.../facets/schema/IsisSchemaValueTypeProvider.java | 42 ++++++++
.../dom/annotDomain/Property/PropertyMenu.java | 10 ++
.../dom/annotDomain/Property/publishing/.gitkeep | 0
.../PropertyPublishingJdo-description.adoc | 74 ++++++++++++++
.../Property/publishing/PropertyPublishingJdo.java | 111 +++++++++++++++++++++
.../publishing/PropertyPublishingJdo.layout.xml | 57 +++++++++++
.../publishing/PropertyPublishingJdoEntities.java | 31 ++++++
.../PropertyPublishingJdoSeedService.java | 39 ++++++++
.../PublishingDisabledMetaAnnotation.java | 22 ++++
.../PublishingEnabledMetaAnnotation.java | 23 +++++
...ropertyPublishingJdo_interactionExecutions.java | 30 ++++++
.../PropertyPublishingJdo_publishedObjects.java | 32 ++++++
.../spiimpl/PublisherServiceSpiForProperties.java | 49 +++++++++
.../src/main/java/demoapp/dom/menubars.layout.xml | 3 +-
.../strings/jdo/JavaLangStringJdoEntities.java | 3 +-
20 files changed, 745 insertions(+), 3 deletions(-)
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/IsisModuleCoreMetamodel.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/IsisModuleCoreMetamodel.java
index 3b34bde..1e2b3af 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/IsisModuleCoreMetamodel.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/IsisModuleCoreMetamodel.java
@@ -24,6 +24,8 @@ import org.springframework.context.annotation.Import;
import org.apache.isis.applib.IsisModuleApplib;
import org.apache.isis.core.config.IsisModuleCoreConfig;
import org.apache.isis.core.metamodel.context.MetaModelContexts;
+import org.apache.isis.core.metamodel.facets.schema.IsisSchemaMetaModelRefiner;
+import org.apache.isis.core.metamodel.facets.schema.IsisSchemaValueTypeProvider;
import org.apache.isis.core.metamodel.inspect.IsisModuleCoreMetamodelInspection;
import org.apache.isis.core.metamodel.objectmanager.ObjectManagerDefault;
import org.apache.isis.core.metamodel.progmodel.ProgrammingModelInitFilterDefault;
@@ -99,7 +101,9 @@ import org.apache.isis.core.security.IsisModuleCoreSecurity;
// @Repository's
ApplicationFeatureRepositoryDefault.class,
-
+
+ IsisSchemaMetaModelRefiner.class,
+ IsisSchemaValueTypeProvider.class,
})
public class IsisModuleCoreMetamodel {
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/schema/InteractionDtoValueFacet.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/schema/InteractionDtoValueFacet.java
new file mode 100644
index 0000000..056a421
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/schema/InteractionDtoValueFacet.java
@@ -0,0 +1,30 @@
+/*
+ * 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.schema;
+
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.spec.ManagedObject;
+
+public interface InteractionDtoValueFacet extends Facet {
+
+ String interactionDtoValue(ManagedObject object);
+ ManagedObject createValue(ManagedObject object, String xml);
+
+}
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/schema/InteractionDtoValueFacetUsingSemanticsProviderFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/schema/InteractionDtoValueFacetUsingSemanticsProviderFactory.java
new file mode 100644
index 0000000..d7b76bf
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/schema/InteractionDtoValueFacetUsingSemanticsProviderFactory.java
@@ -0,0 +1,41 @@
+/*
+ * 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.schema;
+
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.object.value.vsp.ValueFacetUsingSemanticsProviderFactory;
+import org.apache.isis.schema.ixn.v2.InteractionDto;
+
+import lombok.val;
+
+public class InteractionDtoValueFacetUsingSemanticsProviderFactory extends ValueFacetUsingSemanticsProviderFactory<InteractionDto> {
+
+ @Override
+ public void process(final ProcessClassContext processClassContext) {
+ final Class<?> type = processClassContext.getCls();
+ final FacetHolder holder = processClassContext.getFacetHolder();
+
+ if (!(InteractionDto.class.isAssignableFrom(type))) {
+ return;
+ }
+ val provider = new InteractionDtoValueSemanticsProvider(holder);
+ addFacets(provider);
+ }
+}
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/schema/InteractionDtoValueSemanticsProvider.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/schema/InteractionDtoValueSemanticsProvider.java
new file mode 100644
index 0000000..aae5938
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/schema/InteractionDtoValueSemanticsProvider.java
@@ -0,0 +1,107 @@
+/*
+ * 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.schema;
+
+import org.apache.isis.applib.adapters.EncoderDecoder;
+import org.apache.isis.applib.adapters.Parser;
+import org.apache.isis.applib.util.schema.InteractionDtoUtils;
+import org.apache.isis.core.metamodel.facetapi.Facet;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.object.value.vsp.ValueSemanticsProviderAndFacetAbstract;
+import org.apache.isis.core.metamodel.spec.ManagedObject;
+import org.apache.isis.schema.ixn.v2.InteractionDto;
+
+public class InteractionDtoValueSemanticsProvider
+extends ValueSemanticsProviderAndFacetAbstract<InteractionDto>
+implements InteractionDtoValueFacet {
+
+ private static final int TYPICAL_LENGTH = 0;
+
+ private static Class<? extends Facet> type() {
+ return InteractionDtoValueFacet.class;
+ }
+
+ private static final InteractionDto DEFAULT_VALUE = null;
+
+ /**
+ * Required because implementation of {@link Parser} and
+ * {@link EncoderDecoder}.
+ */
+ public InteractionDtoValueSemanticsProvider() {
+ this(null);
+ }
+
+ public InteractionDtoValueSemanticsProvider(final FacetHolder holder) {
+ super(type(), holder, InteractionDto.class, TYPICAL_LENGTH, -1, Immutability.IMMUTABLE, EqualByContent.NOT_HONOURED, DEFAULT_VALUE);
+ }
+
+
+ @Override
+ protected InteractionDto doParse(final Object context, final String str) {
+ return doRestore(str);
+ }
+
+ @Override
+ public String titleString(final Object object) {
+ if (object == null) return "[null]";
+ final InteractionDto interactionDto = (InteractionDto) object;
+ return InteractionDtoUtils.toXml(interactionDto);
+ }
+
+ @Override
+ public String titleStringWithMask(final Object value, final String usingMask) {
+ return titleString(value);
+ }
+
+
+ @Override
+ public String interactionDtoValue(final ManagedObject object) {
+ if (object == null) {
+ return "";
+ }
+ final InteractionDto interactionDto = (InteractionDto) object.getPojo();
+ return InteractionDtoUtils.toXml(interactionDto);
+ }
+
+ @Override
+ public ManagedObject createValue(final ManagedObject object, final String xml) {
+ final InteractionDto interactionDto = InteractionDtoUtils.fromXml(xml);
+ return getObjectManager().adapt(interactionDto);
+ }
+
+
+ @Override
+ protected String doEncode(final Object object) {
+ InteractionDto interactionDto = (InteractionDto) object;
+ return InteractionDtoUtils.toXml(interactionDto);
+ }
+
+ @Override
+ protected InteractionDto doRestore(final String xml) {
+ return InteractionDtoUtils.fromXml(xml);
+ }
+
+
+ @Override
+ public String toString() {
+ return "InteractionDtoValueSemanticsProvider";
+ }
+
+}
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/schema/IsisSchemaMetaModelRefiner.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/schema/IsisSchemaMetaModelRefiner.java
new file mode 100644
index 0000000..dc97220
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/schema/IsisSchemaMetaModelRefiner.java
@@ -0,0 +1,38 @@
+/*
+ * 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.schema;
+
+import javax.inject.Named;
+
+import org.springframework.stereotype.Component;
+
+import org.apache.isis.core.metamodel.facetapi.MetaModelRefiner;
+import org.apache.isis.core.metamodel.progmodel.ProgrammingModel;
+
+@Component
+@Named("isisMetaModel.isisSchema.MetaModelRefiner")
+public class IsisSchemaMetaModelRefiner implements MetaModelRefiner {
+ @Override
+ public void refineProgrammingModel(ProgrammingModel programmingModel) {
+ programmingModel.addFactory(
+ ProgrammingModel.FacetProcessingOrder.G1_VALUE_TYPES,
+ InteractionDtoValueFacetUsingSemanticsProviderFactory.class);
+ }
+}
+
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/schema/IsisSchemaValueTypeProvider.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/schema/IsisSchemaValueTypeProvider.java
new file mode 100644
index 0000000..b5f51bb
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/schema/IsisSchemaValueTypeProvider.java
@@ -0,0 +1,42 @@
+/*
+ * 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.schema;
+
+import java.util.Collection;
+import java.util.Collections;
+
+import javax.inject.Named;
+
+import org.springframework.stereotype.Component;
+
+import org.apache.isis.core.metamodel.valuetypes.ValueTypeDefinition;
+import org.apache.isis.core.metamodel.valuetypes.ValueTypeProvider;
+import org.apache.isis.schema.common.v2.ValueType;
+import org.apache.isis.schema.ixn.v2.InteractionDto;
+import org.apache.isis.schema.ixn.v2.PropertyEditDto;
+
+@Component
+@Named("isisMetaModel.isisSchema.ValueTypeProvider")
+public class IsisSchemaValueTypeProvider implements ValueTypeProvider {
+ @Override
+ public Collection<ValueTypeDefinition> definitions() {
+ return Collections.singletonList(
+ ValueTypeDefinition.of(InteractionDto.class, ValueType.STRING));
+ }
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/PropertyMenu.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/PropertyMenu.java
index 814f1d3..b97d5c3 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/PropertyMenu.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/PropertyMenu.java
@@ -41,6 +41,8 @@ import demoapp.dom.annotDomain.Property.hidden.child.PropertyHiddenChildVm;
import demoapp.dom.annotDomain.Property.maxLength.PropertyMaxLengthVm;
import demoapp.dom.annotDomain.Property.mustSatisfy.PropertyMustSatisfyVm;
import demoapp.dom.annotDomain.Property.optionality.PropertyOptionalityVm;
+import demoapp.dom.annotDomain.Property.publishing.PropertyPublishingJdo;
+import demoapp.dom.annotDomain.Property.publishing.PropertyPublishingJdoEntities;
import demoapp.dom.annotDomain.Property.regexPattern.PropertyRegexPatternVm;
import demoapp.dom.types.Samples;
@@ -127,6 +129,12 @@ public class PropertyMenu {
}
@Action(semantics = SemanticsOf.SAFE)
+ @ActionLayout(cssClassFa="fa-book", describedAs = "Property changed events as XML")
+ public PropertyPublishingJdo publishing(){
+ return propertyPublishingJdoEntities.first();
+ }
+
+ @Action(semantics = SemanticsOf.SAFE)
@ActionLayout(cssClassFa="fa-equals", describedAs = "Regular expressions, such as email")
public PropertyRegexPatternVm regexPattern(){
val vm = new PropertyRegexPatternVm();
@@ -154,5 +162,7 @@ public class PropertyMenu {
Samples<Blob> blobSamples;
@Inject
Samples<Clob> clobSamples;
+ @Inject
+ PropertyPublishingJdoEntities propertyPublishingJdoEntities;
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/.gitkeep b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PropertyPublishingJdo-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PropertyPublishingJdo-description.adoc
new file mode 100644
index 0000000..c62d177
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PropertyPublishingJdo-description.adoc
@@ -0,0 +1,74 @@
+CAUTION: todo - to update.
+
+//The `editing` semantic specifies that a property's value can be changed through the UI:
+//
+//* for properties, the semantic can be specified using either the `@Property` annotation, or a meta-annotation
+//
+//There is no corresponding semantic for parameters, parameters are implicitly editable.
+//
+//== Class Level
+//
+//Usually editing of properties is discouraged; it is usually better to modify state through an explicit action instead.
+//For that reason, editing of properties is disabled by default (though that can be changed globally if necessary using the `isis.applib.annotation.domain-object.editing` configuration property).
+//
+//Editing can also be specified at the class level.
+//This will override any configured defaults, but just for the properties of that class:
+//
+//[source,java,indent=0]
+//----
+//include::PropertyEditingVm.java[tags=class]
+//----
+//
+//The property-level semantic can, in turn, overrides the configured or class-level default.
+//
+//
+//== Annotated
+//
+//The `editing` semantic can be specified explicitly using an annotation:
+//
+//* for properties, using `@Property#editing()`:
+//+
+//[source,java,indent=0]
+//----
+//include::PropertyEditingVm.java[tags=annotation]
+//----
+//<.> explicitly specifies the maximum length that can be entered for the property
+//
+//The annotation could also be applied to a mixin, but would have little effect because mixin properties are always read-only.
+//
+//== Meta-annotated
+//
+//The `editing` semantic can also be specified using a custom meta-annotation:
+//
+//* the meta-annotation is defined as:
+//+
+//[source,java]
+//----
+//include::EditingEnabledMetaAnnotation.java[tags=class]
+//----
+//<.> annotated for a property
+//<.> annotation can be applied to a property (either its getter or the field directly)
+//
+//* and can be applied to a property:
+//+
+//[source,java,indent=0]
+//----
+//include::PropertyEditingVm.java[tags=meta-annotated]
+//----
+//<.> semantic is inherited from the meta-annotation
+//
+//
+//
+//=== Meta-annotated Overridden
+//
+//The meta-annotation can itself be overridden:
+//
+//* in a property:
+//+
+//[source,java,indent=0]
+//----
+//include::PropertyEditingVm.java[tags=meta-annotated-overridden]
+//----
+//<.> semantic from meta-annotation ...
+//<.> \... is overridden by the `@Property` annotation
+//
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PropertyPublishingJdo.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PropertyPublishingJdo.java
new file mode 100644
index 0000000..ae84079
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PropertyPublishingJdo.java
@@ -0,0 +1,111 @@
+/*
+ * 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 demoapp.dom.annotDomain.Property.publishing;
+
+import javax.jdo.annotations.DatastoreIdentity;
+import javax.jdo.annotations.IdGeneratorStrategy;
+import javax.jdo.annotations.IdentityType;
+import javax.jdo.annotations.PersistenceCapable;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.Editing;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Nature;
+import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.Publishing;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
+
+//tag::class[]
+@PersistenceCapable(identityType = IdentityType.DATASTORE, schema = "demo")
+@DatastoreIdentity(strategy = IdGeneratorStrategy.IDENTITY, column = "id")
+@DomainObject(
+ nature=Nature.JDO_ENTITY
+ , objectType = "demo.PropertyPublishingJdo"
+ , editing = Editing.ENABLED
+ , publishing = Publishing.DISABLED // <.>
+)
+public class PropertyPublishingJdo implements HasAsciiDocDescription {
+ // ...
+//end::class[]
+
+ public PropertyPublishingJdo(String initialValue) {
+ this.propertyUsingAnnotation = initialValue;
+ this.propertyUsingMetaAnnotation = initialValue;
+ this.propertyUsingMetaAnnotationButOverridden = initialValue;
+ }
+
+ public String title() {
+ return "Property#publishing";
+ }
+
+//tag::annotation[]
+ @Property(
+ publishing = Publishing.ENABLED // <.>
+ )
+ @PropertyLayout(
+ describedAs =
+ "@Property(publishing = ENABLED)"
+ )
+ @MemberOrder(name = "annotation", sequence = "1")
+ @XmlElement(required = true)
+ @Getter @Setter
+ private String propertyUsingAnnotation;
+//end::annotation[]
+
+//tag::meta-annotated[]
+ @Property()
+ @PublishingEnabledMetaAnnotation // <.>
+ @PropertyLayout(
+ describedAs = "@PublishingEnabledMetaAnnotation"
+ )
+ @MemberOrder(name = "meta-annotated", sequence = "1")
+ @XmlElement(required = true)
+ @Getter @Setter
+ private String propertyUsingMetaAnnotation;
+//end::meta-annotated[]
+
+//tag::meta-annotated-overridden[]
+ @PublishingEnabledMetaAnnotation // <.>
+ @Property(
+ publishing = Publishing.DISABLED // <.>
+ )
+ @PropertyLayout(
+ describedAs =
+ "@PublishingEnabledMetaAnnotation " +
+ "@PropertyLayout(publishing = DISABLED)"
+ )
+ @MemberOrder(name = "meta-annotated-overridden", sequence = "1")
+ @XmlElement(required = false)
+ @Getter @Setter
+ private String propertyUsingMetaAnnotationButOverridden;
+//end::meta-annotated-overridden[]
+
+//tag::class[]
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PropertyPublishingJdo.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PropertyPublishingJdo.layout.xml
new file mode 100644
index 0000000..f3edfb0
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PropertyPublishingJdo.layout.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<bs3:grid
+ xsi:schemaLocation="http://isis.apache.org/applib/layout/component http://isis.apache.org/applib/layout/component/component.xsd http://isis.apache.org/applib/layout/grid/bootstrap3 http://isis.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd"
+ xmlns:bs3="http://isis.apache.org/applib/layout/grid/bootstrap3"
+ xmlns:cpt="http://isis.apache.org/applib/layout/component"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <bs3:row>
+ <bs3:col span="10" unreferencedActions="true">
+ <cpt:domainObject />
+ <cpt:action id="rebuildMetamodel"/>
+ </bs3:col>
+ <bs3:col span="2">
+ <cpt:fieldSet name="" id="sources" />
+ </bs3:col>
+ </bs3:row>
+
+ <bs3:row>
+ <bs3:col span="6">
+ <bs3:row>
+ <bs3:col span="12">
+ <cpt:fieldSet name="Annotated" id="annotation"/>
+ <cpt:fieldSet name="Contributed" id="contributed"/>
+ <cpt:fieldSet name="Meta-annotated" id="meta-annotated"/>
+ <cpt:fieldSet name="Meta-annotated Overridden" id="meta-annotated-overridden"/>
+ </bs3:col>
+ </bs3:row>
+ <bs3:row>
+ <bs3:col span="12">
+ <cpt:collection id="interactionExecutions"/>
+ <cpt:collection id="publishedObjects"/>
+ </bs3:col>
+ </bs3:row>
+ <bs3:row>
+ <bs3:col span="12">
+ <cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
+ </bs3:col>
+ </bs3:row>
+ </bs3:col>
+ <bs3:col span="6">
+ <cpt:fieldSet name="Description" id="description" >
+ <cpt:action id="clearHints" position="PANEL" />
+ <cpt:action id="downloadLayoutXml" position="PANEL_DROPDOWN"/>
+ <cpt:action id="rebuildMetamodel" position="PANEL_DROPDOWN"/>
+ <cpt:action id="downloadMetamodelXml" position="PANEL_DROPDOWN"/>
+ <cpt:action id="inspectMetamodel" position="PANEL_DROPDOWN"/>
+ <cpt:action id="downloadJdoMetadata" position="PANEL_DROPDOWN"/>
+ <cpt:action id="openRestApi" position="PANEL_DROPDOWN" />
+ <cpt:property id="description"/>
+ </cpt:fieldSet>
+ </bs3:col>
+ </bs3:row>
+ <bs3:row>
+ <bs3:col span="12" unreferencedCollections="true"/>
+ </bs3:row>
+
+</bs3:grid>
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PropertyPublishingJdoEntities.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PropertyPublishingJdoEntities.java
new file mode 100644
index 0000000..192c9d3
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PropertyPublishingJdoEntities.java
@@ -0,0 +1,31 @@
+package demoapp.dom.annotDomain.Property.publishing;
+
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
+
+import javax.inject.Inject;
+
+import org.springframework.stereotype.Service;
+
+import org.apache.isis.applib.services.repository.RepositoryService;
+
+@Service
+public class PropertyPublishingJdoEntities {
+
+ public Optional<PropertyPublishingJdo> find(final String value) {
+ return repositoryService.firstMatch(PropertyPublishingJdo.class, x -> Objects.equals(x.getPropertyUsingAnnotation(), value));
+ }
+
+ public List<PropertyPublishingJdo> all() {
+ return repositoryService.allInstances(PropertyPublishingJdo.class);
+ }
+
+ public PropertyPublishingJdo first() {
+ return all().stream().findFirst().get();
+ }
+
+ @Inject
+ RepositoryService repositoryService;
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PropertyPublishingJdoSeedService.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PropertyPublishingJdoSeedService.java
new file mode 100644
index 0000000..c45cd79
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PropertyPublishingJdoSeedService.java
@@ -0,0 +1,39 @@
+package demoapp.dom.annotDomain.Property.publishing;
+
+import javax.inject.Inject;
+
+import org.springframework.stereotype.Service;
+
+import org.apache.isis.applib.services.repository.RepositoryService;
+import org.apache.isis.testing.fixtures.applib.fixturescripts.FixtureScript;
+
+import demoapp.dom._infra.seed.SeedServiceAbstract;
+import demoapp.dom.types.Samples;
+
+@Service
+public class PropertyPublishingJdoSeedService extends SeedServiceAbstract {
+
+ public PropertyPublishingJdoSeedService() {
+ super(PropertyPublishingJdoEntityFixture::new);
+ }
+
+ static class PropertyPublishingJdoEntityFixture extends FixtureScript {
+
+ @Override
+ protected void execute(ExecutionContext executionContext) {
+ samples.stream()
+ .map(PropertyPublishingJdo::new)
+ .forEach(domainObject -> {
+ repositoryService.persist(domainObject);
+ executionContext.addResult(this, domainObject);
+ });
+
+ }
+
+ @Inject
+ RepositoryService repositoryService;
+
+ @Inject
+ Samples<String> samples;
+ }
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PublishingDisabledMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PublishingDisabledMetaAnnotation.java
new file mode 100644
index 0000000..4b7705a
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PublishingDisabledMetaAnnotation.java
@@ -0,0 +1,22 @@
+package demoapp.dom.annotDomain.Property.publishing;
+
+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;
+
+import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.Publishing;
+
+//tag::class[]
+@Property(publishing = Publishing.DISABLED) // <.>
+@Inherited
+@Target({
+ ElementType.METHOD, ElementType.FIELD // <.>
+})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface PublishingDisabledMetaAnnotation {
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PublishingEnabledMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PublishingEnabledMetaAnnotation.java
new file mode 100644
index 0000000..ce7c42a
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/PublishingEnabledMetaAnnotation.java
@@ -0,0 +1,23 @@
+package demoapp.dom.annotDomain.Property.publishing;
+
+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;
+
+import org.apache.isis.applib.annotation.Editing;
+import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.Publishing;
+
+//tag::class[]
+@Property(publishing = Publishing.ENABLED) // <.>
+@Inherited
+@Target({
+ ElementType.METHOD, ElementType.FIELD // <.>
+})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface PublishingEnabledMetaAnnotation {
+
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/spiimpl/PropertyPublishingJdo_interactionExecutions.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/spiimpl/PropertyPublishingJdo_interactionExecutions.java
new file mode 100644
index 0000000..98ad7f9
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/spiimpl/PropertyPublishingJdo_interactionExecutions.java
@@ -0,0 +1,30 @@
+package demoapp.dom.annotDomain.Property.publishing.spiimpl;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+import javax.inject.Inject;
+
+import org.apache.isis.applib.annotation.Collection;
+import org.apache.isis.schema.ixn.v2.InteractionDto;
+
+import demoapp.dom.annotDomain.Property.publishing.PropertyPublishingJdo;
+
+@Collection
+public class PropertyPublishingJdo_interactionExecutions {
+
+ private final PropertyPublishingJdo propertyPublishingJdo;
+
+ public PropertyPublishingJdo_interactionExecutions(PropertyPublishingJdo propertyPublishingJdo) {
+ this.propertyPublishingJdo = propertyPublishingJdo;
+ }
+
+ public List<InteractionDto> coll() {
+ return publisherServiceSpiForProperties
+ .streamInteractionDtos()
+ .collect(Collectors.toList());
+ }
+
+ @Inject
+ private PublisherServiceSpiForProperties publisherServiceSpiForProperties;
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/spiimpl/PropertyPublishingJdo_publishedObjects.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/spiimpl/PropertyPublishingJdo_publishedObjects.java
new file mode 100644
index 0000000..da19d5a
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/spiimpl/PropertyPublishingJdo_publishedObjects.java
@@ -0,0 +1,32 @@
+package demoapp.dom.annotDomain.Property.publishing.spiimpl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import javax.inject.Inject;
+
+import org.apache.isis.applib.annotation.Collection;
+import org.apache.isis.schema.chg.v2.ChangesDto;
+
+import demoapp.dom.annotDomain.Property.publishing.PropertyPublishingJdo;
+
+@Collection
+public class PropertyPublishingJdo_publishedObjects {
+
+ private final PropertyPublishingJdo propertyPublishingJdo;
+ public PropertyPublishingJdo_publishedObjects(PropertyPublishingJdo propertyPublishingJdo) {
+ this.propertyPublishingJdo = propertyPublishingJdo;
+ }
+
+ public List<String> coll() {
+ return new ArrayList<>();
+// return publisherServiceSpiForProperties
+// .streamPublishedObjects()
+// .collect(Collectors.toList());
+ }
+
+ @Inject
+ private PublisherServiceSpiForProperties publisherServiceSpiForProperties;
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/spiimpl/PublisherServiceSpiForProperties.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/spiimpl/PublisherServiceSpiForProperties.java
new file mode 100644
index 0000000..4f92964
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/publishing/spiimpl/PublisherServiceSpiForProperties.java
@@ -0,0 +1,49 @@
+package demoapp.dom.annotDomain.Property.publishing.spiimpl;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Stream;
+
+import org.springframework.stereotype.Service;
+
+import org.apache.isis.applib.services.iactn.Interaction;
+import org.apache.isis.applib.services.publish.PublishedObjects;
+import org.apache.isis.applib.services.publish.PublisherService;
+import org.apache.isis.applib.util.schema.InteractionDtoUtils;
+import org.apache.isis.schema.chg.v2.ChangesDto;
+import org.apache.isis.schema.ixn.v2.InteractionDto;
+
+@Service
+public class PublisherServiceSpiForProperties implements PublisherService {
+
+ private final List<InteractionDto> executions = new ArrayList<>();
+ private final List<ChangesDto> publishedObjects = new ArrayList<ChangesDto>();
+
+ @Override
+ public void publish(Interaction.Execution<?, ?> execution) {
+
+ final InteractionDto dto =
+ InteractionDtoUtils.newInteractionDto(execution, InteractionDtoUtils.Strategy.DEEP);
+
+ executions.add(dto);
+ }
+
+ @Override
+ public void publish(PublishedObjects publishedObjects) {
+ final ChangesDto dto = publishedObjects.getDto();
+ this.publishedObjects.add(dto);
+ }
+
+ public Stream<InteractionDto> streamInteractionDtos() {
+ return executions.stream();
+ }
+
+ public Stream<ChangesDto> streamPublishedObjects() {
+ return publishedObjects.stream();
+ }
+
+ public void clear() {
+ executions.clear();
+ }
+
+}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml
index db3a222..a992119 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml
@@ -15,10 +15,10 @@ as a replacement for
<mb3:named>Basic Types</mb3:named>
<mb3:section>
<mb3:named>Primitives</mb3:named>
- <mb3:serviceAction objectType="demo.PrimitiveTypesMenu" id="bytes"/>
<mb3:serviceAction objectType="demo.PrimitiveTypesMenu" id="shorts"/>
<mb3:serviceAction objectType="demo.PrimitiveTypesMenu" id="ints"/>
<mb3:serviceAction objectType="demo.PrimitiveTypesMenu" id="longs"/>
+ <mb3:serviceAction objectType="demo.PrimitiveTypesMenu" id="bytes"/>
<mb3:serviceAction objectType="demo.PrimitiveTypesMenu" id="floats"/>
<mb3:serviceAction objectType="demo.PrimitiveTypesMenu" id="doubles"/>
<mb3:serviceAction objectType="demo.PrimitiveTypesMenu" id="chars"/>
@@ -122,6 +122,7 @@ as a replacement for
<mb3:serviceAction objectType="demo.PropertyMenu" id="maxLength"/>
<mb3:serviceAction objectType="demo.PropertyMenu" id="mustSatisfy"/>
<mb3:serviceAction objectType="demo.PropertyMenu" id="optionality"/>
+ <mb3:serviceAction objectType="demo.PropertyMenu" id="publishing"/>
<mb3:serviceAction objectType="demo.PropertyMenu" id="regexPattern"/>
</mb3:section>
</mb3:menu>
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/javalang/strings/jdo/JavaLangStringJdoEntities.java b/examples/demo/domain/src/main/java/demoapp/dom/types/javalang/strings/jdo/JavaLangStringJdoEntities.java
index 01e63f5..a3769d7 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/javalang/strings/jdo/JavaLangStringJdoEntities.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/javalang/strings/jdo/JavaLangStringJdoEntities.java
@@ -1,6 +1,7 @@
package demoapp.dom.types.javalang.strings.jdo;
import java.util.List;
+import java.util.Objects;
import java.util.Optional;
import javax.inject.Inject;
@@ -13,7 +14,7 @@ import org.apache.isis.applib.services.repository.RepositoryService;
public class JavaLangStringJdoEntities {
public Optional<JavaLangStringJdo> find(final String readOnlyProperty) {
- return repositoryService.firstMatch(JavaLangStringJdo.class, x -> x.getReadOnlyProperty() == readOnlyProperty);
+ return repositoryService.firstMatch(JavaLangStringJdo.class, x -> Objects.equals(x.getReadOnlyProperty(), readOnlyProperty));
}
public List<JavaLangStringJdo> all() {
[isis] 01/02: ISIS-2222: wip @Action#hidden
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch ISIS-2222
in repository https://gitbox.apache.org/repos/asf/isis.git
commit b3dea47fa5196b23da03fb2df27e55bea774078a
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Sun Aug 9 15:31:10 2020 +0100
ISIS-2222: wip @Action#hidden
24/46
---
.../demoapp/dom/annotDomain/Action/ActionMenu.java | 9 +-
.../ActionDomainEventVm-description.adoc | 4 +-
.../demoapp/dom/annotDomain/Action/hidden/.gitkeep | 0
.../Action/hidden/ActionHiddenVm-description.adoc | 25 ++++
.../annotDomain/Action/hidden/ActionHiddenVm.java | 159 +++++++++++++++++++++
.../Action/hidden/ActionHiddenVm.layout.xml | 50 +++++++
...onHiddenVm_mixinUpdateTextAndHiddenNowhere.java | 53 +++++++
...iddenVm_mixinUpdateTextButHiddenEverywhere.java | 53 +++++++
...ddenVm_mixinUpdateTextButHiddenObjectForms.java | 53 +++++++
...ActionHiddenVm_mixinUpdateTextNoAnnotation.java | 53 +++++++
.../src/main/java/demoapp/dom/menubars.layout.xml | 1 +
11 files changed, 457 insertions(+), 3 deletions(-)
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/ActionMenu.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/ActionMenu.java
index b3884aa..453d6e8 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/ActionMenu.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/ActionMenu.java
@@ -36,6 +36,7 @@ import demoapp.dom._infra.samples.NameSamples;
import demoapp.dom.annotDomain.Action.associateWith.ActionAssociateWithVm;
import demoapp.dom.annotDomain.Action.associateWith.child.ActionAssociateWithChildVm;
import demoapp.dom.annotDomain.Action.domainEvent.ActionDomainEventVm;
+import demoapp.dom.annotDomain.Action.hidden.ActionHiddenVm;
import demoapp.dom.annotDomain.Action.typeOf.ActionTypeOfVm;
import demoapp.dom.annotDomain.Action.typeOf.child.ActionTypeOfChildVm;
import demoapp.dom.types.Samples;
@@ -65,7 +66,13 @@ public class ActionMenu {
@Action(semantics = SemanticsOf.SAFE)
@ActionLayout(cssClassFa="fa-asterisk", describedAs = "Decouples interaction of actions")
public ActionDomainEventVm domainEvent(){
- return new ActionDomainEventVm("change me");
+ return new ActionDomainEventVm("value");
+ }
+
+ @Action(semantics = SemanticsOf.SAFE)
+ @ActionLayout(cssClassFa="fa-glasses", describedAs = "Visibility of actions")
+ public ActionHiddenVm hidden(){
+ return new ActionHiddenVm("value");
}
@Action(semantics = SemanticsOf.SAFE)
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/domainEvent/ActionDomainEventVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/domainEvent/ActionDomainEventVm-description.adoc
index 380ac57..71bb7cd 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/domainEvent/ActionDomainEventVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/domainEvent/ActionDomainEventVm-description.adoc
@@ -22,7 +22,7 @@ The fallback domain event can be suppressed using the `isis.applib.annotation.ac
The demo defines two actions that are annotated using `domainEvent` semantic:
-* in the `ActionDomainEventVm` is a regular action, "updateText":
+* in the `ActionHiddenVm` is a regular action, "updateText":
+
[source,java]
----
@@ -31,7 +31,7 @@ include::ActionDomainEventVm.java[tags=class]
<.> the event class to emit; genericised by the target type
<.> indicates that the framework should emit this type
-* The `ActionDomainEventVm_mixinUpdateText` defines a mixin action, also annotated:
+* The `ActionHiddenVm_mixinUpdateTextNoAnnotation` defines a mixin action, also annotated:
+
[source,java]
----
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/hidden/.gitkeep b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/hidden/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/hidden/ActionHiddenVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/hidden/ActionHiddenVm-description.adoc
new file mode 100644
index 0000000..7c93c9c
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/hidden/ActionHiddenVm-description.adoc
@@ -0,0 +1,25 @@
+The `hidden` semantic specifies whether the action should be visible in the UI or not.
+
+
+[source,java]
+----
+include::ActionHiddenVm.java[tags=class]
+----
+
+Three actions:
+
+* `updateTextNoAnnotation` does not specify whether it is hidden or not.
+The fallback is that actions are not hidden:
++
+[source,java]
+----
+include::ActionHiddenVm.java[tags=action-no-annotation]
+----
+
+* `updateTextAndHiddenNowhere` action is explicitly annotated as not hidden:
++
+[source,java]
+----
+include::ActionHiddenVm.java[tags=action-hidden-nowhere]
+----
+
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/hidden/ActionHiddenVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/hidden/ActionHiddenVm.java
new file mode 100644
index 0000000..4187d40
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/hidden/ActionHiddenVm.java
@@ -0,0 +1,159 @@
+/*
+ * 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 demoapp.dom.annotDomain.Action.hidden;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Nature;
+import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.SemanticsOf;
+import org.apache.isis.applib.annotation.Where;
+import org.apache.isis.applib.events.domain.ActionDomainEvent;
+
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
+
+@XmlRootElement(name = "root")
+@XmlType
+@XmlAccessorType(XmlAccessType.FIELD)
+@DomainObject(
+ nature=Nature.VIEW_MODEL,
+ objectType = "demo.ActionHiddenVm"
+)
+@NoArgsConstructor
+//tag::class[]
+public class ActionHiddenVm implements HasAsciiDocDescription {
+ // ...
+//end::class[]
+
+ public ActionHiddenVm(String value) {
+ this.text = value;
+ this.otherText = value;
+ }
+
+ public String title() {
+ return "Action#hidden";
+ }
+
+ @Property()
+ @MemberOrder(name = "properties", sequence = "1")
+ @XmlElement(required = true)
+ @Getter @Setter
+ private String text;
+
+ @Property()
+ @MemberOrder(name = "properties", sequence = "2")
+ @XmlElement(required = true)
+ @Getter @Setter
+ private String otherText;
+
+//tag::action-no-annotation[]
+ @Action(
+ semantics = SemanticsOf.IDEMPOTENT
+ , associateWith = "text"
+ , associateWithSequence = "1"
+ // no hidden attribute // <.>
+ )
+ @ActionLayout(
+ describedAs =
+ "@Action()"
+ )
+ public ActionHiddenVm updateTextNoAnnotation(final String text) {
+ setText(text);
+ return this;
+ }
+ public String default0UpdateTextNoAnnotation() {
+ return getText();
+ }
+//end::action-no-annotation[]
+
+//tag::action-hidden-nowhere[]
+ @Action(
+ semantics = SemanticsOf.IDEMPOTENT
+ , associateWith = "text"
+ , associateWithSequence = "2"
+ , hidden = Where.NOWHERE // <.>
+ )
+ @ActionLayout(
+ describedAs =
+ "@Action(hidden = Where.OBJECT_FORMS)"
+ )
+ public ActionHiddenVm updateTextAndHiddenNowhere(final String text) {
+ setText(text);
+ return this;
+ }
+ public String default0UpdateTextAndHiddenNowhere() {
+ return getText();
+ }
+//end::action-hidden-nowhere[]
+
+//tag::action-but-hidden-on-forms[]
+ @Action(
+ semantics = SemanticsOf.IDEMPOTENT
+ , associateWith = "text"
+ , associateWithSequence = "3"
+ , hidden = Where.OBJECT_FORMS // <.>
+ )
+ @ActionLayout(
+ describedAs =
+ "@Action(hidden = Where.OBJECT_FORMS)"
+ )
+ public ActionHiddenVm updateTextButHiddenOnForms(final String text) {
+ setText(text);
+ return this;
+ }
+ public String default0UpdateTextButHiddenOnForms() {
+ return getText();
+ }
+//end::action-but-hidden-on-forms[]
+
+//tag::action-but-hidden-everywhere[]
+ @Action(
+ semantics = SemanticsOf.IDEMPOTENT
+ , associateWith = "text"
+ , associateWithSequence = "4"
+ , hidden = Where.EVERYWHERE // <.>
+ )
+ @ActionLayout(
+ describedAs =
+ "@Action(hidden = Where.OBJECT_FORMS)"
+ )
+ public ActionHiddenVm updateTextButHiddenEverywhere(final String text) {
+ setText(text);
+ return this;
+ }
+ public String default0UpdateTextButHiddenEverywhere() {
+ return getText();
+ }
+//end::action-but-hidden-everywhere[]
+
+//tag::class[]
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/hidden/ActionHiddenVm.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/hidden/ActionHiddenVm.layout.xml
new file mode 100644
index 0000000..4b31324
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/hidden/ActionHiddenVm.layout.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<bs3:grid
+ xsi:schemaLocation="http://isis.apache.org/applib/layout/component http://isis.apache.org/applib/layout/component/component.xsd http://isis.apache.org/applib/layout/grid/bootstrap3 http://isis.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd"
+ xmlns:bs3="http://isis.apache.org/applib/layout/grid/bootstrap3"
+ xmlns:cpt="http://isis.apache.org/applib/layout/component"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <bs3:row>
+ <bs3:col span="10" unreferencedActions="true">
+ <cpt:domainObject />
+ <cpt:action id="rebuildMetamodel"/>
+ </bs3:col>
+ <bs3:col span="2">
+ <cpt:fieldSet name="" id="sources" />
+ </bs3:col>
+ </bs3:row>
+
+ <bs3:row>
+ <bs3:col span="6">
+ <bs3:row>
+ <bs3:col span="12">
+ <cpt:fieldSet name="Properties" id="properties"/>
+ <cpt:fieldSet name="Contributed" id="contributed"/>
+ <cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
+ </bs3:col>
+ </bs3:row>
+ <bs3:row>
+ <bs3:col span="12">
+ <cpt:collection id="events"/>
+ </bs3:col>
+ </bs3:row>
+ </bs3:col>
+ <bs3:col span="6">
+ <cpt:fieldSet name="Description" id="description" >
+ <cpt:action id="clearHints" position="PANEL" />
+ <cpt:action id="downloadLayoutXml" position="PANEL_DROPDOWN"/>
+ <cpt:action id="rebuildMetamodel" position="PANEL_DROPDOWN"/>
+ <cpt:action id="downloadMetamodelXml" position="PANEL_DROPDOWN"/>
+ <cpt:action id="inspectMetamodel" position="PANEL_DROPDOWN"/>
+ <cpt:action id="downloadJdoMetadata" position="PANEL_DROPDOWN"/>
+ <cpt:action id="openRestApi" position="PANEL_DROPDOWN" />
+ <cpt:property id="description"/>
+ </cpt:fieldSet>
+ </bs3:col>
+ </bs3:row>
+ <bs3:row>
+ <bs3:col span="12" unreferencedCollections="true"/>
+ </bs3:row>
+
+</bs3:grid>
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/hidden/ActionHiddenVm_mixinUpdateTextAndHiddenNowhere.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/hidden/ActionHiddenVm_mixinUpdateTextAndHiddenNowhere.java
new file mode 100644
index 0000000..34749ac
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/hidden/ActionHiddenVm_mixinUpdateTextAndHiddenNowhere.java
@@ -0,0 +1,53 @@
+/*
+ * 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 demoapp.dom.annotDomain.Action.hidden;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.SemanticsOf;
+import org.apache.isis.applib.annotation.Where;
+
+import lombok.RequiredArgsConstructor;
+
+
+//tag::class[]
+@Action(
+ semantics = SemanticsOf.SAFE
+ , associateWith = "otherText"
+ , associateWithSequence = "2"
+ , hidden = Where.NOWHERE // <.>
+)
+@ActionLayout(
+ describedAs =
+ "@Action(hidden = Where.NOWHERE)"
+)
+@RequiredArgsConstructor
+public class ActionHiddenVm_mixinUpdateTextAndHiddenNowhere {
+
+ private final ActionHiddenVm actionHiddenVm;
+
+ public ActionHiddenVm act(final String text) {
+ actionHiddenVm.setOtherText(text);
+ return actionHiddenVm;
+ }
+ public String default0Act() {
+ return actionHiddenVm.getOtherText();
+ }
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/hidden/ActionHiddenVm_mixinUpdateTextButHiddenEverywhere.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/hidden/ActionHiddenVm_mixinUpdateTextButHiddenEverywhere.java
new file mode 100644
index 0000000..0e0486e
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/hidden/ActionHiddenVm_mixinUpdateTextButHiddenEverywhere.java
@@ -0,0 +1,53 @@
+/*
+ * 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 demoapp.dom.annotDomain.Action.hidden;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.SemanticsOf;
+import org.apache.isis.applib.annotation.Where;
+
+import lombok.RequiredArgsConstructor;
+
+
+//tag::class[]
+@Action(
+ semantics = SemanticsOf.SAFE
+ , associateWith = "otherText"
+ , associateWithSequence = "4"
+ , hidden = Where.EVERYWHERE // <.>
+)
+@ActionLayout(
+ describedAs =
+ "@Action(hidden = Where.EVERYWHERE)"
+)
+@RequiredArgsConstructor
+public class ActionHiddenVm_mixinUpdateTextButHiddenEverywhere {
+
+ private final ActionHiddenVm actionHiddenVm;
+
+ public ActionHiddenVm act(final String text) {
+ actionHiddenVm.setOtherText(text);
+ return actionHiddenVm;
+ }
+ public String default0Act() {
+ return actionHiddenVm.getOtherText();
+ }
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/hidden/ActionHiddenVm_mixinUpdateTextButHiddenObjectForms.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/hidden/ActionHiddenVm_mixinUpdateTextButHiddenObjectForms.java
new file mode 100644
index 0000000..39458ad
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/hidden/ActionHiddenVm_mixinUpdateTextButHiddenObjectForms.java
@@ -0,0 +1,53 @@
+/*
+ * 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 demoapp.dom.annotDomain.Action.hidden;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.SemanticsOf;
+import org.apache.isis.applib.annotation.Where;
+
+import lombok.RequiredArgsConstructor;
+
+
+//tag::class[]
+@Action(
+ semantics = SemanticsOf.SAFE
+ , associateWith = "otherText"
+ , associateWithSequence = "3"
+ , hidden = Where.OBJECT_FORMS // <.>
+)
+@ActionLayout(
+ describedAs =
+ "@Action(hidden = Where.OBJECT_FORMS)"
+)
+@RequiredArgsConstructor
+public class ActionHiddenVm_mixinUpdateTextButHiddenObjectForms {
+
+ private final ActionHiddenVm actionHiddenVm;
+
+ public ActionHiddenVm act(final String text) {
+ actionHiddenVm.setOtherText(text);
+ return actionHiddenVm;
+ }
+ public String default0Act() {
+ return actionHiddenVm.getOtherText();
+ }
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/hidden/ActionHiddenVm_mixinUpdateTextNoAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/hidden/ActionHiddenVm_mixinUpdateTextNoAnnotation.java
new file mode 100644
index 0000000..1eabb01
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/hidden/ActionHiddenVm_mixinUpdateTextNoAnnotation.java
@@ -0,0 +1,53 @@
+/*
+ * 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 demoapp.dom.annotDomain.Action.hidden;
+
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.ActionLayout;
+import org.apache.isis.applib.annotation.SemanticsOf;
+import org.apache.isis.applib.events.domain.ActionDomainEvent;
+
+import lombok.RequiredArgsConstructor;
+
+
+//tag::class[]
+@Action(
+ semantics = SemanticsOf.SAFE
+ , associateWith = "otherText"
+ , associateWithSequence = "1"
+ // no hidden attribute // <.>
+)
+@ActionLayout(
+ describedAs =
+ "@Action()"
+)
+@RequiredArgsConstructor
+public class ActionHiddenVm_mixinUpdateTextNoAnnotation {
+
+ private final ActionHiddenVm actionHiddenVm;
+
+ public ActionHiddenVm act(final String text) {
+ actionHiddenVm.setOtherText(text);
+ return actionHiddenVm;
+ }
+ public String default0Act() {
+ return actionHiddenVm.getOtherText();
+ }
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml
index d041e7f..db3a222 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml
@@ -110,6 +110,7 @@ as a replacement for
<mb3:named>@Action</mb3:named>
<mb3:serviceAction objectType="demo.ActionMenu" id="associateWith"/>
<mb3:serviceAction objectType="demo.ActionMenu" id="domainEvent"/>
+ <mb3:serviceAction objectType="demo.ActionMenu" id="hidden"/>
<mb3:serviceAction objectType="demo.ActionMenu" id="typeOf"/>
</mb3:section>
<mb3:section>