i-net Clear Reports

com.inet.report.schedule
Class ScheduleReport

java.lang.Object
  extended by com.inet.report.schedule.ScheduleReport

public class ScheduleReport
extends java.lang.Object

This class holds the information about a report which is part of a task. It contains all properties with which the report is executed.
It is also possible to register a DynamicProperties class which will create several instances of the report by dynamic report properties at execution.

Since:
i-net Crystal-Clear 6.0

Method Summary
 void addAllProperties(java.util.Properties properties)
          Adds all properties passed to the report properties of this report.
 void addProperty(java.lang.String name, java.lang.String value)
          Adds a report property with a certain value to this report.
 java.lang.String getDynamicPropertiesClass()
          Returns the name of the DynamicProperties class which is registered for this report.
 java.lang.String[] getErrorMessages()
          Returns the errors this report currently has.
 java.util.Properties getProperties()
          Returns all report properties of this report currently defined.
 int getPropertyType(java.lang.String propertyName)
          Returns the value type of a report property.
 java.lang.String getPropertyValue(java.lang.String name)
          Returns the value of a report property of this report.
 java.lang.String getScheduleName()
          Returns the schedule name of this report.
 boolean isDynamic()
          Returns if a DynamicProperties class is defined for this report.
 boolean isValid()
          Returns if this report is valid for execution.
 void removeProperty(java.lang.String propertyName)
          Removes the given property from the list of report properties of this report.
 void setDynamicPropertiesClass(java.lang.String userPropertyName)
          Sets the class name of the DynamicProperties class which should be registered for this report.
 void setPropertyType(java.lang.String propertyName, int propertyType)
          This will set a value type for a given report property.
 java.lang.String toString()
          Returns a string representation of this task with the format scheduleName=<getScheduleName() of this task>.
 

Method Detail

addProperty

public void addProperty(java.lang.String name,
                        java.lang.String value)
                 throws ScheduleException
Adds a report property with a certain value to this report.

Parameters:
name - The name of the property. Usually this should be one of the URL parameters of i-net Clear Reports, e.g. prompt0 or the export_fmt
value - The value of the given property.
Throws:
ScheduleException - If the name of the property is null or empty. (SE0032)

getPropertyValue

public java.lang.String getPropertyValue(java.lang.String name)
Returns the value of a report property of this report.

Parameters:
name - The name of the report property of which the value is requested.
Returns:
The value of the property or null if the property is not defined for this report.

getDynamicPropertiesClass

public java.lang.String getDynamicPropertiesClass()
Returns the name of the DynamicProperties class which is registered for this report.

Returns:
The name of the DynamicProperties class or null if none is defined.

setDynamicPropertiesClass

public void setDynamicPropertiesClass(java.lang.String userPropertyName)
Sets the class name of the DynamicProperties class which should be registered for this report.
Syntax: package.classname(parameter,parameter)
Example: com.inet.report.MyDynamic("myString",true,3.1415)
Separator of Parameter ',' or ';'
The supported parameter types are: boolean, int, double, java.util.Date, java.lang.String.

Parameters:
userPropertyName - The given classname including parameter for a specific Constructor or null if none should be registered.
See Also:
BaseUtils.getParams(String, String)

isDynamic

public boolean isDynamic()
Returns if a DynamicProperties class is defined for this report.

Returns:
True if there is a class defined otherwise false

getScheduleName

public java.lang.String getScheduleName()
Returns the schedule name of this report. This is an unique name for the report within a task. There cannot be two reports with the same schedule name within a task.

Returns:
The schedule name of this report.

addAllProperties

public void addAllProperties(java.util.Properties properties)
Adds all properties passed to the report properties of this report. All properties already existed will be overwritten with the new values.

Parameters:
properties - The properties which should be added to the report properties of this report. If null is passed then nothing will be done.

getProperties

public java.util.Properties getProperties()
Returns all report properties of this report currently defined.
Note: Only a copy of the original Properties object is returned. So all changed to the return Properties object will have no effect to this report.

Returns:
A Properties object with all report propertied defined for this report.

removeProperty

public void removeProperty(java.lang.String propertyName)
Removes the given property from the list of report properties of this report.

Parameters:
propertyName - The name of the property which should be removed.

isValid

public boolean isValid()
Returns if this report is valid for execution.
The report is not valid if no property "report" is set, if the report file could not be found or if the file which was found is no valid report file.

Returns:
True if the report is valid and can be executed otherwise false.

getErrorMessages

public java.lang.String[] getErrorMessages()
Returns the errors this report currently has. Please see isValid() for details when a report has an error.

Returns:
An array with error messages or an array with length 0 if the report has no errors.

toString

public java.lang.String toString()
Returns a string representation of this task with the format scheduleName=<getScheduleName() of this task>.

Overrides:
toString in class java.lang.Object
Returns:
a string identifying this task

setPropertyType

public void setPropertyType(java.lang.String propertyName,
                            int propertyType)
                     throws ScheduleException
This will set a value type for a given report property. This is helpful for prompts. Then the web configuration tool of the i-net Scheduler can also display the type for that prompt. The type given can be one of this values Field.BINARY, Field.BOOLEAN, Field.CURRENCY, Field.DATE, Field.DATETIME, Field.NUMBER, Field.STRING or Field.TIME. The set property type will be used by the web configuration tool of the i-net Scheduler only.

Parameters:
propertyName - The name of the report property you want to set the value type for.
propertyType - The value type of the report property. (See above for possible values)
Throws:
ScheduleException - If a property with the given name does not exist. (SE0033)
Since:
6.1
See Also:
getPropertyType(String), addProperty(String, String)

getPropertyType

public int getPropertyType(java.lang.String propertyName)
Returns the value type of a report property. Usually you will only get the return type of prompts. This are used by the web configuration tool of the i-net Scheduler.

Parameters:
propertyName - The name of the report property you want to get the value type of.
Returns:
-1 if no value type has been set for this report property otherwise one of the values shown in setPropertyType(String, int) is returned.
Since:
6.1
See Also:
setPropertyType(String, int), addProperty(String, String)

i-net Clear Reports

Copyright © 1999-2011 by i-net software GmbH