com.centrasite.control.discovery
Class AbstractReport

java.lang.Object
  extended by com.centrasite.control.discovery.AbstractReport
All Implemented Interfaces:
ItemsProvider, ReportInterface
Direct Known Subclasses:
AssetReport, FileDetailGeneralReport, FileDetailHistoryReport, FileDetailSecurityReport, FolderDetailGeneralReport, HistoryDetailGeneralReport, ListReport, LogReport, RegistryObjectReport, RepositoryOverviewReport, ShowTraceCommand.TraceReport, TextualImpactAnalysisReport

public abstract class AbstractReport
extends java.lang.Object
implements ReportInterface, ItemsProvider

Basic Report (screen page) implementation.


Field Summary
 
Fields inherited from interface com.centrasite.control.ReportInterface
ASCENDING, DESCENDING, FLAG_ADD_CONTEXT_MENU_METHOD, FLAG_NONE, FLAG_NOT_PART_OF_COLUMNS, FLAG_NOT_PART_OF_CSVCOLUMN, FLAG_NOT_PART_OF_LINES, FLAG_RENDER_ITEM_IMAGE, FLAG_RENDER_READ_ONLY, FLAG_RENDER_REFERENCE_ITEM_IMAGE, FLAG_RENDER_VALUE_AS_CHECKBOX, FLAG_RENDER_VALUE_AS_IMAGEPROP, FLAG_RENDER_VALUE_WITH_METHODLINK, FLAG_SORT_BY_DEFAULT_ASC, FLAG_SORT_BY_DEFAULT_DESC, FLAG_SORT_ICON_INVISIBLE, FLAG_VISIBLE_ALWAYS, FLAG_VISIBLE_BY_DEFAULT
 
Constructor Summary
AbstractReport(java.util.Locale locale)
           
 
Method Summary
 void addAccessor(boolean visibleByDefault, PropertyAccessor pa)
           
 void addAccessor(PropertyAccessor pa, int flags)
           
 void addDynamicColumns(java.lang.String extptId, java.lang.String reportName, Connector con)
          Dynamically add accessors to this report based on registered extensions for given extension point
 boolean appendUserHeading(java.lang.String name)
          Append a user heading element for this report NOTE: If a heading is set, then only these headings will be given back on the next execute.
 void clearCommands()
          Clear set of commands to be rendered (for example in a toolbar) for this report.
 AbstractReport duplicate(java.lang.String conceptName, java.util.Locale locale)
           
 void endProcess()
          Notify that processing of this report has finished
 void execute()
          Compute the report.
 java.util.HashMap getAccessor()
          Get hashmap containing accessors for all headings
 java.util.List getAllHeadings()
          Get all the heading that can be displayed in a table for this type
 java.util.List getAllHeadingsNotPartOfColumn()
          Get all line properties that are not displayed as column (eg description)
 java.util.List getCommands()
          Get set of commands to be rendered (for example in a toolbar) for this report.
 java.util.List getContextMenuCommands(Item item)
          Obtain the commands list to be displayed on context menu request.
 java.util.List getFixedColumnHeadings()
          Get the list of headers/columns for this report which shall always be visible
 java.util.List getHeadings()
          Get the list of visible headers/columns for this report
 java.util.List getHeadingsNotPartOfColumn()
          Get all line properties that are not displayed as column (eg description)
 java.lang.String getId()
          Get id for type of report
 Item getItem()
          Get the Item this report is based on
 Item getItem(java.lang.Object object)
          Provide an item to be rendered
 java.util.Collection getItems()
          Provide items to be rendered
 java.util.Locale getLocale()
          Obtain Locale for this command
 java.lang.String getNonEmptyTitle()
           
 com.softwareag.cis.plugin.command.Command getOnSelectCommand(Item item)
          Obtain the command to be executed when selecting a row in the report
 PropertyAccessor getPropertyAccessor(java.lang.String internalName)
          Get PropertyAccessor for given internal name of heading
 int getPropertyAccessorFlags(java.lang.String internalName)
          Get flags for PropertyAccessor
 RowIterator getRows()
          Get the rows of the report
 Item getSelectedItem()
           
 java.util.List getToolbarCommands()
          Obtain the commands list to be displayed within the report toolbar.
 boolean hasPropertyAccessorWithFlag(java.lang.String internalName, int flags)
          Check whether given flags are set for PropertyAccessor
 boolean hasUserConfiguration()
          Method can be used to determine if for current user a configuration exist.
 boolean implicitlyAddRefreshCommand()
          Check whether the standard "Refresh" command shall implicitly be added to this report's toolbar
 boolean implicitlyAddSaveReportCommand()
          Check whether the standard "Save Report" command shall implicitly be added to this report's toolbar.
 boolean implicitlyAddSelectColumnsCommand()
          Check whether the standard "Select Columns" command shall implicitly be added to this report's toolbar.
 void initializeUserHeadings(Connector con)
          Initialize the user selected headings.
 void initializeUserHeadings(GUIConfigurationExt config, java.lang.String user, java.lang.String password)
          Initialize the user selected headings.
 java.util.Collection prepareItems()
          Prepare items to get them in subsequent calls to getItem(Object object)
 void removeCommand(java.lang.Class commandClass)
          Remove command corresponding to given class from set of commands
 void resetUserHeadings()
          Reset the current user heading - that way you can add new ones using setUserHeading()
 void setItem(Item item)
          Set the Item to get the report on
 void setItemsProvider(ItemsProvider itemsProvider)
          Set data source providing set of items to be rendered
 void setLocale(java.util.Locale lc)
          Set Locale for this command
 void setSelectedItem(Item selectedItem)
           
 boolean supportsDelayedRead()
           
 void suppressColumns(java.lang.String extptId, AbstractReport report, java.lang.String conceptName, Connector con)
          Dynamically supress properties for this report based on registered extensions for given extension point
 void suppressProperty(java.lang.String propertyName)
           
 java.lang.String toXhtml()
          Transform the report to XHTML.
 java.lang.String toXhtml(Connector connector)
          Transform the report to XHTML.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.centrasite.control.ReportInterface
