[jboss-svn-commits] JBL Code SVN: r7763 - in labs/reportingservices/trunk/dev/modules/client: . api api/src/main/java/org/jboss/reporting/api

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Nov 22 04:08:34 EST 2006


Author: noel.rocher at jboss.com
Date: 2006-11-22 04:08:29 -0500 (Wed, 22 Nov 2006)
New Revision: 7763

Removed:
   labs/reportingservices/trunk/dev/modules/client/api/src/main/java/org/jboss/reporting/api/ReportTaskFactory.java
   labs/reportingservices/trunk/dev/modules/client/api/src/main/java/org/jboss/reporting/api/ReportTaskImpl.java
Modified:
   labs/reportingservices/trunk/dev/modules/client/api/pom.xml
   labs/reportingservices/trunk/dev/modules/client/pom.xml
Log:


Modified: labs/reportingservices/trunk/dev/modules/client/api/pom.xml
===================================================================
--- labs/reportingservices/trunk/dev/modules/client/api/pom.xml	2006-11-22 09:06:04 UTC (rev 7762)
+++ labs/reportingservices/trunk/dev/modules/client/api/pom.xml	2006-11-22 09:08:29 UTC (rev 7763)
@@ -36,4 +36,4 @@
 			<artifactId>jboss-common</artifactId>
 		</dependency>
 	</dependencies>
-</project>
\ No newline at end of file
+</project>

