You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2018/02/16 12:48:54 UTC

[isis] branch master updated: ISIS-1819 Where-am-I feature initial adoc

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new f7677a3  ISIS-1819 Where-am-I feature initial adoc
f7677a3 is described below

commit f7677a3661d429f3baecbd98fd506ea0fc46623f
Author: Andi Huber <ho...@gmx.at>
AuthorDate: Fri Feb 16 13:48:53 2018 +0100

    ISIS-1819 Where-am-I feature initial adoc
---
 .../guides/ugvw/_ugvw_features_where-am-i.adoc     | 93 ++++++++++++++++++++++
 1 file changed, 93 insertions(+)

diff --git a/adocs/documentation/src/main/asciidoc/guides/ugvw/_ugvw_features_where-am-i.adoc b/adocs/documentation/src/main/asciidoc/guides/ugvw/_ugvw_features_where-am-i.adoc
new file mode 100644
index 0000000..4428d90
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/guides/ugvw/_ugvw_features_where-am-i.adoc
@@ -0,0 +1,93 @@
+[[_ugvw_features_where-am-i]]
+= Where am I (new breadcrumbs since version 2.0)
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
+:_basedir: ../../
+:_imagesdir: images/
+
+
+
+The Wicket viewer provides a secondary navigation scheme that allows users to quickly access domain objects, that are organized in a hierarchical manner. 
+
+This hierarchy can be understood as a navigable tree-structure, where the navigable tree-nodes are either domain objects or domain views. Domain objects that take part in such a navigable-tree-structure need to declare their actual navigable parent within this hierarchy. That's all the framework needs, in order to build a navigable-tree. We introduced the `@Parent` annotation with version 2.0 to allow declarative specification of a domain object's navigable parent. 
+
+In other words: a domain object or view may declare it's parent (with respect to the navigable tree-structure it is part of) via use of the `@Parent` annotation.
+
+
+== Screenshots
+
+The following screenshot shows the navigation links below the top menu bar.
+
+image::{_imagesdir}where-am-i/hello_grey_bg.png[width="720px",link="{_imagesdir}where-am-i/hello_grey_bg.png"]
+
+
+== Domain Code
+
+To declare a domain object's (or view's) navigable parent, add the `@Parent` annotation to a field (that has an associated getter) or a no-arg method, that returns the parent object:
+
+[source,java]
+----
+
+@DomainObject
+public class Company { ... }
+
+@DomainObject
+public class Employee {
+
+    @Parent @Getter // annotated field with e.g. lombok provided getter
+	Company myCompany;
+}
+
+@DomainObject
+public class PhoneNumber {
+
+    @Parent  // annotated no-arg supplier
+	Employee employee(){
+        return ...
+	}
+
+}
+
+----
+
+This results in a navigable tree-structure ...
+
+Company > Employee > PhoneNumber
+
+=== How to use @Parent annotation
+
+. @Parent annotation on members declared with Java interfaces are ignored. These do not contribute to the domain meta model.
+. Any class (abstract or concrete) may at most have one @Parent annotation (on either a method or a field); otherwise meta-model validation will fail.
+. The annotated member (method or field), when ...
+.. ... a method: then must be a no-arg method returning a non-primitive type
+.. ... a field: then the field must be of non-primitive type and must also have a getter (as specified by the Java Beans Standard, particularly to allow @Parent annotations on fields that use the lombok @Getter annotation)
+. Starting from the current concrete domain-object class, we search down the object inheritance hierarchy (super class, super super class, ...), until we find the first class that has a @Parent annotation. That's the one we use to resolve the current domain-object's navigable parent.
+
+
+== User Experience
+
+When viewing a domain object that is part of a hierarchical structure, one can easily navigate to any parent of this object. Horizontally arranged text links separated by the 'greater than' symbol (>) are provided below the main menu. (Traditionally called breadcrumbs.)
+
+
+
+== Related functionality
+
+
+The 'Where am I' functionality is declared at compile-time (predefined by the programmer). Related features (xref:../ugvw/ugvw.adoc#_ugvw_features_recent-pages[Recent Pages] and xref:../ugvw/ugvw.adoc#_ugvw_features_bookmarked-pages[bookmarked pages]) are populated at runtime.
+
+
+== Configuration
+
+By default, the 'Where am I' feature will show a maximum of 64 links. This can be overridden using a property (in `isis.properties`), for example:
+
+[source,ini]
+----
+isis.viewer.whereAmI.maxParentChainLength=20
+----
+
+To disable the 'Where am I' feature, overridden the default (=enabled) using a property (in `isis.properties`):
+
+[source,ini]
+----
+isis.viewer.whereAmI.enabled=false
+----
+

-- 
To stop receiving notification emails like this one, please contact
ahuber@apache.org.