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
#Get all Product from the Master index for all languages. | |
#You can change this to get data from specific language codes | |
#like 'en', 'fr', etc. | |
$searchCriteria = @( | |
@{ Filter = "Equals"; Field = "_language"; Value = "*"; } | |
@{ Filter = "Equals"; Field = "_templatename"; Value = "Product"; } | |
) | |
#This script executes against Sitecore master index | |
$searchProps = @{ |
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
$dnsname = "mysite.com" | |
$pwd = ConvertTo-SecureString -String "123456" -Force -AsPlainText | |
$print = (New-SelfSignedCertificate -certstorelocation cert:\localmachine\my -dnsname $dnsname).Thumbprint | |
$path = "c:\Windows\temp\cert.pfx" | |
Export-PfxCertificate -cert cert:\localMachine\my\$print -FilePath $path -Password $pwd | |
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
Coveo.$$(search).on("buildingQuery", | |
function (e, args) { | |
var currentLatitude = getCookie("currentlatitude"); | |
var currentLongitude = getCookie("currentlongitude"); | |
var latitudeField = '@@' + CoveoForSitecore.Context.fields.toCoveo('latitude'); | |
var longitudeField = '@@' + CoveoForSitecore.Context.fields.toCoveo('longitude'); | |
var distanceField = CoveoForSitecore.Context.fields.toCoveo('distance'); | |
if (currentLatitude != '' && currentLongitude != '') { | |
var geoQuery = "$qf(function:'dist(" + latitudeField + "," + longitudeField + "," + currentLatitude + "," + currentLongitude + ")', fieldName: 'distance') "; | |
if (args && args.queryBuilder) { |
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
public IEnumerable<Dictionary<string, object>> TopViewedPages(int topPagesToGet, string siteName, int daysInterval, string language) | |
{ | |
var provider = (ReportDataProvider)Factory.CreateObject("reporting/dataProvider", true); | |
var query = new ReportDataQuery(string.Format(@"SELECT TOP {0} | |
ItemId, | |
F.LanguageId, | |
SUM(Views) PageViewsCount, | |
SUM(Visits) PageVisitsCount | |
FROM Fact_PageViewsByLanguage F | |
INNER JOIN SiteNames S ON S.SiteNameId = F.SiteNameId |
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
public string GetCountry() | |
{ | |
var country = Sitecore.Analytics.Tracker.Current.Interaction.GeoData.Country; | |
if(string.IsNullOrWhiteSpace(country)) | |
{ | |
return GetCountryByIp(); | |
} | |
return country; | |
} | |
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
// Get the current URL from the page where the AJAX call has been made | |
var url = HttpContext.Current.Request.UrlReferrer; // Note the UrlReferrer | |
// Get the context | |
var siteContext = SiteContextFactory.GetSiteContext(url.Host, url.PathAndQuery); | |
if (siteContext?.StartPath == null) | |
{ | |
throw new Exception(); // log or handle the exception | |
} |
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
# Execute below statement in all the shard DBs | |
UPDATE [__ShardManagement].[ShardsLocal] SET ServerName ='<new db server name>', DatabaseName = '<restored new shard xDB db name with new prefix>' | |
# Execute below statement in the ShardMapManager DB against each Shard DB | |
UPDATE [__ShardManagement].[ShardsGlobal] SET ServerName ='<new db server name>', DatabaseName = '<restored new shard xDB db name with new prefix>' WHERE DatabaseName = '<new shard xDB db1 name with old prefix>' | |
UPDATE [__ShardManagement].[ShardsGlobal] SET ServerName ='<new db server name>', DatabaseName = '<restored new shard xDB db name with new prefix>' WHERE DatabaseName = '<new shard xDB db2 name with old prefix>' | |
UPDATE [__ShardManagement].[ShardsGlobal] SET ServerName ='<new db server name>', DatabaseName = '<restored new shard xDB db name with new prefix>' WHERE DatabaseName = '<new shard xDB dbn name with old prefix>' |
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
RUN Get-ChildItem .\src\Foundation\ –Recurse –Include *.csproj | ForEach-Object { msbuild $_.FullName /p:Configuration=$env:BUILD_CONFIGURATION /p:DeployOnBuild=True /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:PublishUrl=C:\out\website }; | |
RUN Get-ChildItem .\src\Feature\ –Recurse –Include *.csproj | ForEach-Object { msbuild $_.FullName /p:Configuration=$env:BUILD_CONFIGURATION /p:DeployOnBuild=True /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:PublishUrl=C:\out\website }; | |
RUN Get-ChildItem .\src\Project\ –Recurse –Include *.csproj | ForEach-Object { msbuild $_.FullName /p:Configuration=$env:BUILD_CONFIGURATION /p:DeployOnBuild=True /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:PublishUrl=C:\out\website }; | |
#OR | |
RUN msbuild .\MySitecore.sln /p:Configuration=$env:BUILD_CONFIGURATION /p:DeployOnBuild=True /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:PublishUrl=C:\out\website |
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
cm: | |
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xp1-cm:${VERSION:-latest} | |
build: | |
context: ./docker/build/cm | |
args: | |
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp1-cm:${SITECORE_VERSION} | |
SPE_IMAGE: ${SITECORE_MODULE_REGISTRY}sitecore-spe-assets:${SPE_VERSION} | |
SXA_IMAGE: ${SITECORE_MODULE_REGISTRY}sitecore-sxa-xp1-assets:${SXA_VERSION} | |
TOOLING_IMAGE: ${SITECORE_TOOLS_REGISTRY}sitecore-docker-tools-assets:${TOOLS_VERSION} | |
BMF_IMAGE: konabos/brightcove-sitecore-media-framework:10.1-1809 |