com.ihr.xbrl.database.common

## Class XBRLDatabaseAccessApp

- java.lang.Object
- - com.ihr.xbrl.database.common.XBRLDatabaseAccessApp

- Direct Known Subclasses:
    StorageService, UpdateFactProperties

      public abstract class XBRLDatabaseAccessApp
      extends java.lang.Object

  This abstract class should be used to facilitate initialization of applications that require a connection to the XBRL Database. The class must implement HasFrame because if the configuration cannot be obtained the class prompts to the user for dialogs in order to obtain the configuration object and initialize it.
  Author:
    Ignacio

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `XBRLDatabaseAccessApp(DatabaseManagerBase dbm, RegisterExtraClasses[] registerExtraClasses, java.util.Properties extraProperties, boolean bCreateDefault, boolean bHasGUI)` Class this constructor during the initialization of the application.
    `XBRLDatabaseAccessApp(RegisterExtraClasses[] registerExtraClasses, java.util.Properties extraProperties, boolean bCreateDefault, boolean bHasGUI)` Class this constructor during the initialization of the application.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `DbUtil` | `getDbUtil()` Returns back the instance of the DbUtil object created during the initialization of this object.
    `DatabaseManagerBase.DatabaseConfigurationInformationStatus` | `getStatus()` Returns the status information about the database file.
    `boolean` | `showDbSettings(HasDatabaseManagerGUI gui, java.awt.Component relativeTo, RegisterExtraClasses[] registerExtraClasses)` Creates an instance of the DatabaseManager dialog and sets it as visible.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### XBRLDatabaseAccessApp

          public XBRLDatabaseAccessApp(RegisterExtraClasses[] registerExtraClasses,
                               java.util.Properties extraProperties,
                               boolean bCreateDefault,
                               boolean bHasGUI)

      Class this constructor during the initialization of the application. All parameters that requires initialization would require be static in order to properly initialize them.
      Parameters:
        `registerExtraClasses` - may be null. this is an array of objects that implements the RegisterExtraClasses interface.
        `extraProperties` - additional properties in order to initialize the connection to the XBRL Database
        `bCreateDefault` - boolean, if true, default database properties are created if they do not exist. If false, the function just returns and the getStatus() method returns DatabaseConfigurationInformationStatus.NO_PROPERTIES_FILE_EXIST
        `bHasGUI` - the b has gui
      See Also:
        `getStatus()`

    - #### XBRLDatabaseAccessApp

          public XBRLDatabaseAccessApp(DatabaseManagerBase dbm,
                               RegisterExtraClasses[] registerExtraClasses,
                               java.util.Properties extraProperties,
                               boolean bCreateDefault,
                               boolean bHasGUI)

      Class this constructor during the initialization of the application. All parameters that requires initialization would require be static in order to properly initialize them.
      Parameters:
        `dbm` - instance of a DatabaseManagerBase to be used. This instance is provided when multiple databases are used. One instance of the DatabaseManagerBase is required for each database table space.
        `registerExtraClasses` - may be null. this is an array of objects that implements the RegisterExtraClasses interface.
        `extraProperties` - additional properties in order to initialize the connection to the XBRL Database and tune the pojo generation process
        `bCreateDefault` - boolean, if true, default database properties are created if they do not exist. If false, the function just returns and the getStatus() method returns DatabaseConfigurationInformationStatus.NO_PROPERTIES_FILE_EXIST
        `bHasGUI` - the b has gui
      See Also:
        `getStatus()`

  - ### Method Detail

    - #### getDbUtil

          public DbUtil getDbUtil()

      Returns back the instance of the DbUtil object created during the initialization of this object. This may be interesting in order to obtain a session object to the database.
      Returns:
        DbUtil

    - #### getStatus

          public DatabaseManagerBase.DatabaseConfigurationInformationStatus getStatus()

      Returns the status information about the database file.
      Returns:
        a value in the enumeration DatabaseConfigurationInformationStatus

    - #### showDbSettings

          public boolean showDbSettings(HasDatabaseManagerGUI gui,
                               java.awt.Component relativeTo,
                               RegisterExtraClasses[] registerExtraClasses)

      Creates an instance of the DatabaseManager dialog and sets it as visible. This is used in order to configure the database connection if it is not already configured.
      Parameters:
        `gui` - the gui
        `relativeTo` - the relative to
        `registerExtraClasses` - the register extra classes
      Returns:
        true, if successful