|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.squashtest.csp.tm.domain.report.Report
public abstract class Report
A Report is functionally the main concept of the Report API. However it's not exactly the most technical hard to implement. A Report belongs to a ReportCategory, to which it must register to (more on that later), and is of a ReportType. Let's repeat it again, a Report should be a bean, a singleton A Report have a name and a description. The name is, like some other entities of this package, a key that will be searched for in a MessageSource. A Report is registered to a ReportCategory, is of a ReportType, and must be provided with a ReportQueryFactory (that will generate a query corresponding to fill that Report).
FIXME In this version the description is not yet localized.
To implement a report you need :
You may also set a particular ReportQueryFactory at constructor time but you also can let it injected via the IoC engine (if you have one).
Likewise, you can set up its view catalog at construction time.
NOTE : the reason why you need to implement the setReportCategory() and setReportType() is that you may then add an @Resource annotation on it. The container will this automagically call the setter at construction time and will feed it with the resource you named (the real instances of ReportType or ReportCategory)
| Field Summary | |
|---|---|
protected ReportQueryFactory |
queryFactory
|
protected ReportCategory |
reportCategory
|
protected ReportType |
reportType
|
protected String |
resourceKeyDescription
|
protected String |
resourceKeyName
|
protected ReportViewCatalog |
viewCatalog
|
| Constructor Summary | |
|---|---|
Report()
|
|
| Method Summary | |
|---|---|
ReportQuery |
createReportQuery()
This method is simply a wrapper that will call makeReportQuery() of the ReportQueryFactory |
Integer |
getId()
|
ReportQueryFactory |
getQueryFactory()
|
ReportCategory |
getReportCategory()
|
ReportType |
getReportType()
|
String |
getResourceKeyDescription()
|
String |
getResourceKeyName()
|
ReportViewCatalog |
getViewCatalog()
|
void |
setQueryFactory(ReportQueryFactory queryFactory)
|
protected abstract void |
setReportCategory(ReportCategory reportCategory)
will set the ReportCategory for this report. |
protected abstract void |
setReportType(ReportType reportType)
will set the ReportType for this report. |
protected void |
setResourceKeyDescription(String resourceKeyDescription)
Best called at construction time (it's protected). |
protected void |
setResourceKeyName(String resourceKeyName)
Best called at construction time (it's protected) |
protected void |
setViewCatalog(ReportViewCatalog viewCatalog)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ReportType reportType
protected String resourceKeyName
protected String resourceKeyDescription
protected ReportCategory reportCategory
protected ReportQueryFactory queryFactory
protected ReportViewCatalog viewCatalog
| Constructor Detail |
|---|
public Report()
| Method Detail |
|---|
public Integer getId()
public ReportType getReportType()
public ReportCategory getReportCategory()
public String getResourceKeyName()
protected void setResourceKeyName(String resourceKeyName)
resourceKeyName - the key corresponding to that Report in the MessageSource.public String getResourceKeyDescription()
protected void setResourceKeyDescription(String resourceKeyDescription)
resourceKeyDescription - the key corresponding to that description in the MessageSource.public ReportQueryFactory getQueryFactory()
public void setQueryFactory(ReportQueryFactory queryFactory)
queryFactory - the ReportQueryFactory being assigned to that Report.public ReportQuery createReportQuery()
protected void setViewCatalog(ReportViewCatalog viewCatalog)
public ReportViewCatalog getViewCatalog()
protected abstract void setReportType(ReportType reportType)
protected abstract void setReportCategory(ReportCategory reportCategory)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||