Style Intelligence v12.0

inetsoft.sree.schedule
Class RepletAction

java.lang.Object
  extended by inetsoft.sree.schedule.AbstractAction
      extended by inetsoft.sree.schedule.RepletAction
All Implemented Interfaces:
inetsoft.sree.internal.HttpXMLSerializable, ArchiveSupport, CancelableAction, EmailSupport, RepletSupport, ScheduleAction, inetsoft.util.XMLSerializable, Serializable, Cloneable

public class RepletAction
extends AbstractAction
implements RepletSupport, ArchiveSupport

A schedule action to run a report (replet). The action could save the report in a PDF file, deliver it through email, save the output in the report archive, or print it to a printer.

See Also:
Serialized Form

Nested Class Summary
 class RepletAction.ScheduleActionListener
          Schedule action listener, use to cancel the current task.
 
Field Summary
 
Fields inherited from class inetsoft.sree.schedule.AbstractAction
emailInfo, encoding, isNotifyError, notifies
 
Constructor Summary
RepletAction()
          Create an empty action.
RepletAction(String replet, RepletRequest request)
          A replet action for the specified replet.
 
Method Summary
 void clearSaveInArchive()
          Remove the save in archive action.
 Object clone()
           
 boolean equals(Object val)
           
 ScheduleAlert[] getAlerts()
          Gets the alert conditions for this action.
 String getArchiveComment()
          Get the comment associated with this report.
 int getArchiveFormat()
          Get the format to save the report in archive.
 String getArchivePath()
          Get the path in the archive to save a report.
 Permission getArchivePermission()
          Get the saved copy's permission.
 ArchiveRule getArchiveRule()
          Get the archive rule of the saved report.
 String getCSV()
          Deprecated. use getFilePath(Builder.CSV) instead.
 String getExcel()
          Deprecated. use getFilePath(Builder.EXCEL) instead.
 String getExcelData()
          Deprecated. use getFilePath(Builder.EXCEL_DATA) instead.
 String getExcelLayout()
          Deprecated. use getFilePath(Builder.EXCEL_SHEET) instead.
 String getFilePath(int format)
          Gets the file path at which the file will be saved for a particular format.
 String getHTML()
          Deprecated. use getFilePath(Builder.HTML_BUNDLE) instead.
 String getHTMLNoPages()
          Deprecated. use getFilePath(Builder.HTML_BUNDLE_NO_PAGINATION) instead.
 String getLocale()
          Get the locale used by this replet action.
 String getPDF()
          Deprecated. use getFilePath(Builder.PDF) instead.
 String getPPT()
          Deprecated. use getFilePath(Builder.POWERPOINT) instead.
 String getPrinterList()
          Get printers as a comma separated list
 String[] getPrinters()
          Get all printers.
 String getRepletName()
          Get the name of the replet.
 RepletRequest getRepletRequest()
          Get the request used to generate the report.
 String getRTF()
          Deprecated. use getFilePath(Builder.RTF) instead.
 String getRTFLayout()
          Deprecated. use getFilePath(Builder.RTF_LAYOUT) instead.
 int[] getSaveFormats()
          Gets a list of all the formats in which the report will be saved.
 String getScheduleEmails(RepletEngine engine, Object id)
          Get the schedule info.
 String getSVG()
          Deprecated. use getFilePath(Builder.SVG) instead.
 String getTxt()
          Deprecated. use getFilePath(Builder.TEXT) instead.
 String getXML()
          Deprecated. use getFilePath(Builder.XML) instead.
 boolean isSaveToDisk()
          Return whether the action exports to disk.
 void mailTo(String email, String from, String fmt, boolean compress, String subject, String msg)
          Add one or more emails to send the output of the replet to.
 void mailTo(String email, String from, String fmt, boolean compress, String subject, String msg, String attachmentName)
          Add one or more emails to send the output of the replet to.
 void mailTo(String email, String from, String fmt, String msg)
          Add one or more emails to send the output of the replet to.
 void mailTo(String email, String from, String fmt, String subject, String msg)
          Add one or more emails to send the output of the replet to.
 void parseXML(Element action)
          Parse the replet action definition from xml.
