View Javadoc

1   /*
2    * $Id: GalleryPostGrapher.java 7963 2007-08-21 08:53:15Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.tools.visualizer.postgraphers;
12  
13  import org.mule.tools.visualizer.config.GraphEnvironment;
14  
15  import java.io.File;
16  
17  public class GalleryPostGrapher extends AbstractIndexer
18  {
19  
20      public static final String DEFAULT_MULE_GALLERY_TEMPLATE = "template/gallery-index.vm";
21  
22      private String template;
23  
24      public GalleryPostGrapher(GraphEnvironment env) throws Exception
25      {
26          super(env);
27          template = env.getProperties().getProperty("muleGalleryTemplate");
28          if (template == null)
29          {
30              template = DEFAULT_MULE_GALLERY_TEMPLATE;
31          }
32      }
33  
34      /*
35       * (non-Javadoc)
36       * 
37       * @see org.mule.tools.visualizer.PostGrapher#postGrapher(org.mule.tools.visualizer.GraphConfig)
38       */
39      public void postGrapher(GraphEnvironment env)
40      {
41          File[] htmlFiles = getFiles(env.getConfig(), ".gif");
42          String targetFile = env.getConfig().applyOutputDirectory(
43                  env.getProperty("muleGalleryOutputName", "gallery.html"));
44          doRendering(env, htmlFiles, template, targetFile);
45  
46      }
47  
48      public String getStatusTitle()
49      {
50          return "Generating Gallery page";
51      }
52  }