Difference between revisions of "CopyResource class"
(Created page with "{{CGscriptClass_Template |Name=<nowiki>CopyResource</nowiki> |Description=<nowiki>A way to copy resources</nowiki> |Constructors= {{CGscriptConstructors_Template|Parameters= {...") |
|||
Line 1: | Line 1: | ||
{{CGscriptClass_Template | {{CGscriptClass_Template | ||
− | |Name= | + | |Name=CopyResource |
− | |Description= | + | |Description=A way to copy resources |
|Constructors= | |Constructors= | ||
{{CGscriptConstructors_Template|Parameters= | {{CGscriptConstructors_Template|Parameters= | ||
− | {{CGscriptParameters_Template|Type= | + | {{CGscriptParameters_Template|Type=int|Name=sourceResourceId|Description=Resource Id of the source|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=destResourceId|Description=Resource Id of the resource to copy to}} |
− | |Description= | + | |Description=Setup the copy of child resources. Finalize copy by calling CopySourceXXX}} |
+ | {{CGscriptConstructors_Template|Parameters= | ||
+ | {{CGscriptParameters_Template|Type=int|Name=sourceResourceId|Description=Resource Id of the source|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=destParentResourceId|Description=Resource Id of the parent to copy to|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=destName|Description=New resource name}} | ||
+ | |Description=Setup the copy. Finalize copy by calling CopyXXX}} | ||
|Methods= | |Methods= | ||
− | {{CGscriptMethods_Template|ReturnType=Empty|Name= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=CopyBill|Description=Copy a Bill}} |
− | {{CGscriptMethods_Template|ReturnType=Empty|Name= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=CopyDiagram|Parameters= |
− | {{CGscriptParameters_Template|Type=bool|Name= | + | {{CGscriptParameters_Template|Type=bool|Name=copyLayout|Description=Make a copy of the layout}} |
− | |Description= | + | |Description=Copy a diagram}} |
− | {{CGscriptMethods_Template|ReturnType=Empty|Name= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=CopyGroup|Parameters= |
− | {{CGscriptParameters_Template|Type=bool|Name= | + | {{CGscriptParameters_Template|Type=bool|Name=copyUsers|Description=Copy the users|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=copyRules|Description=Copy the group builder rules}} |
− | |Description= | + | |Description=Copy a group}} |
− | {{CGscriptMethods_Template|ReturnType=Empty|Name= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=CopyGroupAccess|Parameters= |
− | {{CGscriptMethods_Template|ReturnType=Empty|Name= | + | {{CGscriptParameters_Template|Type=bool|Name=copyResourceAccess|Description=Copy access to resources|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=copyNavigationAccess|Description=Copy access to functionality}} |
− | {{CGscriptParameters_Template|Type=string|Name= | + | |Description=Copy resource or navigation access}} |
− | |Description= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=CopyProduct|Description=Copy a product}} |
− | {{CGscriptMethods_Template|ReturnType=Empty|Name= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=CopyProject|Parameters= |
− | {{CGscriptParameters_Template|Type=bool|Name= | + | {{CGscriptParameters_Template|Type=string|Name=projectCode|Description=New project code, may be empty |Comma=,}}{{CGscriptParameters_Template|Type=string|Name=clientref|Description=New clientref}} |
− | |Description= | + | |Description=Copy a project}} |
− | {{CGscriptMethods_Template|ReturnType=Empty|Name= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=CopyQuestionnaire|Parameters= |
− | {{CGscriptMethods_Template|ReturnType=Empty|Name= | + | {{CGscriptParameters_Template|Type=bool|Name=copyQuotas|Description=Copy quotas|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=copyStratifications|Description=Copy stratifications|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=copySamplerules|Description=Copy samplerules|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=sampleRuleCopyRebuild|Description=Rebuild copied sample rules|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=sampleRuleCopyExcludeSource|Description=Add a sample rule that the users should not have participated in the original questionnaire}} |
− | {{CGscriptMethods_Template|ReturnType=Empty|Name= | + | |Description=Copy a Questionnaire. Always copies template}} |
− | {{CGscriptMethods_Template|ReturnType=Empty|Name= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=CopyQuestionnaireLayout|Description=Copy a QuestionnaireLayout}} |
− | {{CGscriptMethods_Template|ReturnType=Empty|Name= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=CopyQuestionnaireLayoutTemplate|Description=Copy a QuestionnaireLayoutTemplate}} |
− | {{CGscriptMethods_Template|ReturnType=Empty|Name= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=CopyQuestionnaireTemplate|Description=Copy a QuestionnaireTemplate}} |
− | {{CGscriptMethods_Template|ReturnType=Empty|Name= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=CopyReportStyleSheet|Description=Copy a ReportStyleSheet}} |
− | {{CGscriptMethods_Template|ReturnType=Empty|Name= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=CopyReportTemplate|Description=Copy a ReportTemplate}} |
− | {{CGscriptParameters_Template|Type=bool|Name= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=CopySourceAttachments|Description=Copy the source's Attachments}} |
− | |Description= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=CopySourceConstantOption|Description=Copy the source's ConstantOption}} |
− | {{CGscriptMethods_Template|ReturnType=Empty|Name= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=CopySourceData|Parameters= |
− | {{CGscriptMethods_Template|ReturnType=Empty|Name= | + | {{CGscriptParameters_Template|Type=bool|Name=copyNonSample|Description=Copy non-sample data}} |
− | {{CGscriptMethods_Template|ReturnType=Empty|Name= | + | |Description=Copy the source's Data}} |
− | {{CGscriptMethods_Template|ReturnType=Empty|Name= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=CopySourceImages|Description=Copy the source's Images}} |
− | {{CGscriptMethods_Template|ReturnType=Empty|Name= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=CopySourceJournal|Description=Copy the source's Journal entries}} |
− | {{CGscriptMethods_Template|ReturnType=Empty|Name= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=CopySourceParameters|Description=Copy the source's Parameters}} |
− | {{CGscriptMethods_Template|ReturnType=Empty|Name= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=CopySourceProductCategories|Description=Copy the source's ProductCategories}} |
− | {{CGscriptParameters_Template|Type=bool|Name= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=CopySourceProductOptions|Description=Copy the source's ProductOptions}} |
− | |Description= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=CopySourceProperties|Description=Copy the source's Properties}} |
− | {{CGscriptMethods_Template|ReturnType=Empty|Name= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=CopyTask|Parameters= |
− | {{CGscriptParameters_Template|Type=bool|Name= | + | {{CGscriptParameters_Template|Type=bool|Name=copySettings|Description=Copy settings}} |
− | |Description= | + | |Description=Copy a Task}} |
− | {{CGscriptMethods_Template|ReturnType=string|Name= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=CopyUser|Parameters= |
+ | {{CGscriptParameters_Template|Type=bool|Name=copyNavigationAccess|Description=Copy navigation access|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=copyResourceAccess|Description=Copy resource access|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=copyMembership|Description=Copy group memberships|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=copyUserPrefs|Description=Copy user prefs}} | ||
+ | |Description=Copy a User}} | ||
+ | {{CGscriptMethods_Template|ReturnType=string|Name=ToString|Description=The string representation of the object.}} | ||
|Properties= | |Properties= | ||
− | {{CGscriptProperties_Template|ReturnType=string|Name= | + | {{CGscriptProperties_Template|ReturnType=string|Name=ObjectTypeName|HasGetter=1|Description=The name of the type of object.}} |
− | {{CGscriptProperties_Template|ReturnType= | + | {{CGscriptProperties_Template|ReturnType=int|Name=ResourceIdOfCopy|HasGetter=1|Description=Get the resource id of the copy after copying}} |
− | {{CGscriptProperties_Template|ReturnType=TypeInformation|Name= | + | {{CGscriptProperties_Template|ReturnType=TypeInformation|Name=TypeInformation|HasGetter=1|Description=Get information about this class.}} |
}} | }} | ||
+ | |||
+ | === Examples === | ||
+ | |||
+ | <source lang="javascript"> | ||
+ | |||
+ | number group_rid_from=6793; | ||
+ | number group_rid_to=7080; | ||
+ | CopyResource a=new CopyResource(6793,7080); | ||
+ | a.CopyGroupAccess(true,true); | ||
+ | |||
+ | </source> |
Revision as of 10:26, 6 December 2016
CopyResource
A way to copy resources
Constructors
- (int sourceResourceId "Resource Id of the source", int destResourceId "Resource Id of the resource to copy to") - Setup the copy of child resources. Finalize copy by calling CopySourceXXX
- (int sourceResourceId "Resource Id of the source", int destParentResourceId "Resource Id of the parent to copy to", string destName "New resource name") - Setup the copy. Finalize copy by calling CopyXXX
Methods
- Empty CopyBill() - Copy a Bill
- Empty CopyDiagram(bool copyLayout "Make a copy of the layout") - Copy a diagram
- Empty CopyGroup(bool copyUsers "Copy the users", bool copyRules "Copy the group builder rules") - Copy a group
- Empty CopyGroupAccess(bool copyResourceAccess "Copy access to resources", bool copyNavigationAccess "Copy access to functionality") - Copy resource or navigation access
- Empty CopyProduct() - Copy a product
- Empty CopyProject(string projectCode "New project code, may be empty", string clientref "New clientref") - Copy a project
- Empty CopyQuestionnaire(bool copyQuotas "Copy quotas", bool copyStratifications "Copy stratifications", bool copySamplerules "Copy samplerules", bool sampleRuleCopyRebuild "Rebuild copied sample rules", bool sampleRuleCopyExcludeSource "Add a sample rule that the users should not have participated in the original questionnaire") - Copy a Questionnaire. Always copies template
- Empty CopyQuestionnaireLayout() - Copy a QuestionnaireLayout
- Empty CopyQuestionnaireLayoutTemplate() - Copy a QuestionnaireLayoutTemplate
- Empty CopyQuestionnaireTemplate() - Copy a QuestionnaireTemplate
- Empty CopyReportStyleSheet() - Copy a ReportStyleSheet
- Empty CopyReportTemplate() - Copy a ReportTemplate
- Empty CopySourceAttachments() - Copy the source's Attachments
- Empty CopySourceConstantOption() - Copy the source's ConstantOption
- Empty CopySourceData(bool copyNonSample "Copy non-sample data") - Copy the source's Data
- Empty CopySourceImages() - Copy the source's Images
- Empty CopySourceJournal() - Copy the source's Journal entries
- Empty CopySourceParameters() - Copy the source's Parameters
- Empty CopySourceProductCategories() - Copy the source's ProductCategories
- Empty CopySourceProductOptions() - Copy the source's ProductOptions
- Empty CopySourceProperties() - Copy the source's Properties
- Empty CopyTask(bool copySettings "Copy settings") - Copy a Task
- Empty CopyUser(bool copyNavigationAccess "Copy navigation access", bool copyResourceAccess "Copy resource access", bool copyMembership "Copy group memberships", bool copyUserPrefs "Copy user prefs") - Copy a User
- string ToString() - The string representation of the object.
Properties
- string ObjectTypeName { get; } - The name of the type of object.
- int ResourceIdOfCopy { get; } - Get the resource id of the copy after copying
- TypeInformation TypeInformation { get; } - Get information about this class.
Examples
number group_rid_from=6793;
number group_rid_to=7080;
CopyResource a=new CopyResource(6793,7080);
a.CopyGroupAccess(true,true);