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 2018/02/08 17:54:22 UTC

[isis] branch maint-1.16.1 updated (0b249c8 -> c24306a)

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a change to branch maint-1.16.1
in repository https://gitbox.apache.org/repos/asf/isis.git.


    from 0b249c8  ISIS-1569: ensures that transaction CommandExecutorService is run in a xactn with the command to be executed as the context of that xactn.
     new eb27901  ISIS-1569: adds documentation for this service
     new c24306a  ISIS-1861: adds 'collapseIfOne' atribute for TabGroups

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:
 .../applib/layout/grid/bootstrap3/bootstrap3.xsd   |  1 +
 .../guides/rgsvc/_rgsvc_application-layer-api.adoc | 14 ++++++-
 ...rgsvc_application-layer-api_CommandContext.adoc |  2 +-
 ...plication-layer-api_CommandExecutorService.adoc | 45 ++++++++++++++++++++++
 .../applib/layout/grid/bootstrap3/BS3TabGroup.java | 15 ++++++++
 .../wicket/ui/components/layout/bs3/col/Col.java   | 15 +++++---
 6 files changed, 84 insertions(+), 8 deletions(-)
 create mode 100644 adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_application-layer-api_CommandExecutorService.adoc

-- 
To stop receiving notification emails like this one, please contact
danhaywood@apache.org.

[isis] 01/02: ISIS-1569: adds documentation for this service

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch maint-1.16.1
in repository https://gitbox.apache.org/repos/asf/isis.git

commit eb27901540402761359f63c0f35f49569b033f93
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Feb 8 14:19:48 2018 +0000

    ISIS-1569: adds documentation for this service
---
 .../guides/rgsvc/_rgsvc_application-layer-api.adoc | 14 ++++++-
 ...rgsvc_application-layer-api_CommandContext.adoc |  2 +-
 ...plication-layer-api_CommandExecutorService.adoc | 45 ++++++++++++++++++++++
 3 files changed, 59 insertions(+), 2 deletions(-)

diff --git a/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_application-layer-api.adoc b/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_application-layer-api.adoc
index 7d13989..3701e97 100644
--- a/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_application-layer-api.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_application-layer-api.adoc
@@ -37,7 +37,8 @@ It also lists their corresponding implementation, either a default implementatio
 `services.background` +
 `BackgroundService`]
 |Programmatic persistence of commands to be persisted (so can be executed by a background mechanism, eg scheduler)
-|`BackgroundServiceDefault` +
+|`BackgroundService-`
+`Default` +
 ``o.a.i.core`` +
 ``isis-core-runtime``
 |depends on: +
