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/05/24 07:56:44 UTC

svn commit: r909777 - in /websites/staging/isis/trunk: cgi-bin/ content/ content/components/objectstores/jdo/ content/components/objectstores/jdo/services/ content/intro/getting-started/ content/other/

Author: buildbot
Date: Sat May 24 05:56:43 2014
New Revision: 909777

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/components/objectstores/jdo/IsisConfigurationForJdoIntegTests.html
    websites/staging/isis/trunk/content/components/objectstores/jdo/mapping-blobs.html
    websites/staging/isis/trunk/content/components/objectstores/jdo/services/publishing-service-jdo.html
    websites/staging/isis/trunk/content/documentation.html
    websites/staging/isis/trunk/content/intro/getting-started/quickstart-archetype.html
    websites/staging/isis/trunk/content/intro/getting-started/simple-archetype.html
    websites/staging/isis/trunk/content/other/jrebel.html

Propchange: websites/staging/isis/trunk/cgi-bin/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Sat May 24 05:56:43 2014
@@ -1 +1 @@
-1592509
+1597244

Propchange: websites/staging/isis/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Sat May 24 05:56:43 2014
@@ -1 +1 @@
-1592509
+1597244

Modified: websites/staging/isis/trunk/content/components/objectstores/jdo/IsisConfigurationForJdoIntegTests.html
==============================================================================
--- websites/staging/isis/trunk/content/components/objectstores/jdo/IsisConfigurationForJdoIntegTests.html (original)
+++ websites/staging/isis/trunk/content/components/objectstores/jdo/IsisConfigurationForJdoIntegTests.html Sat May 24 05:56:43 2014
@@ -3,7 +3,7 @@
   <head>
 
     <meta charset="utf-8">
-      <title>`IsisConfigurationForJdoIntegTests` (1.4.2-snapshot)</title>
+      <title>`IsisConfigurationForJdoIntegTests` (1.5.0-snapshot)</title>
     <meta name="description" content="">
     <meta name="author" content="">
 
@@ -223,7 +223,7 @@
       };
       function twshare () {
           window.open(
-                  "https://twitter.com/intent/tweet?url="+document.URL+"&text=`IsisConfigurationForJdoIntegTests` (1.4.2-snapshot)",
+                  "https://twitter.com/intent/tweet?url="+document.URL+"&text=`IsisConfigurationForJdoIntegTests` (1.5.0-snapshot)",
                   'Share on Twitter',
                   'width=800,height=526');
       };
@@ -327,7 +327,7 @@
 
 <div class="page-header">
 <p><a href="./../../../documentation.html">Docs</a>&nbsp;&raquo&nbsp;<a href="./../../../components/about.html">Components</a>&nbsp;&raquo&nbsp;<a href="./../../../components/objectstores/about.html">Objectstores</a>&nbsp;&raquo&nbsp;<a href="./../../../components/objectstores/jdo/about.html">Jdo</a></p>
-<h1>`IsisConfigurationForJdoIntegTests` (1.4.2-snapshot)
+<h1>`IsisConfigurationForJdoIntegTests` (1.5.0-snapshot)
 
 </h1>
 </div>

Modified: websites/staging/isis/trunk/content/components/objectstores/jdo/mapping-blobs.html
==============================================================================
--- websites/staging/isis/trunk/content/components/objectstores/jdo/mapping-blobs.html (original)
+++ websites/staging/isis/trunk/content/components/objectstores/jdo/mapping-blobs.html Sat May 24 05:56:43 2014
@@ -3,7 +3,7 @@
   <head>
 
     <meta charset="utf-8">
-      <title>Mapping Blobs</title>
+      <title>Mapping Blobs (and Clobs)</title>
     <meta name="description" content="">
     <meta name="author" content="">
 
@@ -223,7 +223,7 @@
       };
       function twshare () {
           window.open(
-                  "https://twitter.com/intent/tweet?url="+document.URL+"&text=Mapping Blobs",
+                  "https://twitter.com/intent/tweet?url="+document.URL+"&text=Mapping Blobs (and Clobs)",
                   'Share on Twitter',
                   'width=800,height=526');
       };
@@ -327,24 +327,30 @@
 
 <div class="page-header">
 <p><a href="./../../../documentation.html">Docs</a>&nbsp;&raquo&nbsp;<a href="./../../../components/about.html">Components</a>&nbsp;&raquo&nbsp;<a href="./../../../components/objectstores/about.html">Objectstores</a>&nbsp;&raquo&nbsp;<a href="./../../../components/objectstores/jdo/about.html">Jdo</a></p>
-<h1>Mapping Blobs
+<h1>Mapping Blobs (and Clobs)
 
 </h1>
 </div>
 