getDescription, getImageURL, getTitle
 

Constructor Detail

AbstractReport

public AbstractReport(java.util.Locale locale)
Method Detail

duplicate

public AbstractReport duplicate(java.lang.String conceptName,
                                java.util.Locale locale)
                         throws java.lang.IllegalAccessException,
                                java.lang.InstantiationException
Throws:
java.lang.IllegalAccessException
java.lang.InstantiationException

getId

public java.lang.String getId()
Get id for type of report

Specified by:
getId in interface ReportInterface
Returns:
the id

getAccessor

public java.util.HashMap getAccessor()
Description copied from interface: ReportInterface
Get hashmap containing accessors for all headings

Specified by:
getAccessor in interface ReportInterface
Returns:
accessors hashmap

getPropertyAccessor

public PropertyAccessor getPropertyAccessor(java.lang.String internalName)
Description copied from interface: ReportInterface
Get PropertyAccessor for given internal name of heading

Specified by:
getPropertyAccessor in interface ReportInterface
Parameters:
internalName - internal name of heading
Returns:
the PropertyAccessor or null if not found

getPropertyAccessorFlags

public int getPropertyAccessorFlags(java.lang.String internalName)
Get flags for PropertyAccessor

Parameters:
internalName - internal name of PropertyAccessor
Returns:
the flags
Throws:
java.lang.NullPointerException - if invalid propertyName specified

hasPropertyAccessorWithFlag

public boolean hasPropertyAccessorWithFlag(java.lang.String internalName,
                                           int flags)
Description copied from interface: ReportInterface
Check whether given flags are set for PropertyAccessor

Specified by:
hasPropertyAccessorWithFlag in interface ReportInterface
Parameters:
internalName - internal name of PropertyAccessor
flags - flags to be tested whether set for PropertyAccessor
Returns:
true if respective flags are set

addAccessor

public void addAccessor(boolean visibleByDefault,
                        PropertyAccessor pa)

addAccessor

public void addAccessor(PropertyAccessor pa,
                        int flags)

getAllHeadingsNotPartOfColumn

public java.util.List getAllHeadingsNotPartOfColumn()
Description copied from interface: ReportInterface
Get all line properties that are not displayed as column (eg description)

Specified by:
getAllHeadingsNotPartOfColumn in interface ReportInterface
Returns:
map of internal name to external name

