-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #353 from Sitecore/develop
Release SIM.Tool 1.6.0
- Loading branch information
Showing
246 changed files
with
12,282 additions
and
576 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace SIM | ||
{ | ||
public interface IValidateable | ||
{ | ||
string ValidateAndGetError(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
using Sitecore.Diagnostics.Base; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace SIM | ||
{ | ||
[Serializable] | ||
public class SolrDefinition: ICloneable, IValidateable | ||
{ | ||
string url; | ||
string root; | ||
string name; | ||
|
||
public string Name { | ||
get | ||
{ | ||
return this.name; | ||
} | ||
set | ||
{ | ||
name = value; | ||
} | ||
} | ||
|
||
public string Url { | ||
get | ||
{ | ||
return url; | ||
} | ||
set | ||
{ | ||
url = value.Trim().TrimEnd('/','#'); | ||
} | ||
} | ||
public string Root | ||
{ | ||
get | ||
{ | ||
return root; | ||
} | ||
set | ||
{ | ||
root = value; | ||
} | ||
} | ||
public string Service { get; set; } | ||
|
||
public object Clone() | ||
{ | ||
return new SolrDefinition() | ||
{ | ||
root = Root, | ||
name = Name, | ||
url = Url, | ||
Service = Service | ||
}; | ||
} | ||
|
||
public string ValidateAndGetError() | ||
{ | ||
if (string.IsNullOrWhiteSpace(this.Name) || string.IsNullOrWhiteSpace(this.Url) || | ||
string.IsNullOrWhiteSpace(this.Root)) | ||
{ | ||
return "Name, Root and Url must not be empty."; | ||
} | ||
|
||
Uri uri; | ||
|
||
try | ||
{ | ||
uri = new Uri(this.Url, UriKind.Absolute); | ||
} | ||
catch (Exception ex) | ||
{ | ||
return "Invalid solr URL."; | ||
} | ||
|
||
if (!uri.Scheme.Equals("https", StringComparison.InvariantCultureIgnoreCase)) | ||
{ | ||
return "Solr must be HTTPS"; | ||
} | ||
|
||
if (!Directory.Exists(this.Root)) | ||
{ | ||
return "Solr root path does not exist."; | ||
} | ||
|
||
return string.Empty; | ||
} | ||
} | ||
} |
Oops, something went wrong.