Started migrating over unit tests for UmbracoExamine

This commit is contained in:
Shannon Deminick
2013-01-05 03:28:47 +03:00
parent 027f76af96
commit 59152cbe80
14 changed files with 506 additions and 1107 deletions

View File

@@ -9,13 +9,14 @@ using Examine;
using Examine.LuceneEngine;
using Examine.LuceneEngine.Providers;
using Lucene.Net.Analysis.Standard;
using Lucene.Net.Store;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.Configuration;
using Umbraco.Core.Models;
using Umbraco.Core.PropertyEditors;
using Umbraco.Tests.TestHelpers;
using Umbraco.Tests.TestHelpers.ExamineHelpers;
using Umbraco.Tests.UmbracoExamine;
using Umbraco.Web;
using UmbracoExamine;
using UmbracoExamine.DataServices;
@@ -111,93 +112,98 @@ namespace Umbraco.Tests.PublishedContent
[Test]
public void Children_With_Examine()
{
var newIndexFolder = new DirectoryInfo(Path.Combine("App_Data\\CWSIndexSetTest", Guid.NewGuid().ToString()));
var indexInit = new IndexInitializer();
var indexer = indexInit.GetUmbracoIndexer(newIndexFolder);
indexer.RebuildIndex();
using (var luceneDir = new RAMDirectory())
{
var indexer = IndexInitializer.GetUmbracoIndexer(luceneDir);
indexer.RebuildIndex();
var store = new DefaultPublishedMediaStore(indexInit.GetUmbracoSearcher(newIndexFolder));
var store = new DefaultPublishedMediaStore(IndexInitializer.GetUmbracoSearcher(luceneDir));
//we are using the media.xml media to test the examine results implementation, see the media.xml file in the ExamineHelpers namespace
var publishedMedia = store.GetDocumentById(GetUmbracoContext("/test", 1234), 1111);
var rootChildren = publishedMedia.Children();
Assert.IsTrue(rootChildren.Select(x => x.Id).ContainsAll(new[] { 2222, 1113, 1114, 1115, 1116 }));
//we are using the media.xml media to test the examine results implementation, see the media.xml file in the ExamineHelpers namespace
var publishedMedia = store.GetDocumentById(GetUmbracoContext("/test", 1234), 1111);
var rootChildren = publishedMedia.Children();
Assert.IsTrue(rootChildren.Select(x => x.Id).ContainsAll(new[] { 2222, 1113, 1114, 1115, 1116 }));
var publishedChild1 = store.GetDocumentById(GetUmbracoContext("/test", 1234), 2222);
var subChildren = publishedChild1.Children();
Assert.IsTrue(subChildren.Select(x => x.Id).ContainsAll(new[] { 2112 }));
var publishedChild1 = store.GetDocumentById(GetUmbracoContext("/test", 1234), 2222);
var subChildren = publishedChild1.Children();
Assert.IsTrue(subChildren.Select(x => x.Id).ContainsAll(new[] { 2112 }));
}
}
[Test]
public void Descendants_With_Examine()
{
var newIndexFolder = new DirectoryInfo(Path.Combine("App_Data\\CWSIndexSetTest", Guid.NewGuid().ToString()));
var indexInit = new IndexInitializer();
var indexer = indexInit.GetUmbracoIndexer(newIndexFolder);
indexer.RebuildIndex();
using (var luceneDir = new RAMDirectory())
{
var indexer = IndexInitializer.GetUmbracoIndexer(luceneDir);
indexer.RebuildIndex();
var store = new DefaultPublishedMediaStore(indexInit.GetUmbracoSearcher(newIndexFolder));
var store = new DefaultPublishedMediaStore(IndexInitializer.GetUmbracoSearcher(luceneDir));
//we are using the media.xml media to test the examine results implementation, see the media.xml file in the ExamineHelpers namespace
var publishedMedia = store.GetDocumentById(GetUmbracoContext("/test", 1234), 1111);
var rootDescendants = publishedMedia.Descendants();
Assert.IsTrue(rootDescendants.Select(x => x.Id).ContainsAll(new[] { 2112, 2222, 1113, 1114, 1115, 1116 }));
//we are using the media.xml media to test the examine results implementation, see the media.xml file in the ExamineHelpers namespace
var publishedMedia = store.GetDocumentById(GetUmbracoContext("/test", 1234), 1111);
var rootDescendants = publishedMedia.Descendants();
Assert.IsTrue(rootDescendants.Select(x => x.Id).ContainsAll(new[] { 2112, 2222, 1113, 1114, 1115, 1116 }));
var publishedChild1 = store.GetDocumentById(GetUmbracoContext("/test", 1234), 2222);
var subDescendants = publishedChild1.Descendants();
Assert.IsTrue(subDescendants.Select(x => x.Id).ContainsAll(new[] { 2112, 3113 }));
var publishedChild1 = store.GetDocumentById(GetUmbracoContext("/test", 1234), 2222);
var subDescendants = publishedChild1.Descendants();
Assert.IsTrue(subDescendants.Select(x => x.Id).ContainsAll(new[] { 2112, 3113 }));
}
}
[Test]
public void DescendantsOrSelf_With_Examine()
{
var newIndexFolder = new DirectoryInfo(Path.Combine("App_Data\\CWSIndexSetTest", Guid.NewGuid().ToString()));
var indexInit = new IndexInitializer();
var indexer = indexInit.GetUmbracoIndexer(newIndexFolder);
indexer.RebuildIndex();
using (var luceneDir = new RAMDirectory())
{
var indexer = IndexInitializer.GetUmbracoIndexer(luceneDir);
indexer.RebuildIndex();
var store = new DefaultPublishedMediaStore(IndexInitializer.GetUmbracoSearcher(luceneDir));
var store = new DefaultPublishedMediaStore(indexInit.GetUmbracoSearcher(newIndexFolder));
//we are using the media.xml media to test the examine results implementation, see the media.xml file in the ExamineHelpers namespace
var publishedMedia = store.GetDocumentById(GetUmbracoContext("/test", 1234), 1111);
var rootDescendants = publishedMedia.DescendantsOrSelf();
Assert.IsTrue(rootDescendants.Select(x => x.Id).ContainsAll(new[] { 1111, 2112, 2222, 1113, 1114, 1115, 1116 }));
//we are using the media.xml media to test the examine results implementation, see the media.xml file in the ExamineHelpers namespace
var publishedMedia = store.GetDocumentById(GetUmbracoContext("/test", 1234), 1111);
var rootDescendants = publishedMedia.DescendantsOrSelf();
Assert.IsTrue(rootDescendants.Select(x => x.Id).ContainsAll(new[] { 1111, 2112, 2222, 1113, 1114, 1115, 1116 }));
var publishedChild1 = store.GetDocumentById(GetUmbracoContext("/test", 1234), 2222);
var subDescendants = publishedChild1.DescendantsOrSelf();
Assert.IsTrue(subDescendants.Select(x => x.Id).ContainsAll(new[] { 2222, 2112, 3113 }));
var publishedChild1 = store.GetDocumentById(GetUmbracoContext("/test", 1234), 2222);
var subDescendants = publishedChild1.DescendantsOrSelf();
Assert.IsTrue(subDescendants.Select(x => x.Id).ContainsAll(new[] { 2222, 2112, 3113 }));
}
}
[Test]
public void Ancestors_With_Examine()
{
var newIndexFolder = new DirectoryInfo(Path.Combine("App_Data\\CWSIndexSetTest", Guid.NewGuid().ToString()));
var indexInit = new IndexInitializer();
var indexer = indexInit.GetUmbracoIndexer(newIndexFolder);
indexer.RebuildIndex();
using (var luceneDir = new RAMDirectory())
{
var indexer = IndexInitializer.GetUmbracoIndexer(luceneDir);
indexer.RebuildIndex();
var store = new DefaultPublishedMediaStore(indexInit.GetUmbracoSearcher(newIndexFolder));
var store = new DefaultPublishedMediaStore(IndexInitializer.GetUmbracoSearcher(luceneDir));
//we are using the media.xml media to test the examine results implementation, see the media.xml file in the ExamineHelpers namespace
var publishedMedia = store.GetDocumentById(GetUmbracoContext("/test", 1234), 3113);
var ancestors = publishedMedia.Ancestors();
Assert.IsTrue(ancestors.Select(x => x.Id).ContainsAll(new[] { 2112, 2222, 1111 }));
//we are using the media.xml media to test the examine results implementation, see the media.xml file in the ExamineHelpers namespace
var publishedMedia = store.GetDocumentById(GetUmbracoContext("/test", 1234), 3113);
var ancestors = publishedMedia.Ancestors();
Assert.IsTrue(ancestors.Select(x => x.Id).ContainsAll(new[] { 2112, 2222, 1111 }));
}
}
[Test]
public void AncestorsOrSelf_With_Examine()
{
var newIndexFolder = new DirectoryInfo(Path.Combine("App_Data\\CWSIndexSetTest", Guid.NewGuid().ToString()));
var indexInit = new IndexInitializer();
var indexer = indexInit.GetUmbracoIndexer(newIndexFolder);
indexer.RebuildIndex();
using (var luceneDir = new RAMDirectory())
{
var indexer = IndexInitializer.GetUmbracoIndexer(luceneDir);
indexer.RebuildIndex();
var store = new DefaultPublishedMediaStore(indexInit.GetUmbracoSearcher(newIndexFolder));
var store = new DefaultPublishedMediaStore(IndexInitializer.GetUmbracoSearcher(luceneDir));
//we are using the media.xml media to test the examine results implementation, see the media.xml file in the ExamineHelpers namespace
var publishedMedia = store.GetDocumentById(GetUmbracoContext("/test", 1234), 3113);
var ancestors = publishedMedia.AncestorsOrSelf();
Assert.IsTrue(ancestors.Select(x => x.Id).ContainsAll(new[] { 3113, 2112, 2222, 1111 }));
//we are using the media.xml media to test the examine results implementation, see the media.xml file in the ExamineHelpers namespace
var publishedMedia = store.GetDocumentById(GetUmbracoContext("/test", 1234), 3113);
var ancestors = publishedMedia.AncestorsOrSelf();
Assert.IsTrue(ancestors.Select(x => x.Id).ContainsAll(new[] { 3113, 2112, 2222, 1111 }));
}
}
[Test]

