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 2013/03/15 00:30:36 UTC

svn commit: r1456718 - in /isis/site/trunk/content: ./ components/objectstores/jdo/ components/viewers/wicket/ core/

Author: danhaywood
Date: Thu Mar 14 23:30:36 2013
New Revision: 1456718

URL: http://svn.apache.org/r1456718
Log:
details on configuring the title max length within the wicket viewer

Added:
    isis/site/trunk/content/components/objectstores/jdo/using-jndi-datasource.md
    isis/site/trunk/content/components/viewers/wicket/abbreviating-titles-in-tables.md
    isis/site/trunk/content/components/viewers/wicket/customizing-the-viewer.md
Modified:
    isis/site/trunk/content/components/objectstores/jdo/about.md
    isis/site/trunk/content/components/viewers/wicket/about.md
    isis/site/trunk/content/core/configuration-files.md
    isis/site/trunk/content/documentation.md

Modified: isis/site/trunk/content/components/objectstores/jdo/about.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/components/objectstores/jdo/about.md?rev=1456718&r1=1456717&r2=1456718&view=diff
==============================================================================
--- isis/site/trunk/content/components/objectstores/jdo/about.md (original)
+++ isis/site/trunk/content/components/objectstores/jdo/about.md Thu Mar 14 23:30:36 2013
@@ -6,6 +6,7 @@ Hints and tips:
 
 - [Maven and Eclipse](maven-and-eclipse.html)
 - [Dates, Blobs and Lazy Loading](dates-blobs-lazy-loading.html)
+- [Using a JNDI Datasource](using-jndi-datasource.html) (1.1.0-SNAPSHOT)
 
 ### Releases
 