protected  Object prepareReplet(Principal principal, RepletRepository repository)
           
 void run(Principal principal)
          Execute this action.
 Object runRepletAction(Principal principal, RepletRepository repository)
          Executes this action.
 void saveCSV(String csv)
          Deprecated. use setFilePath(Builder.CSV, path) instead.
 void saveExcel(String excel)
          Deprecated. use setFilePath(Builder.EXCEL, path) instead.
 void saveExcelData(String excel)
          Deprecated. use setFilePath(Builder.EXCEL_DATA, path) instead.
 void saveExcelLayout(String excel)
          Deprecated. use setFilePath(Builder.EXCEL_SHEET, path) instead.
 void saveHTML(String html)
          Deprecated. use setFilePath(Builder.HTML_BUNDLE, path) instead.
 void saveHTMLNoPages(String html)
          Deprecated. use setFilePath(Builder.HTML_BUNDLE_NO_PAGINATION, path) instead.
 void saveInArchive(String path, int fmt, Permission perm, ArchiveRule rule, String comment)
          Save the generated report in report archive.
 void savePDF(String pdf)
          Deprecated. use setFilePath(Builder.PDF, path) instead.
 void savePPT(String ppt)
          Deprecated. use setFilePath(Builder.POWERPOINT, path) instead.
 void saveRTF(String rtf)
          Deprecated. use setFilePath(Builder.RTF, path) instead.
 void saveRTFLayout(String rtf)
          Deprecated. use setFilePath(Builder.RTF_LAYOUT, path) instead.
 void saveSVG(String svg)
          Deprecated. use setFilePath(Builder.SVG, path) instead.
 void saveTxt(String txt)
          Deprecated. use setFilePath(Builder.TEXT, path) instead.
 void saveXML(String xml)
          Deprecated. use setFilePath(Builder.XML, path) instead.
 void setAlerts(ScheduleAlert[] alerts)
          Sets the alert conditions for this action.
 void setArchiveComment(String comment)
          Set the comment associated with this report.
 void setArchiveFormat(int format)
          Set the format to save the report in archive.
 void setArchivePath(String path)
          Set the path in the archive to save a report.
 void setArchivePermission(Permission perm)
          Set the permission in the archive to save a report.
 void setArchiveRule(ArchiveRule rule)
          Set the archive rule of the saved report.
 void setEncoding(boolean encoding)
          Set encoding flag.
 void setFilePath(int format, String path)
          Sets the file path to which to save the file in a particular format.
 void setLocale(String locale)
          Set the locale to be used by this replet action.
 void setPrinters(String[] printers)
          Add a printer to print the output of the replet.
 void setRepletName(String replet)
          Set the name of the replet to execute.
 void setRepletRequest(RepletRequest req)
          Set the request used to generate the report.
 String toString()
           
 void writeXML(PrintWriter writer)
          Write itself to a xml file
 
Methods inherited from class inetsoft.sree.schedule.AbstractAction
byteDecode, byteEncode, cancel, getAttachmentName, getEmails, getEmails, getFileFormat, getFrom, getMessage, getNotifications, getPassword, getSubject, isCanceled, isCompressFile, isEncoding, isNotifyError, notify, setAttachmentName, setCompressFile, setEmails, setFileFormat, setFrom, setMessage, setNotifications, setNotifyError, setPassword, setSubject
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RepletAction

public RepletAction()
Create an empty action.


RepletAction

public RepletAction(String replet,
                    RepletRequest request)
A replet action for the specified replet. When this action is executed, the replet is created and the result is printed and/or mailed.

Method Detail

setPrinters

public void setPrinters(String[] printers)
Add a printer to print the output of the replet.

Parameters:
printers - printer name.

mailTo

public void mailTo(String email,
                   String from,
                   String fmt,
                   String msg)
Add one or more emails to send the output of the replet to.

Parameters:
email - comma separated email list.
from - the from text of the email header.
fmt - file format, "PDF" or one of the format names defined in Builder.
msg - email text message.

mailTo

public void mailTo(String email,
                   String from,
                   String fmt,
                   String subject,
                   String msg)
