Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-5330

Node2Bean should support setContent(Node)

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 5.4.5
    • None
    • core
    • Kromeriz 31
    • 2

      Node2Bean supports setting the content/node where the bean was read from using a setter called setContent. However it only works with the Content object, not a plain JCR Node object.

      In Node2BeanTransformerImpl#setProperty we should check the type of the setter and be able to set it using both types.

      The way the feature is implemented we support these variations:

      • setContent(Content)
      • setContent(SystemContentWrapper)
      • setContent(LazyContentWrapper)
      • setContent(ContentWrapper)
      • setContent(AbstractContent)
      • setContent(ContentHandler)

      We should not break any of these, so something like:

      if (propertyName.equals("content") && value == null && descriptor.getType().getType().isAssignableFrom(SystemContentWrapper.class)) { ... }
      

        Acceptance criteria

              tmattsson Tobias Mattsson
              tmattsson Tobias Mattsson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0d
                    0d
                    Logged:
                    Time Spent - 0.25d
                    0.25d