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, ProjectDescriptionFragment, VersionDescriptionFragment

public abstract class AbstractFragment
extends java.lang.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  ApplicationProperties applicationProperites
           
protected  JiraAuthenticationContext jiraAuthenticationContext
           
protected static org.apache.log4j.Logger log
           
protected  com.atlassian.velocity.VelocityManager velocityManager
           
 
Constructor Summary
protected AbstractFragment(com.atlassian.velocity.VelocityManager velocityManager, ApplicationProperties applicationProperites, JiraAuthenticationContext jiraAuthenticationContext)
           
 
Method Summary
protected  java.util.Map<java.lang.String,java.lang.Object> createVelocityParams(BrowseContext ctx)
          Creates new map of velocity parameters.
 java.lang.String getHtml(BrowseContext ctx)
          Renders the fragment.
protected abstract  java.lang.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 com.atlassian.velocity.VelocityManager velocityManager

applicationProperites

protected final ApplicationProperties applicationProperites

jiraAuthenticationContext

protected final JiraAuthenticationContext jiraAuthenticationContext
Constructor Detail

AbstractFragment

protected AbstractFragment(com.atlassian.velocity.VelocityManager velocityManager,
                           ApplicationProperties applicationProperites,
                           JiraAuthenticationContext jiraAuthenticationContext)
Method Detail

getTemplateDirectoryPath

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

Returns:
the path to the template directory

createVelocityParams

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

This map contains:

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

getHtml

public java.lang.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.


Copyright © 2002-2010 Atlassian. All Rights Reserved.