Author: danhaywood
Date: Fri Nov 14 13:48:33 2014
New Revision: 1639635
URL: http://svn.apache.org/r1639635
Log:
titles, icons
Modified:
isis/site/trunk/content/how-tos/how-to-01-040-How-to-specify-a-title-for-a-domain-entity.md
isis/site/trunk/content/how-tos/how-to-01-070-How-to-specify-the-icon-for-a-domain-entity.md
isis/site/trunk/content/intro/learning-more/articles-and-presentations.md
Modified:
isis/site/trunk/content/how-tos/how-to-01-040-How-to-specify-a-title-for-a-domain-entity.md
URL:
http://svn.apache.org/viewvc/isis/site/trunk/content/how-tos/how-to-01-040-How-to-specify-a-title-for-a-domain-entity.md?rev=1639635&r1=1639634&r2=1639635&view=diff
==============================================================================
---
isis/site/trunk/content/how-tos/how-to-01-040-How-to-specify-a-title-for-a-domain-entity.md
(original)
+++
isis/site/trunk/content/how-tos/how-to-01-040-How-to-specify-a-title-for-a-domain-entity.md
Fri Nov 14 13:48:33 2014
@@ -1,41 +1,31 @@
How to specify a title for a domain entity
------------------------------------------
-A title is used to identify an object to the user in the user interface.
-For example, a Customer's title might be the organization's customer
-reference, or perhaps (more informally) their first and last names.
-
-By default, the framework will use the object's `toString()` method as
-the title. Most titles tend to be made up of the same set of elements:
-for example a Customer's name might be the concatenation of their
-customer first name and their ;ast name. For these the @Title annotation
-can be used:
+Apache Isis viewers identify objects through both an
[icon](./how-to-01-070-How-to-specify-the-icon-for-a-domain-entity.html)
+and a title. For example, a `Customer`'s title might be the organization's
customer reference, or perhaps (more
+informally) their first and last names.
- public class Customer {
- @Title
- public String getFirstName() { ... }
- @Title
- public String getLastName() { ... }
- ...
- }
+The framework has a number of ways to determine the title.
+
+## Declarative
-For more control, the order of the title components can be specified
-using a sequence number (specified in Dewey decimal format):
+Most titles tend to be made up of the same set of elements. For example a
`Customer`'s name might be the concatenation
+of their first name and their last name. For these the `@Title` annotation
can be used:
public class Customer {
- @Title("1.0")
+ @Title(sequence="2")
public String getFirstName() { ... }
- @Title("1.1")
+ @Title(sequence="1", append=",")
public String getLastName() { ... }
...
}
-For more control the title can be declared imperately using the
-`title()` method (returning a `String`). This leaves the programmer
-needs to make use of the `toString()` method for other purposes, such as
-for debugging. For example, to return the title for a customer which is
-their last name and then first initial of their first name, we could
-use:
+For each property that is part of the title joining strings can be specified
to `prepend` or `append` the property value.
+
+## Imperative
+
+For more control the title can be declared imperately using the `title()`
method (returning a `String`). For example,
+to return the title for a customer which is their last name and then first
initial of their first name, we could write:
public class Customer {
public String title() {
@@ -44,6 +34,12 @@ use:
...
}
-The applib contains a class, `org.apache.isis.applib.util.TitleBuffer`,
-which you can use to help create title strings if you so wish. <!-- See ? for
-more details.-->
+The `org.apache.isis.applib.util.TitleBuffer` utility class can be used to
create title strings if you so wish.
+
+## Fallback
+
+If there is no `title()` method and no properties annotated with `@Title`,
then the object's `toString()` method is
+used instead.
+
+In general though we recommend that you do provide either a title explicitly.
You can then use `toString()` method for
+other purposes, such as debugging.
Modified:
isis/site/trunk/content/how-tos/how-to-01-070-How-to-specify-the-icon-for-a-domain-entity.md
URL:
http://svn.apache.org/viewvc/isis/site/trunk/content/how-tos/how-to-01-070-How-to-specify-the-icon-for-a-domain-entity.md?rev=1639635&r1=1639634&r2=1639635&view=diff
==============================================================================
---
isis/site/trunk/content/how-tos/how-to-01-070-How-to-specify-the-icon-for-a-domain-entity.md
(original)
+++
isis/site/trunk/content/how-tos/how-to-01-070-How-to-specify-the-icon-for-a-domain-entity.md
Fri Nov 14 13:48:33 2014
@@ -1,6 +1,31 @@
-How to specify the icon for a domain entity
--------------------------------------------
+title: How to specify the icon for a domain object
+Apache Isis viewers identify objects through both an icon and a
[title](./how-to-01-040-How-to-specify-a-title-for-a-domain-entity.html).
+
+The icon can be either static and fixed - meaning it is based on the object's
class - or dynamic and changing - meaning
+it can change according to the object's state. For example, an `Order` could
indicate its status (pending, shipped), or a `ToDoItem` could indicate if it is
complete or not.
+
+The mechanism to locate up the icon is viewer-specific. In the [Wicket
viewer](../components/viewers/wicket/about.html) there are two mechanisms for
locating an icon/image, though one applies only to static icons.
+
+If the icon is static then it is located either:
+
+* (1.8.0-SNAPSHOT onwards) by specifying a [font
awesome](http://fortawesome.github.io/Font-Awesome/) icon
+ for the class using either the
[`@CssClassFa`](../reference/recognized-annotations/CssClassFa.html)
annotation, or
+ an equivalent entry in the
[.layout.json](../components/viewers/wicket/dynamic-layouts.html) file.
+
+* else, provide an image file for the class, eg `ToDoItem.png`, picked up from
a well-known location on the
+ classpath.
+
+If the icon is dynamic then it is located by the second mechanism only, that
is:
+
+* provide an image file for the object, eg `ToDoItem-completed.png`, again
picked up from a well-known location on
+ the classpath.
+
+The sections below explain this in more detail.
+
+## Statically specified 'font awesome' icon
+
+The framework has a number of mechanisms to locate the image.
By default, the framework will look for an image in the `images`
directory (either from the classpath or from the filesystem) that has
the same name as the object class. Multiple file extensions are searched
@@ -23,6 +48,15 @@ icon `OrderLine.png`. Actually, the fram
are case sensitive, so it is good practice to adopt an unambiguous
convention.
+## Statically-specified image file
+
+
+
+## Dynamically-specified image file
+
+
+
+
Alternatively, you can use the `iconName`() method instead:
public String iconName() {
Modified:
isis/site/trunk/content/intro/learning-more/articles-and-presentations.md
URL:
http://svn.apache.org/viewvc/isis/site/trunk/content/intro/learning-more/articles-and-presentations.md?rev=1639635&r1=1639634&r2=1639635&view=diff
==============================================================================
--- isis/site/trunk/content/intro/learning-more/articles-and-presentations.md
(original)
+++ isis/site/trunk/content/intro/learning-more/articles-and-presentations.md
Fri Nov 14 13:48:33 2014
@@ -4,6 +4,9 @@ Some articles and recorded material rela
2014
+<!--
+* Presentation, BDD Exchange: [To those whom much is given, much is
expected... ](xxx) (45 min. video)
+-->
* Presentation, JEEConf: [Extremely rapid application development with Apache
Isis](https://www.youtube.com/watch?v=BNGUqZ6YE-M) (50 min. video)
2013