View File

@@ -1,360 +0,0 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml.Linq;
using System.Xml.XPath;
using Examine;
using Examine.LuceneEngine;
using Examine.LuceneEngine.Providers;
using Lucene.Net.Analysis.Standard;
using UmbracoExamine;
using UmbracoExamine.DataServices;
namespace Umbraco.Tests.TestHelpers.ExamineHelpers
{
/// <summary>
/// Used internally by test classes to initialize a new index from the template
/// </summary>
internal class IndexInitializer
{
public IndexInitializer()
{
//ensure the umbraco.config and media.xml files exist at the location where we need to load them
var appData = Path.Combine(TestHelper.CurrentAssemblyDirectory, "App_Data");
Directory.CreateDirectory(appData);
var umbConfig = Path.Combine(appData, "umbraco.config");
File.Delete(umbConfig);
using (var s = File.CreateText(umbConfig))
{
s.Write(ExamineResources.umbraco);
}
var umbMedia = Path.Combine(appData, "media.xml");
File.Delete(umbMedia);
using (var s = File.CreateText(umbMedia))
{
s.Write(ExamineResources.media);
}
}
public UmbracoContentIndexer GetUmbracoIndexer(DirectoryInfo d)
{
var i = new UmbracoContentIndexer(new IndexCriteria(
new[]
{
new TestIndexField { Name = "id", EnableSorting = true, Type = "Number" },
new TestIndexField { Name = "nodeName", EnableSorting = true },
new TestIndexField { Name = "updateDate", EnableSorting = true, Type = "DateTime" },
new TestIndexField { Name = "writerName" },
new TestIndexField { Name = "path" },
new TestIndexField { Name = "nodeTypeAlias" },
new TestIndexField { Name = "parentID" }
},
Enumerable.Empty<IIndexField>(),
//new[]
// {
// new TestIndexField { Name = "headerText" },
// new TestIndexField { Name = "bodyText" },
// new TestIndexField { Name = "metaDescription" },
// new TestIndexField { Name = "metaKeywords" },
// new TestIndexField { Name = "bodyTextColOne" },
// new TestIndexField { Name = "bodyTextColTwo" },
// new TestIndexField { Name = "xmlStorageTest" }
// },
Enumerable.Empty<string>(),
//new[]
// {
// "CWS_Home",
// "CWS_Textpage",
// "CWS_TextpageTwoCol",
// "CWS_NewsEventsList",
// "CWS_NewsItem",
// "CWS_Gallery",
// "CWS_EventItem",
// "Image",
// },
new string[] { },
-1),
d,
new TestDataService(),
new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29),
false);
//i.IndexSecondsInterval = 1;
i.IndexingError += IndexingError;
return i;
}
public UmbracoExamineSearcher GetUmbracoSearcher(DirectoryInfo d)
{
return new UmbracoExamineSearcher(d, new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29));
}
//public SimpleDataIndexer GetSimpleIndexer(DirectoryInfo d)
//{
// var i = new SimpleDataIndexer(new IndexCriteria(
// new IIndexField[] { },
// new[]
// {
// new TestIndexField { Name = "Author" },
// new TestIndexField { Name = "DateCreated", EnableSorting = true, Type = "DateTime" },
// new TestIndexField { Name = "Title" },
// new TestIndexField { Name = "Photographer" },
// new TestIndexField { Name = "YearCreated", Type = "Date.Year" },
// new TestIndexField { Name = "MonthCreated", Type = "Date.Month" },
// new TestIndexField { Name = "DayCreated", Type = "Date.Day" },
// new TestIndexField { Name = "HourCreated", Type = "Date.Hour" },
// new TestIndexField { Name = "MinuteCreated", Type = "Date.Minute" },
// new TestIndexField { Name = "SomeNumber", Type = "Number" },
// new TestIndexField { Name = "SomeFloat", Type = "Float" },
// new TestIndexField { Name = "SomeDouble", Type = "Double" },
// new TestIndexField { Name = "SomeLong", Type = "Long" }
// },
// new string[] { },
// new string[] { },
// -1),
// d,
// new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29),
// new TestSimpleDataProvider(),
// new[] { "Documents", "Pictures" },
// false);
// i.IndexingError += IndexingError;
// return i;
//}
public LuceneSearcher GetLuceneSearcher(DirectoryInfo d)
{
return new LuceneSearcher(d, new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29));
}
//public PDFIndexer GetPdfIndexer(DirectoryInfo d)
//{
// var i = new PDFIndexer(d,
// new TestDataService(),
// new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29),
// false);
// i.IndexingError += IndexingError;
// return i;
//}
public MultiIndexSearcher GetMultiSearcher(DirectoryInfo pdfDir, DirectoryInfo simpleDir, DirectoryInfo conventionDir, DirectoryInfo cwsDir)
{
var i = new MultiIndexSearcher(new[] { pdfDir, simpleDir, conventionDir, cwsDir }, new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29));
return i;
}
internal void IndexingError(object sender, IndexingErrorEventArgs e)
{
throw new ApplicationException(e.Message, e.InnerException);
}
internal class TestIndexField : IIndexField
{
public string Name { get; set; }
public bool EnableSorting { get; set; }
public string Type { get; set; }
}
internal class TestDataService : IDataService
{
public TestDataService()
{
ContentService = new TestContentService();
LogService = new TestLogService();
MediaService = new TestMediaService();
}
#region IDataService Members
public IContentService ContentService { get; private set; }
public ILogService LogService { get; private set; }
public IMediaService MediaService { get; private set; }
public string MapPath(string virtualPath)
{
return new DirectoryInfo(TestHelper.CurrentAssemblyDirectory) + "\\" + virtualPath.Replace("/", "\\");
}
#endregion
}
/// <summary>
/// A mock data service used to return content from the XML data file created with CWS
/// </summary>
internal class TestContentService : IContentService
{
public const int ProtectedNode = 1142;
public TestContentService()
{
var xmlFile = new DirectoryInfo(TestHelper.CurrentAssemblyDirectory).GetDirectories("App_Data")
.Single()
.GetFiles("umbraco.config")
.Single();
_xDoc = XDocument.Load(xmlFile.FullName);
}
#region IContentService Members
/// <summary>
/// Return the XDocument containing the xml from the umbraco.config xml file
/// </summary>
/// <param name="xpath"></param>
/// <returns></returns>
/// <remarks>
/// This is no different in the test suite as published content
/// </remarks>
public XDocument GetLatestContentByXPath(string xpath)
{
var xdoc = XDocument.Parse("<content></content>");
xdoc.Root.Add(_xDoc.XPathSelectElements(xpath));
return xdoc;
}
/// <summary>
/// Return the XDocument containing the xml from the umbraco.config xml file
/// </summary>
/// <param name="xpath"></param>
/// <returns></returns>
public XDocument GetPublishedContentByXPath(string xpath)
{
var xdoc = XDocument.Parse("<content></content>");
xdoc.Root.Add(_xDoc.XPathSelectElements(xpath));
return xdoc;
}
public string StripHtml(string value)
{
const string pattern = @"<(.|\n)*?>";
return Regex.Replace(value, pattern, string.Empty);
}
public bool IsProtected(int nodeId, string path)
{
// single node is marked as protected for test indexer
// hierarchy is not important for this test
return nodeId == ProtectedNode;
}
public IEnumerable<string> GetAllUserPropertyNames()
{
return GetPublishedContentByXPath("//*[count(@id)>0]")
.Root
.Elements()
.Select(x => x.Name.LocalName)
.ToList();
}
public IEnumerable<string> GetAllSystemPropertyNames()
{
return new Dictionary<string, FieldIndexTypes>()
{
{"id", FieldIndexTypes.NOT_ANALYZED},
{"version", FieldIndexTypes.NOT_ANALYZED},
{"parentID", FieldIndexTypes.NOT_ANALYZED},
{"level", FieldIndexTypes.NOT_ANALYZED},
{"writerID", FieldIndexTypes.NOT_ANALYZED},
{"creatorID", FieldIndexTypes.NOT_ANALYZED},
{"nodeType", FieldIndexTypes.NOT_ANALYZED},
{"template", FieldIndexTypes.NOT_ANALYZED},
{"sortOrder", FieldIndexTypes.NOT_ANALYZED},
{"createDate", FieldIndexTypes.NOT_ANALYZED},
{"updateDate", FieldIndexTypes.NOT_ANALYZED},
{"nodeName", FieldIndexTypes.ANALYZED},
{"urlName", FieldIndexTypes.NOT_ANALYZED},
{"writerName", FieldIndexTypes.ANALYZED},
{"creatorName", FieldIndexTypes.ANALYZED},
{"nodeTypeAlias", FieldIndexTypes.ANALYZED},
{"path", FieldIndexTypes.NOT_ANALYZED}
}.Select(x => x.Key);
}
#endregion
private readonly XDocument _xDoc;
}
internal class TestLogService : ILogService
{
#region ILogService Members
public string ProviderName { get; set; }
public void AddErrorLog(int nodeId, string msg)
{
Trace.WriteLine("ERROR: (" + nodeId.ToString() + ") " + msg);
}
public void AddInfoLog(int nodeId, string msg)
{
Trace.WriteLine("INFO: (" + nodeId.ToString() + ") " + msg);
}
public void AddVerboseLog(int nodeId, string msg)
{
if (LogLevel == LoggingLevel.Verbose)
Trace.WriteLine("VERBOSE: (" + nodeId.ToString() + ") " + msg);
}
public LoggingLevel LogLevel
{
get
{
return LoggingLevel.Verbose;
}
set
{
//do nothing
}
}
#endregion
}
internal class TestMediaService : IMediaService
{
public TestMediaService()
{
var xmlFile = new DirectoryInfo(TestHelper.CurrentAssemblyDirectory).GetDirectories("App_Data")
.Single()
.GetFiles("media.xml")
.Single();
m_Doc = XDocument.Load(xmlFile.FullName);
}
#region IMediaService Members
public System.Xml.Linq.XDocument GetLatestMediaByXpath(string xpath)
{
var xdoc = XDocument.Parse("<media></media>");
xdoc.Root.Add(m_Doc.XPathSelectElements(xpath));
return xdoc;
}
#endregion
private XDocument m_Doc;
}
}
}

