Merge with 4.10.0
This commit is contained in:
@@ -41,7 +41,7 @@ namespace Umbraco.Core
|
||||
/// <summary>
|
||||
/// Represents an unsuccessful parse operation
|
||||
/// </summary>
|
||||
public static readonly Attempt<T> False;
|
||||
public static readonly Attempt<T> False = new Attempt<T>(false, default(T));
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Attempt{T}"/> struct.
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace Umbraco.Core.Configuration
|
||||
get
|
||||
{
|
||||
return ConfigurationManager.AppSettings.ContainsKey("umbracoPath")
|
||||
? ConfigurationManager.AppSettings["umbracoPath"]
|
||||
? IOHelper.ResolveUrl(ConfigurationManager.AppSettings["umbracoPath"])
|
||||
: string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,12 +115,11 @@ namespace Umbraco.Core
|
||||
PluginManager.Current.ResolveMacroPropertyTypes());
|
||||
|
||||
PropertyEditorValueConvertersResolver.Current = new PropertyEditorValueConvertersResolver(
|
||||
new []
|
||||
{
|
||||
typeof(DatePickerPropertyEditorValueConverter),
|
||||
typeof(TinyMcePropertyEditorValueConverter),
|
||||
typeof(YesNoPropertyEditorValueConverter)
|
||||
});
|
||||
PluginManager.Current.ResolvePropertyEditorValueConverters());
|
||||
//add the internal ones, these are not public currently so need to add them manually
|
||||
PropertyEditorValueConvertersResolver.Current.AddType<DatePickerPropertyEditorValueConverter>();
|
||||
PropertyEditorValueConvertersResolver.Current.AddType<TinyMcePropertyEditorValueConverter>();
|
||||
PropertyEditorValueConvertersResolver.Current.AddType<YesNoPropertyEditorValueConverter>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ using System.Web;
|
||||
|
||||
namespace Umbraco.Core.Dynamics
|
||||
{
|
||||
internal class DynamicXml : DynamicObject, IEnumerable
|
||||
public class DynamicXml : DynamicObject, IEnumerable
|
||||
{
|
||||
public XElement BaseElement { get; set; }
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ using System.Text;
|
||||
using System.Threading;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using umbraco.interfaces;
|
||||
|
||||
namespace Umbraco.Core
|
||||
@@ -68,6 +69,15 @@ namespace Umbraco.Core
|
||||
return ResolveTypes<ICacheRefresher>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all available IPropertyEditorValueConverter
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
internal IEnumerable<Type> ResolvePropertyEditorValueConverters()
|
||||
{
|
||||
return ResolveTypes<IPropertyEditorValueConverter>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all available IDataType in application
|
||||
/// </summary>
|
||||
|
||||
@@ -3,11 +3,8 @@ using Umbraco.Core.Dynamics;
|
||||
|
||||
namespace Umbraco.Core.PropertyEditors
|
||||
{
|
||||
internal interface IPropertyEditorValueConverter
|
||||
public interface IPropertyEditorValueConverter
|
||||
{
|
||||
//TODO: SD: I thinnk this should only support propertyEditorId since I see no reason why we would want
|
||||
// type converters specifically for docTypeAlias of property Alias!
|
||||
// need to ask Gareth about his original intention.
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this converter can perform the value conversion for the specified property editor id
|
||||
|
||||
58
src/Umbraco.Tests/DynamicDocument/DynamicXmlTests.cs
Normal file
58
src/Umbraco.Tests/DynamicDocument/DynamicXmlTests.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
using Microsoft.CSharp.RuntimeBinder;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core.Dynamics;
|
||||
|
||||
namespace Umbraco.Tests.DynamicDocument
|
||||
{
|
||||
[TestFixture]
|
||||
public class DynamicXmlTests
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Test the current Core class
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void Find_Test_Core_Class()
|
||||
{
|
||||
RunFindTest(x => new DynamicXml(x));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests the macroEngines legacy class
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void Find_Test_Legacy_Class()
|
||||
{
|
||||
RunFindTest(x => new global::umbraco.MacroEngines.DynamicXml(x));
|
||||
}
|
||||
|
||||
private void RunFindTest(Func<string, dynamic> getDynamicXml)
|
||||
{
|
||||
var xmlstring = @"<test>
|
||||
<item id='1' name='test 1' value='found 1'/>
|
||||
<item id='2' name='test 2' value='found 2'/>
|
||||
<item id='3' name='test 3' value='found 3'/>
|
||||
</test>";
|
||||
|
||||
dynamic dXml = getDynamicXml(xmlstring);
|
||||
|
||||
var result1 = dXml.Find("@name", "test 1");
|
||||
var result2 = dXml.Find("@name", "test 2");
|
||||
var result3 = dXml.Find("@name", "test 3");
|
||||
var result4 = dXml.Find("@name", "dont find");
|
||||
|
||||
Assert.AreEqual("found 1", result1.value);
|
||||
Assert.AreEqual("found 2", result2.value);
|
||||
Assert.AreEqual("found 3", result3.value);
|
||||
Assert.Throws<RuntimeBinderException>(() =>
|
||||
{
|
||||
//this will throw because result4 is not found
|
||||
var temp = result4.value;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
362
src/Umbraco.Tests/DynamicDocument/StronglyTypedQueryTests.cs
Normal file
362
src/Umbraco.Tests/DynamicDocument/StronglyTypedQueryTests.cs
Normal file
@@ -0,0 +1,362 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Tests.TestHelpers;
|
||||
using Umbraco.Web;
|
||||
|
||||
namespace Umbraco.Tests.DynamicDocument
|
||||
{
|
||||
[TestFixture]
|
||||
public class StronglyTypedQueryTests : BaseWebTest
|
||||
{
|
||||
protected override bool RequiresDbSetup
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
protected override string GetXmlContent(int templateId)
|
||||
{
|
||||
return @"<?xml version=""1.0"" encoding=""utf-8""?>
|
||||
<!DOCTYPE root[
|
||||
<!ELEMENT Home ANY>
|
||||
<!ATTLIST Home id ID #REQUIRED>
|
||||
<!ELEMENT NewsArticle ANY>
|
||||
<!ATTLIST NewsArticle id ID #REQUIRED>
|
||||
<!ELEMENT NewsLandingPage ANY>
|
||||
<!ATTLIST NewsLandingPage id ID #REQUIRED>
|
||||
<!ELEMENT ContentPage ANY>
|
||||
<!ATTLIST ContentPage id ID #REQUIRED>
|
||||
]>
|
||||
<root id=""-1"">
|
||||
<Home id=""1"" parentID=""-1"" level=""1"" writerID=""0"" creatorID=""0"" nodeType=""10"" template=""" + templateId + @""" sortOrder=""1"" createDate=""2012-06-12T14:13:17"" updateDate=""2012-07-20T18:50:43"" nodeName=""Home"" urlName=""home"" writerName=""admin"" creatorName=""admin"" path=""-1,1"" isDoc="""">
|
||||
<siteName><![CDATA[Test site]]></siteName>
|
||||
<siteDescription><![CDATA[this is a test site]]></siteDescription>
|
||||
<bodyContent><![CDATA[This is some body content on the home page]]></bodyContent>
|
||||
<NewsLandingPage id=""2"" parentID=""1"" level=""2"" writerID=""0"" creatorID=""0"" nodeType=""11"" template=""" + templateId + @""" sortOrder=""2"" createDate=""2012-07-20T18:06:45"" updateDate=""2012-07-20T19:07:31"" nodeName=""news"" urlName=""news"" writerName=""admin"" creatorName=""admin"" path=""-1,1,2"" isDoc="""">
|
||||
<bodyContent><![CDATA[This is some body content on the news landing page]]></bodyContent>
|
||||
<pageTitle><![CDATA[page2/alias, 2ndpagealias]]></pageTitle>
|
||||
<NewsArticle id=""3"" parentID=""2"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""12"" template=""" + templateId + @""" sortOrder=""2"" createDate=""2012-07-20T18:07:54"" updateDate=""2012-07-20T19:10:27"" nodeName=""Something happened"" urlName=""something-happened"" writerName=""admin"" creatorName=""admin"" path=""-1,1,2,3"" isDoc="""">
|
||||
<articleContent><![CDATA[Some cool stuff happened today]]></articleContent>
|
||||
<articleDate><![CDATA[2012-01-02 12:33:44]]></articleDate>
|
||||
<articleAuthor><![CDATA[John doe]]></articleAuthor>
|
||||
</NewsArticle>
|
||||
<NewsArticle id=""4"" parentID=""2"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""12"" template=""" + templateId + @""" sortOrder=""3"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Then another thing"" urlName=""then-another-thing"" writerName=""admin"" creatorName=""admin"" path=""-1,1,2,4"" isDoc="""">
|
||||
<articleContent><![CDATA[Today, other cool things occurred]]></articleContent>
|
||||
<articleDate><![CDATA[2012-01-03 15:33:44]]></articleDate>
|
||||
<articleAuthor><![CDATA[John Smith]]></articleAuthor>
|
||||
</NewsArticle>
|
||||
</NewsLandingPage>
|
||||
<ContentPage id=""5"" parentID=""1"" level=""2"" writerID=""0"" creatorID=""0"" nodeType=""13"" template=""" + templateId + @""" sortOrder=""4"" createDate=""2012-07-16T15:26:59"" updateDate=""2012-07-18T14:23:35"" nodeName=""First Content Page"" urlName=""content-page-1"" writerName=""admin"" creatorName=""admin"" path=""-1,1,5"" isDoc="""">
|
||||
<bodyContent><![CDATA[This is some body content on the first content page]]></bodyContent>
|
||||
</ContentPage>
|
||||
<ContentPage id=""6"" parentID=""1"" level=""2"" writerID=""0"" creatorID=""0"" nodeType=""13"" template=""" + templateId + @""" sortOrder=""4"" createDate=""2012-07-16T15:26:59"" updateDate=""2012-07-16T14:23:35"" nodeName=""Second Content Page"" urlName=""content-page-2"" writerName=""admin"" creatorName=""admin"" path=""-1,1,6"" isDoc="""">
|
||||
<bodyContent><![CDATA[This is some body content on the second content page]]></bodyContent>
|
||||
</ContentPage>
|
||||
</Home>
|
||||
</root>";
|
||||
}
|
||||
|
||||
internal IPublishedContent GetNode(int id)
|
||||
{
|
||||
var ctx = GetUmbracoContext("/test", 1234);
|
||||
var contentStore = new DefaultPublishedContentStore();
|
||||
var doc = contentStore.GetDocumentById(ctx, id);
|
||||
Assert.IsNotNull(doc);
|
||||
return doc;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Type_Test()
|
||||
{
|
||||
var doc = GetNode(1);
|
||||
var result = doc.NewsArticles(TraversalType.Descendants).ToArray();
|
||||
Assert.AreEqual("John doe", result[0].ArticleAuthor);
|
||||
Assert.AreEqual("John Smith", result[1].ArticleAuthor);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void As_Test()
|
||||
{
|
||||
var doc = GetNode(1);
|
||||
var result = doc.AsHome();
|
||||
Assert.AreEqual("Test site", result.SiteName);
|
||||
|
||||
Assert.Throws<InvalidOperationException>(() => doc.AsContentPage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//NOTE: Some of these class will be moved in to the core once all this is working the way we want
|
||||
|
||||
#region Gen classes & supporting classes
|
||||
|
||||
//TOOD: SD: This class could be the way that the UmbracoHelper deals with looking things up in the background, we might not
|
||||
// even expose it publicly but it could handle any caching (per request) that might be required when looking up any objects...
|
||||
// though we might not need it at all, not sure yet.
|
||||
// However, what we need to do is implement the GetDocumentsByType method of the IPublishedStore, see the TODO there.
|
||||
// It might be nicer to have a QueryContext on the UmbracoHelper (we can still keep the Content and TypedContent, etc...
|
||||
// methods, but these would just wrap the QueryContext attached to it. Other methods on the QueryContext will be
|
||||
// ContentByType, TypedContentByType, etc... then we can also have extension methods like below for strongly typed
|
||||
// access like: GetAllHomes, GetAllNewsArticles, etc...
|
||||
|
||||
//public class QueryDataContext
|
||||
//{
|
||||
// private readonly IPublishedContentStore _contentStore;
|
||||
// private readonly UmbracoContext _umbracoContext;
|
||||
|
||||
// internal QueryDataContext(IPublishedContentStore contentStore, UmbracoContext umbracoContext)
|
||||
// {
|
||||
// _contentStore = contentStore;
|
||||
// _umbracoContext = umbracoContext;
|
||||
// }
|
||||
|
||||
// public IPublishedContent GetDocumentById(int id)
|
||||
// {
|
||||
// return _contentStore.GetDocumentById(_umbracoContext, id);
|
||||
// }
|
||||
|
||||
// public IEnumerable<IPublishedContent> GetByDocumentType(string alias)
|
||||
// {
|
||||
|
||||
// }
|
||||
//}
|
||||
|
||||
public enum TraversalType
|
||||
{
|
||||
Children,
|
||||
Ancestors,
|
||||
AncestorsOrSelf,
|
||||
Descendants,
|
||||
DescendantsOrSelf
|
||||
}
|
||||
|
||||
public static class StronglyTypedQueryExtensions
|
||||
{
|
||||
private static IEnumerable<IPublishedContent> GetEnumerable(this IPublishedContent content, string docTypeAlias, TraversalType traversalType = TraversalType.Children)
|
||||
{
|
||||
switch (traversalType)
|
||||
{
|
||||
case TraversalType.Children:
|
||||
return content.Children.Where(x => x.DocumentTypeAlias == docTypeAlias);
|
||||
case TraversalType.Ancestors:
|
||||
return content.Ancestors().Where(x => x.DocumentTypeAlias == docTypeAlias);
|
||||
case TraversalType.AncestorsOrSelf:
|
||||
return content.AncestorsOrSelf().Where(x => x.DocumentTypeAlias == docTypeAlias);
|
||||
case TraversalType.Descendants:
|
||||
return content.Descendants().Where(x => x.DocumentTypeAlias == docTypeAlias);
|
||||
case TraversalType.DescendantsOrSelf:
|
||||
return content.DescendantsOrSelf().Where(x => x.DocumentTypeAlias == docTypeAlias);
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException("traversalType");
|
||||
}
|
||||
}
|
||||
|
||||
private static T AsDocumentType<T>(this IPublishedContent content, string alias, Func<IPublishedContent, T> creator)
|
||||
{
|
||||
if (content.DocumentTypeAlias == alias) return creator(content);
|
||||
throw new InvalidOperationException("The content type cannot be cast to " + typeof(T).FullName + " since it is type: " + content.DocumentTypeAlias);
|
||||
}
|
||||
|
||||
public static HomeContentItem AsHome(this IPublishedContent content)
|
||||
{
|
||||
return content.AsDocumentType("Home", x => new HomeContentItem(x));
|
||||
}
|
||||
|
||||
public static IEnumerable<HomeContentItem> Homes(this IPublishedContent content, TraversalType traversalType = TraversalType.Children)
|
||||
{
|
||||
return content.GetEnumerable("Home", traversalType).Select(x => new HomeContentItem(x));
|
||||
}
|
||||
|
||||
public static NewsArticleContentItem AsNewsArticle(this IPublishedContent content)
|
||||
{
|
||||
return content.AsDocumentType("NewsArticle", x => new NewsArticleContentItem(x));
|
||||
}
|
||||
|
||||
public static IEnumerable<NewsArticleContentItem> NewsArticles(this IPublishedContent content, TraversalType traversalType = TraversalType.Children)
|
||||
{
|
||||
return content.GetEnumerable("NewsArticle", traversalType).Select(x => new NewsArticleContentItem(x));
|
||||
}
|
||||
|
||||
public static NewsLandingPageContentItem AsNewsLandingPage(this IPublishedContent content)
|
||||
{
|
||||
return content.AsDocumentType("NewsLandingPage", x => new NewsLandingPageContentItem(x));
|
||||
}
|
||||
|
||||
public static IEnumerable<NewsLandingPageContentItem> NewsLandingPages(this IPublishedContent content, TraversalType traversalType = TraversalType.Children)
|
||||
{
|
||||
return content.GetEnumerable("NewsLandingPage", traversalType).Select(x => new NewsLandingPageContentItem(x));
|
||||
}
|
||||
|
||||
public static ContentPageContentItem AsContentPage(this IPublishedContent content)
|
||||
{
|
||||
return content.AsDocumentType("ContentPage", x => new ContentPageContentItem(x));
|
||||
}
|
||||
|
||||
public static IEnumerable<ContentPageContentItem> ContentPages(this IPublishedContent content, TraversalType traversalType = TraversalType.Children)
|
||||
{
|
||||
return content.GetEnumerable("ContentPage", traversalType).Select(x => new ContentPageContentItem(x));
|
||||
}
|
||||
}
|
||||
|
||||
public class PublishedContentWrapper : IPublishedContent
|
||||
{
|
||||
protected IPublishedContent WrappedContent { get; private set; }
|
||||
|
||||
public PublishedContentWrapper(IPublishedContent content)
|
||||
{
|
||||
WrappedContent = content;
|
||||
}
|
||||
|
||||
public IPublishedContent Parent
|
||||
{
|
||||
get { return WrappedContent.Parent; }
|
||||
}
|
||||
|
||||
public int Id
|
||||
{
|
||||
get { return WrappedContent.Id; }
|
||||
}
|
||||
public int TemplateId
|
||||
{
|
||||
get { return WrappedContent.TemplateId; }
|
||||
}
|
||||
public int SortOrder
|
||||
{
|
||||
get { return WrappedContent.SortOrder; }
|
||||
}
|
||||
public string Name
|
||||
{
|
||||
get { return WrappedContent.Name; }
|
||||
}
|
||||
public string UrlName
|
||||
{
|
||||
get { return WrappedContent.UrlName; }
|
||||
}
|
||||
public string DocumentTypeAlias
|
||||
{
|
||||
get { return WrappedContent.DocumentTypeAlias; }
|
||||
}
|
||||
public int DocumentTypeId
|
||||
{
|
||||
get { return WrappedContent.DocumentTypeId; }
|
||||
}
|
||||
public string WriterName
|
||||
{
|
||||
get { return WrappedContent.WriterName; }
|
||||
}
|
||||
public string CreatorName
|
||||
{
|
||||
get { return WrappedContent.CreatorName; }
|
||||
}
|
||||
public int WriterId
|
||||
{
|
||||
get { return WrappedContent.WriterId; }
|
||||
}
|
||||
public int CreatorId
|
||||
{
|
||||
get { return WrappedContent.CreatorId; }
|
||||
}
|
||||
public string Path
|
||||
{
|
||||
get { return WrappedContent.Path; }
|
||||
}
|
||||
public DateTime CreateDate
|
||||
{
|
||||
get { return WrappedContent.CreateDate; }
|
||||
}
|
||||
public DateTime UpdateDate
|
||||
{
|
||||
get { return WrappedContent.UpdateDate; }
|
||||
}
|
||||
public Guid Version
|
||||
{
|
||||
get { return WrappedContent.Version; }
|
||||
}
|
||||
public int Level
|
||||
{
|
||||
get { return WrappedContent.Level; }
|
||||
}
|
||||
public Collection<IPublishedContentProperty> Properties
|
||||
{
|
||||
get { return WrappedContent.Properties; }
|
||||
}
|
||||
public IEnumerable<IPublishedContent> Children
|
||||
{
|
||||
get { return WrappedContent.Children; }
|
||||
}
|
||||
public IPublishedContentProperty GetProperty(string alias)
|
||||
{
|
||||
return WrappedContent.GetProperty(alias);
|
||||
}
|
||||
}
|
||||
|
||||
public partial class HomeContentItem : ContentPageContentItem
|
||||
{
|
||||
public HomeContentItem(IPublishedContent content) : base(content)
|
||||
{
|
||||
}
|
||||
|
||||
public string SiteName
|
||||
{
|
||||
get { return WrappedContent.GetPropertyValue<string>("siteName"); }
|
||||
}
|
||||
public string SiteDescription
|
||||
{
|
||||
get { return WrappedContent.GetPropertyValue<string>("siteDescription"); }
|
||||
}
|
||||
}
|
||||
|
||||
public partial class NewsLandingPageContentItem : ContentPageContentItem
|
||||
{
|
||||
public NewsLandingPageContentItem(IPublishedContent content)
|
||||
: base(content)
|
||||
{
|
||||
}
|
||||
|
||||
public string PageTitle
|
||||
{
|
||||
get { return WrappedContent.GetPropertyValue<string>("pageTitle"); }
|
||||
}
|
||||
}
|
||||
|
||||
public partial class NewsArticleContentItem : PublishedContentWrapper
|
||||
{
|
||||
public NewsArticleContentItem(IPublishedContent content)
|
||||
: base(content)
|
||||
{
|
||||
}
|
||||
|
||||
public string ArticleContent
|
||||
{
|
||||
get { return WrappedContent.GetPropertyValue<string>("articleContent"); }
|
||||
}
|
||||
public DateTime ArticleDate
|
||||
{
|
||||
get { return WrappedContent.GetPropertyValue<DateTime>("articleDate"); }
|
||||
}
|
||||
public string ArticleAuthor
|
||||
{
|
||||
get { return WrappedContent.GetPropertyValue<string>("articleAuthor"); }
|
||||
}
|
||||
}
|
||||
|
||||
public partial class ContentPageContentItem : PublishedContentWrapper
|
||||
{
|
||||
public ContentPageContentItem(IPublishedContent content)
|
||||
: base(content)
|
||||
{
|
||||
}
|
||||
|
||||
public string BodyContent
|
||||
{
|
||||
get { return WrappedContent.GetPropertyValue<string>("bodyContent"); }
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -87,8 +87,10 @@
|
||||
<Compile Include="Configurations\FileSystemProviderTests.cs" />
|
||||
<Compile Include="Configurations\RepositorySettingsTests.cs" />
|
||||
<Compile Include="ContentStores\PublishMediaStoreTests.cs" />
|
||||
<Compile Include="DynamicDocument\DynamicXmlTests.cs" />
|
||||
<Compile Include="DynamicDocument\PublishedContentDataTableTests.cs" />
|
||||
<Compile Include="DynamicDocument\PublishedContentTests.cs" />
|
||||
<Compile Include="DynamicDocument\StronglyTypedQueryTests.cs" />
|
||||
<Compile Include="HtmlHelperExtensionMethodsTests.cs" />
|
||||
<Compile Include="IO\IOHelperTest.cs" />
|
||||
<Compile Include="LibraryTests.cs" />
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -19,7 +19,8 @@
|
||||
<add namespace="Umbraco.Web" />
|
||||
<add namespace="Umbraco.Core" />
|
||||
<add namespace="Umbraco.Core.Models" />
|
||||
</namespaces>
|
||||
<add namespace="Umbraco.Web.Mvc" />
|
||||
</namespaces>
|
||||
</pages>
|
||||
</system.web.webPages.razor>
|
||||
|
||||
|
||||
@@ -12,6 +12,15 @@ namespace Umbraco.Web.UI.Install.Steps.Skinning {
|
||||
|
||||
public partial class LoadStarterKits {
|
||||
|
||||
/// <summary>
|
||||
/// JsInclude1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::ClientDependency.Core.Controls.JsInclude JsInclude1;
|
||||
|
||||
/// <summary>
|
||||
/// LinkButton2 control.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="loadStarterKitDesigns.ascx.cs" Inherits="umbraco.presentation.install.steps.Skinning.loadStarterKitDesigns" %>
|
||||
<%@ Control Language="C#" AutoEventWireup="True" CodeBehind="LoadStarterKitDesigns.ascx.cs" Inherits="Umbraco.Web.UI.Install.Steps.Skinning.LoadStarterKitDesigns" %>
|
||||
<%@ Import Namespace="umbraco.cms.businesslogic.packager.repositories" %>
|
||||
|
||||
<asp:PlaceHolder ID="pl_loadStarterKitDesigns" runat="server">
|
||||
@@ -26,8 +26,8 @@
|
||||
<ItemTemplate>
|
||||
<li>
|
||||
<div class="image-hold">
|
||||
<img class="faik-mask" src="../umbraco_client/installer/images/bg-img.png" alt="image description" width="152" height="129">
|
||||
<img class="faik-mask-ie6" src="../umbraco_client/installer/images/bg-img-ie.png" alt="image description" width="201" height="178">
|
||||
<img class="faik-mask" src="<%=umbraco.GlobalSettings.ClientPath + "/installer/images/bg-img.png" %>" alt="image description" width="152" height="129">
|
||||
<img class="faik-mask-ie6" src="<%=umbraco.GlobalSettings.ClientPath + "/installer/images/bg-img-ie.png" %>" alt="image description" width="201" height="178">
|
||||
|
||||
<div class="image">
|
||||
<img class="zoom-img" src="<%# ((Skin)Container.DataItem).Thumbnail %>" alt="<%# ((Skin)Container.DataItem).Text %>" width="134" height="103">
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using umbraco.presentation.install.steps.Skinning;
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps.Skinning
|
||||
{
|
||||
public partial class LoadStarterKitDesigns : loadStarterKitDesigns
|
||||
{
|
||||
}
|
||||
}
|
||||
15
src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx.designer.cs
generated
Normal file
15
src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx.designer.cs
generated
Normal file
@@ -0,0 +1,15 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Umbraco.Web.UI.Install.Steps.Skinning {
|
||||
|
||||
|
||||
public partial class LoadStarterKitDesigns {
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="True" CodeBehind="LoadStarterKits.ascx.cs" Inherits="Umbraco.Web.UI.Install.Steps.Skinning.LoadStarterKits" %>
|
||||
<%@ Import Namespace="umbraco.cms.businesslogic.packager.repositories" %>
|
||||
<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %>
|
||||
|
||||
<asp:PlaceHolder ID="pl_loadStarterKits" runat="server">
|
||||
|
||||
<umb:JsInclude ID="JsInclude1" runat="server" FilePath="installer/js/PackageInstaller.js" PathNameAlias="UmbracoClient" />
|
||||
|
||||
<% if (!CannotConnect) { %>
|
||||
<script type="text/javascript">
|
||||
(function ($) {
|
||||
@@ -58,7 +61,7 @@
|
||||
|
||||
<li class="add-thanks">
|
||||
<asp:LinkButton runat="server" class="single-tab declineStarterKits" ID="declineStarterKits" OnClientClick="return confirm('Are you sure you do not want to install a starter kit?');" OnClick="NextStep">
|
||||
<img class="zoom-img" src="../umbraco_client/installer/images/btn-no-thanks.png" alt="image description" width="150" height="204">
|
||||
<img class="zoom-img" src="<%# umbraco.GlobalSettings.ClientPath + "/installer/images/btn-no-thanks.png" %>" alt="image description" width="150" height="204">
|
||||
</asp:LinkButton>
|
||||
|
||||
<em> </em>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="../../masterpages/umbracoPage.Master" Title="Install starter kit" CodeBehind="StarterKits.aspx.cs" Inherits="umbraco.presentation.umbraco.developer.Packages.StarterKits" %>
|
||||
<%@ Page Language="C#" AutoEventWireup="True" MasterPageFile="../../masterpages/umbracoPage.Master" Title="Install starter kit" CodeBehind="StarterKits.aspx.cs" Inherits="Umbraco.Web.UI.Umbraco.Developer.Packages.StarterKits" %>
|
||||
<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>
|
||||
<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %>
|
||||
|
||||
@@ -7,19 +7,33 @@
|
||||
<umb:JsInclude ID="JsInclude1" runat="server" FilePath="ui/jqueryui.js" PathNameAlias="UmbracoClient" />
|
||||
|
||||
<script type="text/javascript">
|
||||
function showProgress(button, elementId) {
|
||||
var img = document.getElementById(elementId);
|
||||
img.style.visibility = "visible";
|
||||
button.style.display = "none";
|
||||
|
||||
var percentComplete = 0;
|
||||
|
||||
jQuery(document).ready(function() {
|
||||
//bind to button click events
|
||||
jQuery("a.selectStarterKit").click(function() {
|
||||
jQuery(".progress-status").siblings(".install-dialog").hide();
|
||||
jQuery(".progress-status").show();
|
||||
});
|
||||
});
|
||||
|
||||
function updateProgressBar(percent) {
|
||||
percentComplete = percent;
|
||||
}
|
||||
function updateStatusMessage(message, error) {
|
||||
if (message != null && message != undefined) {
|
||||
jQuery(".progress-status").text(message + " (" + percentComplete + "%)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function InstallPackages(button, elementId) {
|
||||
showProgress(button, elementId);
|
||||
}
|
||||
</script>
|
||||
<style type="text/css">
|
||||
|
||||
.progress-status {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.add-thanks
|
||||
{
|
||||
position:absolute;
|
||||
@@ -48,16 +62,26 @@
|
||||
|
||||
<cc1:Pane id="StarterKitInstalled" Text="Install skin" runat="server">
|
||||
<h3>Available skins</h3>
|
||||
<p>You can choose from the following skins.</p>
|
||||
<asp:PlaceHolder ID="ph_skins" runat="server"></asp:PlaceHolder>
|
||||
<p>You can choose from the following skins.</p>
|
||||
<div class="progress-status">Please wait...</div>
|
||||
<div id="connectionError"></div>
|
||||
<div id="serverError"></div>
|
||||
<div class="install-dialog">
|
||||
<asp:PlaceHolder ID="ph_skins" runat="server"></asp:PlaceHolder>
|
||||
</div>
|
||||
</cc1:Pane>
|
||||
|
||||
|
||||
|
||||
<cc1:Pane id="StarterKitNotInstalled" Text="Install starter kit" runat="server">
|
||||
<h3>Available starter kits</h3>
|
||||
<p>You can choose from the following starter kits, each having specific functionality.</p>
|
||||
<asp:PlaceHolder ID="ph_starterkits" runat="server"></asp:PlaceHolder>
|
||||
<p>You can choose from the following starter kits, each having specific functionality.</p>
|
||||
<div class="progress-status">Please wait...</div>
|
||||
<div id="connectionError"></div>
|
||||
<div id="serverError"></div>
|
||||
<div class="install-dialog">
|
||||
<asp:PlaceHolder ID="ph_starterkits" runat="server"></asp:PlaceHolder>
|
||||
</div>
|
||||
</cc1:Pane>
|
||||
|
||||
<cc1:Pane id="installationCompleted" Text="Installation completed" runat="server" Visible="false">
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace Umbraco.Web.UI.Umbraco.Developer.Packages
|
||||
{
|
||||
public partial class StarterKits : global::umbraco.presentation.umbraco.developer.Packages.StarterKits
|
||||
{
|
||||
}
|
||||
}
|
||||
15
src/Umbraco.Web.UI/umbraco/developer/Packages/StarterKits.aspx.designer.cs
generated
Normal file
15
src/Umbraco.Web.UI/umbraco/developer/Packages/StarterKits.aspx.designer.cs
generated
Normal file
@@ -0,0 +1,15 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Umbraco.Web.UI.Umbraco.Developer.Packages {
|
||||
|
||||
|
||||
public partial class StarterKits {
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
<%@ Page Language="C#" MasterPageFile="../masterpages/umbracoDialog.Master" AutoEventWireup="true"
|
||||
CodeBehind="ExportCode.aspx.cs" Inherits="umbraco.presentation.umbraco.dialogs.ExportCode" %>
|
||||
|
||||
<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
|
||||
<style type="text/css">
|
||||
.label
|
||||
{
|
||||
width: 150px;
|
||||
float: left;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="server">
|
||||
<p id="pageName" style="text-align: center;">
|
||||
<%=
|
||||
umbraco.ui.GetText("exportDocumentTypeAsCode-Full")
|
||||
%>
|
||||
</p>
|
||||
<cc1:Pane ID="pane_language" runat="server">
|
||||
<em class="label">Generation Mode:</em>
|
||||
<asp:DropDownList ID="ddlGenerationMode" runat="server">
|
||||
<asp:ListItem Text="Plain Old CLR Objects (POCO) with abstractions" Value="abs" />
|
||||
<asp:ListItem Text="Plain Old CLR Objects (POCO)" Value="poco" />
|
||||
</asp:DropDownList>
|
||||
</cc1:Pane>
|
||||
<cc1:Pane ID="pane_contextName" runat="server">
|
||||
<div>
|
||||
<em class="label">DataContext Name:</em>
|
||||
<asp:TextBox ID="txtDataContextName" runat="server" Style="width: 180px;" Text="MyUmbraco" />
|
||||
</div>
|
||||
<div>
|
||||
<em class="label">Namespace:</em>
|
||||
<asp:TextBox ID="txtNamespace" runat="server" Style="width: 180px;" Text="MyUmbraco" />
|
||||
</div>
|
||||
</cc1:Pane>
|
||||
<asp:Panel ID="pnlButtons" runat="server" Style="margin-top: 10px;">
|
||||
<asp:Button ID="btnGenerate" runat="server" Text="Submit" OnClick="btnGenerate_Click"
|
||||
Style="margin-top: 14px" />
|
||||
<em>or </em><a href="#" style="color: Blue; margin-left: 6px;" onclick="UmbClientMgr.closeModalWindow()">
|
||||
<%=umbraco.ui.Text("cancel")%></a>
|
||||
</asp:Panel>
|
||||
<cc1:Pane ID="pane_files" runat="server" Visible="false">
|
||||
<p>
|
||||
<strong>Don't forget to change the extensions to .cs!</strong>
|
||||
</p>
|
||||
<asp:HyperLink ID="lnkPoco" runat="server" Text="POCO" Target="_blank" />
|
||||
<br />
|
||||
<asp:HyperLink ID="lnkAbstractions" runat="server" Text="Abstractions" Target="_blank" Enabled="false" />
|
||||
</cc1:Pane>
|
||||
</asp:Content>
|
||||
@@ -89,7 +89,7 @@ figure{display: block;}
|
||||
|
||||
.bg-main .color3 .bg-c { background:url(../images/bg-blog.jpg) no-repeat 50% 0;}
|
||||
/* Color 4 */
|
||||
.bg-main .color4 { background:#201c01 url(../images/bg-bhuiness-repeat.jpg) repeat-x;}
|
||||
.bg-main .color4 { background:#201c01 url(../images/bg-normal-repeat.jpg) repeat-x;}
|
||||
|
||||
.bg-main .color4 .bg-c { background:url(../images/bg-bhuiness.jpg) no-repeat 50% 0;}
|
||||
/* Color 5 */
|
||||
|
||||
@@ -30,7 +30,10 @@ function updateProgressBar(percent) {
|
||||
}
|
||||
|
||||
function updateStatusMessage(message, error) {
|
||||
jQuery(".loader > strong").text(message);
|
||||
if (message != null && message != undefined) {
|
||||
jQuery(".loader > strong").text(message);
|
||||
}
|
||||
|
||||
if (error != undefined) {
|
||||
jQuery(".loader").append("<p>" + error + "</p>");
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
tinyMCE.addI18n('en.example',{
|
||||
tinyMCE.addI18n('zh.example',{
|
||||
desc : '这是示例按钮'
|
||||
});
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
tinyMCE.addI18n('en.example_dlg',{
|
||||
tinyMCE.addI18n('zh.example_dlg',{
|
||||
title : '这是示例标题'
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tinyMCE.addI18n('en.embed_dlg', {
|
||||
tinyMCE.addI18n('zh.embed_dlg', {
|
||||
title: '嵌入第三方媒体',
|
||||
general: '普通',
|
||||
url: '链接:',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tinyMCE.addI18n('en.embed_dlg', {
|
||||
tinyMCE.addI18n('zh.embed_dlg', {
|
||||
title: '嵌入第三方媒体',
|
||||
general: '普通',
|
||||
url: '链接:',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tinyMCE.addI18n('en.umbimage_dlg', {
|
||||
tinyMCE.addI18n('zh.umbimage_dlg', {
|
||||
tab_general: '普通',
|
||||
tab_appearance: '外观',
|
||||
tab_advanced: '高级',
|
||||
|
||||
@@ -1 +1 @@
|
||||
tinyMCE.addI18n('en.advlink_dlg', { "target_name": "目标名称", classes: "类", style: "样式", id: "ID", "popup_position": "位置 (X/Y)", langdir: "语言书写方向", "popup_size": "尺寸", "popup_dependent": "依赖 (仅限Mozilla/Firefox)", "popup_resizable": "窗口大小可调", "popup_location": "显示地址栏", "popup_menubar": "显示菜单栏", "popup_toolbar": "显示工具栏", "popup_statusbar": "显示状态栏", "popup_scrollbars": "显示滚动条", "popup_return": "插入 \'return false\'", "popup_name": "窗口名称", "popup_url": "URL", popup: "JavaScript 弹出窗口", "target_blank": "在新窗口中打开", "target_top": "在顶部位置打开(替换掉所有Frames)", "target_parent": "在父级窗口或位置中打开", "target_same": "在该窗口或位置打开", "anchor_names": "锚点", "popup_opts": "选项", "advanced_props": "高级属性", "event_props": "事件", "popup_props": "弹窗属性", "general_props": "普通属性", "advanced_tab": "高级", "events_tab": "事件", "popup_tab": "弹窗", "general_tab": "普通", list: "链接列表", "is_external": "您输入的好像是外部链接,您是否想在前面添加http://?", "is_email": "您输入的好像是邮箱地址,您是否想在前面添加mailto:?", titlefield: "标题", target: "目标", url: "链接URL", title: "插入/编辑链接", "link_list": "链接列表", rtl: "从右到左", ltr: "从左到右", accesskey: "访问键", tabindex: "Tab索引", rev: "目标至页面关系", rel: "页面至目标关系", mime: "目标MIME类型", encoding: "目标语言编码", langcode: "语言代码", "target_langcode": "目标语言", width: "宽", height: "高" });
|
||||
tinyMCE.addI18n('zh.advlink_dlg', { "target_name": "目标名称", classes: "类", style: "样式", id: "ID", "popup_position": "位置 (X/Y)", langdir: "语言书写方向", "popup_size": "尺寸", "popup_dependent": "依赖 (仅限Mozilla/Firefox)", "popup_resizable": "窗口大小可调", "popup_location": "显示地址栏", "popup_menubar": "显示菜单栏", "popup_toolbar": "显示工具栏", "popup_statusbar": "显示状态栏", "popup_scrollbars": "显示滚动条", "popup_return": "插入 \'return false\'", "popup_name": "窗口名称", "popup_url": "URL", popup: "JavaScript 弹出窗口", "target_blank": "在新窗口中打开", "target_top": "在顶部位置打开(替换掉所有Frames)", "target_parent": "在父级窗口或位置中打开", "target_same": "在该窗口或位置打开", "anchor_names": "锚点", "popup_opts": "选项", "advanced_props": "高级属性", "event_props": "事件", "popup_props": "弹窗属性", "general_props": "普通属性", "advanced_tab": "高级", "events_tab": "事件", "popup_tab": "弹窗", "general_tab": "普通", list: "链接列表", "is_external": "您输入的好像是外部链接,您是否想在前面添加http://?", "is_email": "您输入的好像是邮箱地址,您是否想在前面添加mailto:?", titlefield: "标题", target: "目标", url: "链接URL", title: "插入/编辑链接", "link_list": "链接列表", rtl: "从右到左", ltr: "从左到右", accesskey: "访问键", tabindex: "Tab索引", rev: "目标至页面关系", rel: "页面至目标关系", mime: "目标MIME类型", encoding: "目标语言编码", langcode: "语言代码", "target_langcode": "目标语言", width: "宽", height: "高" });
|
||||
@@ -1,3 +1,3 @@
|
||||
tinyMCE.addI18n('en.umbracomacro',{
|
||||
tinyMCE.addI18n('zh.umbracomacro',{
|
||||
desc : '插入宏'
|
||||
});
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
tinyMCE.addI18n('en.example_dlg',{
|
||||
tinyMCE.addI18n('zh.example_dlg',{
|
||||
title : '这是示例标题'
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tinyMCE.addI18n('en.umbraco',{"underline_desc":"下划线 (Ctrl+U)",
|
||||
tinyMCE.addI18n('zh.umbraco',{"underline_desc":"下划线 (Ctrl+U)",
|
||||
"italic_desc":"斜体 (Ctrl+I)",
|
||||
"bold_desc":"粗体 (Ctrl+B)",
|
||||
dd:"定义描述",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tinyMCE.addI18n('en.umbraco_dlg', {"link_list":"链接列表",
|
||||
tinyMCE.addI18n('zh.umbraco_dlg', {"link_list":"链接列表",
|
||||
"link_is_external":"您输入的好像是外部链接,是否需要在前面添加 http://?",
|
||||
"link_is_email":"您输入的好像是邮箱地址,是否需要在前面添加mailto:?",
|
||||
"link_titlefield":"标题",
|
||||
|
||||
@@ -6,9 +6,17 @@ namespace Umbraco.Web
|
||||
/// <summary>
|
||||
/// Defines the methods for published documents
|
||||
/// </summary>
|
||||
public interface IPublishedStore
|
||||
internal interface IPublishedStore
|
||||
{
|
||||
IPublishedContent GetDocumentById(UmbracoContext umbracoContext, int nodeId);
|
||||
IEnumerable<IPublishedContent> GetRootDocuments(UmbracoContext umbracoContext);
|
||||
|
||||
//TODO: SD: We should make this happen! This will allow us to natively do a GetByDocumentType query
|
||||
// on the UmbracoHelper (or an internal DataContext that it uses, etc...)
|
||||
// One issue is that we need to make media work as fast as we can and need to create a ConvertFromMediaObject
|
||||
// method in the DefaultPublishedMediaStore, there's already a TODO noting this but in order to do that we'll
|
||||
// have to also use Examine as much as we can so we don't have to make db calls for looking up things like the
|
||||
// node type alias, etc... in order to populate the created IPublishedContent object.
|
||||
//IEnumerable<IPublishedContent> GetDocumentsByType(string docTypeAlias);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using Umbraco.Core.Models;
|
||||
|
||||
@@ -7,15 +8,43 @@ namespace Umbraco.Web.Models
|
||||
/// Represents the model for the current rendering page in Umbraco
|
||||
/// </summary>
|
||||
public class RenderModel
|
||||
{
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructor specifying both the IPublishedContent and the CultureInfo
|
||||
/// </summary>
|
||||
/// <param name="content"></param>
|
||||
/// <param name="culture"></param>
|
||||
public RenderModel(IPublishedContent content, CultureInfo culture)
|
||||
{
|
||||
if (content == null) throw new ArgumentNullException("content");
|
||||
if (culture == null) throw new ArgumentNullException("culture");
|
||||
Content = content;
|
||||
CurrentCulture = culture;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor to set the IPublishedContent and the CurrentCulture is set by the UmbracoContext
|
||||
/// </summary>
|
||||
/// <param name="content"></param>
|
||||
public RenderModel(IPublishedContent content)
|
||||
{
|
||||
if (content == null) throw new ArgumentNullException("content");
|
||||
if (UmbracoContext.Current == null)
|
||||
{
|
||||
throw new InvalidOperationException("Cannot construct a RenderModel without specifying a CultureInfo when no UmbracoContext has been initialized");
|
||||
}
|
||||
Content = content;
|
||||
CurrentCulture = UmbracoContext.Current.PublishedContentRequest.Culture;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the current IPublishedContent object
|
||||
/// </summary>
|
||||
public IPublishedContent Content { get; internal set; }
|
||||
public IPublishedContent Content { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the current Culture assigned to the page being rendered
|
||||
/// </summary>
|
||||
public CultureInfo CurrentCulture { get; internal set; }
|
||||
public CultureInfo CurrentCulture { get; private set; }
|
||||
}
|
||||
}
|
||||
@@ -66,11 +66,7 @@ namespace Umbraco.Web.Mvc
|
||||
throw new NullReferenceException("There is not current PublishedContentRequest, it must be initialized before the RenderRouteHandler executes");
|
||||
}
|
||||
|
||||
var renderModel = new RenderModel()
|
||||
{
|
||||
Content = docRequest.PublishedContent,
|
||||
CurrentCulture = docRequest.Culture
|
||||
};
|
||||
var renderModel = new RenderModel(docRequest.PublishedContent, docRequest.Culture);
|
||||
|
||||
//put essential data into the data tokens, the 'umbraco' key is required to be there for the view engine
|
||||
requestContext.RouteData.DataTokens.Add("umbraco", renderModel); //required for the RenderModelBinder
|
||||
|
||||
@@ -28,10 +28,37 @@ namespace Umbraco.Web.Mvc
|
||||
}
|
||||
}
|
||||
|
||||
protected override void SetViewData(System.Web.Mvc.ViewDataDictionary viewData)
|
||||
{
|
||||
//Here we're going to check if the viewData's model is of IPublishedContent, this is basically just a helper for
|
||||
//syntax on the front-end so we can just pass in an IPublishedContent object to partial views that inherit from
|
||||
//UmbracoTemplatePage. Then we're going to manually contruct a RenderViewModel to pass back in to SetViewData
|
||||
if (viewData.Model is IPublishedContent)
|
||||
{
|
||||
//change the model to a RenderModel and auto set the culture
|
||||
viewData.Model = new RenderModel((IPublishedContent)viewData.Model, UmbracoContext.PublishedContentRequest.Culture);
|
||||
}
|
||||
|
||||
base.SetViewData(viewData);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the a DynamicPublishedContent object
|
||||
/// </summary>
|
||||
public dynamic CurrentPage { get; private set; }
|
||||
public dynamic CurrentPage { get; private set; }
|
||||
|
||||
private UmbracoHelper _helper;
|
||||
|
||||
/// <summary>
|
||||
/// Gets an UmbracoHelper
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This ensures that the UmbracoHelper is constructed with the content model of this view
|
||||
/// </remarks>
|
||||
public override UmbracoHelper Umbraco
|
||||
{
|
||||
get { return _helper ?? (_helper = new UmbracoHelper(UmbracoContext, Model.Content)); }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -13,36 +13,40 @@ namespace Umbraco.Web.Mvc
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void InitializePage()
|
||||
{
|
||||
base.InitializePage();
|
||||
PublishedContentRequest = (PublishedContentRequest)ViewContext.RouteData.DataTokens.GetRequiredObject("umbraco-doc-request");
|
||||
UmbracoContext = (UmbracoContext)ViewContext.RouteData.DataTokens.GetRequiredObject("umbraco-context");
|
||||
ApplicationContext = UmbracoContext.Application;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the current UmbracoContext
|
||||
/// </summary>
|
||||
public UmbracoContext UmbracoContext { get; private set; }
|
||||
public UmbracoContext UmbracoContext
|
||||
{
|
||||
get { return (UmbracoContext) ViewContext.RouteData.DataTokens.GetRequiredObject("umbraco-context"); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the current ApplicationContext
|
||||
/// </summary>
|
||||
public ApplicationContext ApplicationContext { get; private set; }
|
||||
public ApplicationContext ApplicationContext
|
||||
{
|
||||
get { return UmbracoContext.Application; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the current PublishedContentRequest
|
||||
/// </summary>
|
||||
internal PublishedContentRequest PublishedContentRequest { get; private set; }
|
||||
internal PublishedContentRequest PublishedContentRequest
|
||||
{
|
||||
get { return (PublishedContentRequest)ViewContext.RouteData.DataTokens.GetRequiredObject("umbraco-doc-request"); }
|
||||
}
|
||||
|
||||
private UmbracoHelper _helper;
|
||||
|
||||
/// <summary>
|
||||
/// Gets an UmbracoHelper
|
||||
/// </summary>
|
||||
public UmbracoHelper Umbraco
|
||||
/// <remarks>
|
||||
/// This constructs the UmbracoHelper with the content model of the page routed to
|
||||
/// </remarks>
|
||||
public virtual UmbracoHelper Umbraco
|
||||
{
|
||||
get { return _helper ?? (_helper = new UmbracoHelper(UmbracoContext)); }
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
<add namespace="Umbraco.Web" />
|
||||
<add namespace="Umbraco.Core" />
|
||||
<add namespace="Umbraco.Core.Models" />
|
||||
<add namespace="Umbraco.Web.Mvc" />
|
||||
</namespaces>
|
||||
</pages>
|
||||
</system.web.webPages.razor>
|
||||
|
||||
@@ -341,6 +341,9 @@
|
||||
<Compile Include="umbraco.presentation\install\Default.aspx.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\install\steps\Skinning\loadStarterKitDesigns.ascx.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\install\steps\Skinning\loadStarterKits.ascx.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
@@ -348,6 +351,9 @@
|
||||
<Compile Include="umbraco.presentation\umbraco\developer\Macros\editMacro.aspx.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\developer\Packages\StarterKits.aspx.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\developer\Xslt\editXslt.aspx.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
@@ -449,13 +455,6 @@
|
||||
<Compile Include="umbraco.presentation\install\steps\skinning.ascx.designer.cs">
|
||||
<DependentUpon>skinning.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\install\steps\Skinning\loadStarterKitDesigns.ascx.cs">
|
||||
<DependentUpon>loadStarterKitDesigns.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\install\steps\Skinning\loadStarterKitDesigns.ascx.designer.cs">
|
||||
<DependentUpon>loadStarterKitDesigns.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\install\utills\FilePermissions.cs" />
|
||||
<Compile Include="umbraco.presentation\install\utills\Helper.cs" />
|
||||
<Compile Include="umbraco.presentation\install\utills\p.aspx.cs">
|
||||
@@ -814,13 +813,6 @@
|
||||
<Compile Include="umbraco.presentation\umbraco\dashboard\StartupDashboardVideos.ascx.designer.cs">
|
||||
<DependentUpon>StartupDashboardVideos.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\developer\Packages\StarterKits.aspx.cs">
|
||||
<DependentUpon>StarterKits.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\developer\Packages\StarterKits.aspx.designer.cs">
|
||||
<DependentUpon>StarterKits.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="umbraco.presentation\umbraco\developer\RelationTypes\EditRelationType.aspx.cs">
|
||||
<DependentUpon>EditRelationType.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
@@ -1867,7 +1859,6 @@
|
||||
</Content>
|
||||
<Content Include="umbraco.presentation\install\steps\renaming.ascx" />
|
||||
<Content Include="umbraco.presentation\install\steps\skinning.ascx" />
|
||||
<Content Include="umbraco.presentation\install\steps\Skinning\loadStarterKitDesigns.ascx" />
|
||||
<Content Include="umbraco.presentation\install\Title.ascx" />
|
||||
<Content Include="umbraco.presentation\install\utills\p.aspx">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
@@ -1886,7 +1877,6 @@
|
||||
<Content Include="umbraco.presentation\umbraco\dashboard\StartupDashboardIntro.ascx" />
|
||||
<Content Include="umbraco.presentation\umbraco\dashboard\StartupDashboardKits.ascx" />
|
||||
<Content Include="umbraco.presentation\umbraco\dashboard\StartupDashboardVideos.ascx" />
|
||||
<Content Include="umbraco.presentation\umbraco\developer\Packages\StarterKits.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\dialogs\TemplateSkinning.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\helpRedirect.aspx" />
|
||||
<Content Include="umbraco.presentation\umbraco\LiveEditing\Modules\SkinModule\CssParser.aspx" />
|
||||
|
||||
@@ -36,6 +36,22 @@ namespace Umbraco.Web
|
||||
private readonly UmbracoContext _umbracoContext;
|
||||
private readonly IPublishedContent _currentPage;
|
||||
|
||||
/// <summary>
|
||||
/// Custom constructor setting the current page to the parameter passed in
|
||||
/// </summary>
|
||||
/// <param name="umbracoContext"></param>
|
||||
/// <param name="content"></param>
|
||||
public UmbracoHelper(UmbracoContext umbracoContext, IPublishedContent content)
|
||||
: this(umbracoContext)
|
||||
{
|
||||
if (content == null) throw new ArgumentNullException("content");
|
||||
_currentPage = content;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Standard constructor setting the current page to the page that has been routed to
|
||||
/// </summary>
|
||||
/// <param name="umbracoContext"></param>
|
||||
public UmbracoHelper(UmbracoContext umbracoContext)
|
||||
{
|
||||
if (umbracoContext == null) throw new ArgumentNullException("umbracoContext");
|
||||
@@ -43,7 +59,7 @@ namespace Umbraco.Web
|
||||
_umbracoContext = umbracoContext;
|
||||
if (_umbracoContext.IsFrontEndUmbracoRequest)
|
||||
{
|
||||
_currentPage = _umbracoContext.PublishedContentRequest.PublishedContent;
|
||||
_currentPage = _umbracoContext.PublishedContentRequest.PublishedContent;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,6 +251,7 @@ namespace Umbraco.Web
|
||||
|
||||
var item = new Item()
|
||||
{
|
||||
NodeId = currentPage.Id.ToString(),
|
||||
Field = fieldAlias,
|
||||
TextIfEmpty = altText,
|
||||
LegacyAttributes = attributesForItem
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="loadStarterKitDesigns.ascx.cs" Inherits="umbraco.presentation.install.steps.Skinning.loadStarterKitDesigns" %>
|
||||
<%@ Import Namespace="umbraco.cms.businesslogic.packager.repositories" %>
|
||||
|
||||
<asp:PlaceHolder ID="pl_loadStarterKitDesigns" runat="server">
|
||||
<asp:Panel id="pl_CustomizeSkin" runat="server" Visible="false">
|
||||
<h3>Starter kit and skin have been installed</h3>
|
||||
<p id="customizelink"><a target="_blank" href="<%= umbraco.GlobalSettings.Path %>/canvas.aspx?redir=<%= this.ResolveUrl("~/") %>&umbSkinning=true&umbSkinningConfigurator=true" target="_blank">Browse and customize your new site</a></p>
|
||||
</asp:Panel>
|
||||
|
||||
<div id="skinselector">
|
||||
<asp:Repeater ID="rep_starterKitDesigns" runat="server">
|
||||
<HeaderTemplate>
|
||||
<!-- gallery -->
|
||||
<div class="gallery">
|
||||
<a href="#" class="btn-prev"><span>prev</span></a>
|
||||
<a href="#" class="btn-next"><span>next</span></a>
|
||||
|
||||
<div class="hold">
|
||||
<div class="gal-box">
|
||||
|
||||
<div class="box zoom-list2">
|
||||
<ul>
|
||||
</HeaderTemplate>
|
||||
|
||||
|
||||
<ItemTemplate>
|
||||
<li>
|
||||
<div class="image-hold">
|
||||
<img class="faik-mask" src="../umbraco_client/installer/images/bg-img.png" alt="image description" width="152" height="129">
|
||||
<img class="faik-mask-ie6" src="../umbraco_client/installer/images/bg-img-ie.png" alt="image description" width="201" height="178">
|
||||
|
||||
<div class="image">
|
||||
<img class="zoom-img" src="<%# ((Skin)Container.DataItem).Thumbnail %>" alt="<%# ((Skin)Container.DataItem).Text %>" width="134" height="103">
|
||||
<div class="gal-drop">
|
||||
<a href="#lightbox" class="btn-preview" title="<%# ((Skin)Container.DataItem).Text %>"><span>Preview</span></a>
|
||||
<asp:LinkButton CssClass="single-tab btn-install-gal" ID="bt_selectKit" runat="server" onclick="SelectStarterKitDesign" CommandArgument="<%# ((Skin)Container.DataItem).RepoGuid %>" ToolTip="<%# ((Skin)Container.DataItem).Text %>"><span>Install</span></asp:LinkButton>
|
||||
<div class="gal-desc" style="display: none"><%# ((Skin)Container.DataItem).Description %></div>
|
||||
<div class="gal-owner" style="display: none">Created by: <a href="<%# ((Skin)Container.DataItem).AuthorUrl %>" target="_blank"><%# ((Skin)Container.DataItem).Author %></a></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</li>
|
||||
</ItemTemplate>
|
||||
<FooterTemplate>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- paging -->
|
||||
<div class="paging">
|
||||
<div class="w1">
|
||||
<div class="w2">
|
||||
<span>Pages:</span>
|
||||
<ul class="swicher">
|
||||
<li class="active"><a href="#">1</a></li>
|
||||
<li><a href="#">2</a></li>
|
||||
<li><a href="#">3</a></li>
|
||||
<li><a href="#">4</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div></div></div>
|
||||
</FooterTemplate>
|
||||
</asp:Repeater>
|
||||
</div>
|
||||
|
||||
</asp:PlaceHolder>
|
||||
@@ -8,152 +8,179 @@ using umbraco.BusinessLogic;
|
||||
|
||||
namespace umbraco.presentation.install.steps.Skinning
|
||||
{
|
||||
public delegate void StarterKitDesignInstalledEventHandler();
|
||||
public delegate void StarterKitDesignInstalledEventHandler();
|
||||
|
||||
public partial class loadStarterKitDesigns : System.Web.UI.UserControl
|
||||
{
|
||||
public partial class loadStarterKitDesigns : System.Web.UI.UserControl
|
||||
{
|
||||
|
||||
public event StarterKitDesignInstalledEventHandler StarterKitDesignInstalled;
|
||||
public event StarterKitDesignInstalledEventHandler StarterKitDesignInstalled;
|
||||
|
||||
protected virtual void OnStarterKitDesignInstalled()
|
||||
{
|
||||
if (StarterKitDesignInstalled != null)
|
||||
StarterKitDesignInstalled();
|
||||
}
|
||||
protected virtual void OnStarterKitDesignInstalled()
|
||||
{
|
||||
if (StarterKitDesignInstalled != null)
|
||||
StarterKitDesignInstalled();
|
||||
}
|
||||
|
||||
public Guid StarterKitGuid { get; set; }
|
||||
public Guid StarterKitGuid { get; set; }
|
||||
|
||||
private cms.businesslogic.packager.repositories.Repository repo;
|
||||
private string repoGuid = "65194810-1f85-11dd-bd0b-0800200c9a66";
|
||||
private cms.businesslogic.packager.repositories.Repository repo;
|
||||
private string repoGuid = "65194810-1f85-11dd-bd0b-0800200c9a66";
|
||||
|
||||
public loadStarterKitDesigns()
|
||||
{
|
||||
repo = cms.businesslogic.packager.repositories.Repository.getByGuid(repoGuid);
|
||||
}
|
||||
public loadStarterKitDesigns()
|
||||
{
|
||||
repo = cms.businesslogic.packager.repositories.Repository.getByGuid(repoGuid);
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected override void OnInit(EventArgs e)
|
||||
{
|
||||
base.OnInit(e);
|
||||
|
||||
if (repo.HasConnection())
|
||||
{
|
||||
try
|
||||
{
|
||||
//clear progress bar cache
|
||||
Helper.clearProgress();
|
||||
|
||||
var skinsCollection = repo.Webservice.Skins(StarterKitGuid.ToString());
|
||||
|
||||
var numberOfSkins = skinsCollection.Length;
|
||||
this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "skinCounter", "var numberOfSkins = " + numberOfSkins, true);
|
||||
|
||||
rep_starterKitDesigns.DataSource = skinsCollection;
|
||||
rep_starterKitDesigns.DataBind();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Add(LogTypes.Debug, -1, ex.ToString());
|
||||
|
||||
ShowConnectionError();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowConnectionError();
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowConnectionError()
|
||||
{
|
||||
|
||||
uicontrols.Feedback fb = new global::umbraco.uicontrols.Feedback();
|
||||
fb.type = global::umbraco.uicontrols.Feedback.feedbacktype.error;
|
||||
fb.Text = "<strong>No connection to repository.</strong> Starter Kits Designs could not be fetched from the repository as there was no connection to: '" + repo.RepositoryUrl + "'";
|
||||
|
||||
pl_loadStarterKitDesigns.Controls.Clear();
|
||||
pl_loadStarterKitDesigns.Controls.Add(fb);
|
||||
}
|
||||
|
||||
protected void SelectStarterKitDesign(object sender, EventArgs e)
|
||||
{
|
||||
Helper.clearProgress();
|
||||
|
||||
Guid kitGuid = new Guid(((LinkButton)sender).CommandArgument);
|
||||
|
||||
if (!cms.businesslogic.skinning.Skinning.IsSkinInstalled(kitGuid))
|
||||
{
|
||||
|
||||
Helper.setProgress(5, "Fetching starting kit from the repository", "");
|
||||
|
||||
cms.businesslogic.packager.Installer installer = new cms.businesslogic.packager.Installer();
|
||||
|
||||
if (repo.HasConnection())
|
||||
{
|
||||
cms.businesslogic.packager.Installer p = new cms.businesslogic.packager.Installer();
|
||||
|
||||
Helper.setProgress(15, "Connected to repository", "");
|
||||
|
||||
string tempFile = p.Import(repo.fetch(kitGuid.ToString()));
|
||||
p.LoadConfig(tempFile);
|
||||
int pID = p.CreateManifest(tempFile, kitGuid.ToString(), repoGuid);
|
||||
|
||||
Helper.setProgress(30, "Installing skin files", "");
|
||||
p.InstallFiles(pID, tempFile);
|
||||
|
||||
Helper.setProgress(50, "Installing skin system objects", "");
|
||||
p.InstallBusinessLogic(pID, tempFile);
|
||||
|
||||
Helper.setProgress(60, "Finishing skin installation", "");
|
||||
p.InstallCleanUp(pID, tempFile);
|
||||
|
||||
library.RefreshContent();
|
||||
|
||||
Helper.setProgress(80, "Activating skin", "");
|
||||
if (cms.businesslogic.skinning.Skinning.GetAllSkins().Count > 0)
|
||||
{
|
||||
cms.businesslogic.skinning.Skinning.ActivateAsCurrentSkin(cms.businesslogic.skinning.Skinning.GetAllSkins()[0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Helper.setProgress(100, "Skin installation has been completed", "");
|
||||
|
||||
try
|
||||
{
|
||||
protected override void OnInit(EventArgs e)
|
||||
{
|
||||
base.OnInit(e);
|
||||
|
||||
if (repo.HasConnection())
|
||||
{
|
||||
try
|
||||
{
|
||||
//clear progress bar cache
|
||||
Helper.clearProgress();
|
||||
|
||||
var skinsCollection = repo.Webservice.Skins(StarterKitGuid.ToString());
|
||||
|
||||
var numberOfSkins = skinsCollection.Length;
|
||||
this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "skinCounter", "var numberOfSkins = " + numberOfSkins, true);
|
||||
|
||||
rep_starterKitDesigns.DataSource = skinsCollection;
|
||||
rep_starterKitDesigns.DataBind();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Add(LogTypes.Debug, -1, ex.ToString());
|
||||
|
||||
ShowConnectionError();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowConnectionError();
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowConnectionError()
|
||||
{
|
||||
|
||||
uicontrols.Feedback fb = new global::umbraco.uicontrols.Feedback();
|
||||
fb.type = global::umbraco.uicontrols.Feedback.feedbacktype.error;
|
||||
fb.Text = "<strong>No connection to repository.</strong> Starter Kits Designs could not be fetched from the repository as there was no connection to: '" + repo.RepositoryUrl + "'";
|
||||
|
||||
pl_loadStarterKitDesigns.Controls.Clear();
|
||||
pl_loadStarterKitDesigns.Controls.Add(fb);
|
||||
}
|
||||
|
||||
protected void SelectStarterKitDesign(object sender, EventArgs e)
|
||||
{
|
||||
Helper.clearProgress();
|
||||
|
||||
Guid kitGuid = new Guid(((LinkButton)sender).CommandArgument);
|
||||
|
||||
if (!cms.businesslogic.skinning.Skinning.IsSkinInstalled(kitGuid))
|
||||
{
|
||||
|
||||
Helper.setProgress(5, "Fetching starting kit from the repository", "");
|
||||
|
||||
cms.businesslogic.packager.Installer installer = new cms.businesslogic.packager.Installer();
|
||||
|
||||
if (repo.HasConnection())
|
||||
{
|
||||
cms.businesslogic.packager.Installer p = new cms.businesslogic.packager.Installer();
|
||||
|
||||
Helper.setProgress(15, "Connected to repository", "");
|
||||
|
||||
string tempFile = p.Import(repo.fetch(kitGuid.ToString()));
|
||||
p.LoadConfig(tempFile);
|
||||
int pID = p.CreateManifest(tempFile, kitGuid.ToString(), repoGuid);
|
||||
|
||||
Helper.setProgress(30, "Installing skin files", "");
|
||||
p.InstallFiles(pID, tempFile);
|
||||
|
||||
Helper.setProgress(50, "Installing skin system objects", "");
|
||||
p.InstallBusinessLogic(pID, tempFile);
|
||||
|
||||
Helper.setProgress(60, "Finishing skin installation", "");
|
||||
p.InstallCleanUp(pID, tempFile);
|
||||
|
||||
library.RefreshContent();
|
||||
|
||||
Helper.setProgress(80, "Activating skin", "");
|
||||
if (cms.businesslogic.skinning.Skinning.GetAllSkins().Count > 0)
|
||||
{
|
||||
cms.businesslogic.skinning.Skinning.ActivateAsCurrentSkin(cms.businesslogic.skinning.Skinning.GetAllSkins()[0]);
|
||||
}
|
||||
|
||||
|
||||
if (string.IsNullOrEmpty(GlobalSettings.ConfigurationStatus))
|
||||
{
|
||||
GlobalSettings.ConfigurationStatus = GlobalSettings.CurrentVersion;
|
||||
Application["umbracoNeedConfiguration"] = false;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
Helper.setProgress(100, "Skin installation has been completed", "");
|
||||
|
||||
try
|
||||
{
|
||||
Helper.RedirectToNextStep(Page);
|
||||
}
|
||||
catch
|
||||
{
|
||||
OnStarterKitDesignInstalled();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowConnectionError();
|
||||
}
|
||||
try
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(GlobalSettings.ConfigurationStatus))
|
||||
{
|
||||
GlobalSettings.ConfigurationStatus = GlobalSettings.CurrentVersion;
|
||||
Application["umbracoNeedConfiguration"] = false;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Helper.RedirectToNextStep(Page);
|
||||
}
|
||||
catch
|
||||
{
|
||||
OnStarterKitDesignInstalled();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowConnectionError();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// pl_loadStarterKitDesigns control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder pl_loadStarterKitDesigns;
|
||||
|
||||
/// <summary>
|
||||
/// pl_CustomizeSkin control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel pl_CustomizeSkin;
|
||||
|
||||
/// <summary>
|
||||
/// rep_starterKitDesigns control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Repeater rep_starterKitDesigns;
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace umbraco.presentation.install.steps.Skinning {
|
||||
|
||||
|
||||
public partial class loadStarterKitDesigns {
|
||||
|
||||
/// <summary>
|
||||
/// pl_loadStarterKitDesigns control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder pl_loadStarterKitDesigns;
|
||||
|
||||
/// <summary>
|
||||
/// pl_CustomizeSkin control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Panel pl_CustomizeSkin;
|
||||
|
||||
/// <summary>
|
||||
/// rep_starterKitDesigns control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Repeater rep_starterKitDesigns;
|
||||
}
|
||||
}
|
||||
@@ -33,8 +33,8 @@ namespace umbraco {
|
||||
|
||||
|
||||
private static string pageXPathQueryStart = "/root";
|
||||
private static string _urlName = string.Empty;
|
||||
private static bool _urlNameInitialized = false;
|
||||
private static string _urlName = "@urlName";
|
||||
private static bool _urlNameInitialized = true;
|
||||
private static XmlDocument _customHandlers;
|
||||
|
||||
private string _pageXPathQuery = string.Empty;
|
||||
@@ -76,6 +76,9 @@ namespace umbraco {
|
||||
// Init urlName to correspond to web.config entries (umbracoUrlForbittenCharacters and umbracoUrlSpaceCharacter).
|
||||
// Needed to compensate for known asp.net framework error KB826437:
|
||||
// http://support.microsoft.com/default.aspx?scid=kb;EN-US;826437
|
||||
// note: obsoleted, everything was commented out anyway since long, so it just
|
||||
// initializes _urlName, which we can do in the variable definition.
|
||||
[Obsolete("This method did nothing anyway...")]
|
||||
private static void InitializeUrlName() {
|
||||
/* string toReplace = string.Empty;
|
||||
string replaceWith = string.Empty;
|
||||
@@ -197,8 +200,9 @@ namespace umbraco {
|
||||
bool getByID = false;
|
||||
string currentDomain = HttpContext.Current.Request.ServerVariables["SERVER_NAME"];
|
||||
|
||||
if (!_urlNameInitialized)
|
||||
InitializeUrlName();
|
||||
// obsoleted
|
||||
//if (!_urlNameInitialized)
|
||||
// InitializeUrlName();
|
||||
|
||||
// The url exists in cache, and the domain doesn't exists (which makes it ok to do a cache look up on the url alone)
|
||||
// TODO: NH: Remove the flag for friendlyxmlschema when real schema is implemented
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="../../masterpages/umbracoPage.Master" Title="Install starter kit" CodeBehind="StarterKits.aspx.cs" Inherits="umbraco.presentation.umbraco.developer.Packages.StarterKits" %>
|
||||
<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>
|
||||
<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
|
||||
|
||||
<umb:JsInclude ID="JsInclude1" runat="server" FilePath="ui/jqueryui.js" PathNameAlias="UmbracoClient" />
|
||||
|
||||
<script type="text/javascript">
|
||||
function showProgress(button, elementId) {
|
||||
var img = document.getElementById(elementId);
|
||||
img.style.visibility = "visible";
|
||||
button.style.display = "none";
|
||||
|
||||
}
|
||||
|
||||
|
||||
function InstallPackages(button, elementId) {
|
||||
showProgress(button, elementId);
|
||||
}
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.add-thanks
|
||||
{
|
||||
position:absolute;
|
||||
left:-2500;
|
||||
display:none !important;
|
||||
}
|
||||
|
||||
.zoom-list li {float: left; margin: 15px; display: block; width: 180px;}
|
||||
|
||||
.btn-prev, .btn-next, .paging, .btn-preview, .faik-mask , .faik-mask-ie6
|
||||
{
|
||||
display:none;
|
||||
}
|
||||
|
||||
.image {float: left; margin: 15px; display: block; width: 140px;}
|
||||
|
||||
.image .gal-drop{padding-top:10px;}
|
||||
|
||||
ul{list-style-type: none;}
|
||||
</style>
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="server">
|
||||
<cc1:UmbracoPanel id="Panel1" Text="Starter kit" runat="server" Width="612px" Height="600px" hasMenu="false">
|
||||
<cc1:Feedback ID="fb" runat="server" />
|
||||
|
||||
<cc1:Pane id="StarterKitInstalled" Text="Install skin" runat="server">
|
||||
<h3>Available skins</h3>
|
||||
<p>You can choose from the following skins.</p>
|
||||
<asp:PlaceHolder ID="ph_skins" runat="server"></asp:PlaceHolder>
|
||||
</cc1:Pane>
|
||||
|
||||
|
||||
|
||||
<cc1:Pane id="StarterKitNotInstalled" Text="Install starter kit" runat="server">
|
||||
<h3>Available starter kits</h3>
|
||||
<p>You can choose from the following starter kits, each having specific functionality.</p>
|
||||
<asp:PlaceHolder ID="ph_starterkits" runat="server"></asp:PlaceHolder>
|
||||
</cc1:Pane>
|
||||
|
||||
<cc1:Pane id="installationCompleted" Text="Installation completed" runat="server" Visible="false">
|
||||
<p>Installation completed succesfully</p>
|
||||
</cc1:Pane>
|
||||
</cc1:UmbracoPanel>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
@@ -9,63 +9,135 @@ using umbraco.IO;
|
||||
|
||||
namespace umbraco.presentation.umbraco.developer.Packages
|
||||
{
|
||||
public partial class StarterKits : UmbracoEnsuredPage
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!cms.businesslogic.skinning.Skinning.IsStarterKitInstalled())
|
||||
showStarterKits();
|
||||
else
|
||||
showSkins((Guid)cms.businesslogic.skinning.Skinning.StarterKitGuid());
|
||||
}
|
||||
public partial class StarterKits : UmbracoEnsuredPage
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!cms.businesslogic.skinning.Skinning.IsStarterKitInstalled())
|
||||
showStarterKits();
|
||||
else
|
||||
showSkins((Guid)cms.businesslogic.skinning.Skinning.StarterKitGuid());
|
||||
}
|
||||
|
||||
private void showStarterKits()
|
||||
{
|
||||
install.steps.Skinning.loadStarterKits starterkitsctrl =
|
||||
(install.steps.Skinning.loadStarterKits)new UserControl().LoadControl(SystemDirectories.Install + "/steps/Skinning/loadStarterKits.ascx");
|
||||
starterkitsctrl.StarterKitInstalled+=new install.steps.Skinning.StarterKitInstalledEventHandler(starterkitsctrl_StarterKitInstalled);
|
||||
|
||||
ph_starterkits.Controls.Add(starterkitsctrl);
|
||||
private void showStarterKits()
|
||||
{
|
||||
install.steps.Skinning.loadStarterKits starterkitsctrl =
|
||||
(install.steps.Skinning.loadStarterKits)new UserControl().LoadControl(SystemDirectories.Install + "/steps/Skinning/loadStarterKits.ascx");
|
||||
starterkitsctrl.StarterKitInstalled += new install.steps.Skinning.StarterKitInstalledEventHandler(starterkitsctrl_StarterKitInstalled);
|
||||
|
||||
|
||||
ph_starterkits.Controls.Add(starterkitsctrl);
|
||||
|
||||
StarterKitNotInstalled.Visible = true;
|
||||
StarterKitInstalled.Visible = false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
StarterKitNotInstalled.Visible = true;
|
||||
StarterKitInstalled.Visible = false;
|
||||
|
||||
public void showSkins(Guid starterKitGuid)
|
||||
{
|
||||
}
|
||||
|
||||
install.steps.Skinning.loadStarterKitDesigns ctrl = (install.steps.Skinning.loadStarterKitDesigns)new UserControl().LoadControl(SystemDirectories.Install + "/steps/Skinning/loadStarterKitDesigns.ascx");
|
||||
ctrl.ID = "StarterKitDesigns";
|
||||
|
||||
ctrl.StarterKitGuid = starterKitGuid;
|
||||
ctrl.StarterKitDesignInstalled += new install.steps.Skinning.StarterKitDesignInstalledEventHandler(ctrl_StarterKitDesignInstalled);
|
||||
ph_skins.Controls.Add(ctrl);
|
||||
|
||||
StarterKitNotInstalled.Visible = false;
|
||||
StarterKitInstalled.Visible = true;
|
||||
public void showSkins(Guid starterKitGuid)
|
||||
{
|
||||
|
||||
}
|
||||
install.steps.Skinning.loadStarterKitDesigns ctrl = (install.steps.Skinning.loadStarterKitDesigns)new UserControl().LoadControl(SystemDirectories.Install + "/steps/Skinning/loadStarterKitDesigns.ascx");
|
||||
ctrl.ID = "StarterKitDesigns";
|
||||
|
||||
void starterkitsctrl_StarterKitInstalled()
|
||||
{
|
||||
StarterKitNotInstalled.Visible = false;
|
||||
StarterKitInstalled.Visible = false;
|
||||
ctrl.StarterKitGuid = starterKitGuid;
|
||||
ctrl.StarterKitDesignInstalled += new install.steps.Skinning.StarterKitDesignInstalledEventHandler(ctrl_StarterKitDesignInstalled);
|
||||
ph_skins.Controls.Add(ctrl);
|
||||
|
||||
installationCompleted.Visible = true;
|
||||
|
||||
}
|
||||
StarterKitNotInstalled.Visible = false;
|
||||
StarterKitInstalled.Visible = true;
|
||||
|
||||
void ctrl_StarterKitDesignInstalled()
|
||||
{
|
||||
StarterKitNotInstalled.Visible = false;
|
||||
StarterKitInstalled.Visible = false;
|
||||
}
|
||||
|
||||
installationCompleted.Visible = true;
|
||||
}
|
||||
}
|
||||
void starterkitsctrl_StarterKitInstalled()
|
||||
{
|
||||
StarterKitNotInstalled.Visible = false;
|
||||
StarterKitInstalled.Visible = false;
|
||||
|
||||
installationCompleted.Visible = true;
|
||||
|
||||
}
|
||||
|
||||
void ctrl_StarterKitDesignInstalled()
|
||||
{
|
||||
StarterKitNotInstalled.Visible = false;
|
||||
StarterKitInstalled.Visible = false;
|
||||
|
||||
installationCompleted.Visible = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// JsInclude1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::ClientDependency.Core.Controls.JsInclude JsInclude1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::umbraco.uicontrols.UmbracoPanel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// fb control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::umbraco.uicontrols.Feedback fb;
|
||||
|
||||
/// <summary>
|
||||
/// StarterKitInstalled control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::umbraco.uicontrols.Pane StarterKitInstalled;
|
||||
|
||||
/// <summary>
|
||||
/// ph_skins control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder ph_skins;
|
||||
|
||||
/// <summary>
|
||||
/// StarterKitNotInstalled control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::umbraco.uicontrols.Pane StarterKitNotInstalled;
|
||||
|
||||
/// <summary>
|
||||
/// ph_starterkits control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder ph_starterkits;
|
||||
|
||||
/// <summary>
|
||||
/// installationCompleted control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::umbraco.uicontrols.Pane installationCompleted;
|
||||
}
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace umbraco.presentation.umbraco.developer.Packages {
|
||||
|
||||
|
||||
public partial class StarterKits {
|
||||
|
||||
/// <summary>
|
||||
/// JsInclude1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::ClientDependency.Core.Controls.JsInclude JsInclude1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::umbraco.uicontrols.UmbracoPanel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// fb control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::umbraco.uicontrols.Feedback fb;
|
||||
|
||||
/// <summary>
|
||||
/// StarterKitInstalled control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::umbraco.uicontrols.Pane StarterKitInstalled;
|
||||
|
||||
/// <summary>
|
||||
/// ph_skins control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder ph_skins;
|
||||
|
||||
/// <summary>
|
||||
/// StarterKitNotInstalled control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::umbraco.uicontrols.Pane StarterKitNotInstalled;
|
||||
|
||||
/// <summary>
|
||||
/// ph_starterkits control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.PlaceHolder ph_starterkits;
|
||||
|
||||
/// <summary>
|
||||
/// installationCompleted control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::umbraco.uicontrols.Pane installationCompleted;
|
||||
}
|
||||
}
|
||||
@@ -126,7 +126,7 @@ namespace umbraco.editorControls.tags
|
||||
this.ContentTemplateContainer.Controls.Add(tagBox);
|
||||
|
||||
string tagsAutoCompleteScript =
|
||||
"jQuery('.umbTagBox').tagsInput({ width: '400px', defaultText: 'Add a tag', minChars: 2, autocomplete_url: '" +
|
||||
"jQuery('#" + tagBox.ClientID + "').tagsInput({ width: '400px', defaultText: 'Add a tag', minChars: 2, autocomplete_url: '" +
|
||||
umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco)
|
||||
+ "/webservices/TagsAutoCompleteHandler.ashx?group=" + _group + "&id=" + pageId + "&rnd=" +
|
||||
DateTime.Now.Ticks + "&format=json' });";
|
||||
|
||||
Reference in New Issue
Block a user