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/01/08 23:28:29 UTC
[44/52] [abbrv] [partial] isis-site git commit: republishes,
updating content and creates new SNAPSHOT
http://git-wip-us.apache.org/repos/asf/isis-site/blob/9d921a51/content/guides/dg/resources/appendices/dev-env/intellij/isis-settings-live-templates.jar
----------------------------------------------------------------------
diff --git a/content/guides/dg/resources/appendices/dev-env/intellij/isis-settings-live-templates.jar b/content/guides/dg/resources/appendices/dev-env/intellij/isis-settings-live-templates.jar
deleted file mode 100644
index 69ff3e4..0000000
Binary files a/content/guides/dg/resources/appendices/dev-env/intellij/isis-settings-live-templates.jar and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis-site/blob/9d921a51/content/guides/dg/resources/appendices/dev-env/intellij/other/dan-settings-keymaps.jar
----------------------------------------------------------------------
diff --git a/content/guides/dg/resources/appendices/dev-env/intellij/other/dan-settings-keymaps.jar b/content/guides/dg/resources/appendices/dev-env/intellij/other/dan-settings-keymaps.jar
deleted file mode 100644
index 75d09be..0000000
Binary files a/content/guides/dg/resources/appendices/dev-env/intellij/other/dan-settings-keymaps.jar and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis-site/blob/9d921a51/content/guides/dg/resources/appendices/dev-env/intellij/other/dan-settings-uisettings.jar
----------------------------------------------------------------------
diff --git a/content/guides/dg/resources/appendices/dev-env/intellij/other/dan-settings-uisettings.jar b/content/guides/dg/resources/appendices/dev-env/intellij/other/dan-settings-uisettings.jar
deleted file mode 100644
index 0787a69..0000000
Binary files a/content/guides/dg/resources/appendices/dev-env/intellij/other/dan-settings-uisettings.jar and /dev/null differ
http://git-wip-us.apache.org/repos/asf/isis-site/blob/9d921a51/content/guides/dg/resources/eclipse/isis.importorder
----------------------------------------------------------------------
diff --git a/content/guides/dg/resources/eclipse/isis.importorder b/content/guides/dg/resources/eclipse/isis.importorder
index 8603f7f..2708228 100644
--- a/content/guides/dg/resources/eclipse/isis.importorder
+++ b/content/guides/dg/resources/eclipse/isis.importorder
@@ -1,7 +1,7 @@
-#Organize Import Order
-#Wed Dec 15 15:36:51 GMT 2010
-0=java
-1=javax
-2=com
-3=org
-4=org.apache.isis
+#Organize Import Order
+#Wed Dec 15 15:36:51 GMT 2010
+0=java
+1=javax
+2=com
+3=org
+4=org.apache.isis
http://git-wip-us.apache.org/repos/asf/isis-site/blob/9d921a51/content/guides/htg.html
----------------------------------------------------------------------
diff --git a/content/guides/htg.html b/content/guides/htg.html
index ba8aaec..cff02f1 100644
--- a/content/guides/htg.html
+++ b/content/guides/htg.html
@@ -179,6 +179,7 @@ table.CodeRay td.code>pre{padding:0}
<li><a href="../../guides/ugfun/ugfun.html">Fundamentals</a></li>
<li><a href="../../guides/ugvw/ugvw.html">Wicket Viewer</a></li>
<li><a href="../../guides/ugvro/ugvro.html">Restful Objects Viewer</a></li>
+ <li><a href="../../guides/ugodn/ugodn.html">DataNucleus Object Store</a></li>
<li><a href="../../guides/ugsec/ugsec.html">Security</a></li>
<li><a href="../../guides/ugtst/ugtst.html">Testing</a></li>
<li><a href="../../guides/ugbtb/ugbtb.html">Beyond the Basics</a></li>
@@ -196,25 +197,32 @@ table.CodeRay td.code>pre{padding:0}
</ul> </li>
<li class="dropdown hidden-sm hidden-md"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Downloads<span class="caret"></span></a>
<ul class="dropdown-menu">
- <li><a href="../../downloads.html">Downloads</a></li>
- <li><a href="../../release-notes/release-notes.html">Release Notes</a></li>
- <li><a href="../../migration-notes/migration-notes.html">Migration Notes</a></li>
- <li role="separator" class="divider"></li>
<li class="dropdown-header">Maven archetypes</li>
<li><a href="../../guides/ugfun/ugfun.html#_ugfun_getting-started_helloworld-archetype">helloworld</a></li>
<li><a href="../../guides/ugfun/ugfun.html#_ugfun_getting-started_simpleapp-archetype">simpleapp</a></li>
<li role="separator" class="divider"></li>
- <li><a href="https://issues.apache.org/jira/browse/ISIS">ASF JIRA</a></li>
+ <li><a href="../../downloads.html">Downloads</a></li>
+ <li><a href="../../release-notes/release-notes.html">Release Notes</a></li>
+ <li><a href="../../migration-notes/migration-notes.html">Migration Notes</a></li>
+ <li role="separator" class="divider"></li>
<li><a href="https://github.com/apache/isis">Github mirror</a></li>
</ul> </li>
<li class="dropdown hidden-sm"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Support<span class="caret"></span></a>
<ul class="dropdown-menu">
- <li><a href="../../support.html">Mailing lists</a></li>
+ <li class="dropdown-header">Guides</li>
+ <li><a href="../../guides/dg/dg.html">Developers' Guide</a></li>
+ <li><a href="../../guides/cgcom/cgcom.html">Committers' Guide</a></li>
+ <li><a href="../../guides/htg.html">Hints-n-Tips Guide</a></li>
+ <li role="separator" class="divider"></li>
+ <li class="dropdown-header">Mailing Lists</li>
+ <li><a href="../../support.html">How to subscribe</a></li>
<li><a href="https://lists.apache.org/list.html?users@isis.apache.org">Archives (ASF Pony mail)</a></li>
<li><a href="http://isis.markmail.org/search/?q=">Archives (Markmail)</a></li>
+ <li role="separator" class="divider"></li>
+ <li class="dropdown-header">Other Resources</li>
+ <li><a href="https://issues.apache.org/jira/browse/ISIS">ASF JIRA</a></li>
<li><a href="http://stackoverflow.com/questions/tagged/isis">Stack Overflow</a></li>
- <li><a href="../../guides/dg/dg.html">How to contribute</a></li>
- <li><a href="../../help.html">Other resources</a></li>
+ <li><a href="../../help.html">Wiki, Fisheye etc.</a></li>
</ul> </li>
<li class="dropdown hidden-sm hidden-md"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">@ASF<span class="caret"></span></a>
<ul class="dropdown-menu">
@@ -1101,23 +1109,135 @@ table.CodeRay td.code>pre{padding:0}
</ul>
</div>
<div class="paragraph">
- <p>The above FAQ was raised against <code>1.10.0</code>. As of <code>1.11.0</code> (due to <a href="https://issues.apache.org/jira/browse/ISIS-1093">ISIS-1093</a>) it <em>is</em> now possible to internationalize both the Wicket viewer’s labels as well as the regular translations of the domain object metadata using the <code>.po</code> translation files as supported by the <a href="../rgsvc/rgsvc.html#_rgsvc_presentation-layer-spi_TranslationService"><code>TranslationService</code></a>.</p>
+ <p>Yes, it <em>is</em> possible to internationalize both the Wicket viewer’s labels as well as the regular translations of the domain object metadata using the <code>.po</code> translation files as supported by the <a href="../rgsvc/rgsvc.html#_rgsvc_presentation-layer-spi_TranslationService"><code>TranslationService</code></a>.</p>
</div>
<div class="paragraph">
<p>Full details of the <code>msgId</code>s that must be added to the <code>translations.po</code> file can be found in <a href="../ugbtb/ugbtb.html#__ugbtb_i18n_wicket-viewer">i18n</a> section of the <a href="../ugbtb/ugbtb.html">beyond the basics</a> guide.</p>
</div>
+ </div>
+ <div class="sect2">
+ <h3 id="_ugvw_hints-and-tips_highlight-current-row">2.3. Highlight Current Row</h3>
<div class="paragraph">
- <p>In prior releases (<code>1.10.0</code> and earlier) it was necessary to use <a href="https://ci.apache.org/projects/wicket/guide/6.x/guide/i18n.html#i18n_3">Wicket’s internationalization support</a>, namely resource bundles. This is still supported (as a fallback):</p>
+ <p>Demo App: Highlighting Current As a by-the-by, the demo app has one further "trick up its sleeve". If you run the app you’ll notice that the currently selected <code>DemoObject</code> is highlighted in the left-hand table of the <code>HomePageViewModel</code>.</p>
</div>
- <div class="ulist">
- <ul>
- <li> <p>create a directory structure inside the webapp resource folder following that pattern <code>org.apache.isis.viewer.wicket.ui.components.actions</code></p> </li>
- <li> <p>Inside there create an equivalent <code>ActionParametersFormPanel_xx_XX.properties</code> or <code>ActionParametersFormPanel_xx.properties</code> file for the various locales that you want to support (eg <code>ActionParametersFormPanel_en_UK.properties</code>, <code>ActionParametersFormPanel_en_US.properties</code>, <code>ActionParametersFormPanel_de.properties</code> and so on).</p> </li>
- </ul>
+ <div class="paragraph">
+ <p>This is accomplished by having the view model collaborate with a subscribing domain service that configures a CSS class.</p>
+ </div>
+ <div class="paragraph">
+ <p>We start by ensuring that the <code>DemoObject</code> emits an event for its CSS class:</p>
+ </div>
+ <div class="listingblock">
+ <div class="title">
+ DemoObject.java
+ </div>
+ <div class="content">
+ <pre class="CodeRay highlight"><code data-lang="java"><span class="annotation">@DomainObjectLayout</span>(
+...
+cssClassUiEvent = DemoObject.CssClassUiEvent.class
+)
+<span class="directive">public</span> <span class="type">class</span> <span class="class">DemoObject</span> ... {
+
+<span class="directive">public</span> <span class="directive">static</span> <span class="type">class</span> <span class="class">CssClassUiEvent</span>
+<span class="directive">extends</span> org.apache.isis.applib.services.eventbus.CssClassUiEvent<DemoObject> {}
+...
+}</code></pre>
+ </div>
+ </div>
+ <div class="paragraph">
+ <p>Next, we define the domain service to act as the subscriber:</p>
+ </div>
+ <div class="listingblock">
+ <div class="title">
+ HomePageViewModel.java
+ </div>
+ <div class="content">
+ <pre class="CodeRay highlight"><code data-lang="java"><span class="directive">public</span> <span class="type">class</span> <span class="class">HomePageViewModel</span> ... {
+ <span class="annotation">@DomainService</span>(nature = NatureOfService.DOMAIN)
+ <span class="directive">public</span> <span class="directive">static</span> <span class="type">class</span> <span class="class">CssHighlighter</span> <span class="directive">extends</span> AbstractSubscriber {
+ <span class="annotation">@EventHandler</span>
+ <span class="annotation">@Subscribe</span>
+ <span class="directive">public</span> <span class="type">void</span> on(DemoObject.CssClassUiEvent ev) {
+ <span class="keyword">if</span>(getContext() == <span class="predefined-constant">null</span>) { <span class="keyword">return</span>; }
+ <span class="keyword">if</span>(ev.getSource() == getContext().getSelected()) { <i class="conum" data-value="1"></i><b>(1)</b>
+ ev.setCssClass(<span class="string"><span class="delimiter">"</span><span class="content">selected</span><span class="delimiter">"</span></span>);
+ }
+ }
+ <span class="directive">private</span> HomePageViewModel getContext() { <i class="conum" data-value="2"></i><b>(2)</b>
+ <span class="keyword">return</span> (HomePageViewModel) scratchpad.get(<span class="string"><span class="delimiter">"</span><span class="content">context</span><span class="delimiter">"</span></span>);
+ }
+ <span class="type">void</span> setContext(<span class="directive">final</span> HomePageViewModel homePageViewModel) {
+ scratchpad.put(<span class="string"><span class="delimiter">"</span><span class="content">context</span><span class="delimiter">"</span></span>, homePageViewModel);
+ }
+ <span class="annotation">@Inject</span>
+ Scratchpad scratchpad; <i class="conum" data-value="3"></i><b>(3)</b>
+ }
+}</code></pre>
+ </div>
+ </div>
+ <div class="colist arabic">
+ <table>
+ <tbody>
+ <tr>
+ <td><i class="conum" data-value="1"></i><b>1</b></td>
+ <td>If the domain object is the currently selected then set the CSS class</td>
+ </tr>
+ <tr>
+ <td><i class="conum" data-value="2"></i><b>2</b></td>
+ <td>Provide methods to set and get the current <code>HomePageViewModel</code> (acting as the context)</td>
+ </tr>
+ <tr>
+ <td><i class="conum" data-value="3"></i><b>3</b></td>
+ <td>Store the context using the <code>Scratchpad</code> domain service (request-scoped so thread-safe).</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="paragraph">
+ <p>The <code>HomePageViewModel</code> is responsible for setting itself as the context for the domain service:</p>
+ </div>
+ <div class="listingblock">
+ <div class="title">
+ HomePageViewModel.java
+ </div>
+ <div class="content">
+ <pre class="CodeRay highlight"><code data-lang="java"><span class="directive">public</span> <span class="type">class</span> <span class="class">HomePageViewModel</span> ... {
+ ...
+ public TranslatableString title() {
+ cssHighlighter.setContext(<span class="local-variable">this</span>); <i class="conum" data-value="1"></i><b>(1)</b>
+ ...
+ }
+ ...
+ <span class="annotation">@javax</span>.inject.Inject
+ CssHighlighter cssHighlighter;
+}</code></pre>
+ </div>
+ </div>
+ <div class="colist arabic">
+ <table>
+ <tbody>
+ <tr>
+ <td><i class="conum" data-value="1"></i><b>1</b></td>
+ <td>set the context on the domain service</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="paragraph">
+ <p>Finally we just need some CSS, in the <code>application.css</code> file:</p>
+ </div>
+ <div class="listingblock">
+ <div class="title">
+ application.css
+ </div>
+ <div class="content">
+ <pre class="CodeRay highlight"><code data-lang="css"><span class="class">.selected</span> {
+ <span class="key">font-style</span>: <span class="value">italic</span>; <span class="key">font-weight</span>: <span class="value">bolder</span>;
+}</code></pre>
+ </div>
</div>
</div>
<div class="sect2">
- <h3 id="_ugvw_hints-and-tips_svg-support">2.3. SVG Support</h3>
+ <h3 id="_ugvw_hints-and-tips_svg-support">2.4. SVG Support</h3>
<div class="paragraph">
<p>(As per <a href="https://issues.apache.org/jira/browse/ISIS-1604">ISIS-1604</a>), SVG images can be used:</p>
</div>
@@ -1287,6 +1407,80 @@ findCustomer.get({<span class="key">queryString</span>: JSON.stringify(findCusto
<p>To use, split the parts then format the mime type and base64 data correctly before using as source in an <code><img></code> tag.</p>
</div>
</div>
+ <div class="sect2">
+ <h3 id="_ugvro_hints-and-tips_view-model-as-parameter">3.5. View Model as Parameter</h3>
+ <div class="paragraph">
+ <p>As discussed <a href="https://lists.apache.org/thread.html/cbd18320bbf6e5c5e767283f9e675cf56e7f4692c109e1e79dbaa90a@%3Cusers.isis.apache.org%3E">on the mailing list</a>.</p>
+ </div>
+ <div class="sect3">
+ <h4 id="_query">3.5.1. Query</h4>
+ <div class="paragraph">
+ <p>I must provide a REST service accepting more complex view model as input parameter.</p>
+ </div>
+ <div class="paragraph">
+ <p>My view model parameter would look like</p>
+ </div>
+ <div class="listingblock">
+ <div class="content">
+ <pre class="CodeRay highlight"><code data-lang="java"><span class="annotation">@DomainObject</span>(
+ nature = Nature.VIEW_MODEL,
+ objectType = <span class="string"><span class="delimiter">"</span><span class="content">OfferTemplateFilter</span><span class="delimiter">"</span></span>
+)
+<span class="annotation">@XmlRootElement</span>(name = <span class="string"><span class="delimiter">"</span><span class="content">OfferTemplateFilter</span><span class="delimiter">"</span></span>)
+<span class="annotation">@XmlAccessorType</span>(XmlAccessType.FIELD)
+<span class="annotation">@Getter</span> <span class="annotation">@Setter</span>
+<span class="directive">public</span> <span class="type">class</span> <span class="class">OfferTemplateFilter</span> {
+ <span class="directive">public</span> <span class="predefined-type">List</span><<span class="predefined-type">String</span>> selectedDeviceManufacturer = <span class="keyword">new</span> <span class="predefined-type">ArrayList</span><>();
+ <span class="directive">public</span> <span class="predefined-type">List</span><<span class="predefined-type">String</span>> selectedDeviceSizes = <span class="keyword">new</span> <span class="predefined-type">ArrayList</span><>();
+}</code></pre>
+ </div>
+ </div>
+ <div class="paragraph">
+ <p>My REST domain service would be someting like</p>
+ </div>
+ <div class="listingblock">
+ <div class="content">
+ <pre class="CodeRay highlight"><code data-lang="java"><span class="annotation">@DomainService</span>(
+ nature = NatureOfService.VIEW_REST_ONLY,
+ objectType = <span class="string"><span class="delimiter">"</span><span class="content">OfferRestService</span><span class="delimiter">"</span></span>
+)
+<span class="directive">public</span> <span class="type">class</span> <span class="class">OfferRestService</span> {
+
+ <span class="annotation">@Action</span>(semantics = SemanticsOf.IDEMPOTENT)
+ <span class="directive">public</span> OfferTemplateSelectorForCustomer
+ offerSelectorForCustomer(
+ <span class="directive">final</span> <span class="predefined-type">String</span> subscriberNumber,
+ <span class="directive">final</span> OfferTemplateFilter filter) {
+ <span class="keyword">return</span> offerSelectorRepository.create(subscriberNumber, filter);
+ }
+ ...
+}</code></pre>
+ </div>
+ </div>
+ <div class="paragraph">
+ <p>I’m wondering how this could be achieved without custom rest service. Ideally the service consumer would post a kind of JSON structure where my view model OfferTemplateFilter would be created?</p>
+ </div>
+ </div>
+ <div class="sect3">
+ <h4 id="_possible_answer">3.5.2. Possible Answer…</h4>
+ <div class="paragraph">
+ <p>Rather than try to "upload" the <code>OfferTemplateFilter</code> view model as a parameter, instead treat it as a resource.</p>
+ </div>
+ <div class="paragraph">
+ <p>That is:</p>
+ </div>
+ <div class="ulist">
+ <ul>
+ <li> <p>have a new service to create an instance of the filter, and then</p> </li>
+ <li> <p>update this filter (adding/removing from its two collections).</p> </li>
+ <li> <p>When done, pass a reference to the filter to the original REST service, as a regular reference.</p> </li>
+ </ul>
+ </div>
+ <div class="paragraph">
+ <p>Obviously the URL passed in the last step will be rather long and messy, but that’s not a problem per-se.</p>
+ </div>
+ </div>
+ </div>
</div>
</div>
<div class="sect1">
@@ -1328,7 +1522,7 @@ findCustomer.get({<span class="key">queryString</span>: JSON.stringify(findCusto
<p>The second approach (using an <code>.orm</code> file) is therefore often more useful than the first, because the metadata provided overrides rather than replaces the annotations (and annotations not overridden continue to be honoured).</p>
</div>
<div class="paragraph">
- <p>A typical use case is to change the database schema for an entity. For example, as of <code>1.9.0</code> the various (non-ASF) <a href="http://platform.incode.org" target="_blank">Incode Platform</a> modules use schemas for each entity. For example, the <code>AuditEntry</code> entity in the (non-ASF) <a href="http://platform.incode.org" target="_blank">Incode Platform</a>'s audit module is annotated as:</p>
+ <p>A typical use case is to change the database schema for an entity. For example, the various (non-ASF) <a href="http://platform.incode.org" target="_blank">Incode Platform</a> modules use schemas for each entity. For example, the <code>AuditEntry</code> entity in the (non-ASF) <a href="http://platform.incode.org" target="_blank">Incode Platform</a>'s audit module is annotated as:</p>
</div>
<div class="listingblock">
<div class="content">
@@ -1930,8 +2124,7 @@ securityManager.cacheManager = $memoryCacheManager</code></pre>
<div class="listingblock">
<div class="content">
<pre class="CodeRay highlight"><code data-lang="java"><span class="annotation">@DomainService</span>(
- nature = NatureOfService.DOMAIN,
- menuOrder = <span class="string"><span class="delimiter">"</span><span class="content">1</span><span class="delimiter">"</span></span> <i class="conum" data-value="1"></i><b>(1)</b>
+ nature = NatureOfService.DOMAIN
)
<span class="directive">public</span> <span class="type">class</span> <span class="class">MyLocaleProvider</span> <span class="directive">implements</span> LocaleProvider {
<span class="annotation">@Override</span>
@@ -1941,20 +2134,13 @@ securityManager.cacheManager = $memoryCacheManager</code></pre>
}</code></pre>
</div>
</div>
- <div class="colist arabic">
- <table>
- <tbody>
- <tr>
- <td><i class="conum" data-value="1"></i><b>1</b></td>
- <td>takes precedence over the default implementation.</td>
- </tr>
- </tbody>
- </table>
- </div>
<div class="paragraph">
<p>The framework uses the value of the <code>menuOrder</code> attribute to determine priority; lowest number wins.</p>
</div>
<div class="paragraph">
+ <p>However, there is no need to specify the <code>menuOrder</code> attribute: its default value is now set to a lower value (specifically: <code>Integer.MAX_VALUE - 100</code>) than all of the framework-provided implementations, and thus always takes precedence.</p>
+ </div>
+ <div class="paragraph">
<p>Thus, if a single instance is to be injected, eg:</p>
</div>
<div class="listingblock">
@@ -1978,20 +2164,6 @@ LocalProvider localeProvider;</code></pre>
<div class="paragraph">
<p>then all implementations will be present in the list, ordered by priority; your custom implementation will be first in the list.</p>
</div>
- <div class="paragraph">
- <p>(As of <code>1.15.0</code> onwards), there is no need to specify the <code>menuOrder</code> attribute: its default value is now set to a lower value (specifically: <code>Integer.MAX_VALUE - 100</code>). Thus, the code simplifies to:</p>
- </div>
- <div class="listingblock">
- <div class="content">
- <pre class="CodeRay highlight"><code data-lang="java"><span class="annotation">@DomainService</span>(nature = NatureOfService.DOMAIN)
-<span class="directive">public</span> <span class="type">class</span> <span class="class">MyLocaleProvider</span> <span class="directive">implements</span> LocaleProvider {
- <span class="annotation">@Override</span>
- <span class="directive">public</span> <span class="predefined-type">Locale</span> getLocale() {
- <span class="keyword">return</span> ...
- }
-}</code></pre>
- </div>
- </div>
<div class="admonitionblock note">
<table>
<tbody>
@@ -2215,7 +2387,7 @@ LocalProvider localeProvider;</code></pre>
</div>
</div>
<div class="paragraph">
- <p>Prior to 1.10.0 (when lifecycle events were introduced), this could also be be done by accessing the JDO API directly:</p>
+ <p>It is also possible to accomplish this by accessing the JDO API directly:</p>
</div>
<div class="listingblock">
<div class="content">