/// <summary> /// Initializes the Storage Provider. /// </summary> /// <param name="host">The Host of the Component.</param> /// <param name="config">The Configuration data, if any.</param> /// <param name="wiki">The wiki.</param> /// <exception cref="ArgumentNullException">If <paramref name="host"/> or <paramref name="config"/> are <c>null</c>.</exception> /// <exception cref="InvalidConfigurationException">If <paramref name="config"/> is not valid or is incorrect.</exception> public void Init(IHostV50 host, string config, string wiki) { if (host == null) { throw new ArgumentNullException("host"); } if (config == null) { throw new ArgumentNullException("config"); } if (config == "") { config = Config.GetConnectionString(); } _host = host; _wiki = string.IsNullOrEmpty(wiki) ? "root" : wiki.ToLowerInvariant(); _client = TableStorage.StorageAccount(config).CreateCloudBlobClient(); CloudBlobContainer containerRef = _client.GetContainerReference(_wiki + "-themes"); BlobContainerPermissions permissions = new BlobContainerPermissions(); permissions.PublicAccess = BlobContainerPublicAccessType.Blob; containerRef.CreateIfNotExists(); containerRef.SetPermissions(permissions); }
/// <summary> /// Initializes the Storage Provider. /// </summary> /// <param name="host">The Host of the Component.</param> /// <param name="config">The Configuration data, if any.</param> /// <param name="wiki">The wiki.</param> /// <exception cref="ArgumentNullException">If <paramref name="host"/> or <paramref name="config"/> are <c>null</c>.</exception> /// <exception cref="InvalidConfigurationException">If <paramref name="config"/> is not valid or is incorrect.</exception> public void Init(IHostV50 host, string config, string wiki) { if (host == null) { throw new ArgumentNullException("host"); } if (config == null) { throw new ArgumentNullException("config"); } this.host = host; this.wiki = string.IsNullOrEmpty(wiki) ? "root" : wiki; // Create directories, if needed if (!Directory.Exists(GetFullPath(""))) { Directory.CreateDirectory(GetFullPath("")); } if (!Directory.Exists(GetFullPath(UploadDirectory))) { Directory.CreateDirectory(GetFullPath(UploadDirectory)); } if (!Directory.Exists(GetFullPath(AttachmentsDirectory))) { Directory.CreateDirectory(GetFullPath(AttachmentsDirectory)); } }
/// <summary> /// Initializes the Storage Provider. /// </summary> /// <param name="host">The Host of the Component.</param> /// <param name="config">The Configuration data, if any.</param> /// <param name="wiki">The wiki.</param> /// <exception cref="ArgumentNullException">If <paramref name="host"/> or <paramref name="config"/> are <c>null</c>.</exception> /// <exception cref="InvalidConfigurationException">If <paramref name="config"/> is not valid or is incorrect.</exception> public void Init(IHostV50 host, string config, string wiki) { if (host == null) { throw new ArgumentNullException("host"); } if (config == null) { throw new ArgumentNullException("config"); } if (config == "") { config = Config.GetConnectionString(); } _host = host; _wiki = string.IsNullOrEmpty(wiki) ? "root" : wiki.ToLowerInvariant(); _client = TableStorage.StorageAccount(config).CreateCloudBlobClient(); CloudBlobContainer containerRef = _client.GetContainerReference(_wiki); containerRef.CreateIfNotExists(); containerRef = _client.GetContainerReference(_wiki + "-attachments"); containerRef.CreateIfNotExists(); }
/// <summary> /// Initializes the Theme Storage Provider. /// </summary> /// <param name="host">The Host of the Component.</param> /// <param name="config">The Configuration data, if any.</param> /// <param name="wiki">The wiki.</param> /// <exception cref="ArgumentNullException">If <b>host</b> or <b>config</b> are <c>null</c>.</exception> /// <exception cref="InvalidConfigurationException">If <b>config</b> is not valid or is incorrect.</exception> public void Init(IHostV50 host, string config, string wiki) { if (host == null) { throw new ArgumentNullException("host"); } if (config == null) { throw new ArgumentNullException("config"); } this.host = host; this.wiki = string.IsNullOrEmpty(wiki) ? "root" : wiki; if (!LocalProvidersTools.CheckWritePermissions(GetMasterDirectory())) { throw new InvalidConfigurationException("Cannot write into the public directory - check permissions"); } string pathFolders = GetPath(GetMasterDirectory(), ThemeDirectory); if (!Directory.Exists(pathFolders)) { Directory.CreateDirectory(pathFolders); } }
/// <summary> /// Sets up the Storage Provider. /// </summary> /// <param name="host">The Host of the Component.</param> /// <param name="config">The Configuration data, if any.</param> /// <exception cref="ArgumentNullException">If <paramref name="host"/> or <paramref name="config"/> are <c>null</c>.</exception> /// <exception cref="InvalidConfigurationException">If <paramref name="config"/> is not valid or is incorrect.</exception> public void SetUp(IHostV50 host, string config) { if (host == null) { throw new ArgumentNullException("host"); } if (config == null) { throw new ArgumentNullException("config"); } if (config == "") { config = Config.GetConnectionString(); } TableStorage.CreateTable(config, GlobalSettingsTable); TableStorage.CreateTable(config, LogsTable); _client = TableStorage.StorageAccount(config).CreateCloudBlobClient(); CloudBlobContainer containerRef = _client.GetContainerReference(AssembliesContainer); containerRef.CreateIfNotExists(); }
/// <summary> /// Sets up the Storage Provider. /// </summary> /// <param name="host">The Host of the Component.</param> /// <param name="config">The Configuration data, if any.</param> /// <exception cref="ArgumentNullException">If <b>host</b> or <b>config</b> are <c>null</c>.</exception> /// <exception cref="InvalidConfigurationException">If <b>config</b> is not valid or is incorrect.</exception> public void SetUp(IHostV50 host, string config) { if (host == null) { throw new ArgumentNullException("host"); } if (config == null) { throw new ArgumentNullException("config"); } }
/// <summary> /// Initializes the Storage Provider. /// </summary> /// <param name="host">The Host of the Component.</param> /// <param name="config">The Configuration data, if any.</param> /// <param name="wiki">The wiki.</param> /// <exception cref="ArgumentNullException">If <paramref name="host"/> or <paramref name="config"/> are <c>null</c>.</exception> /// <exception cref="InvalidConfigurationException">If <paramref name="config"/> is not valid or is incorrect.</exception> public void Init(IHostV50 host, string config, string wiki) { if (host == null) { throw new ArgumentNullException("host"); } _host = host; _wiki = string.IsNullOrEmpty(wiki) ? "root" : wiki; DirectoryInfo dirInfo = System.IO.Directory.CreateDirectory(GetFullPath(_wiki)); _directory = FSDirectory.Open(dirInfo); }
/// <summary> /// Initializes the Storage Provider. /// </summary> /// <param name="host">The Host of the Component.</param> /// <param name="config">The Configuration data, if any.</param> /// <param name="wiki">The wiki.</param> public new void Init(IHostV50 host, string config, string wiki) { if (host == null) { throw new ArgumentNullException("host"); } if (config == null) { throw new ArgumentNullException("config"); } _connString = config.Length == 0 ? BuildDbConnectionString(host) : config; base.Init(host, _connString, wiki); }
protected IHostV50 MockHost() { if (!System.IO.Directory.Exists(testDir)) { System.IO.Directory.CreateDirectory(testDir); } IHostV50 host = mocks.DynamicMock <IHostV50>(); Expect.Call(host.GetGlobalSettingValue(GlobalSettingName.PublicDirectory)).Return(testDir).Repeat.AtLeastOnce(); mocks.Replay(host); return(host); }
/// <summary> /// Sets up the Storage Provider. /// </summary> /// <param name="host">The Host of the Component.</param> /// <param name="config">The Configuration data, if any.</param> /// <exception cref="ArgumentNullException">If <paramref name="host"/> or <paramref name="config"/> are <c>null</c>.</exception> /// <exception cref="InvalidConfigurationException">If <paramref name="config"/> is not valid or is incorrect.</exception> public void SetUp(IHostV50 host, string config) { if (host == null) { throw new ArgumentNullException("host"); } if (config == null) { throw new ArgumentNullException("config"); } if (config == "") { config = Config.GetConnectionString(); } _host = host; }
/// <summary> /// Sets up the Storage Provider. /// </summary> /// <param name="host">The Host of the Component.</param> /// <param name="config">The Configuration data, if any.</param> /// <exception cref="ArgumentNullException">If <paramref name="host"/> or <paramref name="config"/> are <c>null</c>.</exception> /// <exception cref="InvalidConfigurationException">If <paramref name="config"/> is not valid or is incorrect.</exception> public void SetUp(IHostV50 host, string config) { if (host == null) { throw new ArgumentNullException("host"); } if (config == null) { throw new ArgumentNullException("config"); } if (config == "") { config = Config.GetConnectionString(); } TableStorage.CreateTable(config, UsersTable); TableStorage.CreateTable(config, UserGroupsTable); TableStorage.CreateTable(config, UserDataTable); }
/// <summary> /// Initializes the Storage Provider. /// </summary> /// <param name="host">The Host of the Component.</param> /// <param name="config">The Configuration data, if any.</param> /// <param name="wiki">The wiki.</param> /// <exception cref="ArgumentNullException">If <b>host</b> or <b>config</b> are <c>null</c>.</exception> /// <exception cref="InvalidConfigurationException">If <b>config</b> is not valid or is incorrect.</exception> public new void Init(IHostV50 host, string config, string wiki) { if (host == null) { throw new ArgumentNullException("host"); } if (config == null) { throw new ArgumentNullException("config"); } _connString = config.Length == 0 ? BuildDbConnectionString(host) : config; base.Init(host, _connString, wiki); if (!Directory.Exists(GetFullPath(PluginsDirectory))) { Directory.CreateDirectory(GetFullPath(PluginsDirectory)); } }
/// <summary> /// Initializes the Storage Provider. /// </summary> /// <param name="host">The Host of the Component.</param> /// <param name="config">The Configuration data, if any.</param> /// <param name="wiki">The wiki.</param> /// <exception cref="ArgumentNullException">If <paramref name="host"/> or <paramref name="config"/> are <c>null</c>.</exception> /// <exception cref="InvalidConfigurationException">If <paramref name="config"/> is not valid or is incorrect.</exception> public void Init(IHostV50 host, string config, string wiki) { if (host == null) { throw new ArgumentNullException("host"); } if (config == null) { throw new ArgumentNullException("config"); } if (config == "") { config = Config.GetConnectionString(); } _host = host; _wiki = string.IsNullOrEmpty(wiki) ? "root" : wiki; _directory = new AzureDirectory(TableStorage.StorageAccount(config), wiki + "-searchindex"); }
/// <summary> /// Initializes the Storage Provider. /// </summary> /// <param name="host">The Host of the Component.</param> /// <param name="config">The Configuration data, if any.</param> /// <param name="wiki">The wiki.</param> /// <exception cref="ArgumentNullException">If <paramref name="host"/> or <paramref name="config"/> are <c>null</c>.</exception> /// <exception cref="InvalidConfigurationException">If <paramref name="config"/> is not valid or is incorrect.</exception> public void Init(IHostV50 host, string config, string wiki) { if (host == null) { throw new ArgumentNullException("host"); } if (config == null) { throw new ArgumentNullException("config"); } if (config == "") { config = Config.GetConnectionString(); } _host = host; _wiki = string.IsNullOrEmpty(wiki) ? "root" : wiki.ToLowerInvariant(); _cloudTableClient = TableStorage.TableClient(config); }
/// <summary> /// Initializes the Storage Provider. /// </summary> /// <param name="host">The Host of the Component.</param> /// <param name="config">The Configuration data, if any.</param> /// <param name="wiki">The wiki.</param> /// <exception cref="ArgumentNullException">If <paramref name="host"/> or <paramref name="config"/> are <c>null</c>.</exception> /// <exception cref="InvalidConfigurationException">If <paramref name="config"/> is not valid or is incorrect.</exception> public void Init(IHostV50 host, string config, string wiki) { if (host == null) { throw new ArgumentNullException("host"); } if (config == null) { throw new ArgumentNullException("config"); } if (config == "") { config = Config.GetConnectionString(); } _host = host; _wiki = wiki; _client = TableStorage.StorageAccount(config).CreateCloudBlobClient(); _cloudTableClient = TableStorage.TableClient(config); }
/// <summary> /// Sets up the Storage Provider. /// </summary> /// <param name="host">The Host of the Component.</param> /// <param name="config">The Configuration data, if any.</param> /// <exception cref="ArgumentNullException">If <paramref name="host"/> or <paramref name="config"/> are <c>null</c>.</exception> /// <exception cref="InvalidConfigurationException">If <paramref name="config"/> is not valid or is incorrect.</exception> public void SetUp(IHostV50 host, string config) { if (host == null) { throw new ArgumentNullException("host"); } if (config == null) { throw new ArgumentNullException("config"); } this.host = host; var dataDIrectory = GetDataDirectory(host); if (!Directory.Exists(dataDIrectory)) { throw new Exception(String.Format("Directory '{0}' does not exist", dataDIrectory)); } if (!LocalProvidersTools.CheckWritePermissions(dataDIrectory)) { throw new InvalidConfigurationException("Cannot write into the public directory - check permissions"); } }
/// <summary> /// Sets up the Storage Provider. /// </summary> /// <param name="host">The Host of the Component.</param> /// <param name="config">The Configuration data, if any.</param> /// <exception cref="ArgumentNullException">If <paramref name="host"/> or <paramref name="config"/> are <c>null</c>.</exception> /// <exception cref="InvalidConfigurationException">If <paramref name="config"/> is not valid or is incorrect.</exception> public void SetUp(IHostV50 host, string config) { // Nothing to do. }
public void Init(IHostV50 host, string config, string wiki) { #warning void Init(IHostV50 host, string config, string wiki) }
private string BuildDbConnectionString(IHostV50 host) { return("Data Source = '" + Path.Combine(host.GetGlobalSettingValue(GlobalSettingName.PublicDirectory), "ScrewTurnWiki.sdf") + "';"); }
/// <summary> /// Gets the data directory. /// </summary> /// <param name="host">The host object.</param> /// <returns>The data directory.</returns> protected string GetDataDirectory(IHostV50 host) { return(host.GetGlobalSettingValue(GlobalSettingName.PublicDirectory)); }
public void Init(IHostV50 host, string config, string wiki) { #warning void Init(IHostV50 host, string config, string wiki) //throw new NotImplementedException(); }
public void SetUp(IHostV50 host, string config) { throw new NotImplementedException(); }