Add one or more emails to send the output of the replet to.

Parameters:
email - comma separated email list.
from - the from text of the email header.
fmt - file format, "PDF" or one of the format names defined in Builder.
subject - email subject line.
msg - email text message.

mailTo

public void mailTo(String email,
                   String from,
                   String fmt,
                   boolean compress,
                   String subject,
                   String msg)
Add one or more emails to send the output of the replet to.

Parameters:
email - comma separated email list.
from - the from text of the email header.
fmt - file format, "PDF" or one of the format names defined in Builder.
compress - flag indicating whether or not the exported file is to be compressed.
subject - email subject line.
msg - email text message.

mailTo

public void mailTo(String email,
                   String from,
                   String fmt,
                   boolean compress,
                   String subject,
                   String msg,
                   String attachmentName)
Add one or more emails to send the output of the replet to.

Parameters:
email - comma separated email list.
from - the from text of the email header.
fmt - file format, "PDF" or one of the format names defined in Builder.
compress - flag indicating whether or not the exported file is to be compressed.
subject - email subject line.
msg - email text message.
attachmentName - email attachment's name.

saveInArchive

public void saveInArchive(String path,
                          int fmt,
                          Permission perm,
                          ArchiveRule rule,
                          String comment)
Save the generated report in report archive.

Parameters:
path - report path in the archive.
fmt - one of the format constants defined in Builder or RepletRepository.
perm - saved report access permission.
rule - archive rule.
comment - for the saved report.

clearSaveInArchive

public void clearSaveInArchive()
Remove the save in archive action.


getRepletName

public String getRepletName()
Get the name of the replet.

Specified by:
getRepletName in interface RepletSupport

setRepletName

public void setRepletName(String replet)
Set the name of the replet to execute.

Specified by:
setRepletName in interface RepletSupport

getRepletRequest

public RepletRequest getRepletRequest()
Get the request used to generate the report.


setRepletRequest

public void setRepletRequest(RepletRequest req)
Set the request used to generate the report.


getLocale

public String getLocale()
Get the locale used by this replet action.

Returns:
Locale used by this replet action.

setLocale

public void setLocale(String locale)
Set the locale to be used by this replet action.

Parameters:
locale - to be used by this replet action.

getPrinters

public String[] getPrinters()
Get all printers.


getPrinterList

public String getPrinterList()
Get printers as a comma separated list

Returns:
a String containing the printers

isSaveToDisk

public boolean isSaveToDisk()
Return whether the action exports to disk.


setArchivePath

public void setArchivePath(String path)
Set the path in the archive to save a report.

Specified by:
setArchivePath in interface ArchiveSupport

getArchivePath

public String getArchivePath()
Get the path in the archive to save a report.

Specified by:
getArchivePath in interface ArchiveSupport

setArchiveFormat

public void setArchiveFormat(int format)
Set the format to save the report in archive.

Specified by:
setArchiveFormat in interface ArchiveSupport

getArchiveFormat

public int getArchiveFormat()
Get the format to save the report in archive.

Specified by:
getArchiveFormat in interface ArchiveSupport

setArchivePermission

public void setArchivePermission(Permission perm)
Set the permission in the archive to save a report.

Specified by:
setArchivePermission in interface ArchiveSupport

getArchivePermission

public Permission getArchivePermission()
Get the saved copy's permission.

Specified by:
getArchivePermission in interface ArchiveSupport

setArchiveRule

public void setArchiveRule(ArchiveRule rule)
Set the archive rule of the saved report.

Specified by:
setArchiveRule in interface ArchiveSupport

getArchiveRule

public ArchiveRule getArchiveRule()
Get the archive rule of the saved report.

Specified by:
getArchiveRule in interface ArchiveSupport

setArchiveComment

public void setArchiveComment(String comment)
Set the comment associated with this report.

Specified by:
setArchiveComment in interface ArchiveSupport

getArchiveComment

public String getArchiveComment()
Get the comment associated with this report.

Specified by:
getArchiveComment in interface ArchiveSupport

saveXML

public void saveXML(String xml)
Deprecated. use setFilePath(Builder.XML, path) instead.

