public class

ExportFormat

extends AbstractConfigurationElement
java.lang.Object
   ↳ com.microstrategy.utils.config.AbstractConfigurationElement
     ↳ com.microstrategy.web.app.ExportFormat

Class Overview

Defines the properties of a single export format supported by the application. The application presents this export-format to the user when the export functionality is used.

Summary

Constants
String ATT_BEAN_TYPE
String ATT_CHARSET
String ATT_CODEPAGE
String ATT_DESCRIPTION
String ATT_DESC_ID
String ATT_EXECUTION_MODE
String ATT_EXPORT_FORMAT_TYPE
String ATT_FEATURE
String ATT_FILE_EXTENSION
String ATT_FORCE_DOWNLOAD
String ATT_MIME_TYPE
String ATT_NAME
String ATT_PAGE_NAME
String ATT_SAVE_REPORT_PROPS This constant is deprecated. we now save properties for all formats
String ATT_STYLE
String ATT_VIEW_MODE
String NODE_EXPORT_FORMAT
[Expand]
Inherited Constants
From class com.microstrategy.utils.config.AbstractConfigurationElement
Public Constructors
ExportFormat()
Class constructor.
ExportFormat(Node root)
Class constructor.
Public Methods
String getBeanType()
Returns the bean to which the export format belongs.
String getCharset(AppContext appContext)
int getCodepage(AppContext appContext)
String getDescription()
Returns a description that the application should use to display the export format if the desc-id attribute is missing.
String getDescriptorID()
Returns the Resource Bundle item id that the application should use to display the export format in the language of the user's locale.
String getExecutionMode()
Returns the execution mode that the export format uses.
String getExportFormatType()
Returns the type of this export format.
String getFeature()
Returns the id of a feature that is evaluated to determine whether the export-format should be displayed as an option.
String getFileExtension()
Returns the extension that the application gives to the file that is created when exporting using the export format.
boolean getForceDownload()
String getMessage(Messages messages)
String getMimeType()
Returns the mime-type that the export format uses.
String getName()
Returns the export-format's name, a unique identifier for the export-format.
String getPageName()
Returns the page's name that the application uses when exporting using the specified export format.
boolean getSaveReportProps()
This method is deprecated. we now save properties for all formats
String getStyle()
Returns the name of a style (from the Style Catalog) that is used to transform the corresponding bean when exporting using the export format.
String getViewMode()
Returns the view mode that the export format uses.
String getViewModeName()
This method is deprecated. use getViewMode()
boolean isExcel()
Whether the export format is for Excel with plaintext or Excel with formatting
Determined based on the export format type property
boolean isExportFormatAvailable(String beanType, String viewMode, WebComponent baseBean)
Utility method to determine if an export format is available based on the bean type, view mode and feature-id if present.
boolean isPlainText()
Whether the export format is plaintext (Excel with plaintext, CSV or Plaintext)
Determined based on the export format type property.
boolean isRealPlainText(AppContext appContext)
Whether the export format is plaintext.
void setBeanType(String beanType)
Indicates the bean to which the export format belongs.
void setCharset(boolean charset)
Set the charset to use when exporting.
void setCodepage(boolean codepage)
Set the codepage to use on ASP.NET when exporting.
void setDescription(String description)
Provides a descriptor that the application should use to display the export format if the desc-id attribute is missing.
void setDescriptorID(String descriptorID)
Indicates the Resource Bundle item id that the application should use to display the export format in the language of the user's locale.
void setExecutionMode(String executionMode)
Indicates the execution mode that the export format uses.
void setExportFormatType(String exportFormatType)
Sets the type of this export format.
void setFeature(String feature)
Sets the name of a feature that is evaluated to determine whether the export-format should be displayed as an option.
void setFileExtension(String fileExtension)
Sets the extension that the application will give to the file that is created when exporting using the export format.
void setForceDownload(boolean forceDownload)
Set whether to force the browser to download the file by adding "attachment" to the Content-Disposition HTTP header
void setMimeType(String mimeType)
Indicates the mime-type that the export format should use.
void setName(String exportFormatName)
Sets the export-format's name, which needs to be a unique identifier for the export-format.
void setPageName(String pageName)
Indicates the page that the application will use when exporting using this ExportFormat.
void setSaveReportProps(boolean saveReportProps)
This method is deprecated. we now save properties for all formats
void setStyle(String style)
Indicatges the name of a style (from the Style Catalog) that is used to transform the corresponding bean when exporting using the export format.
void setViewMode(String viewMode)
Indicates the view mode that the export format uses.
void setViewModeName(String viewModeName)
This method is deprecated. use setViewMode()
Protected Methods
String getKeyAttribute()
This method must return the attribute that uniquely identifies this element among its siblings; if no single attribute can be used, return null and override the getKey and setKey methods.
void initDefaultAttributes()
This method can be overridden to set default values for attributes.
[Expand]
Inherited Methods
From class com.microstrategy.utils.config.AbstractConfigurationElement
From class java.lang.Object
From interface com.microstrategy.utils.config.ConfigurationElement
From interface com.microstrategy.utils.config.ConfigurationFile

