View Javadoc

1   /*
2    * Copyright 2008-2010 smartics, Kronseder & Reiner GmbH
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package de.smartics.maven.issues.bugzilla;
18  
19  import java.util.List;
20  import java.util.ResourceBundle;
21  
22  import org.apache.maven.doxia.sink.Sink;
23  import org.eclipse.mylyn.tasks.core.data.TaskData;
24  
25  import de.smartics.maven.issues.RendererConfig;
26  
27  /**
28   * The renderer prints issue information in different sections within their
29   * version. The sections are defines by the key
30   * {@link RendererConfig#getSectionType()} and are selected and ordered by
31   * {@link RendererConfig#getSections()}.
32   *
33   * @author <a href="mailto:robert.reiner@smartics.de">Robert Reiner</a>
34   */
35  public class VersionedSectionReleasePlanReportRenderer extends
36      VersionedSectionReportRenderer
37  {
38    // ********************************* Fields *********************************
39  
40    // --- constants ------------------------------------------------------------
41  
42    // --- members --------------------------------------------------------------
43  
44    // ****************************** Initializer *******************************
45  
46    // ****************************** Constructors ******************************
47  
48    /**
49     * Default constructor.
50     *
51     * @param config the configuration to control the rendering process.
52     * @param sink the sink to write to.
53     * @param issues the issue information to render in the report.
54     */
55    public VersionedSectionReleasePlanReportRenderer(final RendererConfig config,
56        final Sink sink, final List<TaskData> issues)
57    {
58      super(config, sink, issues);
59    }
60  
61    // ****************************** Inner Classes *****************************
62  
63    // ********************************* Methods ********************************
64  
65    // --- init -----------------------------------------------------------------
66  
67    // --- get&set --------------------------------------------------------------
68  
69    /**
70     * {@inheritDoc}
71     */
72    @Override
73    public String getTitle()
74    {
75      return getTitle("report.name.releasePlan");
76    }
77  
78    /**
79     * {@inheritDoc}
80     */
81    @Override
82    public String getDescription()
83    {
84      return getDescription("report.description.releasePlan");
85    }
86  
87    /**
88     * {@inheritDoc}
89     */
90    @Override
91    public String getNoResultsDescription()
92    {
93      return getNoResultsDescription("report.noResultsDescription.releasePlan");
94    }
95  
96    // --- business -------------------------------------------------------------
97  
98    /**
99     * Creates the sectioner to use.
100    *
101    * @return the sectioner to use.
102    */
103   protected Sectioner<Versions> createSectioner()
104   {
105     return new VersionedSectioner(config, issues, null);
106   }
107 
108   /**
109    * Returns the arbiter to determine which versions are excluded from the
110    * report.
111    *
112    * @return the arbiter to determine which versions are excluded from the
113    *         report.
114    */
115   @Override
116   protected VersionSkipper createVersionSkipper()
117   {
118     return new ReleasePlanVersionSkipper(
119         config.getIncludeOnSamePageAllOfVersion());
120   }
121 
122   /**
123    * Returns the identifier part for the version text rendered in the report.
124    *
125    * @return the identifier part for the version text rendered in the report.
126    */
127   protected String getVersionTextId()
128   {
129     return "versionReleasePlan.header";
130   }
131 
132   /**
133    * Returns the introduction text after the section title.
134    *
135    * @param bundle the resource bundle to use.
136    * @param sectionId the identifier (an attribute key of the issue management
137    *          system) of the section.
138    * @return the localized text to render.
139    */
140   protected String getSectionText(final ResourceBundle bundle,
141       final String sectionId)
142   {
143     return ReportHelper.getLabel(bundle, "section.text.versionedReleasePlan",
144         sectionId, currentVersionString);
145   }
146   // --- object basics --------------------------------------------------------
147 
148 }