All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.jasperreports.web.util.ReportExecutionHyperlinkProducerFactory Maven / Gradle / Ivy

There is a newer version: 6.21.3
Show newest version
/*
 * JasperReports - Free Java Reporting Library.
 * Copyright (C) 2001 - 2011 Jaspersoft Corporation. All rights reserved.
 * http://www.jaspersoft.com
 *
 * Unless you have purchased a commercial license agreement from Jaspersoft,
 * the following license terms apply:
 *
 * This program is part of JasperReports.
 *
 * JasperReports is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * JasperReports is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with JasperReports. If not, see .
 */
package net.sf.jasperreports.web.util;

import javax.servlet.http.HttpServletRequest;

import net.sf.jasperreports.engine.JasperReportsContext;
import net.sf.jasperreports.engine.export.JRHyperlinkProducer;
import net.sf.jasperreports.engine.export.JRHyperlinkProducerFactory;


/**
 * @author Teodor Danciu ([email protected])
 * @version $Id: ReportExecutionHyperlinkProducerFactory.java 5378 2012-05-14 00:39:27Z teodord $
 */
public class ReportExecutionHyperlinkProducerFactory extends JRHyperlinkProducerFactory
{
	/**
	 * @deprecated Replaced by {@link ReportExecutionHyperlinkProducer#HYPERLINK_TYPE_REPORT_EXECUTION}.
	 */
	public static final String HYPERLINK_TYPE_REPORT_EXECUTION = "ReportExecution";
	
	private JasperReportsContext jasperReportsContext;
	private HttpServletRequest request;
	
	/**
	 *
	 */
	private ReportExecutionHyperlinkProducerFactory(JasperReportsContext jasperReportsContext, HttpServletRequest request)
	{
		this.jasperReportsContext = jasperReportsContext;
		this.request = request;
	}

	/**
	 *
	 */
	public static ReportExecutionHyperlinkProducerFactory getInstance(JasperReportsContext jasperReportsContext, HttpServletRequest request)
	{
		return new ReportExecutionHyperlinkProducerFactory(jasperReportsContext, request);
	}

	/**
	 *
	 */
	public JRHyperlinkProducer getHandler(String linkType)
	{
		if (linkType != null)
		{
			if (ReportExecutionHyperlinkProducer.HYPERLINK_TYPE_REPORT_EXECUTION.equals(linkType))
			{
				return ReportExecutionHyperlinkProducer.getInstance(jasperReportsContext, request);
			}
			if (ReportInteractionHyperlinkProducer.HYPERLINK_TYPE_REPORT_INTERACTION.equals(linkType))
			{
				return ReportInteractionHyperlinkProducer.getInstance(jasperReportsContext, request);
			}
		}
		return null;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy