Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
7035d6f
Set to target v4.5.2
deeja Jan 3, 2017
fe993ad
Use nuget to resolve Sitecore DLL
deeja Jan 3, 2017
d5af8ba
Remove fast query and replace with recursive item search
deeja Jan 3, 2017
c1a262e
Change the name of the IsProductionEnvironment to SubmitToSearchEngin…
deeja Jan 11, 2017
5e214a8
Run code reformat across solution
deeja Jan 11, 2017
0c6475d
Simplify IsIncluded
deeja Jan 11, 2017
cb4e94f
Added fields for including base templates
deeja Jan 11, 2017
5897745
Add Unicorn configuration files
deeja Jan 11, 2017
4073568
Added Included Base Template field
deeja Jan 11, 2017
1e5476f
Add UnicornWeb project for easy deployment of the Unicorn files
deeja Jan 11, 2017
af07b41
Remove example files
deeja Jan 11, 2017
446dcdd
Move configuration files into UnicornWeb project
deeja Jan 11, 2017
b3c6f78
Add config file as link so it can be published to the server
deeja Jan 11, 2017
baa8745
Add the sitecore module xml as a link
deeja Jan 11, 2017
1d8d1d5
Add references to the other projects for deployment purposes
deeja Jan 11, 2017
2677560
Update annoying length values
deeja Jan 11, 2017
e31065d
Sitecore Package definition - can be used by opening in the package m…
deeja Jan 11, 2017
5800d4e
Update sitecore package definition to include files
deeja Jan 11, 2017
3440cc1
Remove release package
deeja Jan 11, 2017
c375379
Update README
deeja Jan 11, 2017
8f3be60
Update configuration in README
deeja Jan 11, 2017
679b3b8
Update the EnsureHttpPrefix for https based on test runs
deeja Feb 2, 2017
e52cda8
Update the configuration to remove the leading slash from sitemaps
deeja Feb 2, 2017
9c2a463
- Replace code with method from EnsureHttpPrefix
deeja Feb 2, 2017
548fa37
Updated DLL reference in the package definition
deeja Feb 2, 2017
e1207ea
Update Sitecore Package Definitions
deeja Feb 2, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ Sitecore.SharedSource.DynamicSitemap.Tests/bin/
Libraries/
Sitecore.SharedSource.DynamicSitemap.ItemsProcessor/obj/
Sitecore.SharedSource.DynamicSitemap.ItemsProcessor/bin/
obj/
bin/
342 changes: 342 additions & 0 deletions DynamicSitemapPackageDefinition.xml

Large diffs are not rendered by default.

74 changes: 74 additions & 0 deletions DynamicSitemapPackageDefinitionContentDelivery.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<project>
<Metadata>
<metadata>
<PackageName>SitecoreDynamicSitemapXML-ContentDelivery</PackageName>
<Author />
<Version>1.2.1</Version>
<Revision />
<License />
<Comment />
<Attributes />
<Readme />
<Publisher />
<PostStep />
<PackageID />
</metadata>
</Metadata>
<SaveProject>True</SaveProject>
<Sources>
<xfiles>
<Entries>
<x-item>/App_Config/Include/Sitecore.SharedSource.DynamicSitemap.config</x-item>
</Entries>
<Converter>
<FileToEntryConverter>
<Root>/</Root>
<Transforms>
<InstallerConfigurationTransform>
<Options>
<BehaviourOptions>
<ItemMode>Undefined</ItemMode>
<ItemMergeMode>Undefined</ItemMergeMode>
</BehaviourOptions>
</Options>
</InstallerConfigurationTransform>
</Transforms>
</FileToEntryConverter>
</Converter>
<Include />
<Exclude />
<Name>config</Name>
</xfiles>
<xfiles>
<Entries>
<x-item>/bin/Sitecore.SharedSource.DynamicSitemap.dll</x-item>
</Entries>
<Converter>
<FileToEntryConverter>
<Root>/</Root>
<Transforms>
<InstallerConfigurationTransform>
<Options>
<BehaviourOptions>
<ItemMode>Undefined</ItemMode>
<ItemMergeMode>Undefined</ItemMergeMode>
</BehaviourOptions>
</Options>
</InstallerConfigurationTransform>
</Transforms>
</FileToEntryConverter>
</Converter>
<Include />
<Exclude />
<Name>dll</Name>
</xfiles>
</Sources>
<Converter>
<TrivialConverter>
<Transforms />
</TrivialConverter>
</Converter>
<Include />
<Exclude />
<Name />
</project>
Binary file removed Package/SitecoreDynamicSitemapXML-1.0.1.zip
Binary file not shown.
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ It has two main assumptions:

