Package com.microstrategy.web.app
Class ExportFormat
- java.lang.Object
-
- com.microstrategy.utils.config.AbstractConfigurationElement
-
- com.microstrategy.web.app.ExportFormat
-
- All Implemented Interfaces:
ConfigurationElement,ConfigurationFile,java.lang.Cloneable
public class ExportFormat extends AbstractConfigurationElement
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.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.microstrategy.utils.config.AbstractConfigurationElement
AbstractConfigurationElement.FilteredList
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringATT_BEAN_TYPEstatic java.lang.StringATT_CHARSETstatic java.lang.StringATT_CODEPAGEstatic java.lang.StringATT_DESC_IDstatic java.lang.StringATT_DESCRIPTIONstatic java.lang.StringATT_EXECUTION_MODEstatic java.lang.StringATT_EXPORT_FORMAT_TYPEstatic java.lang.StringATT_FEATUREstatic java.lang.StringATT_FILE_EXTENSIONstatic java.lang.StringATT_FORCE_DOWNLOADstatic java.lang.StringATT_MIME_TYPEstatic java.lang.StringATT_NAMEstatic java.lang.StringATT_PAGE_NAMEstatic java.lang.StringATT_SAVE_REPORT_PROPSDeprecated.we now save properties for all formatsstatic java.lang.StringATT_STYLEstatic java.lang.StringATT_VIEW_MODEstatic java.lang.StringNODE_EXPORT_FORMAT-
Fields inherited from class com.microstrategy.utils.config.AbstractConfigurationElement
ATT_CONFIG_SRC, ATT_DELETED, ATT_POSITION, ATT_PROTOTYPE, ATT_USE_DEFAULT
-
-
Constructor Summary
Constructors Constructor Description ExportFormat()Class constructor.ExportFormat(org.w3c.dom.Node root)Class constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.StringgetBeanType()Returns the bean to which the export format belongs.java.lang.StringgetCharset(AppContext appContext)intgetCodepage(AppContext appContext)java.lang.StringgetDescription()Returns a description that the application should use to display the export format if the desc-id attribute is missing.java.lang.StringgetDescriptorID()Returns the Resource Bundle item id that the application should use to display the export format in the language of the user's locale.java.lang.StringgetExecutionMode()Returns the execution mode that the export format uses.java.lang.StringgetExportFormatType()Returns the type of this export format.java.lang.StringgetFeature()Returns the id of a feature that is evaluated to determine whether the export-format should be displayed as an option.java.lang.StringgetFileExtension()Returns the extension that the application gives to the file that is created when exporting using the export format.booleangetForceDownload()protected java.lang.StringgetKeyAttribute()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 thegetKeyandsetKeymethods.java.lang.StringgetMessage(Messages messages)java.lang.StringgetMimeType()Returns the mime-type that the export format uses.java.lang.StringgetName()Returns the export-format's name, a unique identifier for the export-format.java.lang.StringgetPageName()Returns the page's name that the application uses when exporting using the specified export format.booleangetSaveReportProps()Deprecated.we now save properties for all formatsjava.lang.StringgetStyle()Returns the name of a style (from the Style Catalog) that is used to transform the corresponding bean when exporting using the export format.java.lang.StringgetViewMode()Returns the view mode that the export format uses.java.lang.StringgetViewModeName()Deprecated.use getViewMode()protected voidinitDefaultAttributes()This method can be overridden to set default values for attributes.booleanisCsvOrExcelWithPlaintext(AppContext appContext)booleanisExcel()Whether the export format is for Excel with plaintext or Excel with formatting
Determined based on the export format type propertybooleanisExportFormatAvailable(java.lang.String beanType, java.lang.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.booleanisPlainText()Whether the export format is plaintext (Excel with plaintext, CSV or Plaintext)
Determined based on the export format type property.booleanisRealPlainText(AppContext appContext)Whether the export format is plaintext.voidsetBeanType(java.lang.String beanType)Indicates the bean to which the export format belongs.voidsetCharset(boolean charset)Set the charset to use when exporting.voidsetCodepage(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".voidsetDescription(java.lang.String description)Provides a descriptor that the application should use to display the export format if the desc-id attribute is missing.voidsetDescriptorID(java.lang.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.voidsetExecutionMode(java.lang.String executionMode)Indicates the execution mode that the export format uses.voidsetExportFormatType(java.lang.String exportFormatType)Sets the type of this export format.voidsetFeature(java.lang.String feature)Sets the name of a feature that is evaluated to determine whether the export-format should be displayed as an option.voidsetFileExtension(java.lang.String fileExtension)Sets the extension that the application will give to the file that is created when exporting using the export format.voidsetForceDownload(boolean forceDownload)Set whether to force the browser to download the file by adding "attachment" to the Content-Disposition HTTP headervoidsetMimeType(java.lang.String mimeType)Indicates the mime-type that the export format should use.voidsetName(java.lang.String exportFormatName)Sets the export-format's name, which needs to be a unique identifier for the export-format.voidsetPageName(java.lang.String pageName)Indicates the page that the application will use when exporting using this ExportFormat.voidsetSaveReportProps(boolean saveReportProps)Deprecated.we now save properties for all formatsvoidsetStyle(java.lang.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.voidsetViewMode(java.lang.String viewMode)Indicates the view mode that the export format uses.voidsetViewModeName(java.lang.String viewModeName)Deprecated.use setViewMode()-
Methods inherited from class com.microstrategy.utils.config.AbstractConfigurationElement
addFileSource, applyCustomization, applyCustomizations, cleanUpDeletedElements, clone, delete, deltas, deltas, equalAtts, equalElements, equalNodeValues, equals, equalsIncludingDeletedElements, exportAttributesToXML, exportElementsToXML, exportNodeValueToXML, getAttribute, getAttributes, getBoolAttribute, getChildKey, getConfigSrc, getDTDFileName, getElement, getElement, getElements, getFileLoader, getIntAttribute, getIntAttribute, getKey, getLineNumber, getList, getNextKey, getNodeName, getNodeValue, getNodeValue, getOrCreateElement, getParent, getPosition, getPrototype, getRegisteredClass, getSelfInitPath, getSource, getStrAttribute, getUseDefault, getXMLParserParameters, getXMLSerializerParameters, hashCode, hashCodeAtts, hashCodeElements, hashCodeNodeValues, hasRegisteredClass, initAttributesFromXML, initElementFromXML, initElementsFromXML, initFromFile, initFromResource, initFromXML, initFromXML, initNodeValueFromXML, initPrototype, isActive, isCustomized, isDeleted, isDirty, isInSource, isKeyAttribute, load, mergeChanges, newChildInstance, newSource, original, populate, printAttributes, printElements, printNodeValue, refreshLists, registerClass, registerElement, registerElement, registerElementList, reload, reloadPrototype, removeAttribute, removeDefaults, replaceList, restore, save, save, saveChangesAs, saveConfig, saveFlatXML, saveNode, saveSource, setAttribute, setBoolAttribute, setChildOriginals, setConfigSrc, setCustomized, setElement, setFileLoader, setIntAttribute, setKey, setLineNumber, setNodeName, setNodeValue, setPosition, setPrototype, setSelfInitPath, setStrAttribute, setUseDefault, setUseValidation, throwConfigParseException, toString, toXML, toXML, toXML, toXML, useNodeValue, useValidation
-
-
-
-
Field Detail
-
ATT_NAME
public static final java.lang.String ATT_NAME
- See Also:
- Constant Field Values
-
ATT_DESC_ID
public static final java.lang.String ATT_DESC_ID
- See Also:
- Constant Field Values
-
ATT_DESCRIPTION
public static final java.lang.String ATT_DESCRIPTION
- See Also:
- Constant Field Values
-
ATT_BEAN_TYPE
public static final java.lang.String ATT_BEAN_TYPE
- See Also:
- Constant Field Values
-
ATT_VIEW_MODE
public static final java.lang.String ATT_VIEW_MODE
- See Also:
- Constant Field Values
-
ATT_STYLE
public static final java.lang.String ATT_STYLE
- See Also:
- Constant Field Values
-
ATT_MIME_TYPE
public static final java.lang.String ATT_MIME_TYPE
- See Also:
- Constant Field Values
-
ATT_FILE_EXTENSION
public static final java.lang.String ATT_FILE_EXTENSION
- See Also:
- Constant Field Values
-
ATT_EXPORT_FORMAT_TYPE
public static final java.lang.String ATT_EXPORT_FORMAT_TYPE
- Since:
- MicroStrategy Web 8.0.0
- See Also:
- Constant Field Values
-
ATT_PAGE_NAME
public static final java.lang.String ATT_PAGE_NAME
- Since:
- MicroStrategy Web 8.0.0
- See Also:
- Constant Field Values
-
ATT_SAVE_REPORT_PROPS
@Deprecated public static final java.lang.String ATT_SAVE_REPORT_PROPS
Deprecated.we now save properties for all formats- Since:
- MicroStrategy Web 8.0.1
- See Also:
- Constant Field Values
-
ATT_FEATURE
public static final java.lang.String ATT_FEATURE
- Since:
- MicroStrategy Web 8.0.1
- See Also:
- Constant Field Values
-
ATT_EXECUTION_MODE
public static final java.lang.String ATT_EXECUTION_MODE
- Since:
- MicroStrategy Web 8.0.2
- See Also:
- Constant Field Values
-
ATT_FORCE_DOWNLOAD
public static final java.lang.String ATT_FORCE_DOWNLOAD
- Since:
- MicroStrategy Web 8.0.2
- See Also:
- Constant Field Values
-
ATT_CHARSET
public static final java.lang.String ATT_CHARSET
- Since:
- MicroStrategy Web 9.0.0
- See Also:
- Constant Field Values
-
ATT_CODEPAGE
public static final java.lang.String ATT_CODEPAGE
- Since:
- MicroStrategy Web 9.0.0
- See Also:
- Constant Field Values
-
NODE_EXPORT_FORMAT
public static final java.lang.String NODE_EXPORT_FORMAT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ExportFormat
public ExportFormat()
Class constructor. Initializes a new -empty- instance of the exportFormat class.
-
ExportFormat
public ExportFormat(org.w3c.dom.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.
-
-
Method Detail
-
getKeyAttribute
protected java.lang.String getKeyAttribute()
Description copied from class:AbstractConfigurationElementThis method must return the attribute that uniquely identifies this element among its siblings; if no single attribute can be used, return null and override thegetKeyandsetKeymethods.- Specified by:
getKeyAttributein classAbstractConfigurationElement- Since:
- MicroStrategy Web 9.0.0
-
initDefaultAttributes
protected void initDefaultAttributes()
Description copied from class:AbstractConfigurationElementThis method can be overridden to set default values for attributes. Simply extend this method and callAbstractConfigurationElement.setAttribute(java.lang.String, java.lang.Object)- Overrides:
initDefaultAttributesin classAbstractConfigurationElement- Since:
- MicroStrategy Web 9.0.0
-
getMessage
public java.lang.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.
-
getName
public java.lang.String getName()
Returns the export-format's name, a unique identifier for the export-format.
-
setName
public void setName(java.lang.String exportFormatName)
Sets the export-format's name, which needs to be a unique identifier for the export-format.
-
getPageName
public java.lang.String getPageName()
Returns the page's name that the application uses when exporting using the specified export format.- Since:
- MicroStrategy Web 8.0.0
-
setPageName
public void setPageName(java.lang.String pageName)
Indicates the page that the application will use when exporting using this ExportFormat.- Since:
- MicroStrategy Web 8.0.0
-
getDescriptorID
public java.lang.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.
-
setDescriptorID
public void setDescriptorID(java.lang.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.
-
getDescription
public java.lang.String getDescription()
Returns a description that the application should use to display the export format if the desc-id attribute is missing.
-
setDescription
public void setDescription(java.lang.String description)
Provides a descriptor that the application should use to display the export format if the desc-id attribute is missing.
-
getBeanType
public java.lang.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).- See Also:
setBeanType(java.lang.String)
-
setBeanType
public void setBeanType(java.lang.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:ReportBeanDocumentBeanRWBean
-
getViewMode
public java.lang.String getViewMode()
Returns the view mode that the export format uses. It returns the actual (resolved) value from theEnumWebReportViewMode.ReportViewModeGridenumeration. If the view mode is not defined, it returnsnull.
-
setViewMode
public void setViewMode(java.lang.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").
-
getViewModeName
@Deprecated public java.lang.String getViewModeName()
Deprecated.use getViewMode()- Returns:
- the view mode name of this export format
-
setViewModeName
@Deprecated public void setViewModeName(java.lang.String viewModeName)
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.
-
getStyle
public java.lang.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
-
setStyle
public void setStyle(java.lang.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.
-
getMimeType
public java.lang.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.
-
setMimeType
public void setMimeType(java.lang.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.
-
getFileExtension
public java.lang.String getFileExtension()
Returns the extension that the application gives to the file that is created when exporting using the export format.
-
setFileExtension
public void setFileExtension(java.lang.String fileExtension)
Sets the extension that the application will give to the file that is created when exporting using the export format.
-
getExportFormatType
public java.lang.String getExportFormatType()
Returns the type of this export format. It returns the actual (resolved) value from theEnumExportFormatsenumeration ornullif the value is undefined.- Since:
- MicroStrategy Web 8.0.0
-
setExportFormatType
public void setExportFormatType(java.lang.String exportFormatType)
Sets the type of this export format. The value must be a valid fully-qualified name of the values defined in thisEnumExportFormatsinternface, for example, "com.microstrategy.web.app.beans.EnumExportFormats.ExportFormatExcelWithPlaintext".- Parameters:
exportFormatType- the export format type to be used on this export format.- Since:
- MicroStrategy Web 8.0.0
-
getSaveReportProps
@Deprecated public boolean getSaveReportProps()
Deprecated.we now save properties for all formatsReturns whether the options selected by the user in the export dialog should be saved back as part of the report-properties.- Since:
- MicroStrategy Web 8.0.1
-
setSaveReportProps
@Deprecated public void setSaveReportProps(boolean saveReportProps)
Deprecated.we now save properties for all formatsIndicates whether the options selected by the user in the export dialog should be saved back as part of the report-properties.- Since:
- MicroStrategy Web 8.0.1
-
getFeature
public java.lang.String getFeature()
Returns the id of a feature that is evaluated to determine whether the export-format should be displayed as an option.- Since:
- MicroStrategy Web 8.0.1
-
setFeature
public void setFeature(java.lang.String feature)
Sets the name of a feature that is evaluated to determine whether the export-format should be displayed as an option.- Since:
- MicroStrategy Web 8.0.1
-
getExecutionMode
public java.lang.String getExecutionMode()
Returns the execution mode that the export format uses. It returns the actual (resolved) value from theEnumRWExecutionModesenumeration, ornullif the value is underined.- Since:
- MicroStrategy Web 8.0.2
-
setExecutionMode
public void setExecutionMode(java.lang.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 theEnumRWExecutionModesenumeration for example, "com.microstrategy.web.objects.rw.EnumRWExecutionModes.RW_MODE_PDF".- Since:
- MicroStrategy Web 8.0.2
-
getForceDownload
public boolean getForceDownload()
- Returns:
- whether to force the browser to download the file by adding "attachment" to the Content-Disposition HTTP header
- Since:
- MicroStrategy Web 8.0.2
-
setForceDownload
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- Since:
- MicroStrategy Web 8.0.2
-
getCharset
public java.lang.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
- Since:
- MicroStrategy Web 9.0.0
-
setCharset
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.- Since:
- MicroStrategy Web 9.0.0
-
getCodepage
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
- Since:
- MicroStrategy Web 9.0.0
-
setCodepage
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.- Since:
- MicroStrategy Web 9.0.0
-
isPlainText
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
- Since:
- MicroStrategy Web 8.0.0
-
isExcel
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
- Since:
- MicroStrategy Web 8.0.0
-
isExportFormatAvailable
public boolean isExportFormatAvailable(java.lang.String beanType, java.lang.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 typeviewMode- The report's view modebaseBean- The base bean used to solve the feature-id on the export format if any.- Returns:
- whether the export format is available
- Since:
- MicroStrategy Web 8.0.2
-
isRealPlainText
public boolean isRealPlainText(AppContext appContext)
Whether the export format is plaintext.- Parameters:
appContext- the application's context- Returns:
- whether the export format is plaintext
-
isCsvOrExcelWithPlaintext
public boolean isCsvOrExcelWithPlaintext(AppContext appContext)
-
-