Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-12880

Improve Content Node Binder interface

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Normal
    • Resolution: Won't Do
    • 3.2.0
    • None
    • site-toolkit

    Description

      To get rid of a bit of legacy and make the usage of the CNB more intuitive, these could be nice improvements (from an email by Woonsan):

      I think we can improve the following:

      • ContentNodeBinder could be parameterized like ContentNodeBinder<T
        extends HippoBean>. So no casting is necessary.
      • Maybe we can introduce a new interface, ContentBeanBinder which has
        only #bind(Node) like you mentioned. So, wpm can check whether or not
        the interface implemented in addition.

      In the second case the code in the bean could be much simpler:

      @Override
      public boolean bind(Object content, javax.jcr.Node node) throws ContentNodeBindingException {
          try {
              node.setProperty("myhippoproject:username", getUsername());
          } catch (Exception e) {
              log.error("Unable to bind the content to the JCR Node" + e.getMessage(), e);
              throw new ContentNodeBindingException(e);
          }
          return true;
      }

      Attachments

        Issue Links

          Activity

            People

              productteam Product Management Team
              bleunis Bert Leunis (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: