java.lang.Object | |
↳ | com.microstrategy.web.admin.transforms.DiagnosticsViewerTransformHelper |
Title: DiagnosticsViewerTransformHelper This class provides a series of helper methods for building up the XML that will be displayed to the user as Log Diagnostic information
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | FILE_READING_EXCEPTION | Identifier for exceptions generated related with problems reading a file on the specified path location | |||||||||
int | WRONG_PARAMETERS_EXCEPTION | Identifier for exceptions generated related with wrong parameters received in the method call | |||||||||
int | XML_PARSING_EXCEPTION | Identifier for exceptions generated related with XML Parsing of a String or a File |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DiagnosticsViewerTransformHelper() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static HashList |
generateNumericComboContents(int start, int end)
Generate a combo box with the value range specified.
| ||||||||||
static BufferedReader |
getDiagnosticHTMLContent(TransformerFactory tFactory, DiagnosticsBean bean, String xslPath, Document originalXML)
Based on the XML received, transform it with the XSL indicated and return the result of the transform
on a BufferedReader instance.
| ||||||||||
static NodeList |
getSingleFileContent(DOMSupport domSupport, Document xmlDocument, String filePath)
Reads the contents of the file specified on the path, adds a beginning and ending tag for it to
be translated into an XML Document format.
| ||||||||||
static String |
getXMLLogFileContents(DiagnosticsBean bean, DOMSupport domSupport, Document xmlDocument)
Given the
DiagnosticsBean instance properties regarding start and end dates
to display log files, get the file information and gather it on a Document
instance. | ||||||||||
static void |
renderBufferedReaderContents(MarkupOutput out, BufferedReader bufferedReader)
Save the contents of the BufferedReader instance into the
MarkupOutput
instance so they can be displayed to the user. | ||||||||||
static void |
renderDateComboBoxes(MarkupOutput out, String formatString, int year, int month, int day, String paramYear, String paramMonth, String paramDay)
For the given year, month and day information, the format and the name of the
parameters to use, generate three combo boxes for allowing users to select dates.
| ||||||||||
static Document |
sortDiagnosticXMLFile(TransformerFactory tFactory, DiagnosticsBean bean, String xslPath, Document originalXML)
Given an original XML file, it transforms it with the xsl file specified.
| ||||||||||
static boolean |
validateDate(Calendar fromDate, Calendar toDate, DiagnosticsBean bean)
Validate the dates specified by the user.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Identifier for exceptions generated related with problems reading a file on the specified path location
Identifier for exceptions generated related with wrong parameters received in the method call
Identifier for exceptions generated related with XML Parsing of a String or a File
Generate a combo box with the value range specified. Used for building up combo boxes for representing days, months or years.
start | number where to start the list (inclusive) |
---|---|
end | number where to end the list (inclusive) |
HTMLHelper
Based on the XML received, transform it with the XSL indicated and return the result of the transform on a BufferedReader instance. Used normally for getting HTML from the XML and later on display it to the user.
tFactory | a TransformerFactory initialized instance |
---|---|
bean | DiagnosticsBean currently being transformed |
xslPath | a String with the location of the XSL file to use for transforming the
XML. Commonly, /WEB-INF/xml/DisplayErrors.xsl can be used. |
originalXML | the original XML containing the log information to be sorted |
WebAppException | if any error happened while transforming the XML. |
---|
Reads the contents of the file specified on the path, adds a beginning and ending tag for it to be translated into an XML Document format.
domSupport | DOMSupport initialized instance |
---|---|
xmlDocument | original Document instance where the generated XML node list will be copied over. |
filePath | String with the location and name of the file to read |
WebAppException | if any problem happens while reading the file contents or building up the
XML structure. The exceptions will use codes such as XML_PARSING_EXCEPTION ,
WRONG_PARAMETERS_EXCEPTION , etc.
|
---|
Given the DiagnosticsBean
instance properties regarding start and end dates
to display log files, get the file information and gather it on a Document
instance.
bean | DiagnosticsBean currently being transformed |
---|---|
domSupport | initialized DOMSupport instance |
xmlDocument | Document instance where the XML contents of the files will be saved. |
String
with the information of those log files that was
not possible to read. By specification, if there are log file contents to
display even that some files failed, an empty string will be returned.WebAppException |
---|
Save the contents of the BufferedReader instance into the MarkupOutput
instance so they can be displayed to the user.
out | MarkupOutput instance where to save the contents to be rendered |
---|---|
bufferedReader | BufferedReader instance with the information that should be displayed |
WebAppException | if an error happens while processing the BufferedReader instance. |
---|
For the given year, month and day information, the format and the name of the parameters to use, generate three combo boxes for allowing users to select dates.
out | MarkupOutput instance where to save the contents generated |
---|---|
formatString | a String like mmddyyyy which specifies in which order
year, month and day will be displayed |
year | the current value selected for year |
month | the current value selected for month |
day | the current value selected for day |
paramYear | the name of the parameter to use for the year combo box to generate |
paramMonth | the name of the parameter to use for the month combo box to generate |
paramDay | the name of the parameter to use for the day combo box to generate |
Given an original XML file, it transforms it with the xsl file specified. This method will mostly be used for sorting the contents of the log XML file given the configuration fields there included as well as the specifications on the XSL to be used.
tFactory | a TransformerFactory initialized instance |
---|---|
bean | DiagnosticsBean currently being transformed |
xslPath | a String with the location of the XSL file to use for transforming the
XML. Commonly, /WEB-INF/xml/SortErrors.xsl can be used. |
originalXML | the original XML containing the log information to be sorted |
WebAppException | if any error happens while transforming the XML |
---|
Validate the dates specified by the user.
fromDate | a Calendar instance initialized with the start date, loaded from individual year, month and day values |
---|---|
toDate | a Calendar instance initialized with the end date, loaded from individual year, month and day values |
bean | the DiagnosticsBean instance being transformed, and where the start and end dates are also stored. |
True
if the dates are validWebAppException | if an error happens while analyzing the dates or if the dates are not validated properly. For example, if the start date is after the end date, if a date does not make sense (Feb 30), etc. |
---|