Converted the DataType tree to the new tree structure, now need to start creating the pre-value editor. Obsoleted IDataType and a bunch of other things associated with IDataType. Obsoleted old tree classes that we've replaced so far.

This commit is contained in:
Shannon
2013-08-13 18:19:56 +10:00
parent 2e2229e388
commit 4e13b0afe6
18 changed files with 94 additions and 25 deletions

View File

@@ -58,6 +58,11 @@
/// </summary>
public const string Media = "media";
/// <summary>
/// alias for the datatype tree.
/// </summary>
public const string DataTypes = "datatype";
//TODO: Fill in the rest!
}

View File

@@ -8,6 +8,7 @@ namespace Umbraco.Core
/// <summary>
/// A resolver to return all IDataType objects
/// </summary>
[Obsolete("IDataType is obsolete and is no longer used, it will be removed from the codebase in future versions")]
internal sealed class DataTypesResolver : LegacyTransientObjectsResolver<DataTypesResolver, IDataType>
{
/// <summary>

View File

@@ -290,6 +290,7 @@ namespace Umbraco.Core.Services
/// </summary>
/// <param name="id">Id of the DataType, which corresponds to the Guid Id of the control</param>
/// <returns><see cref="IDataType"/> object</returns>
[Obsolete("IDataType is obsolete and is no longer used, it will be removed from the codebase in future versions")]
public IDataType GetDataTypeById(Guid id)
{
return DataTypesResolver.Current.GetById(id);
@@ -299,6 +300,7 @@ namespace Umbraco.Core.Services
/// Gets a complete list of all registered <see cref="IDataType"/>'s
/// </summary>
/// <returns>An enumerable list of <see cref="IDataType"/> objects</returns>
[Obsolete("IDataType is obsolete and is no longer used, it will be removed from the codebase in future versions")]
public IEnumerable<IDataType> GetAllDataTypes()
{
return DataTypesResolver.Current.DataTypes;

View File

@@ -386,12 +386,14 @@ function iconHelper() {
{ oldIcon: ".sprTreePackage", newIcon: "icon-dropbox" },
{ oldIcon: ".sprTreeRepository", newIcon: "icon-github" },
{ oldIcon: ".sprTreeSettingDataType", newIcon: "icon-tasks" },
//TODO:
/*
{ oldIcon: ".sprTreeSettingAgent", newIcon: "" },
{ oldIcon: ".sprTreeSettingCss", newIcon: "" },
{ oldIcon: ".sprTreeSettingCssItem", newIcon: "" },
{ oldIcon: ".sprTreeSettingDataType", newIcon: "" },
{ oldIcon: ".sprTreeSettingDataTypeChild", newIcon: "" },
{ oldIcon: ".sprTreeSettingDomain", newIcon: "" },
{ oldIcon: ".sprTreeSettingLanguage", newIcon: "" },

View File

@@ -2,12 +2,12 @@
<trees>
<!--Content-->
<add application="content" alias="content" title="Content" type="umbraco.loadContent, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" silent="true" sortOrder="0" />
<add application="content" alias="contentRecycleBin" title="RecycleBin" type="umbraco.cms.presentation.Trees.ContentRecycleBin, umbraco" iconClosed="folder.gif" iconOpen="folder_o.gif" initialize="false" sortOrder="0" />
<add initialize="true" sortOrder="0" alias="content" application="content" title="Content" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Web.Trees.ContentTreeController, umbraco" action="" />
<add initialize="false" sortOrder="0" alias="contentRecycleBin" application="content" title="Recycle Bin" iconClosed="folder.gif" iconOpen="folder_o.gif" type="umbraco.cms.presentation.Trees.ContentRecycleBin, umbraco" action="" />
<!--Media-->
<add application="media" alias="media" title="Media" type="umbraco.loadMedia, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="0" />
<add application="media" alias="mediaRecycleBin" title="RecycleBin" type="umbraco.cms.presentation.Trees.MediaRecycleBin, umbraco" iconClosed="folder.gif" iconOpen="folder_o.gif" initialize="false" sortOrder="0" />
<add initialize="true" sortOrder="0" alias="media" application="media" title="Media" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Web.Trees.MediaTreeController, umbraco" />
<add initialize="false" sortOrder="0" alias="mediaRecycleBin" application="media" title="Recycle Bin" iconClosed="folder.gif" iconOpen="folder_o.gif" type="umbraco.cms.presentation.Trees.MediaRecycleBin, umbraco" />
<!--Settings-->
<add application="settings" alias="stylesheets" title="Stylesheets" type="umbraco.loadStylesheets, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="0" />
@@ -21,7 +21,7 @@
<add application="settings" alias="nodeTypes" title="Document Types" type="umbraco.loadNodeTypes, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="7" />
<!--Developer-->
<add application="developer" alias="datatype" title="Data Types" type="umbraco.loadDataTypes, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="1" />
<add initialize="true" sortOrder="0" alias="datatype" application="developer" title="Data Types" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Web.Trees.DataTypeTreeController, umbraco" />
<add application="developer" alias="macros" title="Macros" type="umbraco.loadMacros, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="2" />
<add application="developer" alias="packager" title="Packages" type="umbraco.loadPackager, umbraco" iconClosed="folder.gif" iconOpen="folder_o.gif" sortOrder="3" />
<add application="developer" alias="packagerPackages" title="Packager Packages" type="umbraco.loadPackages, umbraco" iconClosed="folder.gif" iconOpen="folder_o.gif" initialize="false" sortOrder="3" />

View File

@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<trees>
<!--Content-->
<!--<add application="content" alias="content" title="Content" type="umbraco.loadContent, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" silent="true" sortOrder="0" />
<add application="content" alias="contentRecycleBin" title="RecycleBin" type="umbraco.cms.presentation.Trees.ContentRecycleBin, umbraco" iconClosed="folder.gif" iconOpen="folder_o.gif" initialize="false" sortOrder="0" />-->
<add initialize="true" sortOrder="0" alias="content" application="content" title="Content" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Web.Trees.ContentTreeController, umbraco" action="" />
<add initialize="false" sortOrder="0" alias="contentRecycleBin" application="content" title="Recycle Bin" iconClosed="folder.gif" iconOpen="folder_o.gif" type="umbraco.cms.presentation.Trees.ContentRecycleBin, umbraco" action="" />
<!--Media-->
<!--<add application="media" alias="media" title="Media" type="umbraco.loadMedia, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="0" />
<add application="media" alias="mediaRecycleBin" title="RecycleBin" type="umbraco.cms.presentation.Trees.MediaRecycleBin, umbraco" iconClosed="folder.gif" iconOpen="folder_o.gif" initialize="false" sortOrder="0" />-->
<add initialize="true" sortOrder="0" alias="media" application="media" title="Media" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Web.Trees.MediaTreeController, umbraco" />
<add initialize="false" sortOrder="0" alias="mediaRecycleBin" application="media" title="Recycle Bin" iconClosed="folder.gif" iconOpen="folder_o.gif" type="umbraco.cms.presentation.Trees.MediaRecycleBin, umbraco" />
<!--Settings-->
<add application="settings" alias="stylesheets" title="Stylesheets" type="umbraco.loadStylesheets, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="0" />
<add application="settings" alias="stylesheetProperty" title="Stylesheet Property" type="umbraco.loadStylesheetProperty, umbraco" iconClosed="" iconOpen="" initialize="false" sortOrder="0" />
@@ -17,7 +17,7 @@
<add application="settings" alias="mediaTypes" title="Media Types" type="umbraco.loadMediaTypes, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="6" />
<add application="settings" alias="nodeTypes" title="Document Types" type="umbraco.loadNodeTypes, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="7" />
<!--Developer-->
<add application="developer" alias="datatype" title="Data Types" type="umbraco.loadDataTypes, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="1" />
<add initialize="true" sortOrder="0" alias="datatype" application="developer" title="Data Types" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Web.Trees.DataTypeTreeController, umbraco" />
<add application="developer" alias="macros" title="Macros" type="umbraco.loadMacros, umbraco" iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="2" />
<add application="developer" alias="packager" title="Packages" type="umbraco.loadPackager, umbraco" iconClosed="folder.gif" iconOpen="folder_o.gif" sortOrder="3" />
<add application="developer" alias="packagerPackages" title="Packager Packages" type="umbraco.loadPackages, umbraco" iconClosed="folder.gif" iconOpen="folder_o.gif" initialize="false" sortOrder="3" />
@@ -39,8 +39,4 @@
<!-- Custom -->
<!--<add application="myApplication" alias="myTree" title="Me Tree" type="MyNamespace.myTree, MyAssembly"
iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="10" />-->
<add initialize="true" sortOrder="0" alias="content" application="content" title="Content" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Web.Trees.ContentTreeController, umbraco" action="" />
<add initialize="false" sortOrder="0" alias="contentRecycleBin" application="content" title="Recycle Bin" iconClosed="folder.gif" iconOpen="folder_o.gif" type="umbraco.cms.presentation.Trees.ContentRecycleBin, umbraco" action="" />
<add initialize="true" sortOrder="0" alias="media" application="media" title="Media" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Web.Trees.MediaTreeController, umbraco" />
<add initialize="false" sortOrder="0" alias="mediaRecycleBin" application="media" title="Recycle Bin" iconClosed="folder.gif" iconOpen="folder_o.gif" type="umbraco.cms.presentation.Trees.MediaRecycleBin, umbraco" />
</trees>

View File

@@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http.Formatting;
using System.Web.Http;
using Umbraco.Core;
using Umbraco.Web.Trees.Menu;
using umbraco.BusinessLogic.Actions;
namespace Umbraco.Web.Trees
{
[Tree(Constants.Applications.Developer, Constants.Trees.DataTypes, "Data Types")]
public class DataTypeTreeController : TreeApiController
{
protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings)
{
//we only support one tree level for data types
if (id != Constants.System.Root.ToInvariantString())
{
throw new HttpResponseException(HttpStatusCode.NotFound);
}
var collection = new TreeNodeCollection();
collection.AddRange(
Services.DataTypeService.GetAllDataTypeDefinitions()
.OrderBy(x => x.Name)
.Select(dt =>
CreateTreeNode(
dt.Id.ToInvariantString(),
queryStrings,
dt.Name,
"icon-tasks",
false)));
return collection;
}
protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
{
var menu = new MenuItemCollection();
if (id == Constants.System.Root.ToInvariantString())
{
// root actions
menu.AddMenuItem<ActionNew>();
menu.AddMenuItem<RefreshNodeMenuItem, ActionRefresh>(true);
return menu;
}
//only have delete for each node
menu.AddMenuItem<ActionDelete>();
return menu;
}
}
}

View File

@@ -41,7 +41,7 @@ namespace Umbraco.Web.Trees
if (id == Constants.System.Root.ToInvariantString())
{
// default actions for all users
// root actions
menu.AddMenuItem<ActionNew>();
menu.AddMenuItem<ActionSort>(true);
menu.AddMenuItem<RefreshNodeMenuItem, ActionRefresh>(true);

View File

@@ -169,7 +169,7 @@ namespace Umbraco.Web.Trees
var node = new TreeNode(
rootNodeAsString,
"", //root nodes aren't expandable, no need to lookup the child nodes url
Url.GetTreeUrl(GetType(), rootNodeAsString, queryStrings),
Url.GetMenuUrl(GetType(), rootNodeAsString, queryStrings))
{
HasChildren = true,

View File

@@ -303,6 +303,7 @@
<Compile Include="PropertyEditors\LabelPropertyEditor.cs" />
<Compile Include="PropertyEditors\LabelValueEditor.cs" />
<Compile Include="Routing\UrlProviderExtensions.cs" />
<Compile Include="Trees\DataTypeTreeController.cs" />
<Compile Include="WebApi\ControllerContextExtensions.cs" />
<Compile Include="WebApi\CustomDateTimeConvertor.cs" />
<Compile Include="Models\ContentEditing\ContentSortOrder.cs" />

View File

@@ -18,6 +18,7 @@ namespace umbraco.cms.presentation.Trees
/// An abstract tree class for the content application.
/// Has built in methods for handling all of the request parameters specific to the content tree.
/// </summary>
[Obsolete("This is no longer used and will be removed from the codebase in the future")]
public abstract class BaseContentTree : BaseTree
{

View File

@@ -15,6 +15,8 @@ using Property = umbraco.cms.businesslogic.property.Property;
namespace umbraco.cms.presentation.Trees
{
[Obsolete("This is no longer used and will be removed from the codebase in the future")]
public abstract class BaseMediaTree : BaseTree
{
private DisposableTimer _timer;

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Text;
using umbraco.businesslogic;
using umbraco.cms.businesslogic;
@@ -13,7 +14,7 @@ namespace umbraco.cms.presentation.Trees
/// <summary>
/// Handles loading the content tree into umbraco's application tree
/// </summary>
[Tree(Constants.Applications.Content, "contentRecycleBin", "Recycle Bin", "folder.gif", "folder_o.gif", initialize: false)]
[Obsolete("This is no longer used and will be removed from the codebase in the future")]
public class ContentRecycleBin : BaseContentTree
{

View File

@@ -30,7 +30,7 @@ using Umbraco.Core;
namespace umbraco.cms.presentation.Trees
{
[Tree(Constants.Applications.Media, "mediaRecycleBin", "Recycle Bin", "folder.gif", "folder_o.gif", initialize : false)]
[Obsolete("This is no longer used and will be removed from the codebase in the future")]
public class MediaRecycleBin : BaseMediaTree
{
public MediaRecycleBin(string application) : base(application) { }

View File

@@ -1,17 +1,19 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using umbraco.BusinessLogic.Actions;
using umbraco.businesslogic;
using umbraco.cms.businesslogic.web;
using umbraco.cms.presentation.Trees;
using umbraco.interfaces;
using Umbraco.Core;
using Action = umbraco.BusinessLogic.Actions.Action;
namespace umbraco
{
/// <summary>
/// Handles loading the content tree into umbraco's application tree
/// </summary>
[Tree(Constants.Applications.Content, "content", "Content", silent: true)]
[Obsolete("This is no longer used and will be removed from the codebase in the future")]
public class loadContent : BaseContentTree
{

View File

@@ -31,8 +31,8 @@ namespace umbraco
{
/// <summary>
/// Handles loading of all datatypes into the developer application tree
/// </summary>
[Tree(Constants.Applications.Developer, "datatype", "Data Types", sortOrder: 1)]
/// </summary>
[Obsolete("This is no longer used and will be removed from the codebase in the future")]
public class loadDataTypes : BaseTree
{
public loadDataTypes(string application) : base(application) { }

View File

@@ -10,7 +10,7 @@ using Umbraco.Core;
namespace umbraco
{
[Tree(Constants.Applications.Media, "media", "Media")]
[Obsolete("This is no longer used and will be removed from the codebase in the future")]
public class loadMedia : BaseMediaTree
{

View File

@@ -7,6 +7,7 @@ namespace umbraco.interfaces
/// It consists of IdataEditor which provides the Editing UI, the IDataPrevalue which provides prevalues and th their editing UI
/// And finally it contains IData which manages the actual data in the Data Type
/// </summary>
[Obsolete("IDataType is obsolete and is no longer used, it will be removed from the codebase in future versions")]
public interface IDataType
{
/// <summary>