Save the result of the report to a XML file.

Parameters:
xml - full path of the file.

getXML

public String getXML()
Deprecated. use getFilePath(Builder.XML) instead.

Get the path to the XML file to save.

Returns:
the path to the XML file or null if the report should not be saved to XML.

savePDF

public void savePDF(String pdf)
Deprecated. use setFilePath(Builder.PDF, path) instead.

Save the result of the report to a PDF file.

Parameters:
pdf - full path of the file.

getPDF

public String getPDF()
Deprecated. use getFilePath(Builder.PDF) instead.

Get the path to the PDF file to save.

Returns:
the path to the PDF file or null if the report should not be saved to PDF.

saveHTML

public void saveHTML(String html)
Deprecated. use setFilePath(Builder.HTML_BUNDLE, path) instead.

Save the result of the report to a HTML file.

Parameters:
html - full path of the file.

getHTML

public String getHTML()
Deprecated. use getFilePath(Builder.HTML_BUNDLE) instead.

Get the path to the HTML file to save.

Returns:
the path to the HTML file or null if the report should not be saved to HTML.

saveHTMLNoPages

public void saveHTMLNoPages(String html)
Deprecated. use setFilePath(Builder.HTML_BUNDLE_NO_PAGINATION, path) instead.

Save the result of the report to a HTML file w/o pagenation.

Parameters:
html - full path of the file.

getHTMLNoPages

public String getHTMLNoPages()
Deprecated. use getFilePath(Builder.HTML_BUNDLE_NO_PAGINATION) instead.

Get the path to the HTML file to save.

Returns:
the path to the HTML file or null if the report should not be saved to HTML.

saveExcel

public void saveExcel(String excel)
Deprecated. use setFilePath(Builder.EXCEL, path) instead.

Save the generated report in Excel format.

Parameters:
excel - the path to the Excel file to save.

getExcel

public String getExcel()
Deprecated. use getFilePath(Builder.EXCEL) instead.

Get the path to the Excel file to save.

Returns:
the path to the Excel file or null if the report should not be saved to Excel.

saveExcelLayout

public void saveExcelLayout(String excel)
Deprecated. use setFilePath(Builder.EXCEL_SHEET, path) instead.

Save the generated report in Excel Layout format.

Parameters:
excel - the path to the Excel Layout file to save.

getExcelLayout

public String getExcelLayout()
Deprecated. use getFilePath(Builder.EXCEL_SHEET) instead.

Get the path to the Excel Layout file to save.

Returns:
the path to the Excel Layout file or null if the report should not be saved to Excel Layout.

saveExcelData

public void saveExcelData(String excel)
Deprecated. use setFilePath(Builder.EXCEL_DATA, path) instead.

Save the generated report in Excel Data format.

Parameters:
excel - the path to the Excel Data file to save.

getExcelData

public String getExcelData()
Deprecated. use getFilePath(Builder.EXCEL_DATA) instead.

Get the path to the Excel Data file to save.

Returns:
the path to the Excel Data file or null if the report should not be saved to Excel Data.

saveRTF

public void saveRTF(String rtf)
Deprecated. use setFilePath(Builder.RTF, path) instead.

Save the generated report in RTF format.

Parameters:
rtf - the path to the RTF file to save.

getRTF

public String getRTF()
Deprecated. use getFilePath(Builder.RTF) instead.

Get the path to the RTF file to save.

Returns:
the path to the RTF file or null if the report should not be saved to RTF.

saveRTFLayout

public void saveRTFLayout(String rtf)
Deprecated. use setFilePath(Builder.RTF_LAYOUT, path) instead.

Save the generated report in RTF Layout format.

Parameters:
rtf - the path to the RTF Layout file to save.

getRTFLayout

public String getRTFLayout()
Deprecated. use getFilePath(Builder.RTF_LAYOUT) instead.

Get the path to the RTF Layout file to save.

Returns:
the path to the RTF Layout file or null if the report should not be saved to RTF Layout.

saveSVG

public void saveSVG(String svg)
Deprecated. use setFilePath(Builder.SVG, path) instead.

