Difference between revisions of "QuestionnaireResourceTemplate class"

From Catglobe Wiki
Jump to: navigation, search
(Created page with "{{CGscriptClass_Template |Name=QuestionnaireResourceTemplate |Description=A Questionnaire resource template. |Constructors= {{CGscriptConstructors_Template|Parameters= {{CGscr...")
 
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{CGscriptClass_Template
 
{{CGscriptClass_Template
|Name=QuestionnaireResourceTemplate
+
|Name=<nowiki>QuestionnaireResourceTemplate</nowiki>
|Description=A Questionnaire resource template.
+
|Description=<nowiki>A Questionnaire resource template.</nowiki>
|Constructors=
+
|InheritsFrom=ResourceTemplate|Constructors=
 
{{CGscriptConstructors_Template|Parameters=
 
{{CGscriptConstructors_Template|Parameters=
{{CGscriptParameters_Template|Type=string|Name=name|Description=Resource name}}
+
{{CGscriptParameters_Template|Type=string|Name=<nowiki>name</nowiki>|Description=<nowiki>Resource name</nowiki>}}
|Description=Create a new Folder resource template}}
+
|Description=<nowiki>Create a new Questionnaire resource template</nowiki>}}
 
|Methods=
 
|Methods=
{{CGscriptMethods_Template|ReturnType=Empty|Name=DefaultLanguage|Parameters=
+
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>DefaultLanguage</nowiki>|Inherited=ResourceTemplate|Parameters=
{{CGscriptParameters_Template|Type=string|Name=isocode|Description=Iso code to set as default}}
+
{{CGscriptParameters_Template|Type=string|Name=<nowiki>isocode</nowiki>|Description=<nowiki>Iso code to set as default</nowiki>}}
|Description=Which Localized Name is the default}}
+
|Description=<nowiki>Which Localized Name is the default</nowiki>}}
{{CGscriptMethods_Template|ReturnType=Empty|Name=Save|Description=Save the ResourceTemplate resource}}
+
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>Save</nowiki>|Inherited=ResourceTemplate|Description=<nowiki>Save the ResourceTemplate resource</nowiki>}}
{{CGscriptMethods_Template|ReturnType=Empty|Name=SaveProperties|Description=Save the properties of the ResourceTemplate resource. Ignores changes to all constant options in use}}
+
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>SaveProperties</nowiki>|Inherited=ResourceTemplate|Description=<nowiki>Save the properties of the ResourceTemplate resource. Ignores changes to all constant options in use</nowiki>}}
{{CGscriptMethods_Template|ReturnType=string|Name=ToString|Description=The string representation of the object.}}
+
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Inherited=object|Description=<nowiki>The string representation of the object.</nowiki>}}
 
|Properties=
 
|Properties=
{{CGscriptProperties_Template|ReturnType=int|Name=GatewayScriptResourceId|HasGetter=1|HasSetter=1|Description=Set the gateway script}}
+
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>ErrorScriptResourceId</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Set the OnError script</nowiki>}}
{{CGscriptProperties_Template|ReturnType=Dictionary|Name=LocalizedNames|HasGetter=1|HasSetter=1|Description=Localized Name of the ResourceTemplate resource}}
+
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>GatewayScriptResourceId</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Set the gateway script</nowiki>}}
{{CGscriptProperties_Template|ReturnType=string|Name=ObjectTypeName|HasGetter=1|Description=The name of the type of object.}}
+
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>LocalizedName</nowiki>|HasGetter=1|Inherited=ResourceTemplate|Description=<nowiki>Localized Name for current user of the ResourceTemplate resource</nowiki>}}
{{CGscriptProperties_Template|ReturnType=array|Name=Properties|HasGetter=1|Description=Get the list of current properties. Use AddProperty/RemoveProperty to edit order}}
+
{{CGscriptProperties_Template|ReturnType=Dictionary|Name=<nowiki>LocalizedNames</nowiki>|HasGetter=1|HasSetter=1|Inherited=ResourceTemplate|Description=<nowiki>Localized Name of the ResourceTemplate resource</nowiki>}}
{{CGscriptProperties_Template|ReturnType=int|Name=ResourceId|HasGetter=1|Description=The Id of the ResourceTemplate}}
+
{{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=ResourceName|HasGetter=1|Description=Name of the ResourceTemplate resource}}
+
{{CGscriptProperties_Template|ReturnType=array|Name=<nowiki>Properties</nowiki>|HasGetter=1|Inherited=ResourceTemplate|Description=<nowiki>Get the list of current properties. Use AddProperty/RemoveProperty to edit order</nowiki>}}
{{CGscriptProperties_Template|ReturnType=bool|Name=ResourceTimeregEnabled|HasGetter=1|HasSetter=1|Description=Get/set ResourceTimeregEnabled}}
+
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>ResourceId</nowiki>|HasGetter=1|Inherited=ResourceTemplate|Description=<nowiki>The Id of the ResourceTemplate</nowiki>}}
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=TypeInformation|HasGetter=1|Description=Get information about this class.}}
+
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ResourceName</nowiki>|HasGetter=1|Inherited=ResourceTemplate|Description=<nowiki>Name of the ResourceTemplate resource</nowiki>}}
 +
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>ResourceTemplateType</nowiki>|HasGetter=1|Inherited=ResourceTemplate|Description=<nowiki>The type of resource that this ResourceTemplate covers</nowiki>}}
 +
{{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>ResourceTimeregEnabled</nowiki>|HasGetter=1|HasSetter=1|Inherited=ResourceTemplate|Description=<nowiki>Get/set ResourceTimeregEnabled</nowiki>}}
 +
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Inherited=object|Description=<nowiki>Get information about this class.</nowiki>}}
 
}}
 
}}
  

