hudson.plugins.depgraph_view
Class AbstractDependencyGraphAction

java.lang.Object
  extended by hudson.plugins.depgraph_view.AbstractDependencyGraphAction
All Implemented Interfaces:
hudson.model.Action, hudson.model.ModelObject
Direct Known Subclasses:
DependencyGraphProjectActionFactory.DependencyGraphProjectAction, DependencyGraphViewActionFactory.DependencyGraphViewAction

public abstract class AbstractDependencyGraphAction
extends java.lang.Object
implements hudson.model.Action

Basic action for creating a Dot-Image of the DependencyGraph

Author:
wolfs

Nested Class Summary
protected static class AbstractDependencyGraphAction.SupportedImageType
           
 
Field Summary
protected static com.google.common.collect.ImmutableMap<java.lang.String,AbstractDependencyGraphAction.SupportedImageType> extension2Type
          Maps the extension of the requested file to the content type and the argument for the -T option of the graphviz tools
 
Constructor Summary
AbstractDependencyGraphAction()
           
 
Method Summary
 void doDynamic(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          graph.
 java.lang.String generateDotText(java.util.Set<hudson.model.AbstractProject<?,?>> projects, java.util.Set<hudson.model.DependencyGraph.Dependency> deps)
          Generates the graphviz code for the given projects and dependencies
 java.lang.String getDisplayName()
           
 java.lang.String getIconFileName()
           
abstract  hudson.model.AbstractModelObject getParentObject()
           
protected abstract  java.util.Collection<? extends hudson.model.AbstractProject<?,?>> getProjectsForDepgraph()
           
abstract  java.lang.String getTitle()
           
 java.lang.String getUrlName()
           
protected  void runDot(java.io.OutputStream output, java.io.InputStream input, java.lang.String type)
          Execute the dot commando with given input and output stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

extension2Type

protected static final com.google.common.collect.ImmutableMap<java.lang.String,AbstractDependencyGraphAction.SupportedImageType> extension2Type
Maps the extension of the requested file to the content type and the argument for the -T option of the graphviz tools

Constructor Detail

AbstractDependencyGraphAction

public AbstractDependencyGraphAction()
Method Detail

doDynamic

public void doDynamic(org.kohsuke.stapler.StaplerRequest req,
                      org.kohsuke.stapler.StaplerResponse rsp)
               throws java.io.IOException
graph.{png,gv,...} is mapped to the corresponding output

Throws:
java.io.IOException

generateDotText

public java.lang.String generateDotText(java.util.Set<hudson.model.AbstractProject<?,?>> projects,
                                        java.util.Set<hudson.model.DependencyGraph.Dependency> deps)
Generates the graphviz code for the given projects and dependencies

Parameters:
projects - the nodes of the graph
deps - the edges of the graph
Returns:
graphviz code

runDot

protected void runDot(java.io.OutputStream output,
                      java.io.InputStream input,
                      java.lang.String type)
               throws java.io.IOException
Execute the dot commando with given input and output stream

Parameters:
type - the parameter for the -T option of the graphviz tools
Throws:
java.io.IOException

getProjectsForDepgraph

protected abstract java.util.Collection<? extends hudson.model.AbstractProject<?,?>> getProjectsForDepgraph()
Returns:
projects for which the dependency graph should be calculated

getTitle

public abstract java.lang.String getTitle()
Returns:
title of the dependency graph page

getParentObject

public abstract hudson.model.AbstractModelObject getParentObject()
Returns:
object for which the sidepanel.jelly will be shown

getIconFileName

public java.lang.String getIconFileName()
Specified by:
getIconFileName in interface hudson.model.Action

getDisplayName

public java.lang.String getDisplayName()
Specified by:
getDisplayName in interface hudson.model.Action
Specified by:
getDisplayName in interface hudson.model.ModelObject

getUrlName

public java.lang.String getUrlName()
Specified by:
getUrlName in interface hudson.model.Action


Copyright © 2010. All Rights Reserved.