Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-1478

The method convertClassToType(QName alfrescoClass) uses JCRToAlfresco.get(alfrescoClass) rather than AlfrescoToJCR.get(alfrescoClass).

    Details

    • Type: Service Pack Request
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: No Version
    • Fix Version/s: 2.2.7, 3.3.2
    • Component/s: Repository
    • Labels:
      None
    • Bug Priority:
      Category 2
    • ACT Numbers:

      7598, 9460

      Description

      This means that if you do, for example, node.addMixin("mix:referenceable"), that the given JCR mixin type will correctly be translated to the Alfresco type, setting the aspect "sys:referenceable" on the node - but if you then call node.getMixinNodeTypes(), it will not list the JCR type you just set, instead incorrectly returning the Alfresco "sys:referenceable" type.

      Test code to reproduce:

      public static final boolean hasMixin(final Node node, final String mixinName) throws RepositoryException {
      final NodeType[] mixinNodeTypes = node.getMixinNodeTypes();
      if (mixinNodeTypes == null) return false;
      for (NodeType mixinNodeType : mixinNodeTypes)

      { if (mixinNodeType == null) continue; if (mixinName.equals(mixinNodeType.getName())) return true; }

      return false;
      }

      public static final void test(final Node node) throws RepositoryException {
      final String mixPrefix = node.getSession().getNamespacePrefix("http://www.jcp. org/jcr/mix/1.0");
      final String mixReferenceable = mixPrefix + ":referenceable";
      final String sysPrefix = node.getSession().getNamespacePrefix("http://www. alfresco.org/model/system/1.0");
      final String sysReferenceable = sysPrefix + ":referenceable";

      node.addMixin(mixReferenceable);
      if (!hasMixin(node, mixReferenceable))

      { throw new RepositoryException("Node just made 'mix:referenceable' isn't! ('sys:referenceable'=" + hasMixin(node, sysReferenceable) + ")"); }

      return;
      }

        Attachments

          Structure

            Activity

              People

              • Assignee:
                closedbugs Closed Bugs (Inactive)
                Reporter:
                jjaquette John Jaquette [X] (Inactive)
              • Votes:
                1 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Structure Helper Panel