getHeadingsNotPartOfColumn

public java.util.List getHeadingsNotPartOfColumn()
Description copied from interface: ReportInterface
Get all line properties that are not displayed as column (eg description)

Specified by:
getHeadingsNotPartOfColumn in interface ReportInterface
Returns:
map of internal name to external name

suppressProperty

public void suppressProperty(java.lang.String propertyName)

setItem

public void setItem(Item item)
Description copied from interface: ReportInterface
Set the Item to get the report on

Specified by:
setItem in interface ReportInterface

getItem

public Item getItem()
Description copied from interface: ReportInterface
Get the Item this report is based on

Specified by:
getItem in interface ReportInterface

setSelectedItem

public void setSelectedItem(Item selectedItem)

getSelectedItem

public Item getSelectedItem()

getCommands

public java.util.List getCommands()
Get set of commands to be rendered (for example in a toolbar) for this report.

Specified by:
getCommands in interface ReportInterface
Returns:
Collection of commands or null if none.

clearCommands

public void clearCommands()
Clear set of commands to be rendered (for example in a toolbar) for this report.


removeCommand

public void removeCommand(java.lang.Class commandClass)
Remove command corresponding to given class from set of commands

Specified by:
removeCommand in interface ReportInterface
Parameters:
commandClass - class of command to be removed

implicitlyAddRefreshCommand

public boolean implicitlyAddRefreshCommand()
Check whether the standard "Refresh" command shall implicitly be added to this report's toolbar

Specified by:
implicitlyAddRefreshCommand in interface ReportInterface
Returns:
true if to be added, false otherwise

implicitlyAddSelectColumnsCommand

public boolean implicitlyAddSelectColumnsCommand()
Check whether the standard "Select Columns" command shall implicitly be added to this report's toolbar. Default implementation returns true.

Specified by:
implicitlyAddSelectColumnsCommand in interface ReportInterface
Returns:
true if to be added, false otherwise

implicitlyAddSaveReportCommand

public boolean implicitlyAddSaveReportCommand()
Check whether the standard "Save Report" command shall implicitly be added to this report's toolbar. Default implementation returns true.

Specified by:
implicitlyAddSaveReportCommand in interface ReportInterface
Returns:
true if to be added, false otherwise

getHeadings

public java.util.List getHeadings()
Description copied from interface: ReportInterface
Get the list of visible headers/columns for this report

Specified by:
getHeadings in interface ReportInterface
Returns:
Collection of the headings for this report

getFixedColumnHeadings

public java.util.List getFixedColumnHeadings()
Description copied from interface: ReportInterface
Get the list of headers/columns for this report which shall always be visible

Specified by:
getFixedColumnHeadings in interface ReportInterface
Returns:
Collection of the headings for this report

getAllHeadings

public java.util.List getAllHeadings()
Description copied from interface: ReportInterface
Get all the heading that can be displayed in a table for this type

Specified by:
getAllHeadings in interface ReportInterface
Returns:
map of internal name to external name

getRows

public RowIterator getRows()
Description copied from interface: ReportInterface
Get the rows of the report

Specified by:
getRows in interface ReportInterface
Returns:
iterator over the rows of the report

execute

public final void execute()
                   throws java.lang.Exception
Description copied from interface: ReportInterface
Compute the report. NOTE: This must be called before getting any rows/headings. This must also be called after changing filter/sort conditions.

Specified by:
execute in interface ReportInterface
Throws:
java.lang.Exception

toXhtml

public java.lang.String toXhtml()
Transform the report to XHTML.

Specified by:
toXhtml in interface ReportInterface

toXhtml

public java.lang.String toXhtml(Connector connector)
Description copied from interface: ReportInterface
Transform the report to XHTML.

Specified by:
toXhtml in interface ReportInterface

getNonEmptyTitle

public java.lang.String getNonEmptyTitle()
Specified by:
getNonEmptyTitle in interface ReportInterface

supportsDelayedRead

public boolean supportsDelayedRead()
Specified by:
supportsDelayedRead in interface ItemsProvider
Returns:
true, if methods prepareItems() and getItem(Object) are supported for lazy reading / cursoring

prepareItems