Latest revision as of 06:14, 2 July 2020

QuestionnaireResourceTemplate


A Questionnaire resource template.

Parent class

Inherits from ResourceTemplate

Constructors

  • (string name "Resource name") - Create a new Questionnaire resource template

Methods

  • (From ResourceTemplate) Empty DefaultLanguage(string isocode "Iso code to set as default") - Which Localized Name is the default
  • (From ResourceTemplate) Empty Save() - Save the ResourceTemplate resource
  • (From ResourceTemplate) Empty SaveProperties() - Save the properties of the ResourceTemplate resource. Ignores changes to all constant options in use
  • (From object) string ToString() - The string representation of the object.

Properties

  • int ErrorScriptResourceId { get; set; } - Set the OnError script
  • int GatewayScriptResourceId { get; set; } - Set the gateway script
  • (From ResourceTemplate) string LocalizedName { get; } - Localized Name for current user of the ResourceTemplate resource
  • (From ResourceTemplate) Dictionary LocalizedNames { get; set; } - Localized Name of the ResourceTemplate resource
  • string ObjectTypeName { get; } - The name of the type of object.
  • (From ResourceTemplate) array Properties { get; } - Get the list of current properties. Use AddProperty/RemoveProperty to edit order
  • (From ResourceTemplate) int ResourceId { get; } - The Id of the ResourceTemplate
  • (From ResourceTemplate) string ResourceName { get; } - Name of the ResourceTemplate resource
  • (From ResourceTemplate) int ResourceTemplateType { get; } - The type of resource that this ResourceTemplate covers
  • (From ResourceTemplate) bool ResourceTimeregEnabled { get; set; } - Get/set ResourceTimeregEnabled
  • (From object) TypeInformation TypeInformation { get; } - Get information about this class.


Examples

// EX for creating a new QuestionnaireResourceTemplate 
QuestionnaireResourceTemplate qnaireRT = new QuestionnaireResourceTemplate ("qnaireRT Name");
qnaireRT.LocalizedNames={"da-DK":" name in DK", "en-US":" name in US"}; 
qnaireRT.DefaultLanguage("da-DK");
qnaireRT.Save();


//Example for working with an existing QuestionaireResourceTemplate 
number qnaireResourceTemplateRId = 6879;
ResourceTemplateHelper rth = new ResourceTemplateHelper ();
QuestionnaireResourceTemplate qnaireRT = rth.GetTemplate(qnaireResourceTemplateRId);
qnaireRT.GatewayScriptResourceId=6884;
qnaireRT.Save();


//Example for creating new properties 
number qnaireResourceTemplateRId = 6879;
ResourceTemplateHelper rth = new ResourceTemplateHelper ();
QuestionnaireResourceTemplate qnaireRT = rth.GetTemplate(qnaireResourceTemplateRId);
 
new ResourceTemplatePropertyNumber ("propertyNameTypeNumber",false,"description",qnaireRT);
new ResourceTemplatePropertyBoolean ("propertyNameTypeBoolean",true,"description",qnaireRT);
new ResourceTemplatePropertyString ("propertyNameTypeString",false,"description",qnaireRT);
new ResourceTemplatePropertyDateTime ("propertyNameTypeDateTime",false,"description",qnaireRT);
new ResourceTemplatePropertySingle ("propertyNameTypeSingle",true,"description",qnaireRT);
new ResourceTemplatePropertyMulti ("propertyNameTypeMulti",false,"description",qnaireRT);
ResourceTemplatePropertyResource propertyResource = new ResourceTemplatePropertyResource ("propertyNameTypeResource", false, "", qnaireRT);
propertyResource.AddAllowedResourceType(Resource_Type_Project);
 
qnaireRT.SaveProperties();


//Example for working with existing properies 
number qnaireResourceTemplateRId = 6879;
ResourceTemplateHelper rth = new ResourceTemplateHelper ();
QuestionnaireResourceTemplate qnaireRT = rth.GetTemplate(qnaireResourceTemplateRId);
 
array arrayProperty = qnaireRT.Properties;
ResourceTemplatePropertyNumber propertyNumber = arrayProperty[0];
propertyNumber.IsDecimal=true;
 
ResourceTemplatePropertyString propertyString = qnaireRT.Properties.First(function (object p){return p.Label=="propertyNameTypeString";});
propertyString.Required =true;
 
ResourceTemplatePropertyResource propertyResource = qnaireRT.Properties.First(function (object p){return p.Label=="propertyNameTypeResource";});
propertyResource.RemoveAllowedResourceType(Resource_Type_Project);
propertyResource.AddAllowedResourceType(Resource_Type_Folder);
 
qnaireRT.SaveProperties();