Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am using the below code to reload daily my qlikview document. However, by default all the users are allowed to create server objects.
I would like to turn off by default that check box (in the UI is in the Source Document Task/ Server tab/ Server Objects/ Allow Creation of Server Objects). I couldn't find an API equivalent of that check box.
So the question is how can I turn off, or allow only certain users to create server objects, after I reloaded the document. (everything works fine except this).
Thank you.
DocumentTask documentTask = new DocumentTask();
documentTask.General = new DocumentTask.TaskGeneral();
documentTask.General.Enabled = true;
documentTask.General.TaskName = reloadTaskName;
documentTask.General.TaskDescription = reloadTaskName;
documentTask.Document = qlikViewDoc;
// Reload Daily
AddTaskDailyTrigger(documentTask);
// Once Reloaded Distribute (copy) to QlikView Server
AddTaskDistributionToUsers(documentTask);
//// Server Side
documentTask.Server = new DocumentTask.TaskServer();
documentTask.Server.Access = new DocumentTask.TaskServer.TaskServerAccess();
documentTask.Server.Collaboration = new DocumentTask.TaskServer.TaskServerCollaboration() ;
documentTask.Server.DocumentLoading = new DocumentTask.TaskServer.TaskServerDocumentLoading();
//DocumentTask.TaskServer.TaskServerDocumentLoading.TaskServerDocumentLoadServerSetting setting = new DocumentTask.TaskServer.TaskServerDocumentLoading.TaskServerDocumentLoadServerSetting();
setting.Mode = ServerDocumentLoadMode.Allow;
setting.QlikViewServerId = QlikViewServerServiceInfo.ID;
//setting.ClusterSettings = new DocumentTask.TaskServer.TaskServerDocumentLoading.TaskServerDocumentLoadServerSetting.TaskDocumentLoadClusterSetting [] {
new DocumentTask.TaskServer.TaskServerDocumentLoading.TaskServerDocumentLoadServerSetting.TaskDocumentLoadClusterSetting() { Mode = DocumentLoadMode.Allow }};
//documentTask.Server.DocumentLoading.ServerSettings = new DocumentTask.TaskServer.TaskServerDocumentLoading.TaskServerDocumentLoadServerSetting[] { setting };
documentTask.Server.EnableAuditLogging = false;
// Task Details
documentTask.Scope = DocumentTaskScope.Reload | DocumentTaskScope.General | DocumentTaskScope.Triggering | DocumentTaskScope.Distribute| DocumentTaskScope.Server;
documentTask.QDSID = QlikViewDistributionServerServiceInfo.ID;
_qvClientWS.SaveDocumentTask(documentTask);
The solution is to use documentTask.Server.Collaboration. Hope this will help some other folks.
documentTask.Server.Collaboration = new DocumentTask.TaskServer.TaskServerCollaboration();
documentTask.Server.Collaboration.CreationMode = DocumentCollaborationCreationMode.None;
documentTask.Server.Collaboration.CreatorUserNames =
new List<string>().ToArray();
QMS API in version 11 has ServerObject.Shared property. I have not tried this.It might be helpful.
Thank you Brindlogcool. I crossed my fingers hoping that's the answer. However ServerObject.Shared refers to objects that the users already created on the server and they want to share those with other users. I looked at the documentTask.Server object, and that object doesn't have anything intuitive for that UI check box.
The solution is to use documentTask.Server.Collaboration. Hope this will help some other folks.
documentTask.Server.Collaboration = new DocumentTask.TaskServer.TaskServerCollaboration();
documentTask.Server.Collaboration.CreationMode = DocumentCollaborationCreationMode.None;
documentTask.Server.Collaboration.CreatorUserNames =
new List<string>().ToArray();