com.jamasoftware.contour.plugin
Class VelocityReportPluginSupport

java.lang.Object
  extended by com.jamasoftware.contour.plugin.VelocityReportPluginSupport
All Implemented Interfaces:
com.jamasoftware.contour.plugin.ReportPlugin
Direct Known Subclasses:
VelocityReportPlugin

public abstract class VelocityReportPluginSupport
extends java.lang.Object
implements com.jamasoftware.contour.plugin.ReportPlugin

Support class for Velocity Report Plugin.


Field Summary
protected  org.springframework.context.ApplicationContext applicationContext
           
protected  DocumentFieldDao docFieldDao
           
protected  DocumentDao documentDao
           
protected  com.jamasoftware.contour.service.documentNode.DocumentNodeManager documentNodeManager
           
protected  com.jamasoftware.contour.service.DocumentTypeService documentTypeService
           
protected  com.jamasoftware.contour.util.type.FieldDataTypeManager fieldDataTypeManager
           
protected  com.jamasoftware.contour.service.FilterService filterService
           
protected  com.jamasoftware.contour.project.service.ProjectService projectService
           
protected  com.jamasoftware.contour.service.PropertyService propertyService
           
protected  com.jamasoftware.contour.service.RelationshipService relationshipService
           
protected  Report report
           
protected  com.jamasoftware.contour.util.ReportRender reportRender
           
protected  com.jamasoftware.contour.service.SmartFilterService smartFilterService
           
protected  com.jamasoftware.contour.tag.dao.TagDao tagDao
           
protected  UserDao userDao
           
static java.lang.String VELOCITY_REPORT_PARAM_RELATE
           
static java.lang.String VELOCITY_REPORT_PARAM_TAG
           
 
Constructor Summary
VelocityReportPluginSupport()
           
 
Method Summary
protected  void addVelocityTools(java.util.Map<java.lang.String,java.lang.Object> model)
          Adds the Velocity tools to the context model.
protected  java.lang.String getBaseUrl(com.jamasoftware.contour.project.domain.Project project)
          Returns base URL with a trailing slash ('/').
protected  com.jamasoftware.contour.util.DateFormatter getDateFormatter()
          Gets the system date formats.
protected  com.jamasoftware.contour.service.search.SearchResults<ContourItem> getDocumentlist(com.jamasoftware.contour.service.dto.QuickReportDTO quickReport)
           
protected  com.jamasoftware.contour.service.search.SearchResults<ContourItem> getDocumentlistSorted(com.jamasoftware.contour.service.dto.QuickReportDTO quickReport, java.lang.String orderBy)
           
protected  com.jamasoftware.contour.service.dto.DocumentTypeDTO getDocumentMeta(com.jamasoftware.contour.service.dto.QuickReportDTO quickReport, java.util.Map<java.lang.String,com.jamasoftware.contour.service.dto.DocumentTypeDTO> metaCache, ContourItem document)
           
 Report getReport()
           
protected abstract  java.util.Map<java.lang.String,java.lang.Object> getVelocityReport(com.jamasoftware.contour.service.dto.QuickReportDTO quickReport, java.lang.Integer projectId, java.util.Map<java.lang.String,java.lang.Boolean> params, java.lang.String format, java.util.Map<java.lang.String,java.lang.Object> reportParams)
          Renders the report.
 void init(Report report, org.springframework.context.ApplicationContext applicationContext)
          Initiates the daos and services used by the report.
protected  void mergeRelationships(java.util.ArrayList<VelocityReportDTO> vrDtoArrayList, java.util.List<java.lang.Integer> ids)
           
protected  void mergeTags(java.util.ArrayList<VelocityReportDTO> vrDtoArrayList, java.util.ArrayList<java.lang.Integer> ids)
           
 java.util.Map<java.lang.String,java.lang.Object> runPlugin(java.util.Map<java.lang.String,java.lang.Object> params)
          Runs a report plugin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VELOCITY_REPORT_PARAM_TAG

public static java.lang.String VELOCITY_REPORT_PARAM_TAG

VELOCITY_REPORT_PARAM_RELATE

public static java.lang.String VELOCITY_REPORT_PARAM_RELATE

report

protected Report report

applicationContext

protected org.springframework.context.ApplicationContext applicationContext

reportRender

protected com.jamasoftware.contour.util.ReportRender reportRender

projectService

protected com.jamasoftware.contour.project.service.ProjectService projectService

