What would be the best approach to load content from external source? Only approach what I could come up with is to load this data in component and then update hippo bean (see example code bellow). But is there a better way? Is there some "hippo bean post processor" or "external source provider"?
public class MyComponent extends BaseHstComponent {
@Overrideenter code here
public void doBeforeRender(final HstRequest request, final HstResponse response) throws HstComponentException {
SalesDocument doc = (SalesDocument)request.getRequestContext().getContentBean();
ExternalData externalData = externalDataSource.getExternalData(doc.getId());
doc.setValue(externalData.getValue());
if (doc == null) {
response.setStatus(404);
return;
}
request.setAttribute("document",doc);
}
}