Uploaded image for project: 'Isis'
  1. Isis
  2. ISIS-1311

Mixins for Persistable metadata causes exception when rendering.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.11.1
    • Fix Version/s: 1.12.0
    • Component/s: Core
    • Labels:
      None

      Description

      one (or both) of these causes issue (this in the github.com/incodehq/contactapp)

      @Mixin
      public class Persistable_id {
      
          private final Persistable persistable;
      
          public Persistable_id(Persistable persistable) {
              this.persistable = persistable;
          }
      
          @MemberOrder(name = "Metadata", sequence = "1")
          @Action(semantics = SemanticsOf.SAFE)
          @ActionLayout(contributed = Contributed.AS_ASSOCIATION)
          @PropertyLayout()
          public Object $$() {
              final Object objectId = JDOHelper.getObjectId(persistable);
              if(objectId instanceof DatastoreId) {
                  final DatastoreId datastoreId = (DatastoreId) objectId;
                  return datastoreId.getKeyAsObject();
              }
              return null;
          }
      
          public boolean hide$$() {
              return $$() == null;
          }
      
      
      }
      

      and/or

      @Mixin .. 
      public class Persistable_version {
      
          private final Persistable persistable;
      
          public Persistable_version(Persistable persistable) {
              this.persistable = persistable;
          }
      
          @MemberOrder(name = "Metadata", sequence = "2")
          @Action(semantics = SemanticsOf.SAFE)
          @ActionLayout(contributed = Contributed.AS_ASSOCIATION)
          @PropertyLayout()
          public Object $$() {
              return JDOHelper.getVersion(persistable);
          }
          public boolean hide$$() {
              return $$() == null;
          }
      
      }
      

        Activity

        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 4ccb9caa1293e3d0e4e5feb6f90319050692f42f in isis's branch refs/heads/ISIS-993 from Dan Haywood
        [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=4ccb9ca ]

        ISIS-1311: sorted out issue with Persistable mixins (return Long, not Object, otherwise trips up).

        Also, fixed issue with tables that were incorrectly showing the datanucleusId and datanucleusVersion because of how check for HiddenFacets against mixin associations. Now generalized/improved the lookup of facet (had a different facetType key in the ObjectAssociationMixin compared to the underlying ObjectActionDefault).

        Show
        jira-bot ASF subversion and git services added a comment - Commit 4ccb9caa1293e3d0e4e5feb6f90319050692f42f in isis's branch refs/heads/ ISIS-993 from Dan Haywood [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=4ccb9ca ] ISIS-1311 : sorted out issue with Persistable mixins (return Long, not Object, otherwise trips up). Also, fixed issue with tables that were incorrectly showing the datanucleusId and datanucleusVersion because of how check for HiddenFacets against mixin associations. Now generalized/improved the lookup of facet (had a different facetType key in the ObjectAssociationMixin compared to the underlying ObjectActionDefault).
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 23f92334256fb76ee57d9f2807df2602cab60096 in isis's branch refs/heads/ISIS-993 from Dan Haywood
        [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=23f9233 ]

        ISIS-1311: split out Persistable_datanucleusVersion mixin into two, one for timestamps and one for longs (per different VersionStrategy in JDO annotation).

        Also:

        • remove the hideXxx() for Object_downloadLayoutXml mixin, will always be visible.
        Show
        jira-bot ASF subversion and git services added a comment - Commit 23f92334256fb76ee57d9f2807df2602cab60096 in isis's branch refs/heads/ ISIS-993 from Dan Haywood [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=23f9233 ] ISIS-1311 : split out Persistable_datanucleusVersion mixin into two, one for timestamps and one for longs (per different VersionStrategy in JDO annotation). Also: remove the hideXxx() for Object_downloadLayoutXml mixin, will always be visible.
        Hide
        danhaywood Dan Haywood added a comment -

        The issue is that the framework doesn't allow actions that return scalars (eg long, java.sql.Timestamp) to be defined with a compile-time type of java.lang.Object.

        Show
        danhaywood Dan Haywood added a comment - The issue is that the framework doesn't allow actions that return scalars (eg long, java.sql.Timestamp) to be defined with a compile-time type of java.lang.Object.
        Hide
        danhaywood Dan Haywood added a comment -

        Some of this work done on ISIS-993.

        Show
        danhaywood Dan Haywood added a comment - Some of this work done on ISIS-993 .

          People

          • Assignee:
            danhaywood Dan Haywood
            Reporter:
            danhaywood Dan Haywood
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development