Deleted: labs/reportingservices/trunk/dev/modules/client/api/src/main/java/org/jboss/reporting/api/ReportTaskFactory.java
===================================================================
--- labs/reportingservices/trunk/dev/modules/client/api/src/main/java/org/jboss/reporting/api/ReportTaskFactory.java	2006-11-22 09:06:04 UTC (rev 7762)
+++ labs/reportingservices/trunk/dev/modules/client/api/src/main/java/org/jboss/reporting/api/ReportTaskFactory.java	2006-11-22 09:08:29 UTC (rev 7763)
@@ -1,112 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.reporting.api;
-
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.util.Properties;
-
-import org.jboss.remoting.Client;
-import org.jboss.remoting.InvokerLocator;
-import org.jboss.util.id.GUID;
-
-/**
- * @author noel
- *
- */
-public class ReportTaskFactory
-{
-
-	private final static String PROPERTY_LOCATOR_URL="jboss.reporting.locator";
-	private final static String PROPERTY_REPORTING_SUBSYSTEM="jboss.reporting.subsystem";
-
-	private final static String DEFAULT_LOCATOR_URL="socket://localhost:8085";
-	private final static String DEFAULT_REPORTING_SUBSYSTEM="reporting-services";
-	
-	private static String reportLocatorURL=""; 
-	private static String reportSubsystem=""; 
-	private static InvokerLocator reportLocator=null;
-	public static Client reportClient=null;
-	
-
-	/*
-	 * Initialisation
-	 */
-	static
-	{
-		try
-		{	Properties props = new Properties();
-			props.load( (ReportTaskFactory.class).getClassLoader().getResourceAsStream("report-client.properties"));
-			reportLocatorURL = props.getProperty(PROPERTY_LOCATOR_URL);
-			reportSubsystem = props.getProperty(PROPERTY_REPORTING_SUBSYSTEM);
-		} catch (IOException ignore){}
-		
-		if (reportLocatorURL == null || reportLocatorURL.length() == 0)
-		{
-			// look for a system property
-			reportLocatorURL = System.getProperty(PROPERTY_LOCATOR_URL);
-			if (reportLocatorURL == null || reportLocatorURL.length() == 0)
-			{
-				// use the default
-				reportLocatorURL = DEFAULT_LOCATOR_URL;
-			}
-		}		
-			
-	
-		if (reportSubsystem == null || reportSubsystem.length() == 0)
-		{
-			// look for a system property
-			reportSubsystem = System.getProperty(PROPERTY_REPORTING_SUBSYSTEM);
-			if (reportSubsystem == null || reportSubsystem.length() == 0)
-			{
-				// use the default
-				reportSubsystem = DEFAULT_REPORTING_SUBSYSTEM;
-			}
-		}
-	
-		try
-		{
-			reportLocator = new InvokerLocator(reportLocatorURL);
-			reportClient = new Client(reportLocator, reportSubsystem);
-			System.out.println(reportLocator);
-			reportClient.connect();
-			System.out.println(reportClient.isConnected());
-		} catch (MalformedURLException e)
-		{
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (Exception e)
-		{
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-		
-	}
-	
-	
-	/**
-	 * Return a ReportTask implementation
-	 */
-	public static ReportTask getInstance()
-	{
-		ReportTaskImpl result=null;
-		result = new ReportTaskImpl(newReportTaskID());
-		return result;
-	}
-	
-	/**
-	 * Return a ReportTask ID
-	 */
-	public static String newReportTaskID()
-	{
-		return new GUID().toString();
-	}
-	
-
-
-}

Deleted: labs/reportingservices/trunk/dev/modules/client/api/src/main/java/org/jboss/reporting/api/ReportTaskImpl.java
===================================================================
--- labs/reportingservices/trunk/dev/modules/client/api/src/main/java/org/jboss/reporting/api/ReportTaskImpl.java	2006-11-22 09:06:04 UTC (rev 7762)
+++ labs/reportingservices/trunk/dev/modules/client/api/src/main/java/org/jboss/reporting/api/ReportTaskImpl.java	2006-11-22 09:08:29 UTC (rev 7763)
@@ -1,230 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.reporting.api;
-
-import java.io.Serializable;
-
-import org.jboss.reporting.api.distribute.Distribute;
-import org.jboss.reporting.api.distribute.DistributeByMethodReturn;
-import org.jboss.reporting.api.output.OutputFormat;
-import org.jboss.reporting.api.schedule.Schedule;
-import org.jboss.reporting.api.schedule.ScheduleNow;
-import org.jboss.reporting.util.ByteArrayWrapper;
-
-/**
- * @author noel
- *
- */
-public class ReportTaskImpl implements ReportTask, Serializable
-{
-	private static final long serialVersionUID = -3943314104014993256L;
-
-	
-	private Report 			report = null;
-	private Distribute 		distribute = null;
-	private int			 	outputFormat = 0;
-	private Schedule 		schedule = null;
-	private String			ID = "";
-	private boolean			requiresNewID=false;
-
-	// keep this for later
-//	private SecurityThing  securityInfo=null;
-	
-	
-	// CTOR
-	/**
-	 * default : distribute is synchrone, output is PDF, Shedule is NOW
-	 */
-	protected ReportTaskImpl(String in_ID)
-	{
-		this.ID = in_ID;
-		this.distribute = new DistributeByMethodReturn();
-		this.outputFormat = OutputFormat.PDF;
-		this.schedule = new ScheduleNow();
-	}
-
-	
-	/** trigger the execution of the report */
-	public void submit() throws Exception
-	{
-		String previousID=this.ID;
-		boolean error=false;
-		try
-		{
-			// when submitted, the RT ID is used as the timer ID
-			// if the RT is used several times, its ID will change
-			if (this.requiresNewID == true)
-			{
-				this.ID = ReportTaskFactory.newReportTaskID();
-			}
-			ReportTaskFactory.reportClient.invoke(this);
-			this.requiresNewID = true;
-		} 
-		catch (Throwable e)
-		{
-			error=true;
-			Exception ee=new Exception("Invocation error.");
-			ee.initCause(e);
-			throw ee;
-		}
-		finally
-		{
-			if (error)
-			{
-				this.ID=previousID;
-			}
-		}
-	}
-	
-	/**
-	 * used to obtain the result of the execution as a string 
-	 * (<b>not valid</b> for binary output format such as PDF or XLS) 
-	 * Distribute is DistributeByMethodReturn
-	 * Schedule is ScheduleNow
-	 */
-	public String executeToString() throws Exception
-	{
-		String result="";
-		this.distribute = new DistributeByMethodReturn();
-		this.schedule = new ScheduleNow();
-		try
-		{
-			result = (String)ReportTaskFactory.reportClient.invoke(this);
-		} 
-		catch (Throwable e)
-		{
-			Exception ee=new Exception("Invocation error.");
-			ee.initCause(e);
-			throw ee;
-		}
-		return result;
-	}
-
-	public String executeToString(Report in_report) throws Exception
-	{
-		this.report = in_report;
-		return this.executeToString();
-	}
-
-	public String executeToString(String in_reportAbsoluteName) throws Exception
-	{
-		this.report = new Report(in_reportAbsoluteName);
-		return this.executeToString();
-	}
-
-	/**
-	 * used to obtain the result of the execution as a byte array 
-	 * (for binary output format such as PDF or XLS) 
-	 * Distribute is DistributeByMethodReturn
-	 * Schedule is ScheduleNow
-	 */
-	public byte[] executeToByteArray() throws Exception
-	{
-		byte[] result=null;
-		this.distribute = new DistributeByMethodReturn();
-		this.schedule = new ScheduleNow();
-		
-		try
-		{
-			result = ((ByteArrayWrapper)ReportTaskFactory.reportClient.invoke(this)).getValue();
-		} 
-		catch (Throwable e)
-		{
-			Exception ee=new Exception("Invocation error. " + e);
-			ee.initCause(e);
-			throw ee;
-		}
-		
-		return result;
-	}
-	
-	public byte[] executeToByteArray(Report in_report) throws Exception
-	{
-		this.report = in_report;
-		return this.executeToByteArray();
-	}
-
-	public byte[] executeToByteArray(String in_reportAbsoluteName) throws Exception
-	{
-		this.report = new Report(in_reportAbsoluteName);
-		return this.executeToByteArray();
-	}
-	
-	
-	
-	
-	
-	
-	public String toString()
-	{
-		String result=
-		"\n\n******************** ReportTask ***********************\n" 	+
-		"** ID \t= " 			+ this.ID + "\n" +
-		"** report \t= " 		+ this.report.toString() + "\n" +
-		"** output \t= " 		+ OutputFormat.toString(this.outputFormat) + "\n" +
-		"** schedule \t= " 		+ this.schedule.toString() + "\n" +
-		"** distribute \t= " 	+ this.distribute.toString() + "\n";
-		
-		if (report.getData() != null) result = result +
-		"** data columns = " 	+ report.getData().toString() + "\n";
-		
-		result = result + 
-		"*******************************************************\n";
-		
-		return result;
-	}
-	
-	
-// ---- accessors	
-	
-	public Report getReport()
-	{
-		return report;
-	}
-
-	public void setReport(Report in_value)
-	{
-		report = in_value;
-	}
-
-	public Distribute getDistribute()
-	{
-		return distribute;
-	}
-
-	public void setDistribute(Distribute in_value)
-	{
-		distribute = in_value;
-	}
-
-	public int getOutputFormat()
-	{
-		return outputFormat;
-	}
-
-	public void setOutputFormat(int in_value)
-	{
-		outputFormat = in_value;
-	}
-
-	public Schedule getSchedule()
-	{
-		return this.schedule;
-	}
-
-	public void setSchedule(Schedule in_value)
-	{
-		this.schedule = in_value;
-	}
-
-
-	public String getID()
-	{
-		return ID;
-	}
-
-}

Modified: labs/reportingservices/trunk/dev/modules/client/pom.xml
===================================================================
--- labs/reportingservices/trunk/dev/modules/client/pom.xml	2006-11-22 09:06:04 UTC (rev 7762)
+++ labs/reportingservices/trunk/dev/modules/client/pom.xml	2006-11-22 09:08:29 UTC (rev 7763)
@@ -16,6 +16,7 @@
 	<modules>
 		<module>api</module>
 		<module>impl</module>
+		<module>samples</module>
 	</modules>
 
 </project>
\ No newline at end of file




More information about the jboss-svn-commits mailing list