Uploaded image for project: '[Read Only] - Hippo Site Toolkit 2'
  1. [Read Only] - Hippo Site Toolkit 2
  2. HSTTWO-4612

For runtime bean creation, create getter for content blocks

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 13.3.0
    • Component/s: None
    • Labels:
      None
    • Similar issues:
    • Processed by team:
      Pulsar
    • Sprint:
      Platform 211 Eng OKRs

      Description

      At this moment, content blocks do not result in any method. That is because it seemed hard to 'know' which methods to add. For example assume you have a myproject:documentation document type, which has content blocks, and in the content blocks you can store add paragraphs and addresses. If you'd, like to have a created runtime bean something like below,

      @Node(jcrType = "myproject:documentation")
      public class DocumentationDocument extends HippoDocument {
         
         public List<Paragraph> getParagraphs() {
              return getChildBeans(Paragraph.class);
          }
      
         public List<Address> getAddresses() {
              return getChildBeans(Address.class);
          }
      }
      

      then we can never create this this, since we simply can't infer the method names getParagraphs and getAddresses. But is that really a problem? Why would any one ever use content block which are meant to be able to have an ORDERED list of items? If you want to above bean, just create in the document type a separate multi valued property for paragraphs and addresses : No content block needed AT ALL.

      What does make much more sense is the following:

      @Node(jcrType = "myproject:documentation")
      public class DocumentationDocument extends HippoDocument {
         
         public List<HippoBean> getBlockitem() {
              return getChildBeansByName("myproject:blockitem);
          }
      
      }
      

      and the above can be created in the runtime beans without problem

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                aschrijvers Ard Schrijvers
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: