Difference between revisions of "ResourceTemplateHelper"

From Catglobe Wiki
Jump to: navigation, search
(Replaced content with "Category:Archive")
(Tag: Replaced)
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{CGscriptClass_Template
+
[[Category:Archive]]
|Name=ResourceTemplateHelper
 
|Description=Helper class for fetching information about resource templates
 
|Constructors=
 
{{CGscriptConstructors_Template|Description=Make new helper}}
 
|Methods=
 
{{CGscriptMethods_Template|ReturnType=Array of objects|Name=GetAllBulkMailTemplates|Description=Get all templates of the given type}}
 
{{CGscriptMethods_Template|ReturnType=Array of objects|Name=GetAllBulkSmsTemplates|Description=Get all templates of the given type}}
 
{{CGscriptMethods_Template|ReturnType=Array of objects|Name=GetAllTemplates|Parameters=
 
{{CGscriptParameters_Template|Type=int|Name=resourceType|Description=RESOURCE_TYPE_x to determine which list of resource templates to get}}
 
|Description=Get resource templates specified by the resource type constant}}
 
{{CGscriptMethods_Template|ReturnType=string|Name=ToString|Description=The string representation of the object.}}
 
|Properties=
 
{{CGscriptProperties_Template|ReturnType=string|Name=ObjectTypeName|HasGetter=1|Description=The name of the type of object.}}
 
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=TypeInformation|HasGetter=1|Description=Get information about this class.}}
 
}}
 
 
 
=== Examples ===
 
 
 
<source lang="javascript">
 
array list={
 
Resource_Type_ResourceTemplate,
 
Resource_Type_User,
 
Resource_Type_Group,
 
Resource_Type_ReportTemplate,
 
Resource_Type_Project,
 
Resource_Type_Folder,
 
Resource_Type_QuestionnaireTemplate,
 
Resource_Type_Attachment,
 
Resource_Type_Questionnaire,
 
Resource_Type_Report,
 
Resource_Type_MessageTemplate,
 
Resource_Type_Image,
 
Resource_Type_Layout,
 
Resource_Type_Product,
 
Resource_Type_MessageFolder,
 
Resource_Type_EmailAccount,
 
Resource_Type_Diagram,
 
Resource_Type_Asset,
 
Resource_Type_WorkFlow,
 
Resource_Type_QuestionnaireScript,
 
Resource_Type_TabulationScript,
 
Resource_Type_LayoutTemplate,
 
Resource_Type_Coding,
 
Resource_Type_Task,
 
Resource_Type_System,
 
Resource_Type_DataCacheSpecification,
 
Resource_Type_TaskSet,
 
Resource_Type_PaperQuestionnaire,
 
Resource_Type_SampleRequest,
 
Resource_Type_BulkMail,
 
Resource_Type_Function,
 
Resource_Type_DCSExport,
 
Resource_Type_TestCase,
 
Resource_Type_BulkSms
 
};
 
ResourceTemplateHelper a;
 
array s=a.GetAllTemplates(list[33]);
 
print(s);
 
for(number i=0;i<s.Count;i++)
 
{
 
print("-----------");
 
BulkSMSResourceTemplate n=s[i];
 
print(n.ResourceId);
 
print(n.ResourceName);
 
print(n.LocalizedNames);
 
};
 
BulkSMSResourceTemplate templates=new BulkSMSResourceTemplate("Test bulk mail new SMS");
 
templates.IsBulkDependant =true;
 
templates.DependantSendToPartly = true;
 
templates.DependantSendToCompleted = true;
 
templates.DependantSendToNotStarted = true;
 
templates.LocalizedNames = {"da-DK": "Test bulk mail"};
 
templates.DefaultLanguage("da-DK");
 
templates.Save();
 
print("-----------");
 
print(templates.ResourceId);
 
print(templates.ResourceName);
 
print(templates.LocalizedNames);
 
</source>
 

Latest revision as of 03:16, 28 February 2019