You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by bu...@apache.org on 2014/12/05 16:15:11 UTC

svn commit: r931547 - in /websites/staging/isis/trunk: cgi-bin/ content/ content/more-advanced-topics/How-to-suppress-contributions.html

Author: buildbot
Date: Fri Dec  5 15:15:10 2014
New Revision: 931547

Log:
Staging update by buildbot for isis

Modified:
    websites/staging/isis/trunk/cgi-bin/   (props changed)
    websites/staging/isis/trunk/content/   (props changed)
    websites/staging/isis/trunk/content/more-advanced-topics/How-to-suppress-contributions.html

Propchange: websites/staging/isis/trunk/cgi-bin/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Fri Dec  5 15:15:10 2014
@@ -1 +1 @@
-1643313
+1643320

Propchange: websites/staging/isis/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Fri Dec  5 15:15:10 2014
@@ -1 +1 @@
-1643313
+1643320

Modified: websites/staging/isis/trunk/content/more-advanced-topics/How-to-suppress-contributions.html
==============================================================================
--- websites/staging/isis/trunk/content/more-advanced-topics/How-to-suppress-contributions.html (original)
+++ websites/staging/isis/trunk/content/more-advanced-topics/How-to-suppress-contributions.html Fri Dec  5 15:15:10 2014
@@ -489,28 +489,56 @@ includes an example showing how this can
         for (Preference preference : preferences1) { ... }
 </pre>
 
-<p>However, although <code>addPreference(...)</code> and <code>removePreference(...)</code> <em>are</em> contributed to both <code>Person</code> and <code>FoodStuff</code>, this can be hidden using the <code>.layout.json</code> file.  Thus, in <a href="https://github.com/isisaddons/isis-app-kitchensink/tree/d4fd4e8b799af42c343b7e451bbf6f5d218869a1/dom/src/main/java/org/isisaddons/app/kitchensink/dom/contrib/contributee/FoodStuff.layout.json#L57-57">FoodStuff,layout.json</a> we have:</p>
+<p>While <code>addPreference(...)</code> and <code>removePreference(...)</code> are contributed to both <code>Person</code> and <code>FoodStuff</code>, each customizes the representation of those action (and in the case of <code>FoodStuff</code>, hides one of them completely).</p>
 
-<pre><code>"actions": {
-  ...
-  "removePreference": {
-    "actionLayout": {
-      "cssClass": "btn-warn",
-      "hidden": "EVERYWHERE"
+<p>For the <code>Person</code> entity, the actions are associated with the (contributed) <code>likes</code> collection:</p>
+
+<p><img src="images/suppressing-contributions-person.png" width="800px"/></p>
+
+<p>which is accomplished using this [fragment](https://github.com/isisaddons/isis-app-kitchensink/blob/d4fd4e8b799af42c343b7e451bbf6f5d218869a1/dom/src/main/java/org/isisaddons/app/kitchensink/dom/contrib/contributee/Person.layout.json#L44-L61
+) in the <code>Person.layout.json</code> file:</p>
+
+<pre><code>"collections": {
+  "likes": {
+    "collectionLayout": {
+      "render": "EAGERLY"
+    },
+    "actions": {
+      "addPreference": {
+        "actionLayout": {
+          "named": "Add"
+        }
+      },
+      "removePreference": {
+        "actionLayout": {
+          "named": "Remove"
+        }
+      }
     }
   }
 }
 </code></pre>
 
-<p>which means that the "removePreference" action cannot be seen when viewing a FoodStuff entity.</p>
-
-<p>You can see this in the screenshots below; <code>Person</code> has both actions:</p>
+<p>For the <code>FoodStuff</code> entity meanwhile, only the <code>addPreference</code> action is made available:</p>
 
-<p><img src="images/suppressing-contributions-person.png" width="800px"/></p>
+<p><img src="images/suppressing-contributions-foodstuff.png" width="800px"/></p>
 
-<p>while <code>FoodStuff</code> has only one:</p>
+<p>which is accomplished using this <a href="https://github.com/isisaddons/isis-app-kitchensink/blob/d4fd4e8b799af42c343b7e451bbf6f5d218869a1/dom/src/main/java/org/isisaddons/app/kitchensink/dom/contrib/contributee/FoodStuff.layout.json#L48-L59">fragment</a> in the <code>FoodStuff.layout.json</code> file: we have:</p>
 
-<p><img src="images/suppressing-contributions-foodstuff.png" width="800px"/></p>
+<pre><code>"actions": {
+  "addPreference": {
+    "actionLayout": {
+      "cssClass": "btn-success"
+    }
+  },
+  "removePreference": {
+    "actionLayout": {
+      "cssClass": "btn-warn",
+      "hidden": "EVERYWHERE" /* contributed action is hidden on one of its contributees */
+    }
+  }
+}
+</code></pre>