Code functionality should be extensible and overridable. It should be easy to extend or override functionality, without decompiling and copy-pasting a lot of code.

-

Module was based on the original Sitemap XML module

###New features:
### Features:
- Include items based on Base Templates (a.k.a inherited templates)
- Configurations for sites controlled from Content Editor
- Defining <changefreq> and <priority> tags for templates and specified items
- Language fallback for configuration items
Expand All @@ -31,6 +30,22 @@ Module was based on the original Sitemap XML module

###Installation:
- Install zip package using Sitecore Package Installer

###Building the project
This project includes a web project that can be published to the relevant version of Sitecore (refer to the Sitecore Nuget Reference)

- Install a fresh instance of Sitecore. SIM (Sitecore Instance Manager) is recommended.
- Update the _/App_Config/Include/Unicorn/Unicorn.CustomSerializationFolder.config_ to point to the _Unicorn-Serialization_ folder
```
<targetDataStore type="Rainbow.Storage.SerializationFileSystemDataStore, Rainbow">
<patch:attribute name="physicalRootPath">C:\projects\Sitecore.SharedSource.DynamicSitemap\Unicorn-Serialization\$(configurationName)</patch:attribute>
</targetDataStore>
```
- Publish the web project to the newly installed version of Sitecore
- Run Unicorn sync http://mysite.local/Unicorn.aspx
- Upload and Open the _DynamicSitemapPackageDefinition.xml_ using the Package Manager in the Sitecore shell
- Make changes to the package definition as needed. *Make sure DynamicSitemapPackageDefinition.xml is updated in source control*
- Generate and download ZIP

###Configuration:
- Dynamic Sitemap XML provides Sitecore.SharedSource.DynamicSitemap.config configuration file installed in /App_Config/Include directory.
Expand All @@ -40,4 +55,4 @@ Module was based on the original Sitemap XML module
- refreshRobotsFile (true or false) - indicates that robots.txt file will be updated with references to sitemap xml files
- xmlnsTpl - sitemap module schema used for the XML sitemap
- database - the database from which to pull items for generating the sitemap
- productionEnvironment - (true or false) determines whether the sitemap should be submitted to the search engines or not
- submitToSearchEngine - (true or false) determines whether the sitemap should be submitted to the search engines or not
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

