History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: TRAILS-156
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alejandro Scandroli
Reporter: Ken in nashua
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Trails

Collection Semantics for EditPage miss the mark - not natural

Created: 24/Apr/08 10:51 AM   Updated: 12/Jul/08 02:44 AM
Component/s: trails-core
Affects Version/s: 1.2.0
Fix Version/s: 1.2.0

Time Tracking:
Not Specified

Environment: XP Pro, apache-maven-2.0.8, eclipse-3.3.1.1, jre-1.5.0_14, ognl-2.7.3-SNAPSHOT, tapestry-4.1.6-SNAPSHOT , MySQL-5.0.45


 Description  « Hide
Collection Semantics for EditPage miss the mark - not natural

EditPage.JAVA
public boolean cameFromCollection()
{ return getParent() != null; }

All the above method characterizes is that the page is referenced by a delegate page. Has nothing to do with collection. And it seems reasonable to state that it would only be useful for the root case.

Granted, yes trails may need to check for this.

But more checks are warranted, like a real natural check for collection or a reference?

Here is an appropriate implementation

// the patch
public boolean cameFromCollection()
{ return (getAssociationDescriptor() instanceof CollectionDescriptor); }

// optional
public boolean isReferencedByParentPage()
{ return getParent() != null; } }

These aspects can be worked into the dependent logic as needed



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Ken in nashua - 24/Apr/08 10:58 AM
Actually, the patch works beautifully as-is compatible to existing logic.

It also serves my personal implementation of

http://jira.codehaus.org/browse/TRAILS-129

whose title should be changed to "ObjectReferenceDescriptor needs to support inverse"

I have the sweetest implementation of trails runniing.