public void Initialize(PluginEnvironment environment)
 {
     _activityData = new iSecStarActivityData();
     assetSelectionControl.Initialize(AssetAttributes.None);
     printingTaskConfigurationControl.Initialize();
     lockTimeoutControl.Initialize(_activityData.LockTimeouts);
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="iSecStarPullPrintManager"/> class.
 /// The base class, PullPrintManager, maintains the authentication object, _authentication. It is
 /// instantiated using the userCredential object.
 /// </summary>
 /// <param name="pluginExecutionData">The Plugin Execution data.</param>
 /// <param name="deviceInfo">The device information.</param>
 /// <param name="activityData">The activity data.</param>
 public iSecStarPullPrintManager(PluginExecutionData pluginExecutionData, iSecStarActivityData activityData)
     : base(pluginExecutionData)
 {
     _activityData     = activityData;
     PullPrintSolution = "ISecStar Printing";
     this.LockTimeouts = _activityData.LockTimeouts;
     this.AuthProvider = _activityData.AuthProvider;
 }
        public void Initialize(PluginConfigurationData configuration, PluginEnvironment environment)
        {
            _activityData            = configuration.GetMetadata <iSecStarActivityData>();
            _pluginConfigurationData = configuration;

            assetSelectionControl.Initialize(_pluginConfigurationData.Assets, AssetAttributes.None);
            printingTaskConfigurationControl.Initialize(_pluginConfigurationData.Documents, _pluginConfigurationData.PrintQueues, _activityData.DelayAfterPrint, _activityData.ShuffleDocuments, _activityData.UsePrintServerNotification);
            lockTimeoutControl.Initialize(_activityData.LockTimeouts);
            SetConfiguration();
        }
コード例 #4
0
        /// <summary>
        /// Validates the given metadata against the ISecStar Activity data.
        /// </summary>
        /// <param name="configurationData">The configuration data.</param>
        /// <returns>true if valid</returns>
        public bool ValidateMetadata(ref PluginConfigurationData configurationData)
        {
            bool validData = true;
            iSecStarActivityData activityData = null;

            try
            {
                activityData = configurationData.GetMetadata <iSecStarActivityData>();
            }
            catch
            {
                activityData = new iSecStarActivityData();
                validData    = false;
            }

            configurationData = new PluginConfigurationData(activityData, iSecStarPullPrintingConfigurationControl.Version);

            return(validData);
        }
コード例 #5
0
        /// <summary>
        /// Executes this plugin's workflow using the specified <see cref="T:HP.ScalableTest.Framework.Plugin.PluginExecutionData" />.
        /// </summary>
        /// <param name="executionData">The execution data.</param>
        /// <returns>A <see cref="T:HP.ScalableTest.Framework.Plugin.PluginExecutionResult" /> indicating the outcome of the execution.</returns>
        public PluginExecutionResult Execute(PluginExecutionData executionData)
        {
            iSecStarActivityData     data    = executionData.GetMetadata <iSecStarActivityData>();
            iSecStarPullPrintManager manager = new iSecStarPullPrintManager(executionData, data);

            if (_documentCollectionIterator == null)
            {
                CollectionSelectorMode mode = data.ShuffleDocuments ? CollectionSelectorMode.ShuffledRoundRobin : CollectionSelectorMode.RoundRobin;
                _documentCollectionIterator = new DocumentCollectionIterator(mode);
            }

            manager.StatusUpdate           += UpdateStatus;
            manager.DeviceSelected         += UpdateDevice;
            manager.DocumentActionSelected += UpdateDocumentAction;
            manager.SessionIdUpdate        += UpdateSessionId;
            manager.TimeStatusUpdate       += PullPrintManager_TimeStatusUpdate;

            if (executionData.PrintQueues.Any() && executionData.Documents.Any())
            {
                try
                {
                    CloseOrphanedClientPopup();

                    manager.ExecutePrintJob(_documentCollectionIterator, data.UsePrintServerNotification, data.DelayAfterPrint);

                    if (CheckForErrorPrompt())
                    {
                        Thread.Sleep(humanTimeSpan);
                        PerformPrintTask(executionData);
                    }
                }
                catch (PrintQueueNotAvailableException ex)
                {
                    //This exception has already been logged in the call to manager.ExecutePrintJob
                    return(new PluginExecutionResult(PluginResult.Failed, ex, "Print Failure."));
                }
            }
            return(manager.ExecutePullPrintOperation());
        }