/// <summary> /// Initializes a new instance of the <see cref="AttachmentManager"/> class. /// </summary> /// <param name="attachmentAccess">Provides access to application attachments.</param> /// <param name="dataAccess">Provides access to the data layer.</param> /// <param name="applicationManager">Manages applications.</param> /// <param name="entitlementProvider">The entitlement provider.</param> public AttachmentManager(IAttachmentAccess attachmentAccess, IDataAccess dataAccess, ApplicationManager applicationManager, IApplicationEntitlementProvider entitlementProvider) : base(dataAccess) { this.attachmentAccess = attachmentAccess; this.applicationManager = applicationManager; this.entitlementProvider = entitlementProvider; }
/// <summary> /// Initializes a new instance of the <see cref="ApplicationManager"/> class. /// </summary> /// <param name="dataAccess">Provides access to the data layer.</param> /// <param name="workflowGateway">The gateway into the workflow subsystem.</param> /// <param name="entitlementProvider">The entitlement provider.</param> /// <param name="endpointCommunicator">A service endpoint communicator.</param> /// <param name="userManager">Retrieves user data.</param> /// <param name="organisationManager">Retrieves organization specific data.</param> /// <param name="securityService">Retrieves form security configurations.</param> public ApplicationManager(IDataAccess dataAccess, IWorkflowService workflowGateway, IApplicationEntitlementProvider entitlementProvider, IServiceEndpointCommunicator endpointCommunicator, UserManager userManager, OrganisationManager organisationManager, ISecurityService securityService) : base(dataAccess) { this.workflowService = workflowGateway; this.entitlementProvider = entitlementProvider; this.endpointCommunicator = endpointCommunicator; this.userManager = userManager; this.organisationManager = organisationManager; this.securityService = securityService; }
public void LocalTestInitialize() { string json = AssemblyResourceReader.ReadAsString(string.Format("Test_Data.Metadata.FORM-{0}.json", FORM_ID)); this.product = JsonConvert.DeserializeObject<ProductDefinition>(json); var container = new UnityContainer().LoadConfiguration(); this.entitlementProvider = container.Resolve<IApplicationEntitlementProvider>(); }
/// <summary> /// Sets up the dependencies. /// </summary> private static void SetupDependencies() { IConfigurationSource config = ConfigurationSourceFactory.Create(); Logger.SetLogWriter(new LogWriterFactory(config).Create()); ExceptionPolicy.SetExceptionManager(new ExceptionPolicyFactory(config).CreateManager()); JsonConvert.DefaultSettings = () => new JsonSerializerSettings { Formatting = Formatting.None, Converters = new JsonConverter[] { new JsonKnownTypeConverter() } }; try { var container = new UnityContainer().LoadConfiguration(); container.AddNewExtension<SecurityDependencyContainer>(); container.AddNewExtension<WorflowDependencyContainer>(); var configuration = container.Resolve<EventHandlerConfiguration>(); dataAccess = container.Resolve<IDataAccess>(); formServiceGateway = container.Resolve<IFormServiceGateway>(); workbenchServiceGateway = container.Resolve<IWorkbenchServiceGateway>(); var securityServiceGateway = container.Resolve<ISecurityService>(); entitlementProvider = container.Resolve<IApplicationEntitlementProvider>(); workflowService = container.Resolve<IWorkflowService>(); evaluatorFactory = new TruthConditionEvaluatorFactory(); session = securityServiceGateway.CreateSession(configuration.EventHandlerServiceUser, configuration.EventHandlerServicePassword); SystemSettings settings = workbenchServiceGateway.GetSystemSettings(session.Token); container.RegisterInstance(settings); events = dataAccess.GetNewEvents(); container.RegisterInstance(workbenchServiceGateway.GetRoleList(session.Token)); container.RegisterInstance<Func<UserSearchCriteria, UserList>>(usc => workbenchServiceGateway.GetUserList(session.Token, usc)); container.RegisterInstance(workbenchServiceGateway.GetServiceEndpointList(session.Token, true)); responseHandlers = container.ResolveAll<IEventActionResponseHandler>(); } catch (Exception e) { bool rethrow = ExceptionPolicy.HandleException(e, "Default"); if (rethrow) { throw; } Console.WriteLine(ExceptionMessages.Generic); Environment.Exit(1); } }
/// <summary> /// Initializes a new instance of the <see cref="FormPreviewApplicationEntitlementProvider"/> class. /// </summary> /// <param name="wrappedProvider">The wrapped provider.</param> public FormPreviewApplicationEntitlementProvider(IApplicationEntitlementProvider wrappedProvider) { this.wrappedProvider = wrappedProvider; }