Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## samples.javaclient.analyzer
Class AnalyzerUtilities

    java.lang.Object
      samples.javaclient.analyzer.AnalyzerUtilities

public class AnalyzerUtilities
extends java.lang.Object

Utility class. Provides methods that are used across the application. Methods in this class show how to:

- Instantiate and run a CalcBuilder: `runCalcBuilder()`
- Instantiate and run a QueryBuilder: `runQueryBuilder()`.
- Add a measure to the measure dimension in a query: `updateMeasures(oracle.dss.metadataManager.common.MDMeasure)`
- Use the PersistenceObjectChooser as an Open dialog: `showOpenDialog()`
- Use the PersistenceObjectChooser as a Save As dialog: `showSaveAsDialog()`
- Load a view from the BI Beans Catalog: `openView(java.lang.String, boolean, int, int, int, int)`
- Save a view to the BI Beans Catalog: `saveView(java.lang.String, oracle.dss.dataView.Dataview)`
Other methods display other dialogs and manage error messages.

Nested Class Summary
`private class` | `AnalyzerUtilities.OpenViewWorker` Inner class for opening a view on a separate thread.

Field Summary
`static java.lang.String` | `ERR_BAD_CATALOG_CREDENTIALS` Error BIB-01017.
`static java.lang.String` | `ERR_BAD_CONNECTION` Error BIB-16613.
`static java.lang.String` | `ERR_BAD_USER_CREDENTIALS` Error BIB-16612.
`static java.lang.String` | `ERR_INVALID_BIUSER` Error BIB-14736.
`static java.lang.String` | `ERR_INVALID_CATALOG_USER` Error BIB-14736.
`static java.lang.String` | `ERR_INVALID_OBJECT` Error BIB-14122.
`static java.lang.String` | `ERR_INVALID_ROOT` Error BIB-14820.
`private Analyzer` | `m_analyzer` Main application class.
`private AnalyzerConnection` | `m_connection` Connection for the application.
`private javax.swing.JLabel` | `m_statusText` Status message: "Status: Not connected".
`static java.lang.String` | `MSG_BAD_CATALOG_CREDENTIALS` Error message: "Invalid Catalog User ID or Password."
`static java.lang.String` | `MSG_BAD_CONNECTION` Error message: "Invalid host, port or SID."
`static java.lang.String` | `MSG_BAD_UNKNOWN` Error message: "Unable to connect."
`static java.lang.String` | `MSG_BAD_USER_CREDENTIALS` Error message: "Invalid User ID or Password."
`static java.lang.String` | `MSG_INVALID_OBJECT` Error message: "The crosstab or graph contains an invalid object(s).
`static java.lang.String` | `MSG_INVALID_ROOT` Error message: "The specified file-system directory does not exist."

Constructor Summary
`AnalyzerUtilities(Analyzer analyzer)` Constructor.

Method Summary
`javax.swing.JWindow` | `getBusyBar(java.lang.String message)` Gets the busy bar for this application.
`java.lang.String` | `getErrorText(java.lang.Throwable t)` Analyzes an exception and attempts to find an appropriate message to display to a user.
`void` | `openView(java.lang.String strName, boolean isDirty, int x, int y, int width, int height)` Loads a dataview in a separate thread.
`void` | `runCalcBuilder()` Runs the CalcBuilder wizard.
`void` | `runQueryBuilder()` Runs the QueryBuilder.
`(package private) boolean` | `saveView(java.lang.String strName, oracle.dss.dataView.Dataview dv)` Saves a presentation.
`(package private) void` | `showErrorMessage(java.lang.String strMsg, java.lang.Throwable t)` Displays an error message dialog.
`(package private) void` | `showExportDialog()` Displays the Export dialog.
`(package private) void` | `showGraphFormatDialog()` Displays the Graph Format dialog.
`(package private) void` | `showGraphTypeDialog()` Displays the Graph Type dialog.
`void` | `showOpenDialog()` Displays the Open dialog.
`(package private) void` | `showPrintDialog()` Displays the Print dialog.
`(package private) void` | `showSaveAsDialog()` Displays the Save As dialog.
`private void` | `updateMeasures(oracle.dss.metadataManager.common.MDMeasure mdMeasure)` Adds a new custom measure to the list of measures for the active view.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### m_analyzer

    private Analyzer m_analyzer

  Main application class.

### m_connection

    private AnalyzerConnection m_connection

  Connection for the application.

### m_statusText

    private javax.swing.JLabel m_statusText

  Status message: "Status: Not connected".

### MSG_BAD_UNKNOWN

    public static final java.lang.String MSG_BAD_UNKNOWN

  Error message: "Unable to connect."

  See Also:
    Constant Field Values

