diff --git a/src/Umbraco.Examine/IIndexCreator.cs b/src/Umbraco.Examine/IIndexCreator.cs
new file mode 100644
index 0000000000..3b8f683990
--- /dev/null
+++ b/src/Umbraco.Examine/IIndexCreator.cs
@@ -0,0 +1,13 @@
+using System.Collections.Generic;
+using Examine;
+
+namespace Umbraco.Examine
+{
+ ///
+ /// Creates 's
+ ///
+ public interface IIndexCreator
+ {
+ IEnumerable Create();
+ }
+}
diff --git a/src/Umbraco.Examine/IIndexDiagnostics.cs b/src/Umbraco.Examine/IIndexDiagnostics.cs
index 04ca4a6ab9..29d530c2d0 100644
--- a/src/Umbraco.Examine/IIndexDiagnostics.cs
+++ b/src/Umbraco.Examine/IIndexDiagnostics.cs
@@ -1,12 +1,9 @@
using System;
using System.Collections.Generic;
-using Examine;
using Umbraco.Core;
namespace Umbraco.Examine
{
-
-
///
/// Exposes diagnostic information about an index
///
diff --git a/src/Umbraco.Examine/IValueSetBuilder.cs b/src/Umbraco.Examine/IValueSetBuilder.cs
index 89aa907926..1c4890f404 100644
--- a/src/Umbraco.Examine/IValueSetBuilder.cs
+++ b/src/Umbraco.Examine/IValueSetBuilder.cs
@@ -5,18 +5,17 @@ using Umbraco.Core.Models;
namespace Umbraco.Examine
{
///
- /// Creates a collection of to be indexed based on a collection of
+ /// Creates a collection of to be indexed based on a collection of
///
- ///
- public interface IValueSetBuilder
- where TContent : IContentBase
+ ///
+ public interface IValueSetBuilder
{
///
- /// Creates a collection of to be indexed based on a collection of
+ /// Creates a collection of to be indexed based on a collection of
///
///
///
- IEnumerable GetValueSets(params TContent[] content);
+ IEnumerable GetValueSets(params T[] content);
}
}
diff --git a/src/Umbraco.Examine/LuceneIndexCreator.cs b/src/Umbraco.Examine/LuceneIndexCreator.cs
new file mode 100644
index 0000000000..572de1e8a8
--- /dev/null
+++ b/src/Umbraco.Examine/LuceneIndexCreator.cs
@@ -0,0 +1,43 @@
+using System.Collections.Generic;
+using System.IO;
+using Examine;
+using Examine.LuceneEngine.Directories;
+using Lucene.Net.Store;
+using Umbraco.Core.IO;
+
+namespace Umbraco.Examine
+{
+ ///
+ ///
+ /// Abstract class for creating Lucene based Indexes
+ ///
+ public abstract class LuceneIndexCreator : IIndexCreator
+ {
+ public abstract IEnumerable Create();
+
+ ///
+ /// Creates a file system based Lucene with the correct locking guidelines for Umbraco
+ ///
+ ///
+ ///
+ public virtual Lucene.Net.Store.Directory CreateFileSystemLuceneDirectory(string name)
+ {
+ //TODO: We should have a single AppSetting to be able to specify a default DirectoryFactory so we can have a single
+ //setting to configure all indexes that use this to easily swap the directory to Sync/%temp%/blog, etc...
+
+ var dirInfo = new DirectoryInfo(Path.Combine(IOHelper.MapPath(SystemDirectories.Data), "TEMP", "ExamineIndexes", name));
+ if (!dirInfo.Exists)
+ System.IO.Directory.CreateDirectory(dirInfo.FullName);
+
+ var luceneDir = new SimpleFSDirectory(dirInfo);
+
+ //we want to tell examine to use a different fs lock instead of the default NativeFSFileLock which could cause problems if the appdomain
+ //terminates and in some rare cases would only allow unlocking of the file if IIS is forcefully terminated. Instead we'll rely on the simplefslock
+ //which simply checks the existence of the lock file
+ // The full syntax of this is: new NoPrefixSimpleFsLockFactory(dirInfo)
+ // however, we are setting the DefaultLockFactory in startup so we'll use that instead since it can be managed globally.
+ luceneDir.SetLockFactory(DirectoryFactory.DefaultLockFactory(dirInfo));
+ return luceneDir;
+ }
+ }
+}
diff --git a/src/Umbraco.Examine/Umbraco.Examine.csproj b/src/Umbraco.Examine/Umbraco.Examine.csproj
index 0aedf6e754..66b1f09068 100644
--- a/src/Umbraco.Examine/Umbraco.Examine.csproj
+++ b/src/Umbraco.Examine/Umbraco.Examine.csproj
@@ -66,6 +66,7 @@
+
@@ -88,6 +89,7 @@
+
Properties\SolutionInfo.cs
diff --git a/src/Umbraco.Tests/Services/ContentTypeServiceTests.cs b/src/Umbraco.Tests/Services/ContentTypeServiceTests.cs
index bc0854bdb7..8ea4856861 100644
--- a/src/Umbraco.Tests/Services/ContentTypeServiceTests.cs
+++ b/src/Umbraco.Tests/Services/ContentTypeServiceTests.cs
@@ -148,7 +148,7 @@ namespace Umbraco.Tests.Services
//change the content type to be invariant, we will also update the name here to detect the copy changes
doc.SetCultureName("Hello2", "en-US");
ServiceContext.ContentService.Save(doc);
- contentType.Variations = ContentVariation.Nothing;
+ contentType.Variations = ContentVariation.Nothing;
ServiceContext.ContentTypeService.Save(contentType);
doc = ServiceContext.ContentService.GetById(doc.Id); //re-get
@@ -372,7 +372,7 @@ namespace Umbraco.Tests.Services
doc2 = ServiceContext.ContentService.GetById(doc2.Id); //re-get
//this will be null because the doc type was changed back to variant but it's property types don't get changed back
- Assert.IsNull(doc.GetValue("title", "en-US"));
+ Assert.IsNull(doc.GetValue("title", "en-US"));
Assert.IsNull(doc2.GetValue("title", "en-US"));
}
@@ -1714,50 +1714,65 @@ namespace Umbraco.Tests.Services
// Arrange
var service = ServiceContext.ContentTypeService;
+ // create 'page' content type with a 'Content_' group
var page = MockedContentTypes.CreateSimpleContentType("page", "Page", null, false, "Content_");
+ Assert.IsTrue(page.PropertyGroups.Contains("Content_"));
+ Assert.AreEqual(3, page.PropertyTypes.Count());
service.Save(page);
+
+ // create 'contentPage' content type as a child of 'page'
var contentPage = MockedContentTypes.CreateSimpleContentType("contentPage", "Content Page", page, true);
- service.Save(contentPage);
- var composition = MockedContentTypes.CreateMetaContentType();
- composition.AddPropertyGroup("Content");
- service.Save(composition);
- //Adding Meta-composition to child doc type
- contentPage.AddContentType(composition);
+ Assert.AreEqual(3, contentPage.PropertyTypes.Count());
service.Save(contentPage);
- // Act
- var propertyTypeOne = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "testTextbox")
+ // add 'Content' group to 'meta' content type
+ var meta = MockedContentTypes.CreateMetaContentType();
+ meta.AddPropertyGroup("Content");
+ Assert.AreEqual(2, meta.PropertyTypes.Count());
+ service.Save(meta);
+
+ // add 'meta' content type to 'contentPage' composition
+ contentPage.AddContentType(meta);
+ service.Save(contentPage);
+
+ // add property 'prop1' to 'contentPage' group 'Content_'
+ var prop1 = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "testTextbox")
{
Name = "Test Textbox", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88
};
- var firstOneAdded = contentPage.AddPropertyType(propertyTypeOne, "Content_");
- var propertyTypeTwo = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "anotherTextbox")
+ var prop1Added = contentPage.AddPropertyType(prop1, "Content_");
+ Assert.IsTrue(prop1Added);
+
+ // add property 'prop2' to 'contentPage' group 'Content'
+ var prop2 = new PropertyType(Constants.PropertyEditors.Aliases.TextBox, ValueStorageType.Ntext, "anotherTextbox")
{
Name = "Another Test Textbox", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88
};
- var secondOneAdded = contentPage.AddPropertyType(propertyTypeTwo, "Content");
+ var prop2Added = contentPage.AddPropertyType(prop2, "Content");
+ Assert.IsTrue(prop2Added);
+
+ // save 'contentPage' content type
service.Save(contentPage);
- Assert.That(page.PropertyGroups.Contains("Content_"), Is.True);
- var propertyGroup = page.PropertyGroups["Content_"];
- page.PropertyGroups.Add(new PropertyGroup(true) { Id = propertyGroup.Id, Name = "ContentTab", SortOrder = 0});
+ var group = page.PropertyGroups["Content_"];
+ group.Name = "ContentTab"; // rename the group
service.Save(page);
+ Assert.AreEqual(3, page.PropertyTypes.Count());
- // Assert
- Assert.That(firstOneAdded, Is.True);
- Assert.That(secondOneAdded, Is.True);
+ // get 'contentPage' content type again
+ var contentPageAgain = service.Get("contentPage");
+ Assert.IsNotNull(contentPageAgain);
- var contentType = service.Get("contentPage");
- Assert.That(contentType, Is.Not.Null);
+ // assert that 'Content_' group is still there because we don't propagate renames
+ var findGroup = contentPageAgain.CompositionPropertyGroups.FirstOrDefault(x => x.Name == "Content_");
+ Assert.IsNotNull(findGroup);
- var compositionPropertyGroups = contentType.CompositionPropertyGroups;
-
- // now it is still 1, because we don't propagate renames anymore
- Assert.That(compositionPropertyGroups.Count(x => x.Name.Equals("Content_")), Is.EqualTo(1));
-
- var propertyTypeCount = contentType.PropertyTypes.Count();
- var compPropertyTypeCount = contentType.CompositionPropertyTypes.Count();
+ // count all property types (local and composed)
+ var propertyTypeCount = contentPageAgain.PropertyTypes.Count();
Assert.That(propertyTypeCount, Is.EqualTo(5));
+
+ // count composed property types
+ var compPropertyTypeCount = contentPageAgain.CompositionPropertyTypes.Count();
Assert.That(compPropertyTypeCount, Is.EqualTo(10));
}
diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/overlays/umboverlay.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/overlays/umboverlay.directive.js
index 9f9f1aa21e..99b89bf8cf 100644
--- a/src/Umbraco.Web.UI.Client/src/common/directives/components/overlays/umboverlay.directive.js
+++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/overlays/umboverlay.directive.js
@@ -124,58 +124,6 @@
-
-
Content Picker
-Opens a content picker.
-view: contentpicker
-
-
-
-
Param
-
Type
-
Details
-
-
-
-
model.multiPicker
-
Boolean
-
Pick one or multiple items
-
-
-
-
-
-
Returns
-
Type
-
Details
-
-
-
-
model.selection
-
Array
-
Array of content objects
-
-
-
-
-
Icon Picker
-Opens an icon picker.
-view: iconpicker
-
-
-
-
Returns
-
Type
-
Details
-
-
-
-
model.icon
-
String
-
The icon class
-
-
-
Item Picker
Opens an item picker.
view: itempicker
@@ -220,170 +168,6 @@ Opens an item picker.
-
Macro Picker
-Opens a media picker.
-view: macropicker
-
-
-
-
Param
-
Type
-
Details
-
-
-
-
-
model.dialogData
-
Object
-
Object which contains array of allowedMacros. Set to null to allow all.
-
-
-
-
-
-
-
Returns
-
Type
-
Details
-
-
-
-
-
model.macroParams
-
Array
-
Array of macro params
-
-
-
model.selectedMacro
-
Object
-
The selected macro
-
-
-
-
-
Media Picker
-Opens a media picker.
-view: mediapicker
-
-
-
-
Param
-
Type
-
Details
-
-
-
-
-
model.multiPicker
-
Boolean
-
Pick one or multiple items
-
-
-
model.onlyImages
-
Boolean
-
Only display files that have an image file-extension
-
-
-
model.disableFolderSelect
-
Boolean
-
Disable folder selection
-
-
-
-
-
-
-
Returns
-
Type
-
Details
-
-
-
-
-
model.selectedImages
-
Array
-
Array of selected images
-
-
-
-
-
Member Group Picker
-Opens a member group picker.
-view: membergrouppicker
-
-
-
-
Param
-
Type
-
Details
-
-
-
-
-
model.multiPicker
-
Boolean
-
Pick one or multiple items
-
-
-
-
-
-
-
Returns
-
Type
-
Details
-
-
-
-
-
model.selectedMemberGroup
-
String
-
The selected member group
-
-
-
model.selectedMemberGroups (multiPicker)
-
Array
-
The selected member groups
-
-
-
-
-
Member Picker
-Opens a member picker.
-view: memberpicker
-
-
-
-
Param
-
Type
-
Details
-
-
-
-
-
model.multiPicker
-
Boolean
-
Pick one or multiple items
-
-
-
-
-
-
-
Returns
-
Type
-
Details
-
-
-
-
-
model.selection
-
Array
-
Array of selected members/td>
-
-
-
-
YSOD
Opens an overlay to show a custom YSOD.
view: ysod
diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/relationtype.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/relationtype.resource.js
index f17aae0a6b..7f13a46d2f 100644
--- a/src/Umbraco.Web.UI.Client/src/common/resources/relationtype.resource.js
+++ b/src/Umbraco.Web.UI.Client/src/common/resources/relationtype.resource.js
@@ -35,7 +35,7 @@ function relationTypeResource($q, $http, umbRequestHelper, umbDataFormatter) {
/**
* @ngdoc method
* @name umbraco.resources.relationTypeResource#getRelationObjectTypes
- * @methodof umbraco.resources.relationTypeResource
+ * @methodOf umbraco.resources.relationTypeResource
*
* @description
* Gets a list of Umbraco object types which can be associated with a relation.
@@ -54,7 +54,7 @@ function relationTypeResource($q, $http, umbRequestHelper, umbDataFormatter) {
/**
* @ngdoc method
* @name umbraco.resources.relationTypeResource#save
- * @methodof umbraco.resources.relationTypeResource
+ * @methodOf umbraco.resources.relationTypeResource
*
* @description
* Updates a relation type.
@@ -74,7 +74,7 @@ function relationTypeResource($q, $http, umbRequestHelper, umbDataFormatter) {
/**
* @ngdoc method
* @name umbraco.resources.relationTypeResource#create
- * @methodof umbraco.resources.relationTypeResource
+ * @methodOf umbraco.resources.relationTypeResource
*
* @description
* Creates a new relation type.
@@ -94,7 +94,7 @@ function relationTypeResource($q, $http, umbRequestHelper, umbDataFormatter) {
/**
* @ngdoc method
* @name umbraco.resources.relationTypeResource#deleteById
- * @methodof umbraco.resources.relationTypeResource
+ * @methodOf umbraco.resources.relationTypeResource
*
* @description
* Deletes a relation type with a given ID.
diff --git a/src/Umbraco.Web.UI.Client/src/common/services/editor.service.js b/src/Umbraco.Web.UI.Client/src/common/services/editor.service.js
index 650a210784..0dbd27b7a5 100644
--- a/src/Umbraco.Web.UI.Client/src/common/services/editor.service.js
+++ b/src/Umbraco.Web.UI.Client/src/common/services/editor.service.js
@@ -4,6 +4,76 @@
*
* @description
* Added in Umbraco 8.0. Application-wide service for handling infinite editing.
+ *
+ *
+