Details
-
Improvement
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
-
None
-
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
- relates to
-
HSTTWO-4582 Figure out how to process content block types while generating dynamic beans
- Closed