Details
Description
The Document Type Editor provides a "Docbase" field type which can be used in document types to store the UUID of another content item (sort of a weak reference).
Currently the API does not provide an easy way to resolve a link stored as Docbase field.
Ard proposed:
Perhaps the HST can provide some helper utility for it so developers
can easily account for it in their end project beans. Where we now
have
public <T extends HippoBean> T getLinkedBean(String relPath, Class<T>
beanMappingClass) {
we could add something like
public <T extends HippoBean> T getLinkedBean(UUID uuid, Class<T>
beanMappingClass) {
Developers should then implement the getter for a
linked bean through docbase themselves, for example
public HippoBean getLinkedBean() {
String docbase = getProperty("gettingstarted:docbase", null);
try
catch (IllegalArgumentException e) {
log.info("Cannot get linked bean for docbase that is not a
uuid {}", uuid);
return null;
}
}
Attachments
Issue Links
- is awaited by
-
ESSENTIALS-456 Support for "Docbase" document fields in Beanwriter
- Closed