@@ -58,6 +59,17 @@ xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-spi_CommandService[`CommandSer
 The xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-api_InteractionContext[`InteractionContext`] manages the actual execution of the command.
 
 
+|xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-api_CommandExecutorService[`o.a.i.applib.` +
+`services.command` +
+`CommandExecutorService`]
+|Executes the specified `Command`.
+|`CommandExecutorService-`
+`Default` +
+``o.a.i.core`` +
+``isis-core-runtime``
+|
+
+
 |xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-api_DtoMappingHelper[`o.a.i.applib.` +
 `services.dto` +
 `DtoMappingHelper`]
diff --git a/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_application-layer-api_CommandContext.adoc b/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_application-layer-api_CommandContext.adoc
index f39ab29..2449256 100644
--- a/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_application-layer-api_CommandContext.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_application-layer-api_CommandContext.adoc
@@ -1,4 +1,4 @@
-[[_rgsvc_application-layer-api_CommandContext]]
+    [[_rgsvc_application-layer-api_CommandContext]]
 = `CommandContext`
 :Notice: 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 ag [...]
 :_basedir: ../../
diff --git a/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_application-layer-api_CommandExecutorService.adoc b/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_application-layer-api_CommandExecutorService.adoc
new file mode 100644
index 0000000..afda737
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_application-layer-api_CommandExecutorService.adoc
@@ -0,0 +1,45 @@
+[[_rgsvc_application-layer-api_CommandExecutorService]]
+= `CommandExecutorService`
+:Notice: 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 ag [...]
+:_basedir: ../../
+:_imagesdir: images/
+
+
+
+The `CommandExecutorService` domain service is provides the ability to execute a specified `Command`, optionally running the command with the identity of the user captured in that `Command`.
+
+In fact, the service requires that the implementation of the `Command` being executed implements the `CommandWithDto` sub-interface.
+This allows the xref:../rgcms/rgcms.adoc#_rgcms_schema-cmd[`CommandDto`] memento to be extracted, from which the action can be invoked/property edited.
+
+The primary use case for this service is to allow the replay of commands, eg for regression testing.
+This is implemented by the (non-ASF) link:http://platform.incode.org/modules/spi/command/spi-command-replay.html[command replay module].
+(The command replay module also provides a decorator implementation of this service that allows the command to be re-executed at the same _time_ as the original command, leveraging the `TickingClock` implementation provided by the framework).
+
+
+== API & Implementation
+
+The `CommandExecutorService` defines the following API:
+
+[source,java]
+----
+public interface CommandExecutorService {
+    enum SudoPolicy {
+        NO_SWITCH,
+        SWITCH,
+    }
+    void executeCommand(
+            SudoPolicy sudoPolicy,          // <1>
+            CommandWithDto commandWithDto); // <2>
+}
+----
+<1> whether to switch the effective user for the duration of executing the `Command`.
+Behind the scenes this uses the xref:rgsvc.adoc#_rgsvc_testing_SudoService[`SudoService`].
+<2> provided `Command` must implement `CommandDto`.
+
+When the `Command` is executed, it will also be returned by xref:rgsvc.adoc#_rgsvc_application-layer-api_CommandContext[`CommandContext`].
+Any associated objects that implement `HasTransactionId` (audit entries and the like) will therefore have the correct transactionId and will correctly be associated with the `Command` being executed.
+
+The framework provides a default implementation of this service,
+`o.a.i.core.runtime.services.background.CommandExecutorServiceDefault`
+
+

-- 
To stop receiving notification emails like this one, please contact
danhaywood@apache.org.

[isis] 02/02: ISIS-1861: adds 'collapseIfOne' atribute for TabGroups

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch maint-1.16.1
in repository https://gitbox.apache.org/repos/asf/isis.git

commit c24306a26485bf0345d57d5e48677d93b005c4df
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Feb 8 17:54:01 2018 +0000

    ISIS-1861: adds 'collapseIfOne' atribute for TabGroups
---
 .../asciidoc/applib/layout/grid/bootstrap3/bootstrap3.xsd |  1 +
 .../isis/applib/layout/grid/bootstrap3/BS3TabGroup.java   | 15 +++++++++++++++
 .../viewer/wicket/ui/components/layout/bs3/col/Col.java   | 15 +++++++++------
 3 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/adocs/documentation/src/main/asciidoc/applib/layout/grid/bootstrap3/bootstrap3.xsd b/adocs/documentation/src/main/asciidoc/applib/layout/grid/bootstrap3/bootstrap3.xsd
index f494e81..67b2f93 100644
--- a/adocs/documentation/src/main/asciidoc/applib/layout/grid/bootstrap3/bootstrap3.xsd
+++ b/adocs/documentation/src/main/asciidoc/applib/layout/grid/bootstrap3/bootstrap3.xsd
@@ -96,6 +96,7 @@
                     <xs:element maxOccurs="unbounded" minOccurs="0" name="tab" type="tns:tab"/>
                     <xs:element minOccurs="0" name="metadataError" type="xs:string"/>
                 </xs:sequence>
+                <xs:attribute name="collapseIfOne" type="xs:boolean"/>
                 <xs:attribute name="unreferencedCollections" type="xs:boolean"/>
             </xs:extension>
         </xs:complexContent>
diff --git a/core/applib/src/main/java/org/apache/isis/applib/layout/grid/bootstrap3/BS3TabGroup.java b/core/applib/src/main/java/org/apache/isis/applib/layout/grid/bootstrap3/BS3TabGroup.java
index 06e75a7..4ad42af 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/layout/grid/bootstrap3/BS3TabGroup.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/layout/grid/bootstrap3/BS3TabGroup.java
@@ -65,6 +65,21 @@ public class BS3TabGroup extends BS3ElementAbstract implements BS3TabOwner {
 
 
 
+    private Boolean collapseIfOne;
+    /**
+     * If there is a single tab in the tabgroup, then whether to collapse and render without the outer tab.
+     */
+    @XmlAttribute(required = false)
+    public Boolean isCollapseIfOne() {
+        return collapseIfOne;
+    }
+
+    public void setCollapseIfOne(final Boolean collapseIfOne) {
+        this.collapseIfOne = collapseIfOne;
+    }
+
+
+
     private List<BS3Tab> tabs = Lists.newArrayList();
 
     // no wrapper; required=false because may be auto-generated
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/bs3/col/Col.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/bs3/col/Col.java
index 0770f66..4c283b3 100644
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/bs3/col/Col.java
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/layout/bs3/col/Col.java
@@ -203,12 +203,15 @@ public class Col extends PanelAbstract<EntityModel> implements HasDynamicallyVis
                     // shouldn't occur; previously have filtered these out
                     throw new IllegalStateException("Cannot render tabGroup with no tabs");
                 case 1:
-                    final BS3Tab bs3Tab = tabs.get(0);
-                    // render the rows of the one-and-only tab of this tab group.
-                    final List<BS3Row> tabRows = bs3Tab.getRows();
-                    final RepeatingViewWithDynamicallyVisibleContent rowsRv = buildRows(id, tabRows);
-                    tabGroupRv.add(rowsRv);
-                    break;
+                    if(bs3TabGroup.isCollapseIfOne() == null || bs3TabGroup.isCollapseIfOne()) {
+                        final BS3Tab bs3Tab = tabs.get(0);
+                        // render the rows of the one-and-only tab of this tab group.
+                        final List<BS3Row> tabRows = bs3Tab.getRows();
+                        final RepeatingViewWithDynamicallyVisibleContent rowsRv = buildRows(id, tabRows);
+                        tabGroupRv.add(rowsRv);
+                        break;
+                    }
+                    // else fall through...
                 default:
                     final WebMarkupContainer tabGroup = new TabGroupPanel(id, getModel(), bs3TabGroup);
 

-- 
To stop receiving notification emails like this one, please contact
danhaywood@apache.org.