### MSG_BAD_USER_CREDENTIALS

    public static final java.lang.String MSG_BAD_USER_CREDENTIALS

  Error message: "Invalid User ID or Password."

  See Also:
    Constant Field Values

### MSG_BAD_CONNECTION

    public static final java.lang.String MSG_BAD_CONNECTION

  Error message: "Invalid host, port or SID."

  See Also:
    Constant Field Values

### MSG_BAD_CATALOG_CREDENTIALS

    public static final java.lang.String MSG_BAD_CATALOG_CREDENTIALS

  Error message: "Invalid Catalog User ID or Password."

  See Also:
    Constant Field Values

### MSG_INVALID_OBJECT

    public static final java.lang.String MSG_INVALID_OBJECT

  Error message: "The crosstab or graph contains an invalid object(s). Ensure that you have authorized access to the measures, calculations and saved selections that are used by the view."

  See Also:
    Constant Field Values

### MSG_INVALID_ROOT

    public static final java.lang.String MSG_INVALID_ROOT

  Error message: "The specified file-system directory does not exist."

  See Also:
    Constant Field Values

### ERR_BAD_USER_CREDENTIALS

    public static final java.lang.String ERR_BAD_USER_CREDENTIALS

  Error BIB-16612.

  See Also:
    `getErrorText(java.lang.Throwable)`, `MSG_BAD_USER_CREDENTIALS`, Constant Field Values

### ERR_BAD_CONNECTION

    public static final java.lang.String ERR_BAD_CONNECTION

  Error BIB-16613.

  See Also:
    `getErrorText(java.lang.Throwable)`, `MSG_BAD_CONNECTION`, Constant Field Values

### ERR_BAD_CATALOG_CREDENTIALS

    public static final java.lang.String ERR_BAD_CATALOG_CREDENTIALS

  Error BIB-01017.

  See Also:
    `getErrorText(java.lang.Throwable)`, `MSG_BAD_CATALOG_CREDENTIALS`, Constant Field Values

### ERR_INVALID_BIUSER

    public static final java.lang.String ERR_INVALID_BIUSER

  Error BIB-14736.

  See Also:
    `AnalyzerConnection.getCatalogConnection(oracle.dss.connection.client.Connection)`, Constant Field Values

### ERR_INVALID_CATALOG_USER

    public static final java.lang.String ERR_INVALID_CATALOG_USER

  Error BIB-14736.

  See Also:
    `AnalyzerConnection.getCatalogConnection(oracle.dss.connection.client.Connection)`, Constant Field Values

### ERR_INVALID_OBJECT

    public static final java.lang.String ERR_INVALID_OBJECT

  Error BIB-14122.

  See Also:
    `getErrorText(java.lang.Throwable)`, `#MSG_INVALID_CATALOG_USER`, Constant Field Values

### ERR_INVALID_ROOT

    public static final java.lang.String ERR_INVALID_ROOT

  Error BIB-14820.

  See Also:
    `getErrorText(java.lang.Throwable)`, `MSG_INVALID_ROOT`, Constant Field Values

Constructor Detail

### AnalyzerUtilities

    public AnalyzerUtilities(Analyzer analyzer)

  Constructor.

Parameters:
  `analyzer` - The main analyzer application class.

Method Detail

### runCalcBuilder

    public void runCalcBuilder()

  Runs the CalcBuilder wizard. If the CalcBuilder runs successfully, then this method inserts the newly created custom measure into the view that is in focus.

  See Also:
    `updateMeasures(oracle.dss.metadataManager.common.MDMeasure)`

### updateMeasures

    private void updateMeasures(oracle.dss.metadataManager.common.MDMeasure mdMeasure)
                         throws oracle.dss.selection.step.InvalidStepArgException,
                                oracle.dss.selection.SelectionException,
                                oracle.dss.dataSource.common.QueryException,
                                oracle.dss.metadataManager.common.MetadataManagerException

  Adds a new custom measure to the list of measures for the active view. This method is called by the runCalcBuilder method.

  Throws:
    `oracle.dss.selection.step.InvalidStepArgException` - If there is a problem in the Step.
    `oracle.dss.selection.SelectionException` - If the selection for the measure dimension cannot be created.
    `oracle.dss.dataSource.common.QueryException` - If there is a problem fetching data after the measure dimension is updated.
    `oracle.dss.metadataManager.common.MetadataManagerException` - If there is a problem in the MetadataManager
  See Also:
    `runCalcBuilder()`

### getErrorText

    public java.lang.String getErrorText(java.lang.Throwable t)

  Analyzes an exception and attempts to find an appropriate message to display to a user.

  Parameters:
    `t` - The exception that was thrown.
  Returns:
    The message text.