public java.util.Collection prepareItems()
                                  throws java.lang.Exception
Prepare items to get them in subsequent calls to getItem(Object object)

Specified by:
prepareItems in interface ItemsProvider
Throws:
java.lang.Exception

getItem

public Item getItem(java.lang.Object object)
             throws java.lang.Exception
Provide an item to be rendered

Specified by:
getItem in interface ItemsProvider
Throws:
java.lang.Exception

getItems

public java.util.Collection getItems()
                              throws java.lang.Exception
Provide items to be rendered

Specified by:
getItems in interface ItemsProvider
Throws:
java.lang.Exception

initializeUserHeadings

public void initializeUserHeadings(Connector con)
Initialize the user selected headings.

Specified by:
initializeUserHeadings in interface ReportInterface
Parameters:
con - the Connector allowing access to the user settings

initializeUserHeadings

public void initializeUserHeadings(GUIConfigurationExt config,
                                   java.lang.String user,
                                   java.lang.String password)
Initialize the user selected headings.

Specified by:
initializeUserHeadings in interface ReportInterface
Parameters:
config - user configuration
user - user name used to obtained selected headings.
password - user password

appendUserHeading

public boolean appendUserHeading(java.lang.String name)
Description copied from interface: ReportInterface
Append a user heading element for this report NOTE: If a heading is set, then only these headings will be given back on the next execute.

Specified by:
appendUserHeading in interface ReportInterface
Parameters:
name - heading name
Returns:
true if heading was not yet in list of user configured headings/columns

resetUserHeadings

public void resetUserHeadings()
Description copied from interface: ReportInterface
Reset the current user heading - that way you can add new ones using setUserHeading()

Specified by:
resetUserHeadings in interface ReportInterface
See Also:
ReportInterface.appendUserHeading(String)

getOnSelectCommand

public com.softwareag.cis.plugin.command.Command getOnSelectCommand(Item item)
Obtain the command to be executed when selecting a row in the report

Specified by:
getOnSelectCommand in interface ReportInterface
Parameters:
item -
Returns:
the command to be executed; null if no command to be executed

setItemsProvider

public void setItemsProvider(ItemsProvider itemsProvider)
Set data source providing set of items to be rendered

Specified by:
setItemsProvider in interface ReportInterface
Parameters:
itemsProvider -

addDynamicColumns

public void addDynamicColumns(java.lang.String extptId,
                              java.lang.String reportName,
                              Connector con)
Dynamically add accessors to this report based on registered extensions for given extension point

Parameters:
extptId - extension point to be used to check for dynamic extensions
reportName - the name of the report to be checked for dynamic columns to be added
con - the Connector

suppressColumns

public void suppressColumns(java.lang.String extptId,
                            AbstractReport report,
                            java.lang.String conceptName,
                            Connector con)
Dynamically supress properties for this report based on registered extensions for given extension point

Parameters:
extptId - extension point to be used to check for dynamic extensions
conceptName - name of concept where we may suppress columns for
con - the Connector

setLocale

public void setLocale(java.util.Locale lc)
Set Locale for this command

Parameters:
lc -

getLocale

public java.util.Locale getLocale()
Obtain Locale for this command

Returns:
the Locale being used for this Report

endProcess

public void endProcess()
Notify that processing of this report has finished

Specified by:
endProcess in interface ReportInterface

getContextMenuCommands

public java.util.List getContextMenuCommands(Item item)
Description copied from interface: ReportInterface
Obtain the commands list to be displayed on context menu request.

Specified by:
getContextMenuCommands in interface ReportInterface
Returns:
Copy of this item commands collection.
See Also:
Can be overridden by implementors in order to provide custom list of commands.

getToolbarCommands

public java.util.List getToolbarCommands()
Description copied from interface: ReportInterface
Obtain the commands list to be displayed within the report toolbar.

Specified by:
getToolbarCommands in interface ReportInterface
Returns:
Copy of the report commands collection.
See Also:
Can be overridden by implementors in order to provide custom list of commands.

hasUserConfiguration

public boolean hasUserConfiguration()
Method can be used to determine if for current user a configuration exist. If not the default accessors are applied.

Specified by:
hasUserConfiguration in interface ReportInterface
Returns:
true if user configuration exists otherwise false