Trails
  1. Trails
  2. TRAILS-156

Collection Semantics for EditPage miss the mark - not natural

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.0
    • Fix Version/s: 1.2.0
    • Component/s: trails-core
    • Labels:
      None
    • 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
    • Number of attachments :
      0

      Description

      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

        Activity

          People

          • Assignee:
            Alejandro Scandroli
            Reporter:
            Ken in nashua
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: