Interface DesignerDataModel

  • All Known Implementing Classes:
    AbstractDesignerDataModel, BasicDesignerDataModel

    public interface DesignerDataModel
    This interface allows the implementation of a custom data model for the designer. The model is responsible for loading, saving and creating the report templates as well as for restricting access to some menu options. Since this interface may be extended in the future it is recommended to extend either AbstractDesignerDataModel or BasicDesignerDataModel.
    • Field Detail

      • TYPE_TABLE

        static final int TYPE_TABLE
        Shows the database object type is: Table
        See Also:
        Constant Field Values
      • TYPE_SYSTEM_TABLE

        static final int TYPE_SYSTEM_TABLE
        Shows the database object type is: System Table
        See Also:
        Constant Field Values
      • TYPE_VIEW

        static final int TYPE_VIEW
        Shows the database object type is: View
        See Also:
        Constant Field Values
      • TYPE_VIEW_WITH_PARAM

        static final int TYPE_VIEW_WITH_PARAM
        Shows the database object type is: View with parameters
        See Also:
        Constant Field Values
      • TYPE_SPROC

        static final int TYPE_SPROC
        Shows the database object type is: Stored procedure
        See Also:
        Constant Field Values
      • TYPE_SPROC_WITH_PARAM

        static final int TYPE_SPROC_WITH_PARAM
        Shows the database object type is: Stored procedure with parameters
        See Also:
        Constant Field Values
      • TYPE_CONNECTION

        static final int TYPE_CONNECTION
        Shows the database object type is: Connection
        See Also:
        Constant Field Values
      • TYPE_COMMAND

        static final int TYPE_COMMAND
        Shows the database object type is: Command
        See Also:
        Constant Field Values
    • Method Detail

      • createNewReport

        Engine createNewReport​(java.awt.Component parent)
                        throws java.io.IOException,
                               ReportException
        Creates a new report and returns its Engine if the creation was successful or null if it was not successful.
        Parameters:
        parent - A parent window to use for your own dialog.
        Returns:
        null to indicate nothing was created or the engine of the new report
        Throws:
        java.io.IOException - to indicate nothing was created as the result of an IO problem
        ReportException - to indicate nothing was created as the result of a Report problem
        Since:
        6.0
      • getApplicationDirectory

        java.io.File getApplicationDirectory()
        Returns the location of the application directory which is the directory where the designer is located in.
        Returns:
        The directory where the designer is located in.
        Since:
        7.0
      • getAvailableFonts

        java.util.ArrayList<com.inet.font.FontFamily> getAvailableFonts()
        Returns a list of all available fonts for the designer.
        Returns:
        A list of all available fonts.
        Since:
        9.1
      • isReportWizardEnabled

        boolean isReportWizardEnabled()
        Returns true if a new report shall be created using the ReportWizard.
        Returns:
        true <=> Create a new report using the ReportWizard.
        Since:
        7.0
      • isInetTemplatesEnabled

        boolean isInetTemplatesEnabled()
        Returns true if the templates supplied through i-net will be enabled or not.
        Returns:
        true <=> The templates supplied through i-net will be enabled.
        Since:
        7.0
      • isDatabaseChangeAllowed

        boolean isDatabaseChangeAllowed()
        Check if the database configuration may be changed.
        Returns:
        true if it is allowed to change the database configuration.
        Since:
        6.0
      • isDatabaseObjectVisible

        boolean isDatabaseObjectVisible​(int databaseObjectType,
                                        java.lang.String databaseObjectName)
        Checks if the given database object should be visible in the database browser.
        Parameters:
        databaseObjectType - The type of the database object. This will be one of the following table, system table, view or stored procedure
        databaseObjectName - The name of the database object (e.g. of a table)
        Returns:
        True if this database object should be visible in the database browser otherwise false.
        Since:
        6.0
      • isOpenAllowed

        boolean isOpenAllowed()
        Checks if it is allowed to open reports.
        Returns:
        true if it is allowed to open reports
        Since:
        6.0
      • isPreviewTabVisible

        boolean isPreviewTabVisible()
        Checks if the preview tab should be visible or not.
        Returns:
        true if the preview tab should be visible otherwise false
        Since:
        6.0
      • isSaveAllowed

        boolean isSaveAllowed()
        Checks if it is allowed to save reports.
        Returns:
        true if it is allowed to save reports
        Since:
        6.0
      • isSaveAsAllowed

        boolean isSaveAsAllowed()
        Checks if is allowed to save reports with a new name.
        Returns:
        true if it is allowed to save reports with a new name (Save As)
        Since:
        6.0
      • isTablesChangeAllowed

        boolean isTablesChangeAllowed()
        Checks if tables may be added or removed and if the links may be changed.
        Returns:
        true if it is allowed to add or remove tables
        Since:
        6.0
      • isAddGroupAllowed

        boolean isAddGroupAllowed()
        Checks if groups may be added to the Report.
        Returns:
        true if it is allowed to add groups to the report
        Since:
        6.1
      • setAddGroupAllowed

        void setAddGroupAllowed​(boolean isAddGroupAllowed)
        Sets if add groups is allowed.
        Parameters:
        isAddGroupAllowed - true to allow, false to deny
        Since:
        6.1
      • isCloseAllowed

        boolean isCloseAllowed()
        Checks if reports may be closed.
        Returns:
        true if it is allowed to add groups to the report
        Since:
        6.0
      • setCloseAllowed

        void setCloseAllowed​(boolean isCloseAllowed)
        Sets if is allowed to close reports.
        Parameters:
        isCloseAllowed - true to allow, false to deny
        Since:
        6.0
      • isRemoveGroupAllowed

        boolean isRemoveGroupAllowed()
        Checks if groups may be removed.
        Returns:
        true if it is allowed to add groups to the report
        Since:
        6.1
      • setRemoveGroupAllowed

        void setRemoveGroupAllowed​(boolean isRemoveGroupAllowed)
        Sets if remove groups is allowed.
        Parameters:
        isRemoveGroupAllowed - true to allow, false to deny
        Since:
        6.1
      • isReopenAllowed

        boolean isReopenAllowed()
        Checks if it is allowed to use the reopen menu.
        Returns:
        true if it is allowed to add groups to the report
        Since:
        6.0
      • setReopenAllowed

        void setReopenAllowed​(boolean isReopenAllowed)
        Sets if it is allowed to reopen a report.
        Parameters:
        isReopenAllowed - true to allow, false to deny
        Since:
        6.0
      • isAddSectionAllowed

        boolean isAddSectionAllowed()
        Check if adding sections to the report is allowed.
        Returns:
        true if its allowed to add sections to the report
        Since:
        6.1
      • setAddSectionAllowed

        void setAddSectionAllowed​(boolean isAddSectionAllowed)
        Sets if it is allowed to add sections to the report.
        Parameters:
        isAddSectionAllowed - true to allow, false to deny
        Since:
        6.1
      • setRemoveSectionAllowed

        void setRemoveSectionAllowed​(boolean isRemoveSectionAllowed)
        Sets if it is allowed to remove sections from the report.
        Parameters:
        isRemoveSectionAllowed - true to allow, false to deny
        Since:
        6.1
      • isRemoveSectionAllowed

        boolean isRemoveSectionAllowed()
        Checks if removing sections from the report is allowed.
        Returns:
        true if its allowed to add sections to the report
        Since:
        6.1
      • loadReport

        Engine loadReport​(java.awt.Component parent)
                   throws java.io.IOException,
                          ReportException
        Load a report. Choosing a location is the task of the programmer who may use any Swing component.
        Parameters:
        parent - the parent component which should be used in dialogs.
        Returns:
        null to indicate nothing was loaded (choice of the user) or the engine of the loaded report
        Throws:
        java.io.IOException - to indicate nothing was loaded as the result of an IO problem
        ReportException - to indicate nothing was loaded as the result of a Report problem
        Since:
        6.0
      • loadReportFrom

        Engine loadReportFrom​(java.awt.Component parent,
                              java.io.File dir)
                       throws java.io.IOException,
                              ReportException
        Load a report. Choosing a location is the task of the programmer who may use any Swing component.
        Parameters:
        parent - the parent component which should be used in dialogs.
        dir - the Directory for the FileChooser.
        Returns:
        null to indicate nothing was loaded (choice of the user) or the engine of the loaded report
        Throws:
        java.io.IOException - to indicate nothing was loaded as the result of an IO problem
        ReportException - to indicate nothing was loaded as the result of a Report problem
        Since:
        9.0
      • reopenReport

        Engine reopenReport​(java.io.File reportFile)
                     throws ReportException
        Load a report. If the location was chosen from the list of last opened reports, it is the programmer's task to load the report and return the engine.
        Parameters:
        reportFile - the file object which contains the path to the report.
        Returns:
        the engine of the loaded report
        Throws:
        ReportException - to indicate nothing was loaded as the result of a Report problem
        Since:
        6.5
      • saveReport

        boolean saveReport​(java.awt.Component parent,
                           Engine e,
                           boolean saveAs)
                    throws java.io.IOException,
                           ReportException
        Save a report Choosing a location is the task of the programmer who may use any Swing component.
        Parameters:
        parent - the parent component which should be used in dialogs.
        e - the engine which should be saved
        saveAs - if true the user wants to choose a new name for the report, otherwise the old name should be used (if possible)
        Returns:
        true to indicate the report was successfully saved.
        Throws:
        java.io.IOException - to indicate nothing was saved as the result of an IO problem
        ReportException - to indicate nothing was saved as the result of a Report problem
        Since:
        6.0
      • setDatabaseChangeAllowed

        void setDatabaseChangeAllowed​(boolean databaseChangeAllowed)
        Sets whether changes to the connection are allowed.
        Parameters:
        databaseChangeAllowed - true to allow, false to deny
        Since:
        6.0
      • setOpenAllowed

        void setOpenAllowed​(boolean openAllowed)
        Sets whether 'open' is allowed.
        Parameters:
        openAllowed - true to allow, false to deny
        Since:
        6.0
      • setPreviewTabVisible

        void setPreviewTabVisible​(boolean previewTabVisible)
        Sets whether the preview tab should be visible or not.
        Parameters:
        previewTabVisible - true to allow, false to deny
        Since:
        6.0
      • setSaveAllowed

        void setSaveAllowed​(boolean saveAllowed)
        Sets whether 'save' is allowed.
        Parameters:
        saveAllowed - true to allow, false to deny
        Since:
        6.0
      • setSaveAsAllowed

        void setSaveAsAllowed​(boolean saveAsAllowed)
        Sets whether 'save as' is allowed.
        Parameters:
        saveAsAllowed - true to allow, false to deny
        Since:
        6.0
      • setTablesChangeAllowed

        void setTablesChangeAllowed​(boolean tablesChangeAllowed)
        Sets whether tables may be changed.
        Parameters:
        tablesChangeAllowed - true to allow, false to deny
        Since:
        6.0
      • isDesignNeedsConnection

        boolean isDesignNeedsConnection()
        Returns whether the design of reports needs a connection. (Especially for database pictures for which a preview will be shown if this method returns true or an empty picture if false is returned)
        Returns:
        false if no connection should be necessary for design or true if connection is needed
        Since:
        6.0
      • setDesignNeedsConnection

        void setDesignNeedsConnection​(boolean designWithoutConnection)
        Sets whether the design of reports needs a connection. (Especially for database pictures for which a preview will be shown if this method returns true or an empty picture if false is returned)
        Parameters:
        designWithoutConnection - false if no connection should be necessary for design or true if connection is needed
        Since:
        6.0
      • isInvalidSPSelectable

        boolean isInvalidSPSelectable()
        Returns whether stored procedures marked as invalid should be selectable in the visual database wizard or not. Stored procedures were marked as invalid if meta data information indicates that the stored procedure does not return a resultset useable by i-net Clear Reports. Some JDBC drivers might return wrong meta data information and this setting would overwrite it.
        Returns:
        True if invalid stored procedures should be selectable false otherwise.
        Since:
        6.0
      • openUserFormulaDialog

        FormulaField openUserFormulaDialog​(FormulaField formulafield)
        This method is called if the user wants to open the dialog for a user defined formula. The dialog is responsible to create an undo point in case of a modification. This function may be called only if an editor has been opened.
        Parameters:
        formulafield - The formula field if already existent, otherwise null
        Returns:
        The new formula field or null if no field was created
        Since:
        6.1
      • openPropertyFormulaDialog

        FormulaField openPropertyFormulaDialog​(FormulaField formulafield,
                                               int valueType,
                                               ReportComponent element,
                                               java.lang.Object defaultValue,
                                               java.lang.String propertyName,
                                               boolean isTristate)
        This method is called if the user wants to open the dialog for a property formula. The dialog is responsible to create an undo point in case of a modification. This function may be called only if an editor has been opened.
        Parameters:
        formulafield - The formulafield if it already exists, otherwise null
        valueType - The type of the formulas return value
        element - The element thats formula this is
        defaultValue - The default value for this formula
        propertyName - The name of the property for which a formula is being created. Must not be null.
        isTristate - whether the returned property formula is set to more than one Element. When in doubt, set to false
        Returns:
        The new formula field or null if no field was created
        Since:
        14.1
      • openRecordSelectionFormulaDialog

        FormulaField openRecordSelectionFormulaDialog​(FormulaField formulafield)
        This method is called if the user wants to open the dialog for a record selection formula. The dialog is responsible to create an undo point in case of a modification. This function may be called only if an editor has been opened.
        Parameters:
        formulafield - The formulafield if it already exists, otherwise null
        Returns:
        The new formula field or null if no field was created
        Since:
        6.1
      • openGroupSelectionFormulaDialog

        FormulaField openGroupSelectionFormulaDialog​(FormulaField formulafield)
        This method is called if the user wants to open the dialog for a group selection formula. The dialog is responsible to create an undo point in case of a modification. This function may be called only if an editor has been opened.
        Parameters:
        formulafield - The formulafield if already existent, otherwise null
        Returns:
        The new formula field or null if no field was created
        Since:
        6.1
      • openParameterDialog

        void openParameterDialog​(PromptField parameterField)
        This method is called if the user wants to open the dialog for a parameter field. The dialog is responsible to create an undo point in case of a modification. This function may be called only if an editor has been opened.
        Parameters:
        parameterField - The parameter field if already existent, otherwise null Note: Since version 7.0 this method does not return the modified field anymore.
        Since:
        6.1
      • openSQLDialog

        SQLField openSQLDialog​(SQLField SQLfield)
        This method is called if the user wants to open the dialog for a SQL field. The dialog is responsible to create an undo point in case of a modification.
        Parameters:
        SQLfield - The SQL field if already existent, otherwise null
        Returns:
        The new SQL field or null if no field was created
        Since:
        6.1
      • openSumDialog

        void openSumDialog​(SummaryField sumfield)
        This method is called if the user wants to open the dialog for a summary field. The dialog is responsible to create an undo point in case of a modification. This function may only be called if an editor has been opened.
        Parameters:
        sumfield - The parameter field if already existent, otherwise null
        Since:
        6.1
      • openGroupDialog

        void openGroupDialog​(Group group)
        This method is called if the user wants to open the dialog for a group. The dialog is responsible to create an undo point in case of a modification.
        Parameters:
        group - The group if already existent, otherwise null
        Since:
        6.1
      • openSummaryInfoDialog

        void openSummaryInfoDialog()
        This method is called if the user wants to open the Summary Info dialog. The dialog is responsible to create an undo point in case of a modification.
        Since:
        6.1
      • openSortRecordsDialog

        void openSortRecordsDialog()
        This method is called if the user wants to open the Records dialog. The dialog is responsible to create an undo point in case of a modification.
        Since:
        6.1
      • openSubreportLinksDialog

        void openSubreportLinksDialog​(java.lang.String name)
        This method is called if the user wants to open the Subreport links dialog. The dialog is responsible to create an undo point in case of a modification.
        Parameters:
        name - Name of the subreport or null if no subreport was selected
        Since:
        6.1
      • openSectionDialog

        void openSectionDialog​(Section section)
        This method is called if the user wants to open the Section dialog. The dialog is responsible to create an undo point in case of a modification.
        Parameters:
        section - the selected section or null if no section was selected
        Since:
        6.1
      • openVisualDatabaseWizardDialog

        void openVisualDatabaseWizardDialog()
        This method is called if the user wants to open the Visual Database Wizard dialog. The dialog is responsible to create an undo point in case of a modification. Note: It is not allowed to call the super method of this dialog, because it will not show the correct database configuration.
        Since:
        6.1
      • openJavaBeanDialog

        void openJavaBeanDialog()
        This method is called if the user wants to open the Java Bean dialog. The dialog is responsible to create an undo point in case of a modification.
        Since:
        6.1
      • openPageLayoutDialog

        void openPageLayoutDialog()
        This method is called if the user wants to open the Page Layout dialog. The dialog is responsible to create an undo point in case of a modification.
        Since:
        6.5
      • openFacturMappingDialog

        void openFacturMappingDialog​(java.lang.String searchterm)
        This method is called if the user wants to open the Fractur mapping dialog. The dialog is responsible to create an undo point in case of a modification.
        Parameters:
        searchterm - the term to search in the factur mapping dialog, can be null
        Since:
        20.10
      • closedReport

        void closedReport​(Engine engine)
        This method is called if a report was closed.
        Parameters:
        engine - the engine of the closed report.
        Since:
        6.1
      • addedSubreport

        void addedSubreport​(Engine engine)
        This method is called if a subreport was added to the current report.
        Parameters:
        engine - the engine of the added subreport.
        Since:
        6.1
      • removedSubreport

        void removedSubreport​(Engine engine)
        This method will be called if a subreport was removed from the current report.
        Parameters:
        engine - the engine of the removed subreport.
        Since:
        6.1
      • openedSubreport

        void openedSubreport​(Engine engine)
        This method is called if a subreport was opened by the user to edit it. The dialog is responsible to create an undo point in case of a modification.
        Parameters:
        engine - the engine of the opened subreport.
        Since:
        6.1
      • closedSubreport

        void closedSubreport​(Engine engine)
        This method is called if a subreport was closed by the user.
        Parameters:
        engine - the engine of the closed subreport.
        Since:
        6.1
      • addedGroup

        void addedGroup​(Group group)
        This method is called if a group was added to the report by the user.
        Parameters:
        group - the added group.
        Since:
        6.1
      • removedGroup

        void removedGroup​(Group group)
        This method is called if a group was removed from the report by the user.
        Parameters:
        group - the removed group.
        Since:
        6.1
      • addedElement

        void addedElement​(Element element)
        This method is called if the user has added an element to the report.
        Parameters:
        element - the added element.
        Since:
        6.1
      • removedElement

        void removedElement​(Element element)
        This method is called if the user has removed an element from the report.
        Parameters:
        element - the removed element.
        Since:
        6.1
      • isDataSourceManagerAllowed

        boolean isDataSourceManagerAllowed()
        Returns whether the datasource manager dialog is accessible or not.
        Returns:
        True if the datasource manager dialog can be used false otherwise.
        Since:
        7.7
      • setDataSourceManagerAllowed

        void setDataSourceManagerAllowed​(boolean isAllowed)
        Sets whether the datasource manager dialog shall be accessible or not.
        Parameters:
        isAllowed - True if the datasource manager dialog should be accessible false otherwise.
        Since:
        7.7
      • openRepositoryConfigDialog

        void openRepositoryConfigDialog()
        Opens a repository configuration dialog which enables the user to choose the repository URL he wants to employ when opening and saving reports on a repository.
        Since:
        9.1
        See Also:
        saveOnRepository(), openFromRepository()
      • openFromRepository

        void openFromRepository()
        Opens a dialog enabling the user to choose a report file to open from the repository configured for the designer.
        Since:
        9.1
        See Also:
        openRepositoryConfigDialog(), saveOnRepository()
      • getAvailableFontsFromRepository

        java.util.List<com.inet.font.FontFamily> getAvailableFontsFromRepository()
        fetches a list of fonts available on the repository configured for the designer
        Returns:
        list of fonts available on the repository configured for the designer
        Since:
        9.2
      • loadReportsFrom

        Engine[] loadReportsFrom​(java.awt.Component parent,
                                 java.net.URL initialURL)
                          throws java.io.IOException,
                                 ReportException
        Loads one or more report. Choosing a location is the task of the programmer who may use any Swing component.
        Parameters:
        parent - the parent component which should be used in dialogs.
        initialURL - the initial URL for the FileChooser. This could a a location file URL or a HTTP URL of a repository.
        Returns:
        null to indicate nothing was loaded (choice of the user) or an array of engines of the loaded report
        Throws:
        java.io.IOException - to indicate nothing was loaded as the result of an IO problem
        ReportException - to indicate nothing was loaded as the result of a Report problem
        Since:
        10.0