View File

@@ -1,656 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE root[
<!ELEMENT CWS_Contact ANY>
<!ATTLIST CWS_Contact id ID #REQUIRED>
<!ELEMENT CWS_EmailAFriend ANY>
<!ATTLIST CWS_EmailAFriend id ID #REQUIRED>
<!ELEMENT CWS_EventItem ANY>
<!ATTLIST CWS_EventItem id ID #REQUIRED>
<!ELEMENT CWS_Galleries ANY>
<!ATTLIST CWS_Galleries id ID #REQUIRED>
<!ELEMENT CWS_Gallery ANY>
<!ATTLIST CWS_Gallery id ID #REQUIRED>
<!ELEMENT CWS_Home ANY>
<!ATTLIST CWS_Home id ID #REQUIRED>
<!ELEMENT CWS_NewsEventsList ANY>
<!ATTLIST CWS_NewsEventsList id ID #REQUIRED>
<!ELEMENT CWS_NewsItem ANY>
<!ATTLIST CWS_NewsItem id ID #REQUIRED>
<!ELEMENT CWS_Photo ANY>
<!ATTLIST CWS_Photo id ID #REQUIRED>
<!ELEMENT CWS_Textpage ANY>
<!ATTLIST CWS_Textpage id ID #REQUIRED>
<!ELEMENT CWS_TextpageTwoCol ANY>
<!ATTLIST CWS_TextpageTwoCol id ID #REQUIRED>
]>
<root id="-1">
<CWS_Home id="1139" parentID="-1" level="1" writerID="0" creatorID="0" nodeType="1125" template="1110" sortOrder="2" createDate="2009-02-26T18:39:39" updateDate="2010-05-03T20:34:27" nodeName="Home" urlName="home" writerName="Administrator" creatorName="Administrator" path="-1,1139" isDoc="">
<CWS_Textpage id="1140" parentID="1139" level="2" writerID="0" creatorID="0" nodeType="1129" template="1117" sortOrder="1" createDate="2009-02-26T18:47:46" updateDate="2010-04-22T02:19:21" nodeName="About" urlName="about" writerName="Administrator" creatorName="Administrator" path="-1,1139,1140" isDoc="">
<CWS_Textpage id="1141" parentID="1140" level="3" writerID="0" creatorID="0" nodeType="1129" template="1117" sortOrder="1" createDate="2009-02-26T18:51:52" updateDate="2010-04-22T02:18:30" nodeName="About Umbraco" urlName="about-umbraco" writerName="Administrator" creatorName="Administrator" path="-1,1139,1140,1141" isDoc="">
<umbracoUrlName>
</umbracoUrlName>
<umbracoUrlAlias>
</umbracoUrlAlias>
<metaDescription><![CDATA[]]></metaDescription>
<metaKeywords><![CDATA[]]></metaKeywords>
<umbracoRedirect>
</umbracoRedirect>
<umbracoNaviHide>0</umbracoNaviHide>
<headerText>
<![CDATA[
<p>It's the <strong>KING</strong> of all CMS's, what more do you
need to know about it?</p>
]]>
</headerText>
<articlePhoto>/media/171/umbraco_tshirt.jpg</articlePhoto>
<bodyText>
<![CDATA[
<h3>Umbraco CMS is free</h3>
<p>It means that you are not bound and locked to the licensing
rules about the number of content items / processors / web /
domains, etc. Many products are very expensive as the license cost
escalates with the number of websites. In many cases, one is soon
up in the 500' before one can even start to implement the
solution.</p>
<h3>Umbraco is Open Source</h3>
<p>In an Open Source product one has at any time full access to
source code. This provides insight and leads to better quality, as
"shortcuts" and bad code can easily be penetrated. Moreover, one
has the ability to influence and further develop the product.</p>
<p>Umbraco is based on open source and is therefore not
lisence-plated or subject to an enterprise's ownership. The Umbraco
publishing tool places great emphasis on simplicity, standards,
flexibility and integration. Umbraco was launched in 2005 and has
had a tremendous growth since that time. Umbraco is today among the
most popular systems based on open source for Microsoft. NET
platform.</p>
<h3>100% Microsoft .NET</h3>
<p>Umbraco is built 100% on the Microsoft. NET 2.0. This means that
you can use 3rd party .NET components directly in Umbraco.
Moreover, integration with other .NET-based solutions is well
adapted from Umbracos part. Umbraco won an award for the
Integration possibilities on BNP Awards 2006.</p>
<h3>Fast results</h3>
<p>Umbraco is a powerful tool with a focus on core functionality
and openness. This efficiently allows you to achieve exactly what
you want - rather than be restricted to a "finished" module, which
makes only half of what you really wanted.</p>
<h3>Easy-to-use</h3>
<p>Umbraco has a focus on content and facilitate rapid and
intuitive content management. The system strives to be elegant,
usable and effective.</p>
<h3>Based on standards</h3>
<p>Umbraco is based on standards from the W3C as XHTML, CSS, XML
and XSLT. This gives a greater flexibility and independence, which
in turn provides more value for the money.</p>
<h3>Integration</h3>
<p>Umbraco is known to be among the best CMS on integration. Much
of the reason for this is the way to expose Microsoft ASP.NET
components as elements of, or so-called "macro's" for use in
templates, as well as in the WYSIWYG editor that writers and
editors use. Elements is also possible to "cache" on several levels
and is based on standard Microsoft .NET technology. Below are some
examples:</p>
<ul>
<li>External XML sources (ex RSS) can be directly implemented via
XSLT elements (macros).</li>
<li>ASP.NET controls that retrieve data from external or internal
posterior systems via standard Web Services.</li>
</ul>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]>
</bodyText>
</CWS_Textpage>
<CWS_TextpageTwoCol id="1142" parentID="1140" level="3" writerID="0" creatorID="0" nodeType="1130" template="1118" sortOrder="2" createDate="2009-02-26T18:56:06" updateDate="2010-04-22T02:18:30" nodeName="About this project" urlName="about-this-project" writerName="Administrator" creatorName="Administrator" path="-1,1139,1140,1142" isDoc="">
<articlePhotoColOne>/media/227/warren-buckley.jpg</articlePhotoColOne>
<articlePhotoColTwo>/media/228/sam-grady.jpg</articlePhotoColTwo>
<bodyTextColTwo>
<![CDATA[
<h3>Sam Grady</h3>
<p>Sam Grady, me, is a graphic designer. I loves graphic design.
Great graphic design and simple solutions makes this man very
happy. Photography is also very close to my heart and I'd like to
be better, so I practice a lot and annoy people with my
requests.<br />
<br />
I haven't got a blog, yet, don't Twitter and cancelled my Facebook
account as I felt uncomfortable with people knowing my business.
Anyone else feel that way? I do, however, have a Flickr account, so
go check it out: <a
href="http://www.flickr.com/photos/mrgrady">www.flickr.com/photos/mrgrady</a><br />
<br />
I also have my own business, G72, which has a website that
desperately needs updating. Also, as of today (03/03/09), it's
currently down due to inept web hosts. Hopefully it won't be if you
want to take a look: <a
href="http://www.g-72.co.uk">www.g-72.co.uk</a><br />
<br />
Regarding this project, Warren asked me if I wanted to design his
website starter package for the fantastic Umbraco CMS, which I
jumped at the chance to do. Hopefully you'll find the design
appropriate and the package very useful, as that's what we really
want from this project.<br />
<br />
Finally, Warren says the layout is work in progress and I have a,
typically fussy, list of designer layout requests that I've asked
Warren to do, but time being what it is, these changes won't be
made on version 2.0, so if you spot anything, do mail the man as
we'll be compiling a list of tweaks to be made.<br />
<br />
Enjoy.</p>
]]>
</bodyTextColTwo>
<bodyTextColOne>
<![CDATA[
<h3>Warren Buckley</h3>
<p>Warren Buckley is a web developer who specialises in using the
Umbraco CMS platform to build content managed websites for Xeed in
Norway. I run a blog called <a
href="http://www.creativewebspecialist.co.uk">Creative Web
Specialist</a>, where I mainly write tips and tutorial articles
around Umbraco.</p>
<p>I have teamed up with ex-collegue Sam Grady to help me design
the new version of CWS as he produces wonderfully sexy designs for
the web. If you have seen my previous version/s of CWS you will
know that my design skills are far from stunning.</p>
<p>I decided to create this website starter site nicknamed CWS
(Creative Website Starter site) as a learning tool to help you
understand how all the elements of a site work together in
Umbraco.</p>
<p>From this <strong>NEW</strong> CWS package comes the
following:</p>
<ul>
<li>Obviously a <strong>BRAND NEW</strong> spanking design from
ex-collegue Sam Grady of G-72</li>
<li>A focus for this site to be used to help teach new users to the
Umbraco CMS platform.</li>
<li>.NET usercontrols written in C#</li>
<li>XSLT &amp; .NET code heavily commented to help understand what
is going on.</li>
<li>With supporting documentation coming in the near future.</li>
</ul>
<p>Want to see where else you can find me on the net?<br />
Blog - <a
href="http://www.creativewebspecialist.co.uk">www.creativewebspecialist.co.uk</a><br />
Flickr - <a
href="http://www.flickr.com/photos/warrenbuckley">www.flickr.com/photos/warrenbuckley</a><br />
Last.FM - <a
href="http://www.last.fm/user/warrenbuckley">www.last.fm/user/warrenbuckley</a><br />
Twitter - <a
href="http://twitter.com/warrenbuckley">twitter.com/warrenbuckley</a></p>
]]>
</bodyTextColOne>
<umbracoUrlName>
</umbracoUrlName>
<umbracoUrlAlias>
</umbracoUrlAlias>
<metaDescription><![CDATA[]]></metaDescription>
<metaKeywords><![CDATA[]]></metaKeywords>
<xmlStorageTest>
<XmlStorage>
<Nodes>
<Node>1</Node>
<Node>2</Node>
<Node>3</Node>
<Node>4</Node>
<Node>5</Node>
</Nodes>
</XmlStorage>
</xmlStorageTest>
<umbracoRedirect>
</umbracoRedirect>
<umbracoNaviHide>0</umbracoNaviHide>
<headerText>
<![CDATA[
<p>This website has been produced to help you understand
Umbraco.</p>
]]>
</headerText>
</CWS_TextpageTwoCol>
<umbracoUrlName />
<umbracoUrlAlias />
<metaDescription><![CDATA[This is the META description for the about page.]]></metaDescription>
<metaKeywords><![CDATA[about, creative web specialist, umbraco, warren buckley, sam grady]]></metaKeywords>
<umbracoRedirect />
<umbracoNaviHide>0</umbracoNaviHide>
<headerText><![CDATA[<p>This is a good place to put a service message or something to help define your site or company.</p>]]></headerText>
<articlePhoto />
<bodyText>
<![CDATA[<p><strong>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam ullamcorper condimentum lorem. Curabitur placerat nunc ut leo. Integer eros ligula, vestibulum at, eleifend id, dignissim vel, est.</strong></p>
<p>Fusce tristique. Cras faucibus porta nunc. Aliquam ultrices, arcu quis ornare sagittis, lectus augue ornare nulla, eu lobortis velit lectus id nibh. Aliquam condimentum aliquet purus. Quisque blandit ante non sapien. Sed justo libero, sollicitudin ac, pretium et, luctus nec, nisl. Nulla semper neque nec magna. Cras ut nibh ut urna bibendum sodales. Quisque venenatis euismod lacus. Pellentesque dapibus turpis at urna.</p>
<h3>Sub Header</h3>
<p>Sed scelerisque adipiscing mauris. Mauris egestas dapibus quam. Integer in libero eget eros dignissim pretium. Proin luctus sem nec lorem. Praesent lorem. Vivamus eget nunc quis sapien condimentum egestas. Maecenas facilisis, nunc at sodales facilisis, quam magna pretium nibh, vel ultrices lectus lorem quis neque. Nam sit amet leo ac lectus gravida convallis. Phasellus at enim vel dui porta porttitor. Morbi id dolor adipiscing erat egestas consequat.</p>
<p><a href="http://www.google.co.uk">Phasellus diam. Morbi dolor.</a> Donec consequat sodales nunc. Nam dapibus lectus id lectus. Sed ultrices metus sit amet est. Morbi porttitor. Proin vel risus. Phasellus sodales convallis justo. <em>Sed luctus hendrerit risus. Sed est lorem, feugiat et, rutrum quis, condimentum non, nunc.</em> Aenean urna leo, sagittis a, commodo eget, lobortis nec, eros. Vivamus pharetra, lectus eu ultrices pulvinar, nunc quam consectetur nibh, sed pulvinar leo dolor ut felis.</p>
<ol>
<li>Item one</li>
<li>Item two</li>
<li>Item three</li>
</ol>
<p>Nullam lobortis, mi nec feugiat congue, dolor diam cursus lacus, a elementum ligula dolor vitae sem. Suspendisse at quam. Praesent neque. Vestibulum at justo. Nulla rutrum velit et eros.</p>
<ul>
<li>Integer convallis augue in tellus</li>
<li>Magna quam sollicitudin mauris</li>
</ul>
<p>Nullam lobortis, mi nec feugiat congue, dolor diam cursus lacus, a elementum ligula dolor vitae sem. Suspendisse at quam.</p>]]>
</bodyText>
</CWS_Textpage>
<CWS_Galleries id="1143" parentID="1139" level="2" writerID="0" creatorID="0" nodeType="1123" template="1108" sortOrder="2" createDate="2009-02-27T09:39:54" updateDate="2010-04-22T02:34:59" nodeName="Gallery" urlName="gallery" writerName="Administrator" creatorName="Administrator" path="-1,1139,1143" isDoc="">
<CWS_Gallery id="1144" parentID="1143" level="3" writerID="0" creatorID="0" nodeType="1124" template="1109" sortOrder="1" createDate="2009-03-02T17:58:22" updateDate="2010-04-22T02:18:30" nodeName="The Bookhouse Boys" urlName="the-bookhouse-boys" writerName="Administrator" creatorName="Administrator" path="-1,1139,1143,1144" isDoc="">
<umbracoUrlName>
</umbracoUrlName>
<umbracoUrlAlias>
</umbracoUrlAlias>
<metaDescription><![CDATA[I am the description]]></metaDescription>
<metaKeywords><![CDATA[keywords, here]]></metaKeywords>
<umbracoRedirect>
</umbracoRedirect>
<umbracoNaviHide>0</umbracoNaviHide>
<headerText>
<![CDATA[
<p>The Bookhouse Boys. Live at the ICA, London.</p>
]]>
</headerText>
<sortBy><![CDATA[sortOrder]]></sortBy>
<sortOrder><![CDATA[ascending]]></sortOrder>
<galleryThumbnail>/media/1239/bookhouse-boys_gallery.jpg</galleryThumbnail>
<CWS_Photo id="1145" parentID="1144" level="4" writerID="0" creatorID="0" nodeType="1128" template="1114" sortOrder="1" createDate="2009-03-03T18:08:55" updateDate="2010-04-22T02:18:30" nodeName="Catherine Turner and Paul Van Oestren" urlName="catherine-turner-and-paul-van-oestren" writerName="Administrator" creatorName="Administrator" path="-1,1139,1143,1144,1145" isDoc="">
<photoText>Credit: Sam Grady</photoText>
<photo>/media/1277/bookhouse-boys_3.jpg</photo>
<photoThumbnail>/media/1314/bookhouse-boys_3_thumb.jpg</photoThumbnail>
<umbracoUrlName>
</umbracoUrlName>
<umbracoUrlAlias>
</umbracoUrlAlias>
<metaDescription><![CDATA[]]></metaDescription>
<metaKeywords><![CDATA[]]></metaKeywords>
<umbracoRedirect>
</umbracoRedirect>
<umbracoNaviHide>0</umbracoNaviHide>
</CWS_Photo>
<CWS_Photo id="1146" parentID="1144" level="4" writerID="0" creatorID="0" nodeType="1128" template="1114" sortOrder="2" createDate="2009-03-03T18:08:19" updateDate="2010-04-22T02:18:30" nodeName="J.P.Fellows" urlName="jpfellows" writerName="Administrator" creatorName="Administrator" path="-1,1139,1143,1144,1146" isDoc="">
<photoText>Credit: Sam Grady</photoText>
<photo>/media/1250/bookhouse-boys_1.jpg</photo>
<photoThumbnail>/media/1296/bookhouse-boys_1_thumb.jpg</photoThumbnail>
<umbracoUrlName>
</umbracoUrlName>
<umbracoUrlAlias>
</umbracoUrlAlias>
<metaDescription><![CDATA[]]></metaDescription>
<metaKeywords><![CDATA[]]></metaKeywords>
<umbracoRedirect>
</umbracoRedirect>
<umbracoNaviHide>0</umbracoNaviHide>
</CWS_Photo>
<CWS_Photo id="1147" parentID="1144" level="4" writerID="0" creatorID="0" nodeType="1128" template="1114" sortOrder="3" createDate="2009-03-03T18:08:48" updateDate="2010-04-22T02:18:30" nodeName="Catherine Turner" urlName="catherine-turner" writerName="Administrator" creatorName="Administrator" path="-1,1139,1143,1144,1147" isDoc="">
<photoText>Credit: Sam Grady</photoText>
<photo>/media/1331/bookhouse-boys_2.jpg</photo>
<photoThumbnail>/media/1350/bookhouse-boys_2_thumb.jpg</photoThumbnail>
<umbracoUrlName>
</umbracoUrlName>
<umbracoUrlAlias>
</umbracoUrlAlias>
<metaDescription><![CDATA[]]></metaDescription>
<metaKeywords><![CDATA[]]></metaKeywords>
<umbracoRedirect>
</umbracoRedirect>
<umbracoNaviHide>0</umbracoNaviHide>
</CWS_Photo>
</CWS_Gallery>
<CWS_Gallery id="1148" parentID="1143" level="3" writerID="0" creatorID="0" nodeType="1124" template="1109" sortOrder="2" createDate="2009-02-27T09:48:12" updateDate="2010-04-22T02:18:30" nodeName="Codegarden 08" urlName="codegarden-08" writerName="Administrator" creatorName="Administrator" path="-1,1139,1143,1148" isDoc="">
<umbracoUrlName>
</umbracoUrlName>
<umbracoUrlAlias>
</umbracoUrlAlias>
<metaDescription><![CDATA[]]></metaDescription>
<metaKeywords><![CDATA[]]></metaKeywords>
<umbracoRedirect>
</umbracoRedirect>
<umbracoNaviHide>0</umbracoNaviHide>
<headerText>
<![CDATA[
<p>Where all the great minds of umbraco meet!</p>
]]>
</headerText>
<sortBy><![CDATA[sortOrder]]></sortBy>
<sortOrder><![CDATA[ascending]]></sortOrder>
<galleryThumbnail>/media/993/codegarden-08_gallery.jpg</galleryThumbnail>
<CWS_Photo id="1149" parentID="1148" level="4" writerID="0" creatorID="0" nodeType="1128" template="1114" sortOrder="1" createDate="2009-03-02T15:40:01" updateDate="2010-04-22T02:18:30" nodeName="Darren and David have a chat" urlName="darren-and-david-have-a-chat" writerName="Administrator" creatorName="Administrator" path="-1,1139,1143,1148,1149" isDoc="">
<photoText>Credit: Douglas Robar</photoText>
<photo>/media/825/darren-ferguson_david-conlisk.jpg</photo>
<photoThumbnail>/media/835/darren-ferguson_david-conlisk_thumb.jpg</photoThumbnail>
<umbracoUrlName>
</umbracoUrlName>
<umbracoUrlAlias>
</umbracoUrlAlias>
<metaDescription><![CDATA[]]></metaDescription>
<metaKeywords><![CDATA[]]></metaKeywords>
<umbracoRedirect>
</umbracoRedirect>
<umbracoNaviHide>0</umbracoNaviHide>
</CWS_Photo>
<CWS_Photo id="1150" parentID="1148" level="4" writerID="0" creatorID="0" nodeType="1128" template="1114" sortOrder="2" createDate="2009-02-27T09:54:07" updateDate="2010-04-22T02:18:31" nodeName="Codegarden 08 T-Shirt" urlName="codegarden-08-t-shirt" writerName="Administrator" creatorName="Administrator" path="-1,1139,1143,1148,1150" isDoc="">
<photoText>Credit: Warren Buckley</photoText>
<photo>/media/394/codegarden08-t-shirt.jpg</photo>
<photoThumbnail>/media/799/codegarden08-t-shirt_thumb.jpg</photoThumbnail>
<umbracoUrlName>
</umbracoUrlName>
<umbracoUrlAlias>
</umbracoUrlAlias>
<metaDescription><![CDATA[]]></metaDescription>
<metaKeywords><![CDATA[]]></metaKeywords>
<umbracoRedirect>
</umbracoRedirect>
<umbracoNaviHide>0</umbracoNaviHide>
</CWS_Photo>
<CWS_Photo id="1151" parentID="1148" level="4" writerID="0" creatorID="0" nodeType="1128" template="1114" sortOrder="3" createDate="2009-03-02T15:43:43" updateDate="2010-04-22T02:18:31" nodeName="The Umbraco BINGO callers" urlName="the-umbraco-bingo-callers" writerName="Administrator" creatorName="Administrator" path="-1,1139,1143,1148,1151" isDoc="">
<photoText>Credit: Douglas Robar</photoText>
<photo>/media/852/bingo-callers.jpg</photo>
<photoThumbnail>/media/871/bingo-callers_thumb.jpg</photoThumbnail>
<umbracoUrlName>
</umbracoUrlName>
<umbracoUrlAlias>
</umbracoUrlAlias>
<metaDescription><![CDATA[]]></metaDescription>
<metaKeywords><![CDATA[]]></metaKeywords>
<umbracoRedirect>
</umbracoRedirect>
<umbracoNaviHide>0</umbracoNaviHide>
</CWS_Photo>
<CWS_Photo id="1152" parentID="1148" level="4" writerID="0" creatorID="0" nodeType="1128" template="1114" sortOrder="4" createDate="2009-03-02T15:59:24" updateDate="2010-04-22T02:18:31" nodeName="Christian Palm chatting" urlName="christian-palm-chatting" writerName="Administrator" creatorName="Administrator" path="-1,1139,1143,1148,1152" isDoc="">
<photoText>Credit: Douglas Robar</photoText>
<photo>/media/879/christian-palm.jpg</photo>
<photoThumbnail>/media/889/christian-palm_thumb.jpg</photoThumbnail>
<umbracoUrlName>
</umbracoUrlName>
<umbracoUrlAlias>
</umbracoUrlAlias>
<metaDescription><![CDATA[]]></metaDescription>
<metaKeywords><![CDATA[]]></metaKeywords>
<umbracoRedirect>
</umbracoRedirect>
<umbracoNaviHide>0</umbracoNaviHide>
</CWS_Photo>
</CWS_Gallery>
<CWS_Gallery id="1153" parentID="1143" level="3" writerID="0" creatorID="0" nodeType="1124" template="1109" sortOrder="3" createDate="2009-03-02T16:02:14" updateDate="2010-04-22T02:18:31" nodeName="Bath, UK" urlName="bath,-uk" writerName="Administrator" creatorName="Administrator" path="-1,1139,1143,1153" isDoc="">
<umbracoUrlName>
</umbracoUrlName>
<umbracoUrlAlias>
</umbracoUrlAlias>
<metaDescription><![CDATA[]]></metaDescription>
<metaKeywords><![CDATA[]]></metaKeywords>
<umbracoRedirect>
</umbracoRedirect>
<umbracoNaviHide>0</umbracoNaviHide>
<headerText>
<![CDATA[
<p>Photos from a trip to Bath in November 2008</p>
]]>
</headerText>
<sortBy><![CDATA[updateDate]]></sortBy>
<sortOrder><![CDATA[ascending]]></sortOrder>
<galleryThumbnail>/media/935/bath_gallery.jpg</galleryThumbnail>
<CWS_Photo id="1154" parentID="1153" level="4" writerID="0" creatorID="0" nodeType="1128" template="1114" sortOrder="1" createDate="2009-03-02T16:27:17" updateDate="2010-04-22T02:18:31" nodeName="Royal Crescent" urlName="royal-crescent" writerName="Administrator" creatorName="Administrator" path="-1,1139,1143,1153,1154" isDoc="">
<photoText>Credit: Warren Buckley</photoText>
<photo>/media/995/royal-crescent.jpg</photo>
<photoThumbnail>/media/1014/royal-crescent_thumb.jpg</photoThumbnail>
<umbracoUrlName>
</umbracoUrlName>
<umbracoUrlAlias>
</umbracoUrlAlias>
<metaDescription><![CDATA[]]></metaDescription>
<metaKeywords><![CDATA[]]></metaKeywords>
<umbracoRedirect>
</umbracoRedirect>
<umbracoNaviHide>0</umbracoNaviHide>
</CWS_Photo>
</CWS_Gallery>
<umbracoUrlName />
<umbracoUrlAlias />
<metaDescription><![CDATA[dfg]]></metaDescription>
<metaKeywords><![CDATA[dsfg]]></metaKeywords>
<umbracoRedirect />
<umbracoNaviHide>0</umbracoNaviHide>
<headerText><![CDATA[<p>This first page displays all the albums featured within your site.<br /> Please have a browse through.</p>]]></headerText>
<sortBy><![CDATA[sortOrder]]></sortBy>
<sortOrder><![CDATA[ascending]]></sortOrder>
</CWS_Galleries>
<CWS_NewsEventsList id="1155" parentID="1139" level="2" writerID="0" creatorID="0" nodeType="1126" template="1112" sortOrder="3" createDate="2009-02-27T09:57:30" updateDate="2010-04-22T02:18:31" nodeName="News and Events" urlName="news-and-events" writerName="Administrator" creatorName="Administrator" path="-1,1139,1155" isDoc="">
<CWS_EventItem id="1156" parentID="1155" level="3" writerID="0" creatorID="0" nodeType="1122" template="1107" sortOrder="1" createDate="2009-02-27T10:00:53" updateDate="2010-04-22T02:18:31" nodeName="Codegarden 09" urlName="codegarden-09" writerName="Administrator" creatorName="Administrator" path="-1,1139,1155,1156" isDoc="">
<eventDate>2009-06-22T00:00:00</eventDate>
<bodyText>
<![CDATA[
<h3>Come join the annual umbraco developer conference in Wonderful
Copenhagen on June 22nd - 23rd. Two days for insights, eye-openers,
great conversations and friendly people.</h3>
<p>The who's who of umbraco will be gathered and share their
knowledge through talks, tutorials and via un-conference formats
like open space or hacking sessions. We have booked a cool, old and
huge industrial venue in central Copenhagen where we'll have one
huge room, three rooms for breakout sessions and a Caf&eacute; that
serves your taste of espresso.</p>
<p>Come join the annual umbraco developer conference in Wonderful
Copenhagen on June 22nd - 23rd. Two days for insights, eye-openers,
great conversations and friendly people.</p>
<p>We've planned a program that fits both experienced umbraco users
as well as new comers. The conference is kicked off with a Keynote
and after that we'll have two or three tracks of sessions and the
first day is rounded with an open Q/A session with the umbraco core
team.</p>
<p>The second day features an un-conference format called open
space, which we also used with great success at last year's
conference. It's a format where everybody can suggest a topic and
as we have plenty of break-out rooms rest assured that there'll be
room for your topic as well. Last year's more than 20 topics
covered Silverlight, High performance websites with umbraco,
building custom data types and much more.</p>
<p>But it doesn't ends there. We've ensured that we can stay at the
venue until midnight both days which means that when the first day
ends, the fun begins. With more than hundred people gathered at a
place with loads of umbraco knowledge, wifi, great food and plenty
of space, who knows what could happen. A BBQ, new packages,
improvised demos and talks, or...?</p>
<p>&nbsp;</p>
]]>
</bodyText>
<articlePhoto>/media/445/umbraco_tshirt.jpg</articlePhoto>
<umbracoUrlName>
</umbracoUrlName>
<umbracoUrlAlias>
</umbracoUrlAlias>
<metaDescription><![CDATA[]]></metaDescription>
<metaKeywords><![CDATA[]]></metaKeywords>
<umbracoRedirect>
</umbracoRedirect>
<umbracoNaviHide>0</umbracoNaviHide>
</CWS_EventItem>
<CWS_NewsItem id="1157" parentID="1155" level="3" writerID="0" creatorID="0" nodeType="1127" template="1113" sortOrder="2" createDate="2009-03-02T16:32:06" updateDate="2010-04-22T02:18:31" nodeName="CWS2 is released" urlName="cws2-is-released" writerName="Administrator" creatorName="Administrator" path="-1,1139,1155,1157" isDoc="">
<bodyText>
<![CDATA[
<h3>After Warren Buckley's success of the first Creative Website
Starter site package, with over 20K downloads he has decided to
work on CWS2.</h3>
<p>As of today Wednesday the 4th March 2009, the CWS2 package is
now available to download from the built in package repository
inside Umbraco.</p>
<p>With this new version comes the following:</p>
<ul>
<li>A <strong>BRAND NEW</strong> spanking design from ex-collegue
<a href="http://www.g-72.co.uk"
title="Designer Sam Grady of G72">Sam Grady of G-72</a></li>
<li>A focus for this site to be used to help teach new users to the
Umbraco CMS platform.</li>
<li>.NET usercontrols written in C#</li>
<li>XSLT &amp; .NET code heavily commented to help understand what
is going on.</li>
<li>With supporting documentation coming in the near future.</li>
</ul>
]]>
</bodyText>
<articlePhoto>
</articlePhoto>
<umbracoUrlName>
</umbracoUrlName>
<umbracoUrlAlias>
</umbracoUrlAlias>
<metaDescription><![CDATA[]]></metaDescription>
<metaKeywords><![CDATA[]]></metaKeywords>
<umbracoRedirect>
</umbracoRedirect>
<umbracoNaviHide>0</umbracoNaviHide>
</CWS_NewsItem>
<umbracoUrlName />
<umbracoUrlAlias />
<metaDescription><![CDATA[]]></metaDescription>
<metaKeywords><![CDATA[]]></metaKeywords>
<umbracoRedirect />
<umbracoNaviHide>0</umbracoNaviHide>
<sortBy><![CDATA[sortOrder]]></sortBy>
<sortOrder><![CDATA[ascending]]></sortOrder>
<headerText>
<![CDATA[
<p>Please browse through our news archive and event listings
below.</p>
]]>
</headerText>
</CWS_NewsEventsList>
<CWS_Contact id="1158" parentID="1139" level="2" writerID="0" creatorID="0" nodeType="1120" template="1105" sortOrder="4" createDate="2009-02-27T10:03:12" updateDate="2010-04-22T02:18:31" nodeName="Contact" urlName="contact" writerName="Administrator" creatorName="Administrator" path="-1,1139,1158" isDoc="">
<emailTo>you@yourcompany.co.uk</emailTo>
<emailSubject>Email from Contact form on website</emailSubject>
<emailBody>
<![CDATA[Hello a user of your site has filled in your contact form on [Date] @ [Time]
Name: [Name]
Address: [AddressLine1], [AddressLine2]
Email: [Email]
Message: [Message]]]>
</emailBody>
<emailReplyFrom>you@yourcompany.co.uk</emailReplyFrom>
<emailReplySubject>Thank you for your message</emailReplySubject>
<emailReplyBody>
<![CDATA[Hello [Name]
Thanks for contacting us, we will reply shortly.
Your Company Name
www.yourcompany.co.uk]]>
</emailReplyBody>
<enableSSL>0</enableSSL>
<umbracoUrlName />
<umbracoUrlAlias />
<metaDescription><![CDATA[]]></metaDescription>
<metaKeywords><![CDATA[]]></metaKeywords>
<umbracoRedirect />
<umbracoNaviHide>0</umbracoNaviHide>
<headerText>
<![CDATA[
<p>Everything you need to<br />
get in touch.</p>
]]>
</headerText>
<formText>
<![CDATA[
<h3>Enquiry Form</h3>
<p>If you have a particular enquiry, please fill out the form below
and provide as much information as you can, so that one of our
representatives can deal with your enquiry as effciently as
possible.</p>
]]>
</formText>
<thankYouHeaderText>
<![CDATA[
<p><strong>Thank you.</strong> We will be in touch shortly.</p>
]]>
</thankYouHeaderText>
<thankYouMessageText>
<![CDATA[
<p>Thanks for filling out our contact form we will get back to you
shortly.</p>
<p>Regards,<br />
My Company</p>
]]>
</thankYouMessageText>
</CWS_Contact>
<CWS_EmailAFriend id="1159" parentID="1139" level="2" writerID="0" creatorID="0" nodeType="1121" template="1106" sortOrder="5" createDate="2009-02-27T10:05:57" updateDate="2010-04-22T02:18:31" nodeName="Email a Friend" urlName="email-a-friend" writerName="Administrator" creatorName="Administrator" path="-1,1139,1159" isDoc="">
<emailFrom>you@yourcompany.co.uk</emailFrom>
<emailSubjectToFriend>[YourName] has sent you a link to read</emailSubjectToFriend>
<emailMessageToFriend>
<![CDATA[Hello [FriendName], [YourName] has sent you this link to read.
URL: [URL]
Message: [Message]
--------------------------------------------------------
Your Company Name
www.yourcompany.co.uk]]>
</emailMessageToFriend>
<enableSSL>0</enableSSL>
<umbracoUrlName />
<umbracoUrlAlias />
<metaDescription><![CDATA[]]></metaDescription>
<metaKeywords><![CDATA[]]></metaKeywords>
<umbracoRedirect />
<umbracoNaviHide>1</umbracoNaviHide>
<headerText><![CDATA[<p>Send a page onto your friend.</p>]]></headerText>
<thankYouHeaderText><![CDATA[<p><strong>Thank you.</strong> We appreciate the love you are giving our site.</p>]]></thankYouHeaderText>
<thankYouMessageText><![CDATA[<p>Thanks for sending that link onto your friend, we really appreciate it here at My Company.</p>]]></thankYouMessageText>
</CWS_EmailAFriend>
<metaDescription><![CDATA[]]></metaDescription>
<metaKeywords><![CDATA[]]></metaKeywords>
<umbracoNaviHide>0</umbracoNaviHide>
<siteName>Your logo/name</siteName>
<headerText><![CDATA[<p><strong>Sam Grady designed this for Warren Buckley.</strong> "This" idea was first created by the incredible Robert Brownjohn and has been copied many times since.</p>]]></headerText>
<homepagePhoto><![CDATA[]]></homepagePhoto>
<bodyText>
<![CDATA[<p>Thank you for installing the umbraco website package created and developed by Warren Buckley. This should website package be used to help you understand how all the components of an Umbraco site works.</p>
<p><img src="/media/1670/clientdependencylogo.png" width="89" height="89" alt="test1"/></p>]]>
</bodyText>
<MediaPickerTest />
<umbracoUrlName />
<umbracoUrlAlias />
<umbracoRedirect>0</umbracoRedirect>
</CWS_Home>
</root>

View File

@@ -116,10 +116,6 @@
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="UmbracoExamine, Version=0.1.42.2941, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\UmbracoExamine.0.1.42.2941\lib\UmbracoExamine.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Auditing\AuditTests.cs" />
@@ -267,17 +263,23 @@
<Compile Include="Stubs\TestControllerFactory.cs" />
<Compile Include="TestHelpers\BaseUsingSqlCeSyntax.cs" />
<Compile Include="TestHelpers\BaseWebTest.cs" />
<Compile Include="TestHelpers\ExamineHelpers\ExamineResources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>ExamineResources.resx</DependentUpon>
</Compile>
<Compile Include="TestHelpers\BaseDatabaseTest.cs" />
<Compile Include="TestHelpers\Entities\MockedContent.cs" />
<Compile Include="TestHelpers\Entities\MockedContentTypes.cs" />
<Compile Include="TestHelpers\Entities\MockedEntity.cs" />
<Compile Include="TestHelpers\Entities\MockedMedia.cs" />
<Compile Include="TestHelpers\ExamineHelpers\IndexInitializer.cs" />
<Compile Include="UmbracoExamine\EventsTest.cs" />
<Compile Include="UmbracoExamine\IndexInitializer.cs" />
<Compile Include="UmbracoExamine\TestDataService.cs" />
<Compile Include="UmbracoExamine\TestFiles.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>TestFiles.resx</DependentUpon>
</Compile>
<Compile Include="UmbracoExamine\TestIndexField.cs" />
<Compile Include="UmbracoExamine\TestLogService.cs" />
<Compile Include="UmbracoExamine\TestMediaService.cs" />
<Compile Include="UmbracoExamine\TestContentService.cs" />
<Compile Include="UriUtilityTests.cs" />
<Compile Include="Resolvers\MacroFieldEditorsResolverTests.cs" />
<Compile Include="MacroEngineFactoryTests.cs" />
@@ -309,6 +311,7 @@
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
<None Include="UmbracoExamine\TestFiles\umbraco.config" />
<None Include="unit-test-log4net.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
@@ -354,16 +357,19 @@
<Project>{651E1350-91B6-44B7-BD60-7207006D7003}</Project>
<Name>Umbraco.Web</Name>
</ProjectReference>
<ProjectReference Include="..\UmbracoExamine\UmbracoExamine.csproj">
<Project>{07fbc26b-2927-4a22-8d96-d644c667fecc}</Project>
<Name>UmbracoExamine</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Migrations\SqlScripts\SqlResources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>SqlResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="TestHelpers\ExamineHelpers\ExamineResources.resx">
<EmbeddedResource Include="UmbracoExamine\TestFiles.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>ExamineResources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
<LastGenOutput>TestFiles.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
@@ -397,7 +403,9 @@
<Content Include="Migrations\SqlScripts\MySqlTotal-480.sql" />
<Content Include="Migrations\SqlScripts\SqlCeTotal-480.sql" />
<Content Include="Migrations\SqlScripts\SqlServerTotal-480.sql" />
<Content Include="UmbracoExamine\TestFiles\media.xml" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.0\amd64\*.* "$(TargetDir)amd64\" /Y /F /E /D

View File

@@ -0,0 +1,62 @@
using System;
using System.Linq;
using Examine;
using Lucene.Net.Store;
using NUnit.Framework;
using Umbraco.Tests.PartialTrust;
using UmbracoExamine;
namespace Umbraco.Tests.UmbracoExamine
{
[TestFixture]
public class EventsTest : AbstractPartialTrustFixture<EventsTest>
{
[Test]
public void Events_Ignoring_Node()
{
//change the parent id so that they are all ignored
var existingCriteria = ((IndexCriteria)_indexer.IndexerData);
_indexer.IndexerData = new IndexCriteria(existingCriteria.StandardFields, existingCriteria.UserFields, existingCriteria.IncludeNodeTypes, existingCriteria.ExcludeNodeTypes,
999); //change to 999
var isIgnored = false;
EventHandler<IndexingNodeDataEventArgs> ignoringNode = (s, e) =>
{
isIgnored = true;
};
_indexer.IgnoringNode += ignoringNode;
//get a node from the data repo
var node = _contentService.GetPublishedContentByXPath("//*[string-length(@id)>0 and number(@id)>0]")
.Root
.Elements()
.First();
_indexer.ReIndexNode(node, IndexTypes.Content);
Assert.IsTrue(isIgnored);
}
private readonly TestContentService _contentService = new TestContentService();
private static UmbracoExamineSearcher _searcher;
private static UmbracoContentIndexer _indexer;
private Lucene.Net.Store.Directory _luceneDir;
public override void TestSetup()
{
_luceneDir = new RAMDirectory();
_indexer = IndexInitializer.GetUmbracoIndexer(_luceneDir);
_indexer.RebuildIndex();
_searcher = IndexInitializer.GetUmbracoSearcher(_luceneDir);
}
public override void TestTearDown()
{
_luceneDir.Dispose();
}
}
}

View File

@@ -0,0 +1,128 @@
using System;
using Examine;
using Examine.LuceneEngine.Providers;
using Lucene.Net.Analysis.Standard;
using UmbracoExamine;
namespace Umbraco.Tests.UmbracoExamine
{
/// <summary>
/// Used internally by test classes to initialize a new index from the template
/// </summary>
internal static class IndexInitializer
{
public static UmbracoContentIndexer GetUmbracoIndexer(Lucene.Net.Store.Directory luceneDir)
{
var i = new UmbracoContentIndexer(new IndexCriteria(
new[]
{
new TestIndexField { Name = "id", EnableSorting = true, Type = "Number" },
new TestIndexField { Name = "nodeName", EnableSorting = true },
new TestIndexField { Name = "updateDate", EnableSorting = true, Type = "DateTime" },
new TestIndexField { Name = "writerName" },
new TestIndexField { Name = "path" },
new TestIndexField { Name = "nodeTypeAlias" },
new TestIndexField { Name = "parentID" }
},
new[]
{
new TestIndexField { Name = "headerText" },
new TestIndexField { Name = "bodyText" },
new TestIndexField { Name = "metaDescription" },
new TestIndexField { Name = "metaKeywords" },
new TestIndexField { Name = "bodyTextColOne" },
new TestIndexField { Name = "bodyTextColTwo" },
new TestIndexField { Name = "xmlStorageTest" }
},
new[]
{
"CWS_Home",
"CWS_Textpage",
"CWS_TextpageTwoCol",
"CWS_NewsEventsList",
"CWS_NewsItem",
"CWS_Gallery",
"CWS_EventItem",
"Image",
},
new string[] { },
-1),
luceneDir, //custom lucene directory
new TestDataService(),
new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29),
false);
//i.IndexSecondsInterval = 1;
i.IndexingError += IndexingError;
return i;
}
public static UmbracoExamineSearcher GetUmbracoSearcher(Lucene.Net.Store.Directory luceneDir)
{
return new UmbracoExamineSearcher(luceneDir, new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29));
}
//public static SimpleDataIndexer GetSimpleIndexer(Lucene.Net.Store.Directory luceneDir)
//{
// var i = new SimpleDataIndexer(new IndexCriteria(
// new IIndexField[] { },
// new[]
// {
// new TestIndexField { Name = "Author" },
// new TestIndexField { Name = "DateCreated", EnableSorting = true, Type = "DateTime" },
// new TestIndexField { Name = "Title" },
// new TestIndexField { Name = "Photographer" },
// new TestIndexField { Name = "YearCreated", Type = "Date.Year" },
// new TestIndexField { Name = "MonthCreated", Type = "Date.Month" },
// new TestIndexField { Name = "DayCreated", Type = "Date.Day" },
// new TestIndexField { Name = "HourCreated", Type = "Date.Hour" },
// new TestIndexField { Name = "MinuteCreated", Type = "Date.Minute" },
// new TestIndexField { Name = "SomeNumber", Type = "Number" },
// new TestIndexField { Name = "SomeFloat", Type = "Float" },
// new TestIndexField { Name = "SomeDouble", Type = "Double" },
// new TestIndexField { Name = "SomeLong", Type = "Long" }
// },
// new string[] { },
// new string[] { },
// -1),
// luceneDir,
// new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29),
// new TestSimpleDataProvider(),
// new[] { "Documents", "Pictures" },
// false);
// i.IndexingError += IndexingError;
// return i;
//}
public static LuceneSearcher GetLuceneSearcher(Lucene.Net.Store.Directory luceneDir)
{
return new LuceneSearcher(luceneDir, new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29));
}
//public static PDFIndexer GetPdfIndexer(Lucene.Net.Store.Directory luceneDir)
//{
// var i = new PDFIndexer(luceneDir,
// new TestDataService(),
// new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29),
// false);
// i.IndexingError += IndexingError;
// return i;
//}
public static MultiIndexSearcher GetMultiSearcher(Lucene.Net.Store.Directory pdfDir, Lucene.Net.Store.Directory simpleDir, Lucene.Net.Store.Directory conventionDir, Lucene.Net.Store.Directory cwsDir)
{
var i = new MultiIndexSearcher(new[] { pdfDir, simpleDir, conventionDir, cwsDir }, new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29));
return i;
}
internal static void IndexingError(object sender, IndexingErrorEventArgs e)
{
throw new ApplicationException(e.Message, e.InnerException);
}
}
}