documentTypeService

protected com.jamasoftware.contour.service.DocumentTypeService documentTypeService

filterService

protected com.jamasoftware.contour.service.FilterService filterService

smartFilterService

protected com.jamasoftware.contour.service.SmartFilterService smartFilterService

relationshipService

protected com.jamasoftware.contour.service.RelationshipService relationshipService

tagDao

protected com.jamasoftware.contour.tag.dao.TagDao tagDao

propertyService

protected com.jamasoftware.contour.service.PropertyService propertyService

docFieldDao

protected DocumentFieldDao docFieldDao

documentDao

protected DocumentDao documentDao

userDao

protected UserDao userDao

fieldDataTypeManager

protected com.jamasoftware.contour.util.type.FieldDataTypeManager fieldDataTypeManager

documentNodeManager

protected com.jamasoftware.contour.service.documentNode.DocumentNodeManager documentNodeManager
Constructor Detail

VelocityReportPluginSupport

public VelocityReportPluginSupport()
Method Detail

init

public void init(Report report,
                 org.springframework.context.ApplicationContext applicationContext)
Initiates the daos and services used by the report.

Specified by:
init in interface com.jamasoftware.contour.plugin.ReportPlugin
Parameters:
report - the underlying report
applicationContext - Spring context

runPlugin

public java.util.Map<java.lang.String,java.lang.Object> runPlugin(java.util.Map<java.lang.String,java.lang.Object> params)
                                                           throws java.lang.Exception
Description copied from interface: com.jamasoftware.contour.plugin.ReportPlugin
Runs a report plugin

Specified by:
runPlugin in interface com.jamasoftware.contour.plugin.ReportPlugin
Parameters:
params - parameters for the report
Returns:
report string (Velocity) or model data for Spring views (BIRT).
Throws:
java.lang.Exception

getVelocityReport

protected abstract java.util.Map<java.lang.String,java.lang.Object> getVelocityReport(com.jamasoftware.contour.service.dto.QuickReportDTO quickReport,
                                                                                      java.lang.Integer projectId,
                                                                                      java.util.Map<java.lang.String,java.lang.Boolean> params,
                                                                                      java.lang.String format,
                                                                                      java.util.Map<java.lang.String,java.lang.Object> reportParams)
                                                                               throws java.lang.Exception
Renders the report.

Parameters:
quickReport -
projectId -
params -
format -
reportParams -
Returns:
Throws:
java.lang.Exception

getDateFormatter

protected com.jamasoftware.contour.util.DateFormatter getDateFormatter()
Gets the system date formats.

Returns:
date formatter.

addVelocityTools

protected void addVelocityTools(java.util.Map<java.lang.String,java.lang.Object> model)
Adds the Velocity tools to the context model.

By default, mathTool, sortTool, dateTool and escapeTool are added.

Parameters:
model -

mergeTags

protected void mergeTags(java.util.ArrayList<VelocityReportDTO> vrDtoArrayList,
                         java.util.ArrayList<java.lang.Integer> ids)

mergeRelationships

protected void mergeRelationships(java.util.ArrayList<VelocityReportDTO> vrDtoArrayList,
                                  java.util.List<java.lang.Integer> ids)

getDocumentMeta

protected com.jamasoftware.contour.service.dto.DocumentTypeDTO getDocumentMeta(com.jamasoftware.contour.service.dto.QuickReportDTO quickReport,
                                                                               java.util.Map<java.lang.String,com.jamasoftware.contour.service.dto.DocumentTypeDTO> metaCache,
                                                                               ContourItem document)

getDocumentlist

protected com.jamasoftware.contour.service.search.SearchResults<ContourItem> getDocumentlist(com.jamasoftware.contour.service.dto.QuickReportDTO quickReport)

getDocumentlistSorted

protected com.jamasoftware.contour.service.search.SearchResults<ContourItem> getDocumentlistSorted(com.jamasoftware.contour.service.dto.QuickReportDTO quickReport,
                                                                                                   java.lang.String orderBy)

getReport

public Report getReport()
Specified by:
getReport in interface com.jamasoftware.contour.plugin.ReportPlugin

getBaseUrl

protected java.lang.String getBaseUrl(com.jamasoftware.contour.project.domain.Project project)
Returns base URL with a trailing slash ('/').

Parameters:
project -
Returns:


Copyright (c) 2010 Jama Software, Inc. All Rights Reserved.