[assembly: AssemblyTitle("Sitecore.SharedSource.DynamicSitemap.ItemsProcessor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
Expand All @@ -17,9 +18,11 @@
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.

[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM

[assembly: Guid("21b0ab34-57d2-41ed-8e6d-c22dd14b0577")]

// Version information for an assembly consists of the following four values:
Expand All @@ -32,5 +35,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using Sitecore.SharedSource.DynamicSitemap.Interfaces;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Sitecore.SharedSource.DynamicSitemap;
using Sitecore.SharedSource.DynamicSitemap.Model;

Expand All @@ -29,18 +31,19 @@ public List<UrlElement> ProcessItems(SitemapSiteConfiguration sitemapSiteConfigu
{
// - Add your own elements packed into object of UrlElement class -

items.Add(new UrlElement
{
Location = "http://mysite.com/some-custom-static-page.html",
Priority = "0.7",
LastModification = new DateTime(2016, 03, 01),
ChangeFrequency = "yearly"
});
items.Add(
new UrlElement
{
Location = "http://mysite.com/some-custom-static-page.html",
Priority = "0.7",
LastModification = new DateTime(2016, 03, 01),
ChangeFrequency = "yearly"
});
}

// - Return collected items -

return items;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Sitecore.SharedSource.DynamicSitemap.ItemsProcessor</RootNamespace>
<AssemblyName>Sitecore.SharedSource.DynamicSitemap.ItemsProcessor</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
Expand Down
4 changes: 3 additions & 1 deletion Sitecore.SharedSource.DynamicSitemap.Tests/HelperTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using NUnit.Framework;

using Sitecore.SharedSource.DynamicSitemap.Helpers;

using System;

namespace Sitecore.SharedSource.DynamicSitemap.Tests
Expand Down Expand Up @@ -34,4 +36,4 @@ public void TestEnsureHttpPrefix()
Assert.AreEqual(DynamicSitemapHelper.EnsureHttpPrefix(urlWithHttp, true), "https" + urlWithoutHttp);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

[assembly: AssemblyTitle("Sitecore.SharedSource.DynamicSitemap.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
Expand All @@ -17,9 +18,11 @@
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.

[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM

[assembly: Guid("a6e1447c-5bcf-4133-8c73-9aa2d06e37f2")]

// Version information for an assembly consists of the following four values:
Expand All @@ -32,5 +35,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Sitecore.SharedSource.DynamicSitemap.Tests</RootNamespace>
<AssemblyName>Sitecore.SharedSource.DynamicSitemap.Tests</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down
1 change: 1 addition & 0 deletions Sitecore.SharedSource.DynamicSitemap.Tests/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>

<packages>
<package id="Castle.Core" version="3.3.3" targetFramework="net461" />
<package id="Moq" version="4.5.16" targetFramework="net461" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<!--
Rainbow.config

This file configures the Rainbow serialization library

This file should be present on all environments Rainbow is present on.

http://github.com/kamsar/Rainbow
-->
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<settings>
<!-- Rainbow - SERIALIZATION FOLDER PATH MAX LENGTH
In Windows, there is 248 characters limit on the lenght of file system paths. To avoid exceeding the maximum path length, Rainbow will loop
long paths back to the root. This setting specifies the maximum length of the path to the serialization root path,
which determines how long item paths can be before they are looped.
Important: The value of this setting must be the same on all Sitecore instances accessing the serialized data.
Important: When changing this value, you must reserialize all configurations!
Example: A value of "90" for this setting will mean that item paths longer than 150 characters will be shortened, since Sitecore
reserves 8 characters (and 248 - 8 - 90 = 150).
Default value: 110
-->
<setting name="Rainbow.SFS.SerializationFolderPathMaxLength" value="150" />

<!-- Rainbow MAX ITEM NAME LENGTH BEFORE TRUNCATION
Sitecore item names can become so long that they will not fit on the filesystem without hitting the max path length.
This setting controls when Rainbow truncates item file names that are extremely long so they will fit on the filesystem.
The value must be less than MAX_PATH - SerializationFolderPathMaxLength - Length of GUID - length of file extension.
Default value: 30
-->
<setting name="Rainbow.SFS.MaxItemNameLengthBeforeTruncation" value="50" />

<!-- Rainbow EXTRA INVALID FILENAME CHARACTERS
Sometimes source control systems, like TFS with '$', impose additional limitations on what files on disk may be named.
Adding characters to this setting will disallow their use in written SFS item names on disk.
Path.GetInvalidFileNameChars() are always included as invalid characters; this setting is for extra characters only.
Default value: $ (for 1.0.x, blank)
-->
<setting name="Rainbow.SFS.ExtraInvalidFilenameCharacters" value="$" />

<!-- Rainbow INVALID FILE NAMES
Windows has certain file names that are disallowed that are device names. These apply regardless of file extension, so should you name an item PRN, we'll fix that.
See https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
If an item name matches one of these names it will be prefixed with an underscore to make the name valid (e.g. COM1 -> _COM1)
-->
<setting name="Rainbow.SFS.InvalidFilenames" value="CON,PRN,AUX,NUL,COM1,COM2,COM3,COM4,COM5,COM6,COM7,COM8,COM9,LPT1,LPT2,LPT3,LPT4,LPT5,LPT6,LPT7,LPT8,LPT9" />

<!-- Rainbow LEGACY XML FIELD ATTRIBUTE FORMATTING
In Rainbow 1.1 and earlier, XML fields were formatted with all attributes on a single line. This was suboptimal for merging.
Rainbow 1.2 and later will place each XML attribute on its own line by default. If you want to force legacy behaviour, you can use this setting to do so.
The format of the XML does not affect item comparisons, using legacy formatting simply prevents unchanged items from getting extra diffs.
You probably still shouldn't use legacy formatting, but the option is there if you are very very change averse.
-->
<setting name="Rainbow.XmlFormat.UseLegacyAttributeFormatting" value="false" />
</settings>
</sitecore>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!--
Unicorn Auto Publish Configuration

This file configures the Unicorn serialization system to automatically publish items that it syncs.

This file should be removed on content delivery environments.

http://github.com/kamsar/Unicorn
-->
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<unicornSyncComplete>
<!-- at the end of each configuration's sync, we throw the items it changed into ManualPublishQueueHandler's queue -->
<processor type="Unicorn.Pipelines.UnicornSyncComplete.AddSyncedItemsToPublishQueue, Unicorn" />
</unicornSyncComplete>

<unicornSyncEnd>
<!-- when all configurations have synced, fire off a publish that processes the queue we've accumulated -->
<processor type="Unicorn.Pipelines.UnicornSyncEnd.TriggerAutoPublishSyncedItems, Unicorn">
<PublishTriggerItemId>/sitecore/templates/Common/Folder</PublishTriggerItemId> <!-- the trigger item can be any leaf node Sitecore item - just has to have a 'starting point' for the publish -->
<!-- these are the database(s) to publish synced items to -->
<TargetDatabases hint="list:AddTargetDatabase">
<web>web</web>
</TargetDatabases>
</processor>
</unicornSyncEnd>

<publish>
<!--
This handler manually injects arbitrary items into the publish queue so that the next publish to occur will cause the injected items to get published.
See http://www.velir.com/blog/index.php/2013/11/22/how-to-create-a-custom-publish-queue-in-sitecore/ et. al.
-->
<processor patch:after="*[@type='Sitecore.Publishing.Pipelines.Publish.AddItemsToQueue, Sitecore.Kernel']" type="Unicorn.Publishing.ManualPublishQueueHandler, Unicorn"/>
</publish>
</pipelines>
</sitecore>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!--
Unicorn.Configs.Default.config

This is an example of how to configure a basic Unicorn configuration using your own config patch file.
Copy this file to use as a basis for your own configuration definitions.

Enabled configuration definition patches should be present on all environments Unicorn is present on.

See Unicorn.config for commentary on how configurations operate, or https://github.com/kamsar/Unicorn/blob/master/README.md
-->
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<unicorn>
<configurations>
<configuration name="Dynamic Sitemap XML" description="Sitemap items">
<predicate type="Unicorn.Predicates.SerializationPresetPredicate, Unicorn" singleInstance="true">
<include name="Templates" database="master" path="/sitecore/templates/Dynamic Sitemap XML" />
<include name="Branches" database="master" path="/sitecore/templates/Branches/Dynamic Sitemap XML" />
<include name="System" database="master" path="/sitecore/system/Modules/Dynamic Sitemap XML" />
<include name="Core Layouts" database="core" path="/sitecore/layout/Layouts/Applications/DynamicSitemapManager" />
<include name="Core Applications" database="core" path="/sitecore/content/Applications/DynamicSitemapManager" />
<include name="Core Start Menu Programs" database="core" path="/sitecore/content/Documents and settings/All users/Start menu/Programs/Dynamic Sitemap Manager" />
<include name="Core Start Menu Left" database="core" path="/sitecore/content/Documents and settings/All users/Start menu/Left/Dynamic Sitemap Manager" />
</predicate>
<dataProviderConfiguration enableTransparentSync="false" type="Unicorn.Data.DataProvider.DefaultUnicornDataProviderConfiguration, Unicorn" singleInstance="true" />
<syncConfiguration updateLinkDatabase="false" updateSearchIndex="false" maxConcurrency="1" type="Unicorn.Loader.DefaultSyncConfiguration, Unicorn" singleInstance="true" />
</configuration>
</configurations>
</unicorn>
</sitecore>
</configuration>
Loading