View File

@@ -0,0 +1,92 @@
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Xml.Linq;
using System.Xml.XPath;
using UmbracoExamine;
using UmbracoExamine.DataServices;
namespace Umbraco.Tests.UmbracoExamine
{
/// <summary>
/// A mock data service used to return content from the XML data file created with CWS
/// </summary>
public class TestContentService : IContentService
{
public const int ProtectedNode = 1142;
public TestContentService()
{
_xDoc = XDocument.Parse(TestFiles.umbraco);
}
#region IContentService Members
/// <summary>
/// Return the XDocument containing the xml from the umbraco.config xml file
/// </summary>
/// <param name="xpath"></param>
/// <returns></returns>
/// <remarks>
/// This is no different in the test suite as published content
/// </remarks>
public XDocument GetLatestContentByXPath(string xpath)
{
var xdoc = XDocument.Parse("<content></content>");
xdoc.Root.Add(_xDoc.XPathSelectElements(xpath));
return xdoc;
}
/// <summary>
/// Return the XDocument containing the xml from the umbraco.config xml file
/// </summary>
/// <param name="xpath"></param>
/// <returns></returns>
public XDocument GetPublishedContentByXPath(string xpath)
{
var xdoc = XDocument.Parse("<content></content>");
xdoc.Root.Add(_xDoc.XPathSelectElements(xpath));
return xdoc;
}
public string StripHtml(string value)
{
const string pattern = @"<(.|\n)*?>";
return Regex.Replace(value, pattern, string.Empty);
}
public bool IsProtected(int nodeId, string path)
{
// single node is marked as protected for test indexer
// hierarchy is not important for this test
return nodeId == ProtectedNode;
}
public IEnumerable<string> GetAllUserPropertyNames()
{
return GetPublishedContentByXPath("//*[count(@id)>0]")
.Root
.Elements()
.Select(x => x.Name.LocalName)
.ToList();
}
public IEnumerable<string> GetAllSystemPropertyNames()
{
return UmbracoContentIndexer.IndexFieldPolicies.Select(x => x.Key);
}
#endregion
private readonly XDocument _xDoc;
}
}

