internal PowerShellResults <JsonDictionary <object> > GetProgress(string progressId, bool async) { string text = this.workflow ?? "GetProgress"; if (!string.IsNullOrEmpty(this.schema) && this.IsWorkflowDefined(text)) { return(this.ExecuteProgressWorkflow(text, progressId)); } if (async) { DDIHelper.ProgressIdForGetListAsync = progressId; DDIParameters ddiparameters = new DDIParameters(); AsyncGetListContext registeredContext = AsyncServiceManager.GetRegisteredContext(progressId); Dictionary <string, object> dictionary; if (registeredContext != null && registeredContext.Parameters != null && registeredContext.Parameters.Parameters != null) { dictionary = registeredContext.Parameters.Parameters.RawDictionary; } else { dictionary = new Dictionary <string, object>(); } if (registeredContext != null && !string.IsNullOrEmpty(registeredContext.WorkflowOutput)) { dictionary["workflowOutput"] = registeredContext.WorkflowOutput; } dictionary["ProgressId"] = progressId; ddiparameters.Parameters = new JsonDictionary <object>(dictionary); return(this.GetListCommon(ddiparameters, null, true)); } return(AsyncServiceManager.GetProgress(progressId)); }
public static void FaultIfNull(this DDIParameters properties, string parameterName) { if (properties == null) { throw new FaultException(new ArgumentNullException(parameterName).Message); } }
private PowerShellResults <JsonDictionary <object> > ExecuteProgressWorkflow(string executingWorkflowName, string progressId) { DDIParameters ddiparameters = new DDIParameters(); Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary["ProgressId"] = progressId; ddiparameters.Parameters = new JsonDictionary <object>(dictionary); return(this.Execute(executingWorkflowName, null, ddiparameters)); }
internal PowerShellResults RemoveObjects(Identity[] identities, DDIParameters parameters) { if (identities == null) { throw new FaultException(new ArgumentNullException("identities").Message); } this.ValidateIdentities(identities); string text = this.workflow ?? "RemoveObjects"; return(new PowerShellResults(this.Execute(text, identities, parameters))); }
private List <string> InitializeDDIParameters(WSDataHandler dataHandler, DDIParameters parameters) { List <string> list = new List <string>(); if (parameters != null && parameters.Parameters != null) { Dictionary <string, object> dictionary = parameters.Parameters; foreach (string text in dictionary.Keys) { if (dataHandler.Table.Columns.Contains(text)) { dataHandler.InputValue(text, dictionary[text]); list.Add(text); } } } return(list); }
private PowerShellResults <JsonDictionary <object> > GetListCommon(DDIParameters filter, SortOptions sort, bool forGetProgress) { string workflowName = this.workflow ?? "GetList"; WSDataHandler wsdataHandler = new WSListDataHandler(this.schemaFilesInstallPath, this.schema, workflowName, filter, sort); this.RaiseWSDataHandlerCreatedEvent(wsdataHandler); this.SetWorkflowOutput(workflowName, wsdataHandler, filter); wsdataHandler.DataObjectStore.SetModifiedColumns(this.InitializeDDIParameters(wsdataHandler, filter)); wsdataHandler.DataObjectStore.IsGetListWorkflow = true; if (filter != null && filter.Parameters != null && filter.Parameters.ContainsKey("ProgressId") && !forGetProgress) { wsdataHandler.DataObjectStore.AsyncType = ListAsyncType.GetListEndLoad; DDIHelper.ProgressIdForGetListAsync = (string)filter.Parameters["ProgressId"]; } else if (DDIHelper.IsGetListAsync) { wsdataHandler.DataObjectStore.AsyncType = ListAsyncType.GetListAsync; } else if (DDIHelper.IsGetListPreLoad) { wsdataHandler.DataObjectStore.AsyncType = ListAsyncType.GetListPreLoad; } PowerShellResults <JsonDictionary <object> > powerShellResults = wsdataHandler.Execute(); if (powerShellResults.HasWarnings) { for (int i = 0; i < powerShellResults.Warnings.Length; i++) { if (powerShellResults.Warnings[i] == Strings.WarningMoreResultsAvailable) { powerShellResults.Warnings[i] = ClientStrings.ListViewMoreResultsWarning; } } } return(powerShellResults); }
public PowerShellResults <JsonDictionary <object> > SetObject(Identity identity, DDIParameters properties) { DDIServiceHelper ddiserviceHelper = this.CreateDDIServiceHelper(); return(ddiserviceHelper.SetObject(identity, properties)); }
public PowerShellResults <JsonDictionary <object> > GetList(DDIParameters filter, SortOptions sort) { DDIServiceHelper ddiserviceHelper = this.CreateDDIServiceHelper(); return(ddiserviceHelper.GetList(filter, sort)); }
public PowerShellResults <JsonDictionary <object> > MultiObjectExecute(Identity[] identities, DDIParameters parameters) { DDIServiceHelper ddiserviceHelper = this.CreateDDIServiceHelper(); return(ddiserviceHelper.MultiObjectExecute(identities, parameters)); }
public WSListDataHandler(string schemaFilesInstallPath, string resourceName, string workflowName, DDIParameters parameters, SortOptions sortOptions) : base(schemaFilesInstallPath, resourceName, workflowName, parameters) { this.sortOptions = sortOptions; }
public WSDataHandler(string schemaFilesInstallPath, string resourceName, string workflowName, DDIParameters parameters = null) : base(schemaFilesInstallPath, resourceName) { this.Construct(workflowName); this.parameters = parameters; }
internal PowerShellResults <JsonDictionary <object> > GetList(DDIParameters filter, SortOptions sort) { return(this.GetListCommon(filter, sort, false)); }
private PowerShellResults <JsonDictionary <object> > Execute(string workflow, Identity[] identities, DDIParameters properties) { WSDataHandler wsdataHandler = new WSSingleObjectDataHandler(this.schemaFilesInstallPath, this.schema, workflow); this.RaiseWSDataHandlerCreatedEvent(wsdataHandler); if (identities != null) { wsdataHandler.InputIdentity(identities); } wsdataHandler.OutputVariableWorkflow = "GetList"; wsdataHandler.DataObjectStore.SetModifiedColumns(this.InitializeDDIParameters(wsdataHandler, properties)); return(wsdataHandler.Execute()); }
internal PowerShellResults <JsonDictionary <object> > SingleObjectExecute(Identity identity, DDIParameters properties) { return(this.Execute(this.workflow, (identity == null) ? null : new Identity[] { identity }, properties)); }
internal PowerShellResults <JsonDictionary <object> > MultiObjectExecute(Identity[] identities, DDIParameters parameters) { this.ValidateIdentities(identities); return(this.Execute(this.workflow, identities, parameters)); }
public PowerShellResults <JsonDictionary <object> > NewObject(DDIParameters properties) { DDIServiceHelper ddiserviceHelper = this.CreateDDIServiceHelper(); return(ddiserviceHelper.NewObject(properties)); }
public PowerShellResults RemoveObjects(Identity[] identities, DDIParameters parameters) { DDIServiceHelper ddiserviceHelper = this.CreateDDIServiceHelper(); return(ddiserviceHelper.RemoveObjects(identities, parameters)); }
private void SetWorkflowOutput(string workflowName, WSDataHandler dataHandler, DDIParameters filter) { Workflow workFlow = dataHandler.GetWorkFlow(workflowName); string text = null; if (filter != null && filter.Parameters != null) { Dictionary <string, object> dictionary = filter.Parameters; if (dictionary.ContainsKey("workflowOutput")) { text = (string)dictionary["workflowOutput"]; } else if (dictionary.ContainsKey("AdditionalCustomOutputs")) { text = workFlow.Output + ',' + dictionary["AdditionalCustomOutputs"]; } } if (!string.IsNullOrWhiteSpace(text) && workFlow != null) { workFlow.Output = text; } }
internal PowerShellResults <JsonDictionary <object> > SetObject(Identity identity, DDIParameters properties) { properties.FaultIfNull("properties"); string text = this.workflow ?? "SetObject"; return(this.Execute(text, (identity == null) ? null : new Identity[] { identity }, properties)); }
internal PowerShellResults <JsonDictionary <object> > NewObject(DDIParameters properties) { string text = this.workflow ?? "NewObject"; return(this.Execute(text, null, properties)); }