isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject [3/5] isis git commit: ISIS-1696: shows menuBar as an extension for RO viewer's representation of a service
Date Tue, 15 Aug 2017 21:56:40 GMT
ISIS-1696: shows menuBar as an extension for RO viewer's representation of a service


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/bdb84968
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/bdb84968
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/bdb84968

Branch: refs/heads/master
Commit: bdb84968a09273dcda59432f863f0d340d2e96f6
Parents: a4279f0
Author: Dan Haywood <dan@haywood-associates.co.uk>
Authored: Tue Aug 15 21:48:53 2017 +0100
Committer: Dan Haywood <dan@haywood-associates.co.uk>
Committed: Tue Aug 15 21:48:53 2017 +0100

----------------------------------------------------------------------
 .../domainobjects/DomainObjectReprRenderer.java        | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/bdb84968/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/domainobjects/DomainObjectReprRenderer.java
----------------------------------------------------------------------
diff --git a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/domainobjects/DomainObjectReprRenderer.java
b/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/domainobjects/DomainObjectReprRenderer.java
index 4263b83..2f64732 100644
--- a/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/domainobjects/DomainObjectReprRenderer.java
+++ b/core/viewer-restfulobjects-rendering/src/main/java/org/apache/isis/viewer/restfulobjects/rendering/domainobjects/DomainObjectReprRenderer.java
@@ -18,8 +18,10 @@ package org.apache.isis.viewer.restfulobjects.rendering.domainobjects;
 
 import java.util.List;
 
+import org.apache.isis.applib.annotation.DomainServiceLayout;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.consent.Consent;
+import org.apache.isis.core.metamodel.facets.object.domainservicelayout.DomainServiceLayoutFacet;
 import org.apache.isis.core.metamodel.facets.object.notpersistable.NotPersistableFacet;
 import org.apache.isis.core.metamodel.facets.object.title.TitleFacet;
 import org.apache.isis.core.metamodel.services.ServiceUtil;
@@ -177,6 +179,17 @@ public class DomainObjectReprRenderer extends ReprRendererAbstract<DomainObjectR
             // extensions
             getExtensions().mapPut("isService", isService);
             getExtensions().mapPut("isPersistent", objectAdapter.representsPersistent());
+            if(isService) {
+                final ObjectSpecification objectSpec = objectAdapter.getSpecification();
+                final DomainServiceLayoutFacet layoutFacet =
+                        objectSpec.getFacet(DomainServiceLayoutFacet.class);
+                if(layoutFacet != null) {
+                    final DomainServiceLayout.MenuBar menuBar = layoutFacet.getMenuBar();
+                    if(menuBar != null) {
+                        getExtensions().mapPut("menuBar", menuBar);
+                    }
+                }
+            }
         }
 
         return representation;


Mime
View raw message