Constants

public static final String ATT_BEAN_TYPE

Constant Value: "bean-type"

public static final String ATT_CHARSET

Constant Value: "charset"

public static final String ATT_CODEPAGE

Constant Value: "codepage"

public static final String ATT_DESCRIPTION

Constant Value: "desc"

public static final String ATT_DESC_ID

Constant Value: "desc-id"

public static final String ATT_EXECUTION_MODE

Constant Value: "execution-mode"

public static final String ATT_EXPORT_FORMAT_TYPE

Constant Value: "export-format-type"

public static final String ATT_FEATURE

Constant Value: "feature-id"

public static final String ATT_FILE_EXTENSION

Constant Value: "file-extension"

public static final String ATT_FORCE_DOWNLOAD

Constant Value: "force-download"

public static final String ATT_MIME_TYPE

Constant Value: "mime-type"

public static final String ATT_NAME

Constant Value: "name"

public static final String ATT_PAGE_NAME

Constant Value: "page-name"

public static final String ATT_SAVE_REPORT_PROPS

This constant is deprecated.
we now save properties for all formats

Constant Value: "save-report-props"

public static final String ATT_STYLE

Constant Value: "style"

public static final String ATT_VIEW_MODE

Constant Value: "view-mode"

public static final String NODE_EXPORT_FORMAT

Constant Value: "export-format"

Public Constructors

public ExportFormat ()

Class constructor. Initializes a new -empty- instance of the exportFormat class.

public ExportFormat (Node root)

Class constructor. Initializes an Export format instance based on the information included on the XML Node

Parameters
root Node instance representing the export format information.

Public Methods

public String getBeanType ()

Returns the bean to which the export format belongs. In the export dialog this attributes dictactes which format to display depending on the object being exported (report, document or HTML Document).

public String getCharset (AppContext appContext)

Parameters
appContext the application's context
Returns
  • the charset to use when exporting.
    If not specified we read this from the value specified on the locales.xml like this:
    • "charset-excel". Excel with plaintext and CSV
        "charset". All other export formats

public int getCodepage (AppContext appContext)

Parameters
appContext the application's context
Returns
  • the codepage to use on ASP.NET when exporting.
    If not specified we read this from the value specified on the locales.xml like this:
    • "codepage-excel". Excel with plaintext and CSV
        "codepage". All other export formats

public String getDescription ()

Returns a description that the application should use to display the export format if the desc-id attribute is missing.

public String getDescriptorID ()

Returns the Resource Bundle item id that the application should use to display the export format in the language of the user's locale.

public String getExecutionMode ()

Returns the execution mode that the export format uses. It returns the actual (resolved) value from the EnumRWExecutionModes enumeration, or null if the value is underined.

public String getExportFormatType ()

Returns the type of this export format. It returns the actual (resolved) value from the EnumExportFormats enumeration or null if the value is undefined.

public String getFeature ()

Returns the id of a feature that is evaluated to determine whether the export-format should be displayed as an option.

public String getFileExtension ()

Returns the extension that the application gives to the file that is created when exporting using the export format.

public boolean getForceDownload ()

Returns
  • whether to force the browser to download the file by adding "attachment" to the Content-Disposition HTTP header

public String getMessage (Messages messages)

Parameters
messages the messages l10n object.
Returns
  • the export format's localized descriptor, or the description if the descriptionId is empty.

public String getMimeType ()

Returns the mime-type that the export format uses. This type is used by the browser to identify the type of content being sent.

public String getName ()

Returns the export-format's name, a unique identifier for the export-format.

public String getPageName ()

Returns the page's name that the application uses when exporting using the specified export format.

public boolean getSaveReportProps ()

This method is deprecated.
we now save properties for all formats

Returns whether the options selected by the user in the export dialog should be saved back as part of the report-properties.

public String getStyle ()

Returns the name of a style (from the Style Catalog) that is used to transform the corresponding bean when exporting using the export format. It only applies in export-formats that are used for reports

public String getViewMode ()

Returns the view mode that the export format uses. It returns the actual (resolved) value from the ReportViewModeGrid enumeration. If the view mode is not defined, it returns null.

public String getViewModeName ()

This method is deprecated.
use getViewMode()

Returns
  • the view mode name of this export format

public boolean isExcel ()

Whether the export format is for Excel with plaintext or Excel with formatting
Determined based on the export format type property

