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 18:05:17 UTC
svn commit: r1457019 - in /isis/site/trunk/content: ./
components/viewers/wicket/ components/viewers/wicket/images/
getting-started/resources/
Author: danhaywood
Date: Fri Mar 15 17:05:16 2013
New Revision: 1457019
URL: http://svn.apache.org/r1457019
Log:
isis site - more on title support within wicket viewer's tables
Added:
isis/site/trunk/content/components/viewers/wicket/images/cust-order-product.png (with props)
isis/site/trunk/content/components/viewers/wicket/titles-in-tables.md
- copied, changed from r1456719, isis/site/trunk/content/components/viewers/wicket/abbreviating-titles-in-tables.md
Removed:
isis/site/trunk/content/components/viewers/wicket/abbreviating-titles-in-tables.md
Modified:
isis/site/trunk/content/components/viewers/wicket/about.md
isis/site/trunk/content/documentation.md
isis/site/trunk/content/getting-started/resources/jmock2-templates.xml
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=1457019&r1=1457018&r2=1457019&view=diff
==============================================================================
--- isis/site/trunk/content/components/viewers/wicket/about.md (original)
+++ isis/site/trunk/content/components/viewers/wicket/about.md Fri Mar 15 17:05:16 2013
@@ -7,7 +7,7 @@ Like the [HTML viewer](../html/about.htm
### Further reading:
- [Customizing the viewer](customizing-the-viewer.html)
-- [Abbreviating titles in tables](abbreviating-titles-in-tables.html) (1.2.0-SNAPSHOT)
+- [Titles in tables](titles-in-tables.html) (1.2.0-SNAPSHOT)
- [Configuring the about page](configuring-the-about-page.html) (1.2.0-SNAPSHOT)
### Releases
Added: isis/site/trunk/content/components/viewers/wicket/images/cust-order-product.png
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/components/viewers/wicket/images/cust-order-product.png?rev=1457019&view=auto
==============================================================================
Binary file - no diff available.
Propchange: isis/site/trunk/content/components/viewers/wicket/images/cust-order-product.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Copied: isis/site/trunk/content/components/viewers/wicket/titles-in-tables.md (from r1456719, 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/titles-in-tables.md?p2=isis/site/trunk/content/components/viewers/wicket/titles-in-tables.md&p1=isis/site/trunk/content/components/viewers/wicket/abbreviating-titles-in-tables.md&r1=1456719&r2=1457019&rev=1457019&view=diff
==============================================================================
--- isis/site/trunk/content/components/viewers/wicket/abbreviating-titles-in-tables.md (original)
+++ isis/site/trunk/content/components/viewers/wicket/titles-in-tables.md Fri Mar 15 17:05:16 2013
@@ -1,12 +1,58 @@
-Title: Abbreviating Titles in Tables (1.2.0-SNAPSHOT)
+Title: 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.
+Isis' Wicket viewer implements two features to shorten these titles.
-### Viewer-specific configuration file
+### Excluding parent context (@Title annotation)
-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).
+The first feature to shorten the title in tables is to automatically exclude the title of the parent object. This can be done when the `@Title` annotation is used.
+
+For example, suppose we have:
+
+
+
+where the `Order` class references both `Customer` and `Product`. It's title might involve each of these:
+
+<pre>
+public class Order {
+ @Title(sequence="1")
+ public Customer getCustomer() { ... }
+
+ @Title(sequence="2")
+ public Product getProduct() { ... }
+
+ @Title(sequence="3")
+ public String getOtherInfo() { ... }
+
+ ...
+}
+</pre>
+
+In this case, if we view the `Order` from the context of `Customer` (that is, within a parented collection's table) then the customer's property will be automatically excluded from the title of the `Order`.
+
+Incidentally, this feature is closely related to the
+`@Hidden(where=Where.REFERENCES_PARENT)` annotation, which will cause the property itself to be hidden as a column in the table. An Isis idiom is therefore:
+
+<pre>
+public class Order {
+ @Title(sequence="1")
+ @Hidden(where=Where.REFERENCES_PARENT)
+ public Customer getCustomer() { ... }
+
+ ...
+}
+</pre>
+
+The above annotations mean that titles usually "just work", altering according to the context in which they are viewed.
+
+### Abbreviating titles
+
+The second feature that the Wicket viewer supports is to truncate titles longer than a certain length. This is done using properties specific to the Wicket viewer.
+
+#### Viewer-specific configuration file
+
+Because these configuration properties to be set up *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`:
@@ -20,7 +66,7 @@ To have Isis pick up this configuration
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 configuration properties
The properties themselves are:
Modified: isis/site/trunk/content/documentation.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/documentation.md?rev=1457019&r1=1457018&r2=1457019&view=diff
==============================================================================
--- isis/site/trunk/content/documentation.md (original)
+++ isis/site/trunk/content/documentation.md Fri Mar 15 17:05:16 2013
@@ -125,7 +125,7 @@ Title: Documentation
- [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)
+- [Titles in tables](components/viewers/wicket/titles-in-tables.html) (1.2.0-SNAPSHOT)
- [Configuring the about page](components/viewers/wicket/configuring-the-about-page.html) (1.2.0-SNAPSHOT)
}
Modified: isis/site/trunk/content/getting-started/resources/jmock2-templates.xml
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/getting-started/resources/jmock2-templates.xml?rev=1457019&r1=1457018&r2=1457019&view=diff
==============================================================================
--- isis/site/trunk/content/getting-started/resources/jmock2-templates.xml (original)
+++ isis/site/trunk/content/getting-started/resources/jmock2-templates.xml Fri Mar 15 17:05:16 2013
@@ -3,7 +3,7 @@ private ${MockClass} mock${MockClass};&#
</template><template autoinsert="true" context="java" deleted="false" description="JMock2 Context field" enabled="true" name="jmcontext">${:import(org.jmock.Mockery,org.jmock.integration.junit4.JUnit4Mockery)}private Mockery context = new JUnit4Mockery();
</template><template autoinsert="true" context="java" deleted="false" description="JMock2 Expectations" enabled="true" name="jmexpectations">${:import(org.jmock.Expectations)}context.checking(new Expectations() {{
${cursor}
-}});</template><template autoinsert="true" context="java" deleted="false" description="JMock2 Mock Definition" enabled="true" name="jmmock">${MockClass} ${mockObject} = context.mock(${MockClass}.class);</template><template autoinsert="true" context="java" deleted="false" description="JMock2 Rule (Isis variant)" enabled="true" name="jmrule">${:import(org.junit.Rule,org.apache.isis.core.testsupport.jmock.JUnitRuleMockery2,org.apache.isis.core.testsupport.jmock.JUnitRuleMockery2.Mode)}@Rule
+}});</template><template autoinsert="true" context="java" deleted="false" description="JMock2 Mock Definition" enabled="true" name="jmmock">${MockClass} ${mockObject} = context.mock(${MockClass}.class);</template><template autoinsert="true" context="java" deleted="false" description="JMock2 Rule (Isis variant)" enabled="true" name="jmrule">${:import(org.junit.Rule,org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2,org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode)}@Rule
public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES${cursor});
</template><template autoinsert="true" context="java" deleted="false" description="JMock2 RunWith" enabled="true" name="jmrunwith">${:import(org.junit.runner.RunWith,org.jmock.integration.junit4.JMock)}@RunWith(JMock.class)</template><template autoinsert="true" context="java" deleted="false" description="JMock2 Expectation Return Value" enabled="true" name="jmvalue">will(returnValue(${cursor}));</template></templates>
\ No newline at end of file