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