View File

@@ -0,0 +1,32 @@
using System.IO;
using Umbraco.Tests.TestHelpers;
using UmbracoExamine.DataServices;
namespace Umbraco.Tests.UmbracoExamine
{
public class TestDataService : IDataService
{
public TestDataService()
{
ContentService = new TestContentService();
LogService = new TestLogService();
MediaService = new TestMediaService();
}
#region IDataService Members
public IContentService ContentService { get; private set; }
public ILogService LogService { get; private set; }
public IMediaService MediaService { get; private set; }
public string MapPath(string virtualPath)
{
return new DirectoryInfo(TestHelper.CurrentAssemblyDirectory) + "\\" + virtualPath.Replace("/", "\\");
}
#endregion
}
}

View File

@@ -8,7 +8,7 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace Umbraco.Tests.TestHelpers.ExamineHelpers {
namespace Umbraco.Tests.UmbracoExamine {
using System;
@@ -22,14 +22,14 @@ namespace Umbraco.Tests.TestHelpers.ExamineHelpers {
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class ExamineResources {
internal class TestFiles {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal ExamineResources() {
internal TestFiles() {
}
/// <summary>
@@ -39,7 +39,7 @@ namespace Umbraco.Tests.TestHelpers.ExamineHelpers {
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Umbraco.Tests.TestHelpers.ExamineHelpers.ExamineResources", typeof(ExamineResources).Assembly);
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Umbraco.Tests.UmbracoExamine.TestFiles", typeof(TestFiles).Assembly);
resourceMan = temp;
}
return resourceMan;
@@ -65,7 +65,7 @@ namespace Umbraco.Tests.TestHelpers.ExamineHelpers {
///&lt;media&gt;
/// &lt;node id=&quot;1111&quot; version=&quot;902e13f7-5793-482a-9e06-cd94eebd1de0&quot; parentID=&quot;-1&quot; level=&quot;1&quot; writerID=&quot;0&quot; nodeType=&quot;1031&quot; template=&quot;0&quot; sortOrder=&quot;2&quot; createDate=&quot;2010-05-19T15:26:08&quot; updateDate=&quot;2010-05-19T15:26:09&quot; nodeName=&quot;Product Images&quot; urlName=&quot;productimages&quot; writerName=&quot;Administrator&quot; nodeTypeAlias=&quot;Folder&quot; path=&quot;-1,1111&quot;&gt;
/// &lt;data alias=&quot;contents&quot;&gt;&lt;/data&gt;
/// &lt;node id=&quot;2222&quot; version=&quot;902e13f7-5793-482a-9e06-cd94eebd1de0&quot; parentID=&quot;-1&quot; level=&quot;1&quot; writerID=&quot;0&quot; [rest of string was truncated]&quot;;.
/// &lt;node id=&quot;2222&quot; version=&quot;902e13f7-5793-482a-9e06-cd94eebd1de0&quot; parentID=&quot;1111&quot; level=&quot;1&quot; writerID=&quot;0 [rest of string was truncated]&quot;;.
/// </summary>
internal static string media {
get {
@@ -75,20 +75,20 @@ namespace Umbraco.Tests.TestHelpers.ExamineHelpers {
/// <summary>
/// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
///&lt;!DOCTYPE root[
/// &lt;!ELEMENT CWS_Contact ANY&gt;
/// &lt;!ATTLIST CWS_Contact id ID #REQUIRED&gt;
/// &lt;!ELEMENT CWS_EmailAFriend ANY&gt;
/// &lt;!ATTLIST CWS_EmailAFriend id ID #REQUIRED&gt;
/// &lt;!ELEMENT CWS_EventItem ANY&gt;
/// &lt;!ATTLIST CWS_EventItem id ID #REQUIRED&gt;
/// &lt;!ELEMENT CWS_Galleries ANY&gt;
/// &lt;!ATTLIST CWS_Galleries id ID #REQUIRED&gt;
/// &lt;!ELEMENT CWS_Gallery ANY&gt;
/// &lt;!ATTLIST CWS_Gallery id ID #REQUIRED&gt;
/// &lt;!ELEMENT CWS_Home ANY&gt;
/// &lt;!ATTLIST CWS_Home id ID #REQUIRED&gt;
/// &lt;!ELEMENT CWS_NewsEven [rest of string was truncated]&quot;;.
///&lt;!DOCTYPE root[
///&lt;!ELEMENT CWS_Contact ANY&gt;
///&lt;!ATTLIST CWS_Contact id ID #REQUIRED&gt;
///&lt;!ELEMENT CWS_EmailAFriend ANY&gt;
///&lt;!ATTLIST CWS_EmailAFriend id ID #REQUIRED&gt;
///&lt;!ELEMENT CWS_EventItem ANY&gt;
///&lt;!ATTLIST CWS_EventItem id ID #REQUIRED&gt;
///&lt;!ELEMENT CWS_Galleries ANY&gt;
///&lt;!ATTLIST CWS_Galleries id ID #REQUIRED&gt;
///&lt;!ELEMENT CWS_Gallery ANY&gt;
///&lt;!ATTLIST CWS_Gallery id ID #REQUIRED&gt;
///&lt;!ELEMENT CWS_Home ANY&gt;
///&lt;!ATTLIST CWS_Home id ID #REQUIRED&gt;
///&lt;!ELEMENT CWS_NewsEventsList ANY&gt; /// [rest of string was truncated]&quot;;.
/// </summary>
internal static string umbraco {
get {

View File

@@ -119,9 +119,9 @@
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="media" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>media.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
<value>testfiles\media.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="umbraco" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>umbraco.config;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
<value>testfiles\umbraco.config;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
</root>

View File

@@ -17,7 +17,7 @@
<data alias="umbracoBytes">10726</data>
<data alias="umbracoExtension">jpg</data>
</node>
</node>
</node>
</node>
<node id="1113" version="5b3e46ab-3e37-4cfa-ab70-014234b5bd39" parentID="1111" level="2" writerID="0" nodeType="1032" template="0" sortOrder="1" createDate="2010-05-19T17:32:46" updateDate="2010-05-19T17:32:46" nodeName="Acne Stress Scrub" urlName="acnestressscrub" writerName="Administrator" nodeTypeAlias="File" path="-1,1111,1113">
<data alias="umbracoFile"><![CDATA[/App_Data/VS2010CSharp.pdf]]></data>

View File

@@ -0,0 +1,11 @@
using Examine;
namespace Umbraco.Tests.UmbracoExamine
{
public class TestIndexField : IIndexField
{
public string Name { get; set; }
public bool EnableSorting { get; set; }
public string Type { get; set; }
}
}

View File

@@ -0,0 +1,43 @@
using System.Diagnostics;
using UmbracoExamine;
using UmbracoExamine.DataServices;
namespace Umbraco.Tests.UmbracoExamine
{
public class TestLogService : ILogService
{
#region ILogService Members
public string ProviderName { get; set; }
public void AddErrorLog(int nodeId, string msg)
{
Trace.WriteLine("ERROR: (" + nodeId.ToString() + ") " + msg);
}
public void AddInfoLog(int nodeId, string msg)
{
Trace.WriteLine("INFO: (" + nodeId.ToString() + ") " + msg);
}
public void AddVerboseLog(int nodeId, string msg)
{
if (LogLevel == LoggingLevel.Verbose)
Trace.WriteLine("VERBOSE: (" + nodeId.ToString() + ") " + msg);
}
public LoggingLevel LogLevel
{
get
{
return LoggingLevel.Verbose;
}
set
{
//do nothing
}
}
#endregion
}
}

View File

@@ -0,0 +1,33 @@
using System;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using System.Xml.XPath;
using Umbraco.Tests.TestHelpers;
using UmbracoExamine.DataServices;
namespace Umbraco.Tests.UmbracoExamine
{
public class TestMediaService : IMediaService
{
public TestMediaService()
{
m_Doc = XDocument.Parse(TestFiles.media);
}
#region IMediaService Members
public System.Xml.Linq.XDocument GetLatestMediaByXpath(string xpath)
{
var xdoc = XDocument.Parse("<media></media>");
xdoc.Root.Add(m_Doc.XPathSelectElements(xpath));
return xdoc;
}
#endregion
private XDocument m_Doc;
}
}