ChangeSynergy::SubReportEntry
The ChangeSynergy::SubReportEntry class is used as part of a set of classes when a report is imported or exported from the server. All ReportEntry objects contain a QueryEntry object and one or more SubReportEntry objects. These set of objects make up a standard Change report configuration entry. This class represents a CCM_PROBLEM, CCM_TASK or CCM_OBJECT entry as shown below for the 'Column' reports CCM_PROBLEM definition.
[CCM_PROBLEM] [NAME]column_cr[/NAME] [MAIN_TEMPLATE]user_framework/column_rpt.html[/MAIN_TEMPLATE] [HDR_TEMPLATE]user_framework/common_bulk_hdr.html[/HDR_TEMPLATE] [ATTR_TEMPLATE]user_framework/column_attr.html[/ATTR_TEMPLATE] [LABEL_TEMPLATE]user_framework/custom_label.html[/LABEL_TEMPLATE] [AUTO_LABEL_TEMPLATE]user_framework/custom_auto_label.html[/AUTO_LABEL_TEMPLATE] [SPAN_ATTR_TEMPLATE]user_framework/custom_span_attr.html[/SPAN_ATTR_TEMPLATE] [AUTO_ATTR_TEMPLATE]user_framework/column_auto_attr.html[/AUTO_ATTR_TEMPLATE] [FTR_TEMPLATE]user_framework/common_bulk_ftr.html[/FTR_TEMPLATE] [ATTRS]problem_number:0:false|crstatus:1:false|problem_synopsis:2:false[/ATTRS] [SORT_ORDER]problem_number:intb:A[/SORT_ORDER] [/CCM_PROBLEM]
Example:
eval { $csapi->setUpConnection("http", "machine", 8600);
my $aUser = $csapi->Login("u00001", "u00001", "User", "\\\\machine\\ccmdb\\cm_database");
#Construct a new Globals object. my $globals = new ChangeSynergy::Globals(); #Export a CR report named 'My Report' from the shared preferences my $reportEntry = $csapi->exportAReport($aUser, "My Report", $globals->{PROBLEM_TYPE}, $globals->{SHARED_PROFILE}); my @subreports = $reportEntry->getSubReports(); for my $subReportEntry (@subreports) { print "--------------- Sub Report Entry ---------------------\n"; print "getName: " . $subReportEntry->getName() . "\n"; print "getMainTemplate: " . $subReportEntry->getMainTemplate() . "\n"; print "getHeaderTemplate: " . $subReportEntry->getHeaderTemplate() . "\n"; print "getAttributeTemplate: " . $subReportEntry->getAttributeTemplate() . "\n"; print "getImageTemplate: " . $subReportEntry->getImageTemplate() . "\n"; print "getGroupTemplate: " . $subReportEntry->getGroupTemplate() . "\n"; print "getAutoAttributeTemplate: " . $subReportEntry->getAutoAttributeTemplate() . "\n"; print "getFooterTemplate: " . $subReportEntry->getFooterTemplate() . "\n"; print "getGroupBy: " . $subReportEntry->getGroupBy() . "\n"; print "getCustomWslet: " . $subReportEntry->getCustomWslet() . "\n"; print "getXmlContent: " . $subReportEntry->getXmlContent() . "\n"; print "getSpanAttributeTemplate: " . $subReportEntry->getSpanAttributeTemplate() . "\n"; print "getLabelTemplate: " . $subReportEntry->getLabelTemplate() . "\n"; print "getAutoLabelTemplate: " . $subReportEntry->getAutoLabelTemplate() . "\n"; print "getAttributes: " . $subReportEntry->getAttributes() . "\n"; print "getSortOrder: " . $subReportEntry->getSortOrder() . "\n"; print "getRelation: " . $subReportEntry->getRelation() . "\n"; print "getDefinitionType: " . $subReportEntry->getDefinitionType() . "\n\n"; } };
if ($@) { print $@; }
scalar |
getAttributes() Gets the attribute string that determines which attributes will be looked up for the subreport an example attribute string is problem_number:0:false|crstatus:1:false|problem_synopsis:2:false. |
scalar |
getAttributeTemplate() Gets the name of the attribute template to load to format the report results, e.g., user_framework/column_attr.html. |
scalar |
getAutoAttributeTemplate() Gets the name of the auto attribute template to load to format the report results, e.g., user_framework/custom_auto_attr.html. |
scalar |
getAutoLabelTemplate() Gets the name of the auto label template to load to format the report results, e.g., user_framework/custom_auto_label.html. |
scalar |
getCustomWslet() Gets the name of the custom WSLET to run for this subreport. |
scalar |
getDefinitionType() Gets the definition type for this sub report, either PROBLEM_DEF, TASK_DEF or OBJECT_DEF. |
scalar |
getFooterTemplate() Gets the name of the footer template to load, e.g., user_framework/common_bulk_ftr.html. |
scalar |
getGroupBy() Gets the groups that have the same attribute name as follows: [GROUP_BY]attribute_name|sort_type:sort_direction[/GROUP_BY]. |
scalar |
getGroupTemplate() Gets the name of the group template. |
scalar |
getHeaderTemplate() Gets the name of the header template to load to format the report results, e.g., user_framework/common_bulk_hdr.html. |
scalar |
getImageTemplate() Gets the name of the image template to load to format the report results, e.g., user_framework/cs_chart_common_img.html. |
scalar |
getLabelTemplate() Gets the name of the label template to load to format column baed report results, e.g., user_framework/custom_label.html. |
scalar |
getMainTemplate() Gets the name of the main template to load to format the report results, e.g., user_framework/column_rpt.html. |
scalar |
getName() Gets the name of the sub report, in the configuration example above this is the data in the NAME tag. |
scalar |
getRelation() Gets the name of the relation this sub report is following. |
scalar |
getSortOrder() Gets the sort order string that determines how the subreport items will be sorted an example sort order string is problem_number:intb:A. |
scalar |
getSpanAttributeTemplate() Gets the name of the span attribute template to load, e.g., user_framework/custom_span_attr.html. |
scalar |
getXmlContent() Gets the XML data to pass to a custom WSLET. |
void |
setAttributes(scalar attributes) Sets the attribute string that determines which attributes will be looked up for the subreport an example attribute string is problem_number:0:false|crstatus:1:false|problem_synopsis:2:false. |
void |
setAttributeTemplate(scalar attributeTemplate) Sets the name of the attribute template to load to format the report results, e.g., user_framework/column_attr.html. |
void |
setAutoAttributeTemplate(scalar autoAttributeTemplate) Sets the name of the auto attribute template to load to format the report results for auto-generated reports, e.g., user_framework/custom_auto_attr.html. |
void |
setAutoLabelTemplate(scalar autoLabelTemplate) Sets the name of the auto label template to load to format the report results for auto-generated reports, e.g., user_framework/custom_auto_label.html. |
void |
setCustomWslet(scalar customTemplate) Sets the name of the custom WSLET to run for this subreport an example is CSChartMultipleDateTrend. |
void |
setDefinitionType(scalar definitionType) Sets the definition type for this sub report, either PROBLEM_DEF, TASK_DEF or OBJECT_DEF. |
void |
setFooterTemplate(scalar footerTemplate) Sets the name of the footer template to load, e.g., user_framework/common_bulk_ftr.html. |
void |
setGroupBy(scalar groupBy) Sets the groups that have the same attribute name as follows: [GROUP_BY]attribute_name|sort_type:sort_direction[/GROUP_BY]. |
void |
setGroupTemplate(scalar groupTemplate) Sets the name of the group template to load. |
void |
setHeaderTemplate(scalar headerTemplate) Sets the name of the header template to load to format the report results, e.g., user_framework/common_bulk_hdr.html. |
void |
setImageTemplate(scalar imageTemplate) Sets the name of the image template to load to format the report results, e.g., user_framework/cs_chart_common_img.html. |
void |
setLabelTemplate(scalar labelTemplate) Sets the name of the label template to load to format column baed report results, e.g., user_framework/custom_label.html. |
void |
setMainTemplate(scalar mainTemplate) Sets the name of the main template to load to format the report results, e.g., user_framework/column_rpt.html. |
void |
setName(scalar subReportName) Sets the name of the sub report, the name is required as it links the report definition to the sub report definition. |
void |
setRelation(scalar relationName) Sets the name of the relation the sub report is following, for example associated_task. |
void |
setSortOrder(scalar sortOrder) Gets the sort order string that determines how the subreport items will be sorted an example sort order string is problem_number:intb:A. |
void |
setSpanAttributeTemplate(scalar spanAttributeTemplate) Sets the name of the span attribute template to load when an attribute should span an entire row, e.g., user_framework/custom_span_attr.html. |
void |
setXmlContent(scalar xmContent) Sets the XML data to send to a custom WSLET. |
Gets the delimited list of attributes to include in the report. The general syntax is attribute_name:sort_position:span_option where sort_postion and span_option are optional.
Returns: scalar The list of attributes as a string.
Gets the name of the attribute template to load to format the report results, e.g., user_framework/column_attr.html. An attribute template is repeated for each item that is found in the report and prints information about the attributes for an item. The template path begins with "wsconfig/templates/pt/reports".
Returns: scalar The name of the attribute template.
Gets the name of the auto attribute template to load to format auto-generated report results, e.g., user_framework/custom_auto_attr.html. An auto attribute template is repeated for each item that is found in the report and prints information about the attributes for an item. The template path begins with "wsconfig/templates/pt/reports".
Returns: scalar The name of the auto attribute template.
Gets the name of the auto label template to load to format auto-generated report results, e.g., user_framework/custom_auto_label.html. An auto label template enables you to label a column that contains multiple values instead of formatting the report with label and value pairs. The template path begins with "wsconfig/templates/pt/reports".
Returns: scalar The name of the auto attribute template.
Gets the name of the custom WSLET to run for this subreport.
Returns: scalar The name of the custom WSLET to execute.
Gets the definition type for this sub report, either PROBLEM_DEF, TASK_DEF or OBJECT_DEF.
Returns: scalar The definition type for the report.
Gets the name of the footer template to load, e.g., user_framework/common_bulk_ftr.html. A footer template is added one time at the bottom of the report. The template path begins with "wsconfig/templates/pt/reports".
Returns: scalar The name of the footer template.
Gets the groups that have the same attribute name as follows: attribute_name|sort_type:sort_direction, or just an attribute name.
Returns: scalar The attribute grouping string.
Gets the name of the group template to load. The grouping template allows for charting based on the grouped items. The template path begins with "wsconfig/templates/pt/reports".
Returns: scalar The name of the group template.
Gets the name of the header template to load to format the report results, e.g., user_framework/common_bulk_hdr.html. A header template normally contains all the information that is displayed at the very top of a report. The template path begins with "wsconfig/templates/pt/reports".
Returns: scalar The name of the header template.
Gets the name of the image template to include on the report results, e.g., user_framework/cs_chart_common_img.html. An image template normally contains an image or a chart and is only included once in the report output. The template path begins with "wsconfig/templates/pt/reports".
Returns: scalar The name of the image template.
Gets the name of the label template for column-formatted reports. This tempalte enables you to label a column that contains muitliple values instead of formatting the report with label and value pairs, e.g., user_framework/custom_label.html. The template path begins with "wsconfig/templates/pt/reports".
Returns: scalar The name of the main template.
Gets the name of the main template to load to format the report results, e.g., user_framework/column_rpt.html. The template path begins with "wsconfig/templates/pt/reports".
Returns: scalar The name of the main template.
Gets the name of the sub report, this name will never be displayed in the interface but it links the CCM_REPORT definition to the CCM_PROBLEM, CCM_TASK or CCM_OBJECT definition and thus is required.
Returns: scalar The name of the sub report.
Gets the name of the relationship that the sub report is following, for example associated_task to find the associated tasks of a change request.
Returns: scalar The name of the relation.
Gets the sort order string that determines how the subreport items will be sorted an example sort order string is problem_number:intb:A.
Returns: scalar The list sort order attributes as a string.
Gets the name of the span attribute template to load to format the report results, e.g., user_framework/custom_span_attr.html. A span attribute template is repeated for each item that is found that spans a row in the report and prints information about the attributes for an item. The template path begins with "wsconfig/templates/pt/reports".
Returns: scalar The name of the span attribute template.
Gets the XML data to pass to a custom WSLET.
Returns: scalar The XML data for a custom WSLET.
Sets the delimited list of attributes to include in the report. The general syntax is attribute_name:sort_position:span_option where sort_postion and span_option are optional.
Parameters: scalar: The delimited list of attributes to set.
Example: my $reportEntry = $csapi->exportAReport($aUser, "My Report", $globals->{PROBLEM_TYPE}, $globals->{SHARED_PROFILE}); my @subreports = $reportEntry->getSubReports(); my $firstSubReport = $subreports[0]; $firstSubReport->setAttributes("problem_number:0:false|crstatus:1:false|problem_synopsis:2:false");
Sets the name of the attribute template to load to format the report results, e.g., user_framework/column_attr.html. An attribute template is repeated for each item that is found in the report and prints information about the attributes for an item. The template path begins with "wsconfig/templates/pt/reports".
Parameters: scalar: The name of the attribute template to load.
Example: my $reportEntry = $csapi->exportAReport($aUser, "My Report", $globals->{PROBLEM_TYPE}, $globals->{SHARED_PROFILE}); my @subreports = $reportEntry->getSubReports(); my $firstSubReport = $subreports[0]; $firstSubReport->setAttributeTemplate("user_framework/column_attr.html");
Sets the name of the auto label template to load to format auto-generated report results, e.g., user_framework/custom_auto_label.html. An auto label template enables you to label a column that contains multiple values instead of formatting the report with label and value pairs. The template path begins with "wsconfig/templates/pt/reports".
Parameters: scalar: The name of the auto attribute template to load.
Example: my $reportEntry = $csapi->exportAReport($aUser, "My Report", $globals->{PROBLEM_TYPE}, $globals->{SHARED_PROFILE}); my @subreports = $reportEntry->getSubReports(); my $firstSubReport = $subreports[0]; $firstSubReport->setAutoAttributeTemplate("user_framework/custom_auto_label.html");
Sets the name of the auto attribute template to load to format auto-generated report results, e.g., user_framework/custom_auto_attr.html. An auto attribute template is repeated for each item that is found in the report and prints information about the attributes for an item. The template path begins with "wsconfig/templates/pt/reports".
Parameters: scalar: The name of the auto label template to load.
Example: my $reportEntry = $csapi->exportAReport($aUser, "My Report", $globals->{PROBLEM_TYPE}, $globals->{SHARED_PROFILE}); my @subreports = $reportEntry->getSubReports(); my $firstSubReport = $subreports[0]; $firstSubReport->setAutoLabelTemplate("user_framework/custom_auto_attr.html");
Sets the name of the custom WSLET to run for this subreport an example is CSChartMultipleDateTrend.
Parameters: scalar: The name of the custom WSLET to run for this subreport.
Example: my $reportEntry = $csapi->exportAReport($aUser, "My Report", $globals->{PROBLEM_TYPE}, $globals->{SHARED_PROFILE}); my @subreports = $reportEntry->getSubReports(); my $firstSubReport = $subreports[0]; $firstSubReport->setCustomWslet("CSChartMultipleDateTrend");
Gets the definition type for this sub report, either PROBLEM_DEF, TASK_DEF or OBJECT_DEF.
Parameters: scalar: The definition type for the report.
Example: my $reportEntry = $csapi->exportAReport($aUser, "My Report", $globals->{PROBLEM_TYPE}, $globals->{SHARED_PROFILE}); my @subreports = $reportEntry->getSubReports(); my $firstSubReport = $subreports[0]; $firstSubReport->setDefinitionType("PROBLEM_DEF");
Sets the name of the footer template to load, e.g., user_framework/common_bulk_ftr.html. A footer template is added one time at the bottom of the report. The template path begins with "wsconfig/templates/pt/reports".
Parameters: scalar: The name of the footer template to load.
Example: my $reportEntry = $csapi->exportAReport($aUser, "My Report", $globals->{PROBLEM_TYPE}, $globals->{SHARED_PROFILE}); my @subreports = $reportEntry->getSubReports(); my $firstSubReport = $subreports[0]; $firstSubReport->setFooterTemplate("user_framework/common_bulk_ftr.html");
Sets the groups that have the same attribute name as follows: attribute_name|sort_type:sort_direction, or just an attribute name.
Parameters: scalar: The group by attribute string.
Example: my $reportEntry = $csapi->exportAReport($aUser, "My Report", $globals->{PROBLEM_TYPE}, $globals->{SHARED_PROFILE}); my @subreports = $reportEntry->getSubReports(); my $firstSubReport = $subreports[0]; $firstSubReport->setGroupBy("assigner");
Sets the name of the group template to load. The grouping template allows for charting based on the grouped items. The template path begins with "wsconfig/templates/pt/reports".
Parameters: scalar: The name of the group template to load.
Example: my $reportEntry = $csapi->exportAReport($aUser, "My Report", $globals->{PROBLEM_TYPE}, $globals->{SHARED_PROFILE}); my @subreports = $reportEntry->getSubReports(); my $firstSubReport = $subreports[0]; $firstSubReport->setGroupTemplate("user_framework/groupTemplate.html");
Sets the name of the header template to load to format the report results, e.g., user_framework/common_bulk_hdr.html. A header template normally contains all the information that is displayed at the very top of a report. The template path begins with "wsconfig/templates/pt/reports".
Parameters: scalar: The name of the header template to load.
Example: my $reportEntry = $csapi->exportAReport($aUser, "My Report", $globals->{PROBLEM_TYPE}, $globals->{SHARED_PROFILE}); my @subreports = $reportEntry->getSubReports(); my $firstSubReport = $subreports[0]; $firstSubReport->setHeaderTemplate("user_framework/common_bulk_hdr.html");
Sets the name of the image template to include on the report results, e.g., user_framework/cs_chart_common_img.html. An image template normally contains an image or a chart and is only included once in the report output. The template path begins with "wsconfig/templates/pt/reports".
Parameters: scalar: The name of the image template to load.
Example: my $reportEntry = $csapi->exportAReport($aUser, "My Report", $globals->{PROBLEM_TYPE}, $globals->{SHARED_PROFILE}); my @subreports = $reportEntry->getSubReports(); my $firstSubReport = $subreports[0]; $firstSubReport->setImageTemplate("user_framework/cs_chart_common_img.html");
Sets the name of the label template for column-formatted reports. This tempalte enables you to label a column that contains muitliple values instead of formatting the report with label and value pairs, e.g., user_framework/custom_label.html. The template path begins with "wsconfig/templates/pt/reports".
Parameters: scalar: The name of the label template to load.
Example: my $reportEntry = $csapi->exportAReport($aUser, "My Report", $globals->{PROBLEM_TYPE}, $globals->{SHARED_PROFILE}); my @subreports = $reportEntry->getSubReports(); my $firstSubReport = $subreports[0]; $firstSubReport->setLabelTemplate("wsconfig/templates/pt/reports");
Sets the name of the main template to load to format the report results, e.g., user_framework/column_rpt.html. The template path begins with "wsconfig/templates/pt/reports".
Parameters: scalar: The name of the main template to load.
Example: my $reportEntry = $csapi->exportAReport($aUser, "My Report", $globals->{PROBLEM_TYPE}, $globals->{SHARED_PROFILE}); my @subreports = $reportEntry->getSubReports(); my $firstSubReport = $subreports[0]; $firstSubReport->setMainTemplate("user_framework/column_rpt.html");
Sets the name of the sub report, this name will never be displayed in the interface but it links the CCM_REPORT definition to the CCM_PROBLEM, CCM_TASK or CCM_OBJECT definition.
Parameters: scalar: The name this sub report shall have upon creation.
Example: my $reportEntry = $csapi->exportAReport($aUser, "My Report", $globals->{PROBLEM_TYPE}, $globals->{SHARED_PROFILE}); my @subreports = $reportEntry->getSubReports(); my $firstSubReport = $subreports[0]; $firstSubReport->setName("my sub report");
Sets the name of the relation the sub report is following, for example associated_task.
Parameters: scalar: The name of the relationship that this subreport should look up..
Example: my $reportEntry = $csapi->exportAReport($aUser, "My Report", $globals->{PROBLEM_TYPE}, $globals->{SHARED_PROFILE}); my @subreports = $reportEntry->getSubReports(); my $firstSubReport = $subreports[0]; $firstSubReport->setRelation("associated_task");
Gets the sort order string that determines how the subreport items will be sorted an example sort order string is problem_number:intb:A.
Parameters: scalar: The delimited list of sort order attributes to set.
Example: my $reportEntry = $csapi->exportAReport($aUser, "My Report", $globals->{PROBLEM_TYPE}, $globals->{SHARED_PROFILE}); my @subreports = $reportEntry->getSubReports(); my $firstSubReport = $subreports[0]; $firstSubReport->setSortOrder("problem_number:intb:A");
Sets the name of the span attribute template to load to format the report results, e.g., user_framework/custom_span_attr.html. A span attribute template is repeated for each item that is found that spans a row in the report and prints information about the attributes for an item. The template path begins with "wsconfig/templates/pt/reports".
Parameters: scalar: The name of the attribute template to load.
Example: my $reportEntry = $csapi->exportAReport($aUser, "My Report", $globals->{PROBLEM_TYPE}, $globals->{SHARED_PROFILE}); my @subreports = $reportEntry->getSubReports(); my $firstSubReport = $subreports[0]; $firstSubReport->setSpanAttributeTemplate("user_framework/custom_span_attr.html");
Sets the XML data to send to a custom WSLET.
Parameters: scalar: The XML content for a CUSTOM WSLET.
Example: my $reportEntry = $csapi->exportAReport($aUser, "My Report", $globals->{PROBLEM_TYPE}, $globals->{SHARED_PROFILE}); my @subreports = $reportEntry->getSubReports(); my $firstSubReport = $subreports[0]; $firstSubReport->setCustomWslet(XML DATA);