* @return the output root data, not null
*/
protected FlexiBean createRootData() {
FlexiBean out = super.createRootData();
SecurityDocument securityDoc = data().getSecurity();
ManageableSecurity security = securityDoc.getSecurity();
// REVIEW jonathan 2012-01-12 -- we are throwing away any adjuster that may be required, e.g. to apply
// normalisation to the time-series. This reproduces the previous behaviour but probably indicates that the
// time-series information is in the wrong place.
// Get the last price HTS for the security
ObjectId tsObjectId = null;
HistoricalTimeSeriesInfoSearchRequest searchRequest =
new HistoricalTimeSeriesInfoSearchRequest(security.getExternalIdBundle());
HistoricalTimeSeriesInfoSearchResult searchResult = data().getHistoricalTimeSeriesMaster().search(searchRequest);
if (searchResult.getFirstInfo() != null) {
tsObjectId = searchResult.getFirstInfo().getUniqueId().getObjectId();
}
out.put("securityAttributes", security.getAttributes());
out.put("securityDoc", securityDoc);
out.put("security", security);
out.put("timeSeriesId", tsObjectId);
out.put("deleted", !securityDoc.isLatest());
addSecuritySpecificMetaData(security, out);