### showErrorMessage

    void showErrorMessage(java.lang.String strMsg,
                          java.lang.Throwable t)

  Displays an error message dialog. Shows the stack trace.

  Parameters:
    `strMsg` - The message to display in the error dialog.
    `t` - The Exception that was thrown.

### runQueryBuilder

    public void runQueryBuilder()

  Runs the QueryBuilder. This method:
  1. Instantiates a new QueryBuilder.
  2. Gets the query from the active view and sets it on the QueryBuilder.
  3. Runs the QueryBuilder, which updates the query in the view.

### showGraphFormatDialog

    void showGraphFormatDialog()

  Displays the Graph Format dialog. The Graph Format dialog allows users to set properties of the graph. This method gets the active view and makes sure it is a graph. Then it instantiates a GraphFormatDialog and runs it.

  The Graph Format dialog contains different panels, depending on the graph type of the graph.

  See Also:
    `GraphFormatDialog`

### showGraphTypeDialog

    void showGraphTypeDialog()

  Displays the Graph Type dialog. The Graph Type dialog allows users to change the graph type. This method gets the active view and checks to make sure it is a graph. Then this method instantiates a GraphTypeDialog and runs it.

  The Graph Type dialog is separate from the Graph Format dialog because the Graph Format dialog has different panels, depending on the graph type.

  See Also:
    `GraphTypeDialog`

### showExportDialog

    void showExportDialog()

  Displays the Export dialog. The Export dialog allows users to export data to a spreadsheet.

  This method gets the active view and checks to make sure it is a crosstab. Then it constructs a dialog that contains the standard BI Beans ExportPanel, as well as OK and Cancel buttons. Then this method shows the dialog. Data from the crosstab is exported to a file in the format that the user selects in the dialog.

### showPrintDialog

    void showPrintDialog()

  Displays the Print dialog. This method gets the active view. It then constructs a standard BI Beans PrintDialog and displays it. The view is printed according to options that the user sets in the dialog.

### showOpenDialog

    public void showOpenDialog()

  Displays the Open dialog. This method:
  1. Gets the root folder from the connection object for this application.
  2. Constructs a standard BI Beans PersistenceObjectChooser and uses a BIPresentationFilter to filter the types of objects that appear in the PersistenceObjectChooser.
  3. Displays the PersistenceObjectChooser.
  4. calls the openView method to load the object that the user specifies in the PersistenceObjectChooser.

  See Also:
    `openView(java.lang.String, boolean, int, int, int, int)`, `BIPresentationFilter`

### openView

    public void openView(java.lang.String strName,
                         boolean isDirty,
                         int x,
                         int y,
                         int width,
                         int height)

  Loads a dataview in a separate thread. This method instantiates an OpenViewWorker object for the thread. Using a separate thread frees the user interface. This method is called from the showOpenDialog method.

  Parameters:
    `strName` - Name of the presentation to open, such as "/My Reports/Sales Trends".
    `isDirty` - `true` if the view has changes that need to be saved, `false` if it does not.
    `x` - The horizontal position for the view.
    `y` - The vertical position for the view.
    `width` - The width of the view.
    `height` - The height of the view.
  See Also:
    `showOpenDialog()`, `AnalyzerUtilities.OpenViewWorker`

### getBusyBar

    public javax.swing.JWindow getBusyBar(java.lang.String message)

  Gets the busy bar for this application. The busy bar notifies the user that the application is busy opening up a dataview.

  Parameters:
    `message` - The message to display in the busy bar.
  Returns:
    The busy bar.

### showSaveAsDialog

    void showSaveAsDialog()

  Displays the Save As dialog. This method:
  1. Gets the active view.
  2. Gets the root folder from the connection for this application.
  3. Constructs a standard BI Beans PersistenceObjectChooser to use as a Save As dialog.
  4. Sets a BIPresentation Filter object, to filter the types of objects that appear in the PersistenceObjectChooser.
  5. Displays the PersistenceObjectChooser as a Save As dialog.
  6. After the user closes the dialog, calls the saveView method to save the view.
  7. Updates the path for the active view.

  See Also:
    `saveView(java.lang.String, oracle.dss.dataView.Dataview)`

### saveView

    boolean saveView(java.lang.String strName,
                     oracle.dss.dataView.Dataview dv)

  Saves a presentation. This method gets the MetadataManager and the root folder from the connection for this application. Then it saves the specified Dataview under the specified name.

  Parameters:
    `strName` - The name under which to save the object. Pass the full path name from the root folder.
    `dv` - The view to save.
  Returns:
    `true` if the save is successful, `false` if it is not.

Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD