Package er.jrexample.components

Source Code of er.jrexample.components.Main

package er.jrexample.components;


import java.io.File;
import java.util.concurrent.Callable;

import com.webobjects.appserver.WOActionResults;
import com.webobjects.appserver.WOContext;

import er.coolcomponents.CCAjaxLongResponsePage;
import er.extensions.components.ERXComponent;
import er.jrexample.businesslogic.Reports;
import er.jrexample.controllers.FileTaskDownloadController;

public class Main extends ERXComponent {
  public Main(WOContext context) {
    super(context);
  }
 
  public WOActionResults studioRevenueReportAction() {
   
    // Create the task
    Callable<File> reportTask = Reports.createStudioRevenueReportTask();
   
    // Create the long response page
    CCAjaxLongResponsePage nextPage = pageWithName(CCAjaxLongResponsePage.class);
   
    // Push the task into the long response page
    nextPage.setTask(reportTask);
   
    // Controller for handling the Callable result in the long response page
    FileTaskDownloadController nextPageController = new FileTaskDownloadController();
   
    // Hyperlink text on the "Your file is downloaded page" to get back here
    nextPageController.setReturnLinkText("Reports Menu");
   
    // The filename for the download
    nextPageController.setDownloadFileNameForClient("StudioRevenueReport.pdf");
   
    nextPage.setNextPageForResultController(nextPageController);
   
    return nextPage;
   
  }
}
TOP

Related Classes of er.jrexample.components.Main

TOP
Copyright © 2018 www.massapi.com. 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.