com.atlassian.jira.plugin.projectpanel.fragment.impl
Class AbstractFragment

java.lang.Object
  extended by com.atlassian.jira.plugin.projectpanel.fragment.impl.AbstractFragment
All Implemented Interfaces:
ProjectTabPanelFragment
Direct Known Subclasses:
AbstractMultiFragment, ActivityStreamFragment, ComponentDescriptionFragment, CreatedVsResolvedFragment, DueVersionsFragment, IssueFiltersFragment, NoIssuesFragment, ProjectDescriptionFragment, ProjectGetStarted, ProjectReportsFragment, VersionDescriptionFragment

public abstract class AbstractFragment
extends Object
implements ProjectTabPanelFragment

This abstract class implements the standard way of rendering this fragment's HTML in getHtml(BrowseContext) method and base Velocity parameters creation via createVelocityParams(BrowseContext) method.

Since:
v4.0

Field Summary
protected  JiraAuthenticationContext authenticationContext
           
protected static org.apache.log4j.Logger log
           
protected  VelocityTemplatingEngine velocityManager
           
 
Constructor Summary
protected AbstractFragment(VelocityTemplatingEngine templatingEngine, JiraAuthenticationContext authenticationContext)
           
 
Method Summary
protected  Map<String,Object> createVelocityParams(BrowseContext ctx)
          Creates new map of velocity parameters.
 String getHtml(BrowseContext ctx)
          Renders the fragment.
protected  long getIssueCountInSearch(BrowseContext ctx)
           
protected abstract  String getTemplateDirectoryPath()
          Returns the path to the template directory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.jira.plugin.projectpanel.fragment.ProjectTabPanelFragment
getId, showFragment
 

Field Detail

log

protected static final org.apache.log4j.Logger log

velocityManager

protected final VelocityTemplatingEngine velocityManager

authenticationContext

protected final JiraAuthenticationContext authenticationContext
Constructor Detail

AbstractFragment

protected AbstractFragment(VelocityTemplatingEngine templatingEngine,
                           JiraAuthenticationContext authenticationContext)
Method Detail

getTemplateDirectoryPath

protected abstract String getTemplateDirectoryPath()
Returns the path to the template directory

Returns:
the path to the template directory

createVelocityParams

protected Map<String,Object> createVelocityParams(BrowseContext ctx)
Creates new map of velocity parameters.

This map contains:

Parameters:
ctx - browse context
Returns:
new velocity parameters map

getHtml

public String getHtml(BrowseContext ctx)
Renders the fragment.

It uses Veocity parameters created by createVelocityParams(BrowseContext) method. If you need to pass in more parameters, please override createVelocityParams(BrowseContext) method.

Specified by:
getHtml in interface ProjectTabPanelFragment
Parameters:
ctx - the context that this fragment is being rendered in.
Returns:
the escaped HTML to include.

getIssueCountInSearch

protected long getIssueCountInSearch(BrowseContext ctx)


Copyright © 2002-2013 Atlassian. All Rights Reserved.