Added: isis/site/trunk/content/components/objectstores/jdo/using-jndi-datasource.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/components/objectstores/jdo/using-jndi-datasource.md?rev=1456718&view=auto
==============================================================================
--- isis/site/trunk/content/components/objectstores/jdo/using-jndi-datasource.md (added)
+++ isis/site/trunk/content/components/objectstores/jdo/using-jndi-datasource.md Thu Mar 14 23:30:36 2013
@@ -0,0 +1,68 @@
+Title: Using JNDI Datasource (1.2.0-SNAPSHOT)
+
+Isis' JDO objectstore can be configured either to connect to the database using its own connection pool, or by using a container-managed datasource.
+
+#### Application managed connections
+
+Using a connection pool managed directly by the application (that is, by Isis' JDO objectstore and ultimately by DataNucleus) requires a single set of configuration properties to be specified.
+
+In the `WEB-INF\persistor_datanucleus.properties` file, specify the connection driver, url, username and password.
+
+For example:
+
+<pre>
+isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=net.sf.log4jdbc.DriverSpy
+isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:log4jdbc:hsqldb:mem:test
+isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa
+isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=
+</pre>
+
+{note
+Those configuration properties that start with the prefix `isis.persistor.datanucleus.impl.` are passed through directly to DataNucleus (with the prefix removed).
+}
+
+#### Container managed (JNDI) datasource
+
+Using a datasource managed by the servlet container requires three separate bits of configuration.
+
+Firstly, specify the name of the datasource in the `WEB-INF\persistor_datanucleus.properties` file.  For example:
+
+<pre>
+isis.persistor.datanucleus.impl.datanucleus.ConnectionFactoryName=java:comp/env/jdbc/quickstart
+</pre>
+
+{note
+If connection pool settings are also present in this file, they will simply be ignored.  Any other configuration properties that start with the prefix `isis.persistor.datanucleus.impl.` are passed through directly to DataNucleus (with the prefix removed).
+}
+
+Secondly, in the `WEB-INF/web.xml`, declare the resource reference:
+
+<pre>
+&lt;resource-ref&gt;
+    &lt;description&gt;db&lt;/description&gt;
+    &lt;res-ref-name&gt;jdbc/quickstart&lt;/res-ref-name&gt;
+    &lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;
+    &lt;res-auth&gt;Container&lt;/res-auth&gt;
+&lt;/resource-ref&gt;
+</pre>
+
+Finally, declare the datasource as required by the servlet container.  For example, if using Tomcat 7, the datasource can be specified by adding the following to `$TOMCAT_HOME/conf/context.xml`:
+
+<pre>
+&lt;Resource name="jdbc/quickstart" 
+  auth="Container" 
+  type="javax.sql.DataSource" 
+  maxActive="100" 
+  maxIdle="30" 
+  maxWait="10000" 
+  username="sa"
+  password="p4ssword" 
+  driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
+  url="jdbc:sqlserver://127.0.0.1:1433;instance=.;databaseName=quickstart"/&gt;
+</pre>
+
+You will also need to make sure that the JDBC driver is on the servlet container's classpath.  For Tomcat, this means copying the driver to `$TOMCAT_HOME/lib`.
+
+{note
+According to Tomcat's documentation, it is supposedly possible to copy the `conf/context.xml` to the name of the webapp, eg `conf/mywebapp.xml`, and scope the connection to that webapp only.  I was unable to get this working, however.
+}

Added: isis/site/trunk/content/components/viewers/wicket/abbreviating-titles-in-tables.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/components/viewers/wicket/abbreviating-titles-in-tables.md?rev=1456718&view=auto
==============================================================================
--- isis/site/trunk/content/components/viewers/wicket/abbreviating-titles-in-tables.md (added)
+++ isis/site/trunk/content/components/viewers/wicket/abbreviating-titles-in-tables.md Thu Mar 14 23:30:36 2013
@@ -0,0 +1,42 @@
+Title: Abbreviating Titles in Tables (1.2.0-SNAPSHOT)
+
+Object titles can often be quite long if the intention is to uniquely identify the object.  While this is appropriate for the object view, it can be cumbersome within tables.
+
+Isis' Wicket viewer provides the option to abbreviate these titles, using configuration properties.
+
+### Viewer-specific configuration file
+
+Because these configuration properties are specific to the Wicket viewer, it is good practice to put them into their own configuration file, `WEB-INF/viewer_wicket.properties`.  (You can put them into the regular `WEB-INF/isis.properties` file if you wish, though).
+
+To have Isis pick up this configuration file, add the following to `WEB-INF/web.xml`:
+
+<pre>
+&lt;context-param&gt;
+    &lt;param-name&gt;isis.viewers&lt;/param-name&gt;
+    &lt;param-value&gt;wicket&lt;/param-value&gt;
+&lt;/context-param&gt;
+</pre>
+
+{note
+If there is more than one viewer configured in the webapp, specify them as a comma-separated list, eg `wicket,restfulobjects`.
+}
+
+
+### The configuration properties
+
+The properties themselves are:
+
+<pre>
+isis.viewer.wicket.maxTitleLengthInStandaloneTables=20
+isis.viewer.wicket.maxTitleLengthInParentedTables=8
+</pre>
+
+If you wish to use the same value in both cases, you can also specify just:
+
+<pre>
+isis.viewer.wicket.maxTitleLengthInTables=15
+</pre>
+
+This is used as a fallback if the more specific properties are not provided.
+
+If no properties are provided, then the Wicket viewer defaults to abbreviating titles to a length of `12`.
\ No newline at end of file

Modified: isis/site/trunk/content/components/viewers/wicket/about.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/components/viewers/wicket/about.md?rev=1456718&r1=1456717&r2=1456718&view=diff
==============================================================================
--- isis/site/trunk/content/components/viewers/wicket/about.md (original)
+++ isis/site/trunk/content/components/viewers/wicket/about.md Thu Mar 14 23:30:36 2013
@@ -4,18 +4,11 @@ The wicket module provides a customizabl
 
 Like the [HTML viewer](../html/about.html), the wicket viewer provides a generic webapp with a page displayed for each entity or collection of entities. Unlike that viewer, though, you can also customize the GUI.
 
-### Customization
+### Further reading:
 
-The wicket viewer allows you to customize the GUI in 3 ways:
+- [Customizing the viewer](customizing-the-viewer.html)
+- [Abbreviating titles in tables](abbreviating-titles-in-tables.html) (1.2.0-SNAPSHOT)
 
-* first and most straight-forwardly, you can change the styling using CSS
-
-* second, you can write your own views using the Apache Wicket `Component` API.
-
-  These views will typically be to render a specific entity, a particular property/parameter type, or a collection of entities. You can either write these views from scratch, or use existing `Component` implementations (for example the open source code available at Wicket's companion site, [wicketstuff.org](http://wicketstuff.org)).
-
-* third, you can register your own pages for a particular object type
-This allows you to render certain objects (eg a DashBoard object) using a completely customized web page if required.
 
 ### Releases
 

Added: isis/site/trunk/content/components/viewers/wicket/customizing-the-viewer.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/components/viewers/wicket/customizing-the-viewer.md?rev=1456718&view=auto
==============================================================================
--- isis/site/trunk/content/components/viewers/wicket/customizing-the-viewer.md (added)
+++ isis/site/trunk/content/components/viewers/wicket/customizing-the-viewer.md Thu Mar 14 23:30:36 2013
@@ -0,0 +1,22 @@
+Title: Customizing the Viewer
+
+{note
+This is a stub article; for more information ask on the mailing list.
+}
+
+The Wicket viewer allows you to customize the GUI in 3 ways:
+
+* first and most straight-forwardly, you can change the styling using CSS
+
+* second, you can write your own views using the Apache Wicket `Component` API.
+
+  These views will typically be to render a specific entity, a particular property/parameter type, or a collection of entities. Examples include:
+
+  * [google maps v3 integration](https://github.com/danhaywood/isis-wicket-gmap3)
+  * [wicked charts integration](https://github.com/danhaywood/isis-wicket-wickedcharts)
+  * [full calendar integration](https://github.com/danhaywood/isis-wicket-fullcalendar)
+  
+  Wicket itself has lots of components available at its [wicketstuff.org](http://wicketstuff.org) companion website.  These could also be used as the basis for customizations.
+
+* third, you can register your own pages for a particular object type.
+This allows you to render certain objects (eg a Dashboard object) using a completely customized web page if required.

Modified: isis/site/trunk/content/core/configuration-files.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/core/configuration-files.md?rev=1456718&r1=1456717&r2=1456718&view=diff
==============================================================================
--- isis/site/trunk/content/core/configuration-files.md (original)
+++ isis/site/trunk/content/core/configuration-files.md Thu Mar 14 23:30:36 2013
@@ -44,14 +44,17 @@ This will cause Isis to search and read 
 
 As noted above, by default Isis will look for configuration files in the `WEB-INF` directory.  If you wish to vary the configuration by environment (eg systest vs production), then this can be altered by specifying the `isis.config.dir` context parameter.
 
-If the external configuration directory will change from one environment to another, then specify the context parameter according to the documentation of your chosen servlet container.  For example, if using Tomcat 7.0, the context parameter can be specified by adding the following to the parameter:
+If the external configuration directory will change from one environment to another, then specify the context parameter according to the documentation of your chosen servlet container.
+
+For example, if using Tomcat 7.0, you would typically copy the empty `$TOMCAT_HOME/webapps/conf/context.xml` to a file specific to the webapp, for example `$TOMCAT_HOME/webapps/conf/todo.xml`.  The context parameter would then be specified by adding the following:
 
 <pre>
-&lt;Parameter name="isis.config.dir" value="/usr/local/tomcat/conf/"
-         override="true"/&gt;
+&lt;Parameter name="isis.config.dir"
+           value="/usr/local/tomcat/conf/"
+           override="true"/&gt;
 </pre>
 
-For more detail see the [Tomcat documentation](http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Context_Parameters).
+For more detail, see the Tomcat documentation on [defining a context](http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Defining_a_context) and on [context parameters](http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Context_Parameters).
      
 If the external configuration directory is fixed for all environments, then you can specify within the `web.xml` itself:
 

Modified: isis/site/trunk/content/documentation.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/documentation.md?rev=1456718&r1=1456717&r2=1456718&view=diff
==============================================================================
--- isis/site/trunk/content/documentation.md (original)
+++ isis/site/trunk/content/documentation.md Thu Mar 14 23:30:36 2013
@@ -124,6 +124,8 @@ Title: Documentation
 ###  Wicket [1.1.0](components/viewers/wicket/release-notes/about.html)
 
 - [About](components/viewers/wicket/about.html)
+- [Customizing the viewer](components/viewers/wicket/customizing-the-viewer.html)
+- [Abbreviating titles in tables](components/viewers/wicket/abbreviating-titles-in-tables.html) (1.2.0-SNAPSHOT)
 
 }
 
@@ -206,6 +208,7 @@ Title: Documentation
 - [About](components/objectstores/jdo/about.html)
 - [Maven and Eclipse](components/objectstores/jdo/maven-and-eclipse.html)
 - [Dates, Blobs and Lazy Loading](components/objectstores/jdo/dates-blobs-lazy-loading.html)
+- [Using a JNDI Datasource](components/objectstores/jdo/using-jndi-datasource.html) (1.1.0-SNAPSHOT)
 
 }