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

ContentWrapper requires AbstractContent to work properly

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 4.3
    • 4.3
    • core
    • None

    Description

      AbstractContent defines

          abstract public NodeData getNodeData(String name, int type) throws AccessDeniedException, RepositoryException;
      

      method that all extending classes need to implement and ContentWrapper implements this method as well, undiscriminatelly casting Content returned by

          public Content getWrappedContent();
      

      method into AbstractContent.
      Since the content wrapper is used to wrap all sorts of content in Magnolia making it actually mandatory for all Content implementations to extend AbstractContent the abstract method above should be declared in the Content interface directly or the ContentWrapper init method should be changed to accept only objects extending AbstractContent rather then those implementing Content.
      For example the easymock objects created against Content interface obviously fail to be casted into AbstractContent.

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              pbaerfuss Philipp Bärfuss
              had Jan Haderka
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Task DoD