This file is used for getting the general configuration information from the appSettings.json file These properties will subsequently used for authorizing to spo and storing data into redis cache
 /// <summary>
 /// Handle the upload functionality.
 /// </summary>
 /// <param name="mailSettings"></param>
 /// <param name="errorSettings"></param>
 /// <param name="documentRepository"></param>
 /// <param name="generalSettings"></param>
 public UploadHelperFunctionsUtility(IOptions<MailSettings> mailSettings, IOptions<ErrorSettings> errorSettings, IDocumentRepository documentRepository, IOptions<GeneralSettings> generalSettings)
 {
     this.mailSettings = mailSettings.Value;
     this.errorSettings = errorSettings.Value;
     this.documentRepository = documentRepository;
     this.generalSettings = generalSettings.Value;
 }
Exemplo n.º 2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="spoAuthorization"></param>
 /// <param name="generalSettings"></param>
 /// <param name="searchSettings"></param>
 public Search(ISPOAuthorization spoAuthorization,
     IConfigurationRoot configuration,
     ICustomLogger customLogger,
     IUsersDetails userDetails,
     ISPList spList,
     IOptions<GeneralSettings> generalSettings,
     IOptions<SharedSettings> sharedSettings,
     IOptions<LogTables> logTables,
     IOptions<SearchSettings> searchSettings,
     IOptions<CamlQueries> camlQueries,
     IOptions<ListNames> listNames,
     IOptions<ErrorSettings> errorSettings)
 {
     this.spoAuthorization = spoAuthorization;
     this.generalSettings = generalSettings.Value;
     this.searchSettings = searchSettings.Value;
     this.userDetails = userDetails;
     this.customLogger = customLogger;
     this.logTables = logTables.Value;
     this.spList = spList;
     this.camlQueries = camlQueries.Value;
     this.listNames = listNames.Value;
     this.sharedSettings = sharedSettings.Value;
     this.errorSettings = errorSettings.Value;
     this.configuration = configuration;
 }
Exemplo n.º 3
0
        /// <summary>
        /// ConfigRepository with all the required dependency injections inserted
        /// </summary>
        /// <param name="generalSettings"></param>
        /// <param name="configSettings"></param>
        public ConfigRepository(ISPOAuthorization spoAuthorization,
            IOptions<GeneralSettings> generalSettings,
              IOptions<UIConfigSettings> configSettings)
        {
            this.generalSettings = generalSettings.Value;
            this.configSettings = configSettings.Value;
            this.spoAuthorization = spoAuthorization;

        }