+<blockquote>
+  <p><em>Note:</em> prior to 1.5.0-snapshot, the Isis mapping for <code>Blob</code>s and <code>Clob</code>s is broken (the mapping classes are not correctly registered with DataNucleus), and so the <code>Blob</code> or <code>Clob</code> are stored as a serialized Java object... not ideal.</p>
+</blockquote>
+
 <p>Isis configures JDO/DataNucleus so that the properties of type <code>org.apache.isis.applib.value.Blob</code> and <code>org.apache.isis.applib.value.Clob</code> can also be persisted.</p>
 
 <p>As for <a href="mapping-joda-dates.html">Joda dates</a>, this requires the <code>@javax.jdo.annotations.Persistent</code> annotation.  However, whereas for dates one would always expect this value to be retrieved eagerly, for blobs and clobs it is not so clear cut.</p>
 
-<p>For example, in the <code>ToDoItem</code> (in the <a href="../../../getting-started/quickstart-archetype.html">wicket/restful/jdo archetype</a>) the <code>attachment</code> property is as follows:</p>
+<p>For example, in the <code>ToDoItem</code> class (of the <a href="../../../getting-started/quickstart-archetype.html">quickstart archetype</a>) the <code>attachment</code> property (as of 1.5.0-snapshot) is as follows:</p>
 
 <pre>
-  @javax.jdo.annotations.Persistent(defaultFetchGroup="false")
+  @javax.jdo.annotations.Persistent(defaultFetchGroup="false", columns = {
+      @javax.jdo.annotations.Column(name = "attachment_name"),
+      @javax.jdo.annotations.Column(name = "attachment_mimetype"),
+      @javax.jdo.annotations.Column(name = "attachment_bytes", sqlType = "BLOB")
+  })
   private Blob attachment;
 
   @Optional
-  @MemberOrder(name="Detail", sequence = "7")
-  @Hidden(where=Where.STANDALONE_TABLES)
   public Blob getAttachment() {
     return attachment;
   }
@@ -353,7 +359,50 @@
   }
 </pre>
 