Save the generated report in SVG format.

Parameters:
svg - the path to the SVG file to save.

getPPT

public String getPPT()
Deprecated. use getFilePath(Builder.POWERPOINT) instead.

Get the path to the ppt file to save.

Returns:
the path to the ppt file or null if the report should not be saved to ppt.

savePPT

public void savePPT(String ppt)
Deprecated. use setFilePath(Builder.POWERPOINT, path) instead.

Save the generated report in ppt format.

Parameters:
ppt - the path to the ppt file to save.

getSVG

public String getSVG()
Deprecated. use getFilePath(Builder.SVG) instead.

Get the path to the SVG file to save.

Returns:
the path to the SVG file or null if the report should not be saved to SVG.

saveCSV

public void saveCSV(String csv)
Deprecated. use setFilePath(Builder.CSV, path) instead.

Save the generated report in CSV format.

Parameters:
csv - the path to the CSV file to save.

getCSV

public String getCSV()
Deprecated. use getFilePath(Builder.CSV) instead.

Get the path to the CSV file to save.

Returns:
the path to the CSV file or null if the report should not be saved to CSV.

saveTxt

public void saveTxt(String txt)
Deprecated. use setFilePath(Builder.TEXT, path) instead.

Save the generated report in Txt format.

Parameters:
txt - the path to the Txt file to save.

getTxt

public String getTxt()
Deprecated. use getFilePath(Builder.TEXT) instead.

Get the path to the Txt file to save.

Returns:
the path to the Txt file or null if the report should not be saved to Txt.

setFilePath

public void setFilePath(int format,
                        String path)
Sets the file path to which to save the file in a particular format.

Parameters:
format - the format in which to save. Must be a format supported by inetsoft.report.io.Builder.
path - the file path.
Since:
7.0

getFilePath

public String getFilePath(int format)
Gets the file path at which the file will be saved for a particular format.

Parameters:
format - the format for which to get the file path. Must be a format type supported by inetsoft.report.io.Builder.
Returns:
the file path or null if the file will not be saved in the specified format.
Since:
7.0

getSaveFormats

public int[] getSaveFormats()
Gets a list of all the formats in which the report will be saved.

Returns:
an array of format types. These are format types supported by inetsoft.report.io.Builder.

getAlerts

public ScheduleAlert[] getAlerts()
Gets the alert conditions for this action.

Returns:
the alert conditions.

setAlerts

public void setAlerts(ScheduleAlert[] alerts)
Sets the alert conditions for this action.

Parameters:
alerts - the alert conditions.

run

public void run(Principal principal)
         throws Throwable
Execute this action.

Specified by:
run in interface ScheduleAction
Parameters:
principal - represents an entity
Throws:
Throwable

prepareReplet

protected Object prepareReplet(Principal principal,
                               RepletRepository repository)
                        throws Throwable
Throws:
Throwable

runRepletAction

public Object runRepletAction(Principal principal,
                              RepletRepository repository)
                       throws Throwable
Executes this action. The caller is responsible for destroying the replet.

Parameters:
principal - the user that is executing the action.
repository - the replet engine.
Returns:
the unique ID of the executed replet.
Throws:
Throwable - if an error occurs while executing this action.

toString

public String toString()
Overrides:
toString in class Object

clone

public Object clone()
Overrides:
clone in class Object

writeXML

public void writeXML(PrintWriter writer)
Write itself to a xml file

Specified by:
writeXML in interface inetsoft.util.XMLSerializable

parseXML

public void parseXML(Element action)
              throws Exception
Parse the replet action definition from xml.

Specified by:
parseXML in interface inetsoft.util.XMLSerializable
Throws:
Exception

equals

public boolean equals(Object val)
Overrides:
equals in class Object

setEncoding

public void setEncoding(boolean encoding)
Set encoding flag.

Specified by:
setEncoding in interface inetsoft.sree.internal.HttpXMLSerializable
Overrides:
setEncoding in class AbstractAction
Parameters:
encoding - true to encode.

getScheduleEmails

public String getScheduleEmails(RepletEngine engine,
                                Object id)
Get the schedule info.


Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.