예제 #1
0
  private FlexiBean createPortfolioData() {
    PortfolioDocument doc = data().getPortfolio();
    PositionSearchRequest positionSearch = new PositionSearchRequest();
    positionSearch.setPositionObjectIds(doc.getPortfolio().getRootNode().getPositionIds());
    PositionSearchResult positionsResult = data().getPositionMaster().search(positionSearch);

    FlexiBean out = createRootData();
    out.put("positionsResult", positionsResult);
    out.put("positions", positionsResult.getPositions());
    return out;
  }
 protected Collection<Position> positions(PositionSearchRequest positionSearch) {
   s_logger.debug("findPositions.positionSearchRequest {}", positionSearch);
   List<Position> positions = Lists.newArrayList();
   for (ObjectId positionObjectId : positionSearch.getPositionObjectIds()) {
     Position position =
         getDelegatingPositionSource().getPosition(positionObjectId, VersionCorrection.LATEST);
     if (position != null) {
       positions.add(position);
     } else {
       s_logger.warn(
           "Position {} cannot be found in DelegatingPositionSource {}",
           positionObjectId,
           getDelegatingPositionSource());
     }
   }
   return positions;
 }