Difference between revisions of "ReportTemplate class"

From Catglobe Wiki
Jump to: navigation, search
(Created page with "{{CGscriptClass_Template |Name=<nowiki>ReportTemplate</nowiki> |Description=<nowiki>A report template</nowiki> |Constructors= {{CGscriptConstructors_Template|Parameters= {{CGs...")
 
Line 1: Line 1:
 
{{CGscriptClass_Template
 
{{CGscriptClass_Template
|Name=<nowiki>ReportTemplate</nowiki>
+
|Name=ReportTemplate
|Description=<nowiki>A report template</nowiki>
+
|Description=A report template
 
|Constructors=
 
|Constructors=
 
{{CGscriptConstructors_Template|Parameters=
 
{{CGscriptConstructors_Template|Parameters=
{{CGscriptParameters_Template|Type=int|Name=<nowiki>resourceId</nowiki>|Description=<nowiki>ResourceId of existing template</nowiki>}}
+
{{CGscriptParameters_Template|Type=int|Name=resourceId|Description=ResourceId of existing template}}
|Description=<nowiki>Fetch existing template</nowiki>}}
+
|Description=Fetch existing template}}
 
{{CGscriptConstructors_Template|Parameters=
 
{{CGscriptConstructors_Template|Parameters=
{{CGscriptParameters_Template|Type=string|Name=<nowiki>name</nowiki>|Description=<nowiki>Resource name</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>parentResourceId</nowiki>|Description=<nowiki>Parent resource</nowiki>}}
+
{{CGscriptParameters_Template|Type=string|Name=name|Description=Resource name|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=parentResourceId|Description=Parent resource}}
|Description=<nowiki>Create new template</nowiki>}}
+
|Description=Create new template}}
 
|Methods=
 
|Methods=
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>DefaultLanguage</nowiki>|Parameters=
+
{{CGscriptMethods_Template|ReturnType=Empty|Name=DefaultLanguage|Parameters=
{{CGscriptParameters_Template|Type=string|Name=<nowiki>isocode</nowiki>|Description=<nowiki>Iso code to set as default</nowiki>}}
+
{{CGscriptParameters_Template|Type=string|Name=isocode|Description=Iso code to set as default}}
|Description=<nowiki>Which content is the default</nowiki>}}
+
|Description=Which content is the default}}
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>Save</nowiki>|Description=<nowiki>Save the template</nowiki>}}
+
{{CGscriptMethods_Template|ReturnType=Empty|Name=Save|Description=Save the template}}
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Description=<nowiki>The string representation of the object.</nowiki>}}
+
{{CGscriptMethods_Template|ReturnType=string|Name=ToString|Description=The string representation of the object.}}
 
|Properties=
 
|Properties=
{{CGscriptProperties_Template|ReturnType=Dictionary|Name=<nowiki>LocalizedContent</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Localized content of the template</nowiki>}}
+
{{CGscriptProperties_Template|ReturnType=Dictionary|Name=LocalizedContent|HasGetter=1|HasSetter=1|Description=Localized content of the template}}
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}}
+
{{CGscriptProperties_Template|ReturnType=string|Name=Name|HasGetter=1|Description=Name of the template}}
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Description=<nowiki>Get information about this class.</nowiki>}}
+
{{CGscriptProperties_Template|ReturnType=string|Name=ObjectTypeName|HasGetter=1|Description=The name of the type of object.}}
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ViewUrl</nowiki>|HasGetter=1|Description=<nowiki>Url to use to view template</nowiki>}}
+
{{CGscriptProperties_Template|ReturnType=int|Name=ResourceId|HasGetter=1|Description=Resource Id of the template}}
 +
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=TypeInformation|HasGetter=1|Description=Get information about this class.}}
 +
{{CGscriptProperties_Template|ReturnType=string|Name=ViewUrl|HasGetter=1|Description=Url to use to view template}}
 
}}
 
}}
 +
 +
=== <span style="color:#DF8621">'''Examples'''</span> ===
 +
 +
<source lang="javascript">
 +
//Create new report template:
 +
ReportTemplate rt = new ReportTemplate ("Antest1",11088827);
 +
Dictionary content = {
 +
"da-DK":"content in DK",
 +
"en-US":"content in US"
 +
};
 +
rt.LocalizedContent=content;
 +
rt.DefaultLanguage("en-US");
 +
rt.Save();
 +
print(rt.ResourceId);//15550190
 +
</source>
 +
 +
<source lang="javascript">
 +
//Get an existing report template:
 +
ReportTemplate rt = new ReportTemplate (15550190);
 +
print(rt.ViewUrl);///CatglobeInABox/#Cross/15550190
 +
print(rt.ResourceId);//15550190
 +
print(rt.Name);//Antest1
 +
</source>

Revision as of 06:03, 7 December 2016

ReportTemplate



A report template

Constructors

  • (int resourceId "ResourceId of existing template") - Fetch existing template
  • (string name "Resource name", int parentResourceId "Parent resource") - Create new template

Methods

  • Empty DefaultLanguage(string isocode "Iso code to set as default") - Which content is the default
  • Empty Save() - Save the template
  • string ToString() - The string representation of the object.

Properties

  • Dictionary LocalizedContent { get; set; } - Localized content of the template
  • string Name { get; } - Name of the template
  • string ObjectTypeName { get; } - The name of the type of object.
  • int ResourceId { get; } - Resource Id of the template
  • TypeInformation TypeInformation { get; } - Get information about this class.
  • string ViewUrl { get; } - Url to use to view template


Examples

//Create new report template:
ReportTemplate rt = new ReportTemplate ("Antest1",11088827);
Dictionary content = {
 "da-DK":"content in DK",
 "en-US":"content in US"
};
rt.LocalizedContent=content;
rt.DefaultLanguage("en-US");
rt.Save();
print(rt.ResourceId);//15550190
//Get an existing report template:
ReportTemplate rt = new ReportTemplate (15550190);
print(rt.ViewUrl);///CatglobeInABox/#Cross/15550190
print(rt.ResourceId);//15550190
print(rt.Name);//Antest1