-<p>Here we can see that the property is hidden in standalone tables, and so there's no need to retrieve it eagerly.  The converse of this the object is rendered by itself, then the attachment property will be retrieved as a one separate query; this seems like a reasonable compromise.</p>
+<p>The three <code>@javax.jdo.annotations.Column</code> annotations are required because the mapping classes that Isis provides (<a href="https://github.com/apache/isis/blob/isis-1.4.0/component/objectstore/jdo/jdo-datanucleus/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/valuetypes/IsisBlobMapping.java#L59">IsisBlobMapping</a> and <a href="https://github.com/apache/isis/blob/isis-1.4.0/component/objectstore/jdo/jdo-datanucleus/src/main/java/org/apache/isis/objectstore/jdo/datanucleus/valuetypes/IsisClobMapping.java#L59">IsisClobMapping</a>) map to 3 columns.  (It is not an error to omit these <code>@Column</code> annotations, but without them the names of the table columns are simply suffixed <code>_0</code>, <code>_1</code>, <code>_2</code> etc.</p>
+
+<p>If the <code>Blob</code> or <code>Clob</code> is mandatory, then use:</p>
+
+<pre>
+  @javax.jdo.annotations.Persistent(defaultFetchGroup="false", columns = {
+      @javax.jdo.annotations.Column(name = "attachment_name", allowsNull="false"),
+      @javax.jdo.annotations.Column(name = "attachment_mimetype", allowsNull="false"),
+      @javax.jdo.annotations.Column(name = "attachment_bytes", sqlType = "BLOB", allowsNull="false")
+  })
+  private Blob attachment;
+
+  @Mandatory
+  public Blob getAttachment() {
+    return attachment;
+  }
+  public void setAttachment(final Blob attachment) {
+    this.attachment = attachment;
+  }
+</pre>
+
+<blockquote>
+  <p>Instead of <code>@Mandatory</code>, using <code>@javax.jdo.annotations.Column(allowsNull="false")</code> will also work.  However, as this last <code>@Column</code> annotation is only for Isis' benefit (DataNucleus ignores it in the presence of the <code>Persistent#columns</code> attribute) we prefer to use <code>@Mandatory</code> instead.</p>
+</blockquote>
+
+<p>Using the <code>@Column</code> annotation, you can also specify whether the <code>Blob</code> is mapped to a <code>VARBINARY</code> rather than a <code>BLOB</code> column:</p>
+
+<pre>
+      @javax.jdo.annotations.Column(name = "attachment_bytes", sqlType = "VARBINARY", length=2048)
+</pre>
+
+<p>The maximum allowed length for a <code>VARBINARY</code> will vary by database vendor.  Obviously, only do this if you are sure that the data to be mapped fits into the smaller size.  </p>
+
+<p>Mapping <code>Clob</code>s works the exact same way, but the <code>@Column#sqlType</code> attribute will either be <code>CLOB</code></p>
+
+<pre>
+      @javax.jdo.annotations.Column(name = "attachment_chars", sqlType = "CLOB")
+</pre>
+
+<p>or <code>VARCHAR</code>, </p>
+
+<pre>
+      @javax.jdo.annotations.Column(name = "attachment_chars", sqlType = "VARCHAR", length=2048)
+</pre>
 
 
 

Modified: websites/staging/isis/trunk/content/components/objectstores/jdo/services/publishing-service-jdo.html
==============================================================================
--- websites/staging/isis/trunk/content/components/objectstores/jdo/services/publishing-service-jdo.html (original)
+++ websites/staging/isis/trunk/content/components/objectstores/jdo/services/publishing-service-jdo.html Sat May 24 05:56:43 2014
@@ -340,7 +340,7 @@
 
 <p>Although a polling architecture introduces some overhead, it avoids the complexity of XA/JTA transactions which would otherwise be needed to ensure that events are only published atomically with committed changes to the database.</p>
 
-<h2>Configuration [1.4.2-snapshot]</h2>
+<h2>Configuration [1.5.0-snapshot]</h2>
 
 <p>The <code>PublishedEvent</code> entity can either persist the serialized form of the event as a zipped byte array or as a CLOB.  Which is used is determined by a configuration setting (typically stored in <code>persistor_datanucleus.properties</code>, but <code>isis.properties</code> can also be used):</p>
 

Modified: websites/staging/isis/trunk/content/documentation.html
==============================================================================
--- websites/staging/isis/trunk/content/documentation.html (original)
+++ websites/staging/isis/trunk/content/documentation.html Sat May 24 05:56:43 2014
@@ -888,7 +888,7 @@
 <li><a href="components/objectstores/jdo/using-jndi-datasource.html">Using a JNDI Datasource</a></li>
 <li><a href="components/objectstores/jdo/enabling-logging.html">Enabling Logging</a></li>
 <li><a href="components/objectstores/jdo/deploying-on-the-google-app-engine.html">Deploying on the Google App Engine</a></li>
-<li><a href="components/objectstores/jdo/IsisConfigurationForJdoIntegTests.html"><code>IsisConfigurationForJdoIntegTests</code></a> (1.4.2-snapshot)
+<li><a href="components/objectstores/jdo/IsisConfigurationForJdoIntegTests.html"><code>IsisConfigurationForJdoIntegTests</code></a> (1.5.0-snapshot)
 </div>
 <div class="col-md-4"></li>
 </ul>

Modified: websites/staging/isis/trunk/content/intro/getting-started/quickstart-archetype.html
==============================================================================
--- websites/staging/isis/trunk/content/intro/getting-started/quickstart-archetype.html (original)
+++ websites/staging/isis/trunk/content/intro/getting-started/quickstart-archetype.html Sat May 24 05:56:43 2014
@@ -409,7 +409,7 @@ mvn clean install
 </code></pre>
 
 <blockquote>
-  <p>in 1.4.2-snapshot this is changing to: mvn -P self-host antrun:run</p>
+  <p>in 1.5.0-snapshot this is changing to: mvn -P self-host antrun:run</p>
 </blockquote>
 
 <p>The first is to simply deploying the generated WAR (<code>webapp/target/myapp-webapp-1.0-SNAPSHOT.war</code>) to a servlet container.</p>

Modified: websites/staging/isis/trunk/content/intro/getting-started/simple-archetype.html
==============================================================================
--- websites/staging/isis/trunk/content/intro/getting-started/simple-archetype.html (original)
+++ websites/staging/isis/trunk/content/intro/getting-started/simple-archetype.html Sat May 24 05:56:43 2014
@@ -390,7 +390,7 @@ mvn clean install
 </code></pre>
 
 <blockquote>
-  <p>in 1.4.2-snapshot this is changing to: mvn -P self-host antrun:run</p>
+  <p>in 1.5.0-snapshot this is changing to: mvn -P self-host antrun:run</p>
 </blockquote>
 
 <p>The first is to simply deploying the generated WAR (<code>webapp/target/myapp-webapp-1.0-SNAPSHOT.war</code>) to a servlet container.</p>

Modified: websites/staging/isis/trunk/content/other/jrebel.html
==============================================================================
--- websites/staging/isis/trunk/content/other/jrebel.html (original)
+++ websites/staging/isis/trunk/content/other/jrebel.html Sat May 24 05:56:43 2014
@@ -375,10 +375,10 @@
 <p>Note the use of the <code>${project.root}</code> and <code>${target.dir}</code> properties; values are supplied when the application is launched (as explained below).</p>
 
 <blockquote>
-  <p>Prior to 1.4.2-snapshot, the <code>rebel.xml</code> file simply had hard-coded values within it.</p>
+  <p>Prior to 1.5.0-snapshot, the <code>rebel.xml</code> file simply had hard-coded values within it.</p>
 </blockquote>
 
-<h2><a name="maven"><a name="screencast">Using Maven with JRebel (1.4.2-snapshot)</a></a></h2>
+<h2><a name="maven"><a name="screencast">Using Maven with JRebel (1.5.0-snapshot)</a></a></h2>
 
 <p>This screencast shows how to use Maven in conjunction with JRebel:</p>