[
https://issues.apache.org/jira/browse/ISIS-1740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16190375#comment-16190375
]
Andi Huber edited comment on ISIS-1740 at 10/3/17 9:44 PM:
---
I've managed to assemble a working example. (actually without the need to touch
the layout.xml logic.)
We extend the SimpleObject and add the proposed @Parent annotation to a member
(Method or Field) to declare, what we want this object's navigable parent to
be. That's all we need to do! (If there's no navigable parent, the where-am-I
web-components are hidden.)
And for clarity: The navigable parent can be any DomainObject/View. It's not
necessarily of the same type as the current object.
{code:java}
@DomainObject
public class SimpleObject {
...
@Getter @Setter @Parent
private SimpleObject superior;
}
{code}
Screenshot: [^Clipboard04.png]
Let me know if you like this or want me to provide some code!
was (Author: hobrom):
I've managed to assemble a working example. (actually without the need to touch
the layout.xml logic.)
We extend the SimpleObject and add the proposed @Parent annotation to a member
(Method or Field) to declare, what we want this object's navigable parent to
be. That's all we need to do! (If there's no navigable parent, the where-am-I
web-components are hidden.)
{code:java}
@DomainObject
public class SimpleObject {
...
@Getter @Setter @Parent
private SimpleObject superior;
}
{code}
Screenshot: [^Clipboard04.png]
Let me know if you like this or want me to provide some code!
> New Feature: Where am I
> ---
>
> Key: ISIS-1740
> URL: https://issues.apache.org/jira/browse/ISIS-1740
> Project: Isis
> Issue Type: New Feature
> Components: Core
>Reporter: Andi Huber
> Fix For: 2.0.0
>
> Attachments: Clipboard01.png, Clipboard02.png, Clipboard03.png,
> Clipboard04.png
>
>
> Its common practice to display a navigation hint somewhere at top of an
> application's page or below the main menu, indicating where the user
> currently has navigated to. (Typically within a navigable tree-structure.)
> Let's call this the *WhereAmI hint*. We could integrate such a feature into
> ISIS.
> +Examples+
> [^Clipboard01.png]
> [^Clipboard02.png]
> [^Clipboard03.png]
> Note: we could optionally include the DomainObject's icons
> +Proposal+
> For any DomainObject/View currently displayed ISIS would need to know its
> corresponding
> navigable tree-structure. Let's call this the DomainObject's *WhereAmI tree*.
> All the framework needs to known to build the relevant sub-tree, is to know
> the parent node of any DomainObject/View that 'takes part' in the tree.
> We could provide this 'who is your parent' meta information similar to the
> existing 'what is your title' mechanism:
> {code:java}
> // Who is your parent? if null there is none
> public AnyDomainObjectOrView parent()
> {
> return foo;
> }
> {code}
> or
> {code:java}
> // Who is your parent? if null there is none
> @Parent
> public AnyDomainObjectOrView anyMethodName()
> {
> return foo;
> }
> {code}
> The typical layout.xml could look like this:
> {code:xml}
>
>
>
>
>
> ...
>
>
> ...
>
> {code}
> +Implementation Notes+
> # The framework needs to ensure that the chain of parent references starting
> at the current DomainObject/View is finite. (No circular or self references.)
> If it detects a circle, be nice and just stop the 'tree-up' traversal there.
> # For standalone Collection Views we could display a WhereAmI hint that
> allows back navigation to the DomainObject/View that had produced the
> collection.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)