Exemplo n.º 4
0
 /// <summary>
 /// All the dependencies are injected 
 /// </summary>
 /// <param name="spoAuthorization"></param>
 /// <param name="generalSettings"></param>
 public SPPage(ISPOAuthorization spoAuthorization, IOptions<GeneralSettings> generalSettings, 
     IOptions<LogTables> logTables, ICustomLogger customLogger, ISPList spList, IOptions<MatterSettings> matterSettings)
 {
     this.generalSettings = generalSettings.Value;
     this.spoAuthorization = spoAuthorization;
     this.logTables = logTables.Value;
     this.customLogger = customLogger;
     this.spList = spList;
     this.matterSettings = matterSettings.Value;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Constructor where GeneralSettings and ErrorSettings are injected
 /// </summary>
 /// <param name="generalSettings"></param>
 /// <param name="errorSettings"></param>
 public SPOAuthorization(IOptions<GeneralSettings> generalSettings, 
     IOptions<ErrorSettings> errorSettings, 
     IOptions<LogTables> logTables, 
     ICustomLogger customLogger, 
     IHttpContextAccessor httpContextAccessor)
 {            
     this.generalSettings = generalSettings.Value;
     this.errorSettings = errorSettings.Value;
     this.customLogger = customLogger;
     this.logTables = logTables.Value;
     this.httpContextAccessor = httpContextAccessor;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Do validation stuff
 /// </summary>
 /// <param name="spList"></param>
 /// <param name="matterSettings"></param>
 /// <param name="errorSettings"></param>
 /// <param name="matterRespository"></param>
 /// <param name="listNames"></param>
 /// <param name="camlQueries"></param>
 public ValidationFunctions(ISPList spList, IOptions<MatterSettings> matterSettings,
     IOptions<ErrorSettings> errorSettings, IMatterRepository matterRespository,
     IOptions<ListNames> listNames, IOptions<CamlQueries> camlQueries, IOptions<GeneralSettings> generalSettings, IOptions<TaxonomySettings> taxonomySettings)
 {
     this.matterSettings = matterSettings.Value;
     this.spList = spList;
     this.errorSettings = errorSettings.Value;
     this.matterRespository = matterRespository;
     this.listNames = listNames.Value;
     this.camlQueries = camlQueries.Value;
     this.generalSettings = generalSettings.Value;
     this.taxonomySettings = taxonomySettings.Value;
 }
Exemplo n.º 7
0
        public ExternalSharing(ISPOAuthorization spoAuthorization, IOptions<ListNames> listNames, 
            IOptions<GeneralSettings> generalSettings, 
            IOptions<MatterSettings> matterSettings, 
            IOptions<LogTables> logTables, IUsersDetails userDetails, ICustomLogger customLogger)
        {
            this.spoAuthorization = spoAuthorization;
            this.listNames = listNames.Value;
            this.generalSettings = generalSettings.Value;
            this.matterSettings = matterSettings.Value;
            this.logTables = logTables.Value;
            this.userDetails = userDetails;
            this.customLogger = customLogger;

        }
Exemplo n.º 8
0
 /// <summary>
 /// constructor where are all the dependencies are injected
 /// </summary>
 /// <param name="errorSettings"></param>
 /// <param name="matterCenterServiceFunctions"></param>
 /// <param name="userRepositoy"></param>
 /// <param name="customLogger"></param>
 /// <param name="logTables"></param>
 /// <param name="generalSettings"></param>
  public UserController(IOptions<ErrorSettings> errorSettings,
      IMatterCenterServiceFunctions matterCenterServiceFunctions,
      IUserRepository userRepositoy,
      ICustomLogger customLogger, 
      IOptions<LogTables> logTables,  
      IOptions<GeneralSettings> generalSettings
      )
  {
      this.errorSettings = errorSettings.Value; 
      this.matterCenterServiceFunctions = matterCenterServiceFunctions;            
      this.customLogger = customLogger;
      this.logTables = logTables.Value;             
      this.generalSettings = generalSettings.Value;
      this.userRepositoy = userRepositoy;
  }
Exemplo n.º 9
0
 /// <summary>
 /// Constructor where all the required dependencies are injected
 /// </summary>
 /// <param name="errorSettings"></param>
 /// <param name="taxonomySettings"></param>
 /// <param name="generalSettings"></param>
 /// <param name="spoAuthorization"></param>
 /// <param name="matterCenterServiceFunctions"></param>
 /// <param name="taxonomyRepository"></param>
 public TaxonomyController(IOptions<ErrorSettings> errorSettings, 
     IOptions<TaxonomySettings> taxonomySettings, 
     IOptions<GeneralSettings> generalSettings,
     ISPOAuthorization spoAuthorization, 
     IMatterCenterServiceFunctions matterCenterServiceFunctions,
     ITaxonomyRepository taxonomyRepository, ICustomLogger customLogger, IOptions<LogTables> logTables)
 {
     this.errorSettings = errorSettings.Value;
     this.taxonomySettings = taxonomySettings.Value;
     this.generalSettings = generalSettings.Value;
     this.spoAuthorization = spoAuthorization;
     this.matterCenterServiceFunctions = matterCenterServiceFunctions;            
     this.taxonomyRepository = taxonomyRepository;
     this.customLogger = customLogger;
     this.logTables = logTables.Value;
 }
Exemplo n.º 10
0
 /// <summary>
 /// Constructor to inject required dependencies
 /// </summary>
 /// <param name="generalSettings"></param>
 /// <param name="taxonomySettings"></param>
 /// <param name="logTables"></param>
 /// <param name="spoAuthorization"></param>
 /// <param name="customLogger"></param>
 public Taxonomy(IOptions<GeneralSettings> generalSettings, 
     IOptions<TaxonomySettings> taxonomySettings,
     IOptions<ContentTypesConfig> contentTypeSettings,
     IOptions<LogTables> logTables,
     ISPOAuthorization spoAuthorization, ICustomLogger customLogger, 
     IConfigurationRoot configuration)
 {
     this.generalSettings = generalSettings.Value;
     this.taxonomySettings = taxonomySettings.Value;
     this.contentTypeSettings = contentTypeSettings.Value;
     this.logTables = logTables.Value;
     this.spoAuthorization = spoAuthorization;
     taxonomyResponseVM = new TaxonomyResponseVM();
     this.customLogger = customLogger;
     
     this.configuration = configuration;
 }       
Exemplo n.º 11
0
 /// <summary>
 /// Constructir where all the dependencies are injected
 /// </summary>
 /// <param name="spoAuthorization"></param>
 public UsersDetails(IOptions<MatterSettings> matterSettings, 
     IOptions<ListNames> listNames,
     ISPOAuthorization spoAuthorization, 
     ICustomLogger customLogger, 
     IOptions<LogTables> logTables,
     IHttpContextAccessor httpContextAccessor,
     IOptions<GeneralSettings> generalSettings)
 {
     this.matterSettings = matterSettings.Value;
     this.listNames = listNames.Value;
     this.spoAuthorization = spoAuthorization;
     //this.spList = spList;
     this.customLogger = customLogger;
     this.logTables = logTables.Value;
     this.httpContextAccessor = httpContextAccessor;
     this.generalSettings = generalSettings.Value;
 }
Exemplo n.º 12
0
        /// <summary>
        /// Constructor where all the required dependencies are injected
        /// </summary>
        /// <param name="errorSettings"></param>
        /// <param name="generalSettings"></param>
        /// <param name="uiConfigSettings"></param>
        /// <param name="configRepository"></param>
        /// <param name="logTables"></param>
        /// <param name="hostingEnvironment"></param>
        /// <param name="matterCenterServiceFunctions"></param>
        public ConfigController(IOptions<ErrorSettings> errorSettings,
            IOptions<GeneralSettings> generalSettings,
            IOptions<UIConfigSettings> uiConfigSettings,
            IOptions<LogTables> logTables,
            IMatterCenterServiceFunctions matterCenterServiceFunctions,
            IConfigRepository configRepository,
            IHostingEnvironment hostingEnvironment           

            )
        {
            this.errorSettings = errorSettings.Value;
            this.matterCenterServiceFunctions = matterCenterServiceFunctions;
            this.configRepository = configRepository;
            this.generalSettings = generalSettings.Value;
            this.uiConfigSettings = uiConfigSettings.Value;
            this.hostingEnvironment = hostingEnvironment;
            
        }
Exemplo n.º 13
0
        /// <summary>
        /// DcouemtsController Constructor where all the required dependencies are injected
        /// </summary>
        /// <remarks></remarks>        /// 
        /// <param name="errorSettings"></param>
        /// <param name="documentSettings"></param>
        /// <param name="matterCenterServiceFunctions"></param>
        /// <param name="documentRepositoy"></param>
        /// <param name="customLogger"></param>
        /// <param name="logTables"></param>
        /// <param name="documentProvision"></param>
        /// <param name="generalSettings"></param>
        public DocumentController(IOptions<ErrorSettings> errorSettings,
            IOptions<DocumentSettings> documentSettings,            
            IMatterCenterServiceFunctions matterCenterServiceFunctions,
            IDocumentRepository documentRepositoy,
            ICustomLogger customLogger, IOptions<LogTables> logTables, IDocumentProvision documentProvision,
            IOptions<GeneralSettings> generalSettings

            )
        {
            this.errorSettings = errorSettings.Value;
            this.documentSettings = documentSettings.Value;            
            this.matterCenterServiceFunctions = matterCenterServiceFunctions;
            this.documentRepositoy = documentRepositoy;
            this.customLogger = customLogger;
            this.logTables = logTables.Value;
            this.documentProvision = documentProvision;
            this.generalSettings = generalSettings.Value;
        }
Exemplo n.º 14
0
 /// <summary>
 /// Logs message to Azure table storage.
 /// </summary>
 /// <param name="exception">Exception Object</param>
 /// <param name="className">Class Name where exception occur</param>
 /// <param name="methodName">Method Name where exception occur</param>
 /// <param name="logTableName">Name of the log table.</param>
 /// <param name="lineNumber">Line Number of the log table.</param>
 /// <returns>Returns date of logging</returns>
 internal static string LogInAzure(Exception exception, string className, string methodName, 
     string logTableName, int lineNumber, LogTables logTables, GeneralSettings generalSettings)
 {
     string connStr = generalSettings.CloudStorageConnectionString;
     CloudStorageAccount storageAccount = CloudStorageAccount.Parse(connStr);
     CloudTableClient client = storageAccount.CreateCloudTableClient();
     CloudTable table = client.GetTableReference(logTableName);
     table.CreateIfNotExists();
     AzureLogEntity tableEntityObj = new AzureLogEntity();
     tableEntityObj.PartitionKey = className;
     tableEntityObj.MethodName = methodName;
     string date = DateTime.Now.ToUniversalTime().ToString(logTables.AzureRowKeyDateFormat, CultureInfo.InvariantCulture);
     tableEntityObj.RowKey = string.Format(CultureInfo.InvariantCulture, "{0} - {1}", date, Guid.NewGuid().ToString());
     tableEntityObj.Stacktrace = exception.StackTrace;
     tableEntityObj.LogMessage = exception.Message;
     tableEntityObj.ErrorCode = exception.HResult;
     tableEntityObj.LineNumber = lineNumber;
     TableOperation insertOp = TableOperation.Insert(tableEntityObj);
     table.Execute(insertOp);
     return date;
 }
Exemplo n.º 15
0
 public DocumentProvision(IDocumentRepository docRepository, 
     IUserRepository userRepository, 
     IUploadHelperFunctions uploadHelperFunctions, 
     IOptions<GeneralSettings> generalSettings, 
     IOptions<DocumentSettings> documentSettings, 
     ICustomLogger customLogger,
     IOptions<SearchSettings> searchSettings,
     IConfigurationRoot configuration,
     IHttpContextAccessor httpContextAccessor,
     IOptions<LogTables> logTables, IOptions<ErrorSettings> errorSettings)
 {
     this.docRepository = docRepository;
     this.uploadHelperFunctions = uploadHelperFunctions;
     this.userRepository = userRepository;
     this.generalSettings = generalSettings.Value;
     this.documentSettings = documentSettings.Value;
     this.customLogger = customLogger;
     this.logTables = logTables.Value;
     this.errorSettings = errorSettings.Value;
     this.searchSettings = searchSettings.Value;
     this.configuration = configuration;
     this.httpContextAccessor = httpContextAccessor;
 }
Exemplo n.º 16
0
 /// <summary>
 /// All the dependencies are injected into the constructor
 /// </summary>
 /// <param name="spoAuthorization"></param>
 /// <param name="generalSettings"></param>
 public SPList(ISPOAuthorization spoAuthorization,
     IOptions<CamlQueries> camlQueries, 
     IOptions<ErrorSettings> errorSettings,
     IOptions<SearchSettings> searchSettings,
     IOptions<ContentTypesConfig> contentTypesConfig,
     ICustomLogger customLogger, 
     IOptions<LogTables> logTables, 
     IOptions<MailSettings> mailSettings,
     IOptions<GeneralSettings> generalSettings,
     IHostingEnvironment hostingEnvironment, 
     IUsersDetails userDetails)
 {
     this.searchSettings = searchSettings.Value;
     this.camlQueries = camlQueries.Value;
     this.spoAuthorization = spoAuthorization;
     this.customLogger = customLogger;
     this.logTables = logTables.Value;
     this.mailSettings = mailSettings.Value;
     this.hostingEnvironment = hostingEnvironment;
     this.errorSettings = errorSettings.Value;
     this.userDetails = userDetails;
     this.generalSettings = generalSettings.Value;
 }
Exemplo n.º 17
0
 /// <summary>
 /// Constructor where all the dependencies are injected
 /// </summary>
 /// <param name="matterRepositoy"></param>
 /// <param name="matterSettings"></param>
 /// <param name="errorSettings"></param>
 /// <param name="spoAuthorization"></param>
 /// <param name="editFunctions"></param>
 /// <param name="validationFunctions"></param>
 /// <param name="customLogger"></param>
 /// <param name="logTables"></param>
 /// <param name="mailSettings"></param>
 /// <param name="camlQueries"></param>
 /// <param name="listNames"></param>
 /// <param name="generalSettings"></param>
 /// <param name="searchSettings"></param>
 /// <param name="userRepositoy"></param>
 /// <param name="externalSharing"></param>
 /// <param name="configuration"></param>
 /// <param name="userDetails"></param>
 public MatterProvision(IMatterRepository matterRepositoy, IOptions<MatterSettings> matterSettings,
     IOptions<ErrorSettings> errorSettings,
     ISPOAuthorization spoAuthorization, IEditFunctions editFunctions, IValidationFunctions validationFunctions,
     ICustomLogger customLogger, IOptions<LogTables> logTables,
     IOptions<MailSettings> mailSettings,
     IOptions<CamlQueries> camlQueries,
     IOptions<ListNames> listNames,
     IOptions<GeneralSettings> generalSettings,
     IOptions<SearchSettings> searchSettings, IUserRepository userRepositoy, 
     IExternalSharing externalSharing, IConfigurationRoot configuration, IUsersDetails userDetails
     )
 {
     this.matterRepositoy = matterRepositoy;
     this.matterSettings = matterSettings.Value;
     this.spoAuthorization = spoAuthorization;
     this.editFunctions = editFunctions;
     this.errorSettings = errorSettings.Value;
     this.customLogger = customLogger;
     this.logTables = logTables.Value;
     this.validationFunctions = validationFunctions;
     this.mailSettings = mailSettings.Value;
     this.camlQueries = camlQueries.Value;
     this.listNames = listNames.Value;
     this.searchSettings = searchSettings.Value;
     this.userRepositoy = userRepositoy;
     this.externalSharing = externalSharing;
     this.configuration = configuration;
     this.userDetails = userDetails;
     this.generalSettings = generalSettings.Value;
 }
Exemplo n.º 18
0
 public CustomLogger(IOptions<LogTables> logTables, IOptions<GeneralSettings> generalSettings)
 {
     this.logTables = logTables.Value;
     this.generalSettings = generalSettings.Value;
     
 }