Returns
  • boolean whether the export format is for Excel

public boolean isExportFormatAvailable (String beanType, String viewMode, WebComponent baseBean)

Utility method to determine if an export format is available based on the bean type, view mode and feature-id if present.

Parameters
beanType The Export Format's bean type
viewMode The report's view mode
baseBean The base bean used to solve the feature-id on the export format if any.
Returns
  • whether the export format is available

public boolean isPlainText ()

Whether the export format is plaintext (Excel with plaintext, CSV or Plaintext)
Determined based on the export format type property.

Returns
  • boolean whether the export format is plaintext

public boolean isRealPlainText (AppContext appContext)

Whether the export format is plaintext.

Parameters
appContext the application's context
Returns
  • whether the export format is plaintext

public void setBeanType (String beanType)

Indicates the bean to which the export format belongs. In the export dialog this attributes dictactes which format to display depending on the object being exported (report, document or HTML Document). Possible values are:

  • ReportBean
  • DocumentBean
  • RWBean

public void setCharset (boolean charset)

Set the charset to use when exporting.
If not specified we read this from the value specified on the locales.xml like this:

    • "charset-excel". Excel with plaintext and CSV
        "charset". All other export formats

  • Parameters
    charset the charset to use when exporting.

    public void setCodepage (boolean codepage)

    Set the codepage to use on ASP.NET when exporting.
    If not specified we read this from the value specified on the locales.xml like this:

    • "codepage-excel". Excel with plaintext and CSV
        "codepage". All other export formats

  • Parameters
    codepage the codepage to use on ASP.NET when exporting.

    public void setDescription (String description)

    Provides a descriptor that the application should use to display the export format if the desc-id attribute is missing.

    public void setDescriptorID (String descriptorID)

    Indicates the Resource Bundle item id that the application should use to display the export format in the language of the user's locale.

    public void setExecutionMode (String executionMode)

    Indicates the execution mode that the export format uses. This execution-mode applies only to export formats that are used for documents, that is their bean-type is "RWBean". The values of the attribute are expressed using the fully-qualified name of the constants defined in the EnumRWExecutionModes enumeration for example, "com.microstrategy.web.objects.rw.EnumRWExecutionModes.RW_MODE_PDF".

    public void setExportFormatType (String exportFormatType)

    Sets the type of this export format. The value must be a valid fully-qualified name of the values defined in this EnumExportFormats internface, for example, "com.microstrategy.web.app.beans.EnumExportFormats.ExportFormatExcelWithPlaintext".

    Parameters
    exportFormatType the export format type to be used on this export format.

    public void setFeature (String feature)

    Sets the name of a feature that is evaluated to determine whether the export-format should be displayed as an option.

    public void setFileExtension (String fileExtension)

    Sets the extension that the application will give to the file that is created when exporting using the export format.

    public void setForceDownload (boolean forceDownload)

    Set whether to force the browser to download the file by adding "attachment" to the Content-Disposition HTTP header

    Parameters
    forceDownload whether to force the browser to download the file by adding "attachment" to the Content-Disposition HTTP header

    public void setMimeType (String mimeType)

    Indicates the mime-type that the export format should use. This type is used by the browser to identify the type of content being sent.

    public void setName (String exportFormatName)

    Sets the export-format's name, which needs to be a unique identifier for the export-format.

    public void setPageName (String pageName)

    Indicates the page that the application will use when exporting using this ExportFormat.

    public void setSaveReportProps (boolean saveReportProps)

    This method is deprecated.
    we now save properties for all formats

    Indicates whether the options selected by the user in the export dialog should be saved back as part of the report-properties.

    public void setStyle (String style)

    Indicatges the name of a style (from the Style Catalog) that is used to transform the corresponding bean when exporting using the export format. This attribute applies only to export formats that are used for reports (i.e. their beantype is ReportBean) , but in this case it is always required to have a valid value.

    public void setViewMode (String viewMode)

    Indicates the view mode that the export format uses. The values of the attribute are expressed using the fully-qualified name of the constants defined in the EnumWebReportViewMode interface for example, "com.microstrategy.web.objects.EnumWebReportViewMode.ReportViewModeGrid").

    public void setViewModeName (String viewModeName)

    This method is deprecated.
    use setViewMode()

    Set the view mode name of this export format to the given parameter

    Parameters
    viewModeName the view mode used on this export format.

    Protected Methods

    protected String getKeyAttribute ()

    This method must return the attribute that uniquely identifies this element among its siblings; if no single attribute can be used, return null and override the getKey and setKey methods.

    protected void initDefaultAttributes ()

    This method can be overridden to set default values for attributes. Simply extend this method and call setAttribute(String, Object)