deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r914998 - in /websites/staging/deltaspike/trunk/content: ./ jsf.html
Date Fri, 04 Jul 2014 13:23:21 GMT
Author: buildbot
Date: Fri Jul  4 13:23:21 2014
New Revision: 914998

Log:
Staging update by buildbot for deltaspike

Modified:
    websites/staging/deltaspike/trunk/content/   (props changed)
    websites/staging/deltaspike/trunk/content/jsf.html

Propchange: websites/staging/deltaspike/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Fri Jul  4 13:23:21 2014
@@ -1 +1 @@
-1605909
+1607848

Modified: websites/staging/deltaspike/trunk/content/jsf.html
==============================================================================
--- websites/staging/deltaspike/trunk/content/jsf.html (original)
+++ websites/staging/deltaspike/trunk/content/jsf.html Fri Jul  4 13:23:21 2014
@@ -155,6 +155,7 @@
 </li>
 <li><a href="#advanced-api-usages">Advanced API usages</a><ul>
 <li><a href="#creating-custom-meta-data-via-viewmetadata">Creating Custom Meta-Data
via @ViewMetaData</a></li>
+<li><a href="#creating-custom-meta-data-via-viewmetadata-and-stereotype">Creating
Custom Meta-Data via @ViewMetaData and @Stereotype</a></li>
 <li><a href="#creating-custom-callbacks-via-viewmetadata">Creating Custom Callbacks
via @ViewMetaData</a></li>
 <li><a href="#creating-custom-inline-meta-data-via-inlineviewmetadata">Creating
Custom inline Meta-Data via @InlineViewMetaData</a></li>
 </ul>
@@ -1032,6 +1033,22 @@ Furthermore, it's also possible to use i
 </pre></div>
 
 
+<h3 id="creating-custom-meta-data-via-viewmetadata-and-stereotype">Creating Custom
Meta-Data via @ViewMetaData and @Stereotype</h3>
+<p>Like with CDI itself you can encapsulate multiple view meta-data annotation in one
annotation.</p>
+<p>e.g.:</p>
+<div class="codehilite"><pre><span class="nd">@Target</span><span
class="o">({</span><span class="n">TYPE</span><span class="o">})</span>
+<span class="nd">@Retention</span><span class="o">(</span><span
class="n">RUNTIME</span><span class="o">)</span>
+
+<span class="nd">@Stereotype</span>
+<span class="nd">@Secured</span><span class="o">(</span><span
class="n">CustomAccessDecisionVoter</span><span class="o">.</span><span
class="na">class</span><span class="o">)</span> <span class="c1">//view
meta-data #1</span>
+<span class="nd">@View</span><span class="o">(</span><span class="n">navigation</span>
<span class="o">=</span> <span class="n">REDIRECT</span><span class="o">)</span>
<span class="c1">//view meta-data #2</span>
+<span class="nd">@interface</span> <span class="n">MySecuredView</span>
<span class="o">{}</span>
+</pre></div>
+
+
+<p>Instead of using the same combination of annotations in multiple places, you can
use the stereotype annotation.
+If you query the meta-data at runtime (see <code>ViewConfigDescriptor#getMetaData</code>),
you can access <code>@Secured</code> as well as <code>@View</code>
(in the example above). however, you won't see <code>@MySecuredView</code> itself
at runtime, because stereotype annotations are per default transparent.</p>
+<p>Since v1.0.1+ it's possible to access such stereotype annotations as well, once
you annotate them with <code>@ViewMetaData</code>.</p>
 <h3 id="creating-custom-callbacks-via-viewmetadata">Creating Custom Callbacks via @ViewMetaData</h3>
 <p>Via a custom ConfigPreProcessor it's possible to register custom callbacks dynamically.
 The following listing shows a view-config which adds a simple callback including the corresponding
<code>ConfigPreProcessor</code> and <code>ExecutableCallbackDescriptor</code>.</p>



Mime
View raw message