Package com.opengamma.web.analytics

Examples of com.opengamma.web.analytics.ViewportResults


  public ViewportResults getViewportResultAsCsv(@PathParam("viewId") String viewId,
                                                @PathParam("gridType") String gridTypeStr,
                                                @Context HttpServletResponse response) {
    AnalyticsView view = _viewManager.getView(viewId);
    AnalyticsView.GridType gridType = gridType(gridTypeStr);
    ViewportResults result = view.getAllGridData(gridType, TypeFormatter.Format.CELL);
    Instant valuationTime;
    if (result.getValuationTime() != null) {
      valuationTime = result.getValuationTime();
    } else {
      valuationTime = OpenGammaClock.getInstance().instant();
    }
    LocalDateTime time = LocalDateTime.ofInstant(valuationTime, OpenGammaClock.getZone());
View Full Code Here


  @Path("data")
  @Produces(RestUtils.TEXT_CSV)
  public ViewportResults getViewportResultAsCsv(@Context HttpServletResponse response) {
    ArgumentChecker.notNull(response, "response");
   
    ViewportResults result = getView().getAllGridData(getGridType(), Format.CELL);
    Instant valuationTime = result.getValuationTime() == null ? OpenGammaClock.getInstance().instant() : result.getValuationTime();
    LocalDateTime time = LocalDateTime.ofInstant(valuationTime, OpenGammaClock.getZone());
   
    String filename = String.format("%s-%s-%s.csv", getView().getViewDefinitionId(), getGridType().name().toLowerCase(), time.toString(CSV_TIME_FORMAT));
    response.addHeader("content-disposition", "attachment; filename=\"" + filename + "\"");
    return getView().getAllGridData(getGridType(), Format.CELL);
View Full Code Here

TOP

Related Classes of com.opengamma.web.analytics.ViewportResults

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.