reverts default userId parameters to be zero which means 'unknown'
This commit is contained in:
@@ -309,7 +309,7 @@ namespace Umbraco.Core.Packaging
|
||||
}).ToArray();
|
||||
}
|
||||
|
||||
private IEnumerable<IContent> InstallDocuments(XElement documentsElement, int userId = -1)
|
||||
private IEnumerable<IContent> InstallDocuments(XElement documentsElement, int userId = 0)
|
||||
{
|
||||
if ((string.Equals(Constants.Packaging.DocumentSetNodeName, documentsElement.Name.LocalName) == false)
|
||||
&& (string.Equals(Constants.Packaging.DocumentsNodeName, documentsElement.Name.LocalName) == false))
|
||||
@@ -341,7 +341,7 @@ namespace Umbraco.Core.Packaging
|
||||
throw new NotImplementedException("The packaging service do not yes have a method for importing stylesheets");
|
||||
}
|
||||
|
||||
private IEnumerable<IContentType> InstallDocumentTypes(XElement documentTypes, int userId = -1)
|
||||
private IEnumerable<IContentType> InstallDocumentTypes(XElement documentTypes, int userId = 0)
|
||||
{
|
||||
if (string.Equals(Constants.Packaging.DocumentTypesNodeName, documentTypes.Name.LocalName) == false)
|
||||
{
|
||||
@@ -355,7 +355,7 @@ namespace Umbraco.Core.Packaging
|
||||
return _packagingService.ImportContentTypes(documentTypes, userId);
|
||||
}
|
||||
|
||||
private IEnumerable<ITemplate> InstallTemplats(XElement templateElement, int userId = -1)
|
||||
private IEnumerable<ITemplate> InstallTemplats(XElement templateElement, int userId = 0)
|
||||
{
|
||||
if (string.Equals(Constants.Packaging.TemplatesNodeName, templateElement.Name.LocalName) == false)
|
||||
{
|
||||
@@ -382,7 +382,7 @@ namespace Umbraco.Core.Packaging
|
||||
sd => new KeyValuePair<string, string>(sd.Key, Path.Combine(fullpathToRoot, sd.Value))).ToArray();
|
||||
}
|
||||
|
||||
private IEnumerable<IMacro> InstallMacros(XElement macroElements, int userId = -1)
|
||||
private IEnumerable<IMacro> InstallMacros(XElement macroElements, int userId = 0)
|
||||
{
|
||||
if (string.Equals(Constants.Packaging.MacrosNodeName, macroElements.Name.LocalName) == false)
|
||||
{
|
||||
@@ -403,7 +403,7 @@ namespace Umbraco.Core.Packaging
|
||||
return _packagingService.ImportDictionaryItems(dictionaryItemsElement);
|
||||
}
|
||||
|
||||
private IEnumerable<ILanguage> InstallLanguages(XElement languageElement, int userId = -1)
|
||||
private IEnumerable<ILanguage> InstallLanguages(XElement languageElement, int userId = 0)
|
||||
{
|
||||
if (string.Equals(Constants.Packaging.LanguagesNodeName, languageElement.Name.LocalName) == false)
|
||||
{
|
||||
@@ -412,7 +412,7 @@ namespace Umbraco.Core.Packaging
|
||||
return _packagingService.ImportLanguages(languageElement, userId);
|
||||
}
|
||||
|
||||
private IEnumerable<IDataType> InstallDataTypes(XElement dataTypeElements, int userId = -1)
|
||||
private IEnumerable<IDataType> InstallDataTypes(XElement dataTypeElements, int userId = 0)
|
||||
{
|
||||
if (string.Equals(Constants.Packaging.DataTypesNodeName, dataTypeElements.Name.LocalName) == false)
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="mediaTypeAlias"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public static IContent CreateContent(this IContentService contentService, string name, Udi parentId, string mediaTypeAlias, int userId = -1)
|
||||
public static IContent CreateContent(this IContentService contentService, string name, Udi parentId, string mediaTypeAlias, int userId = 0)
|
||||
{
|
||||
var guidUdi = parentId as GuidUdi;
|
||||
if (guidUdi == null)
|
||||
|
||||
@@ -32,27 +32,27 @@ namespace Umbraco.Core.Services
|
||||
/// <summary>
|
||||
/// Saves a blueprint.
|
||||
/// </summary>
|
||||
void SaveBlueprint(IContent content, int userId = -1);
|
||||
void SaveBlueprint(IContent content, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a blueprint.
|
||||
/// </summary>
|
||||
void DeleteBlueprint(IContent content, int userId = -1);
|
||||
void DeleteBlueprint(IContent content, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new content item from a blueprint.
|
||||
/// </summary>
|
||||
IContent CreateContentFromBlueprint(IContent blueprint, string name, int userId = -1);
|
||||
IContent CreateContentFromBlueprint(IContent blueprint, string name, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes blueprints for a content type.
|
||||
/// </summary>
|
||||
void DeleteBlueprintsOfType(int contentTypeId, int userId = -1);
|
||||
void DeleteBlueprintsOfType(int contentTypeId, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes blueprints for content types.
|
||||
/// </summary>
|
||||
void DeleteBlueprintsOfTypes(IEnumerable<int> contentTypeIds, int userId = -1);
|
||||
void DeleteBlueprintsOfTypes(IEnumerable<int> contentTypeIds, int userId = 0);
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -251,13 +251,13 @@ namespace Umbraco.Core.Services
|
||||
/// <summary>
|
||||
/// Saves a document.
|
||||
/// </summary>
|
||||
OperationResult Save(IContent content, int userId = -1, bool raiseEvents = true);
|
||||
OperationResult Save(IContent content, int userId = 0, bool raiseEvents = true);
|
||||
|
||||
/// <summary>
|
||||
/// Saves documents.
|
||||
/// </summary>
|
||||
// fixme why only 1 result not 1 per content?!
|
||||
OperationResult Save(IEnumerable<IContent> contents, int userId = -1, bool raiseEvents = true);
|
||||
OperationResult Save(IEnumerable<IContent> contents, int userId = 0, bool raiseEvents = true);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a document.
|
||||
@@ -266,7 +266,7 @@ namespace Umbraco.Core.Services
|
||||
/// <para>This method will also delete associated media files, child content and possibly associated domains.</para>
|
||||
/// <para>This method entirely clears the content from the database.</para>
|
||||
/// </remarks>
|
||||
OperationResult Delete(IContent content, int userId = -1);
|
||||
OperationResult Delete(IContent content, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes all documents of a given document type.
|
||||
@@ -275,7 +275,7 @@ namespace Umbraco.Core.Services
|
||||
/// <para>All non-deleted descendants of the deleted documents are moved to the recycle bin.</para>
|
||||
/// <para>This operation is potentially dangerous and expensive.</para>
|
||||
/// </remarks>
|
||||
void DeleteOfType(int documentTypeId, int userId = -1);
|
||||
void DeleteOfType(int documentTypeId, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes all documents of given document types.
|
||||
@@ -284,17 +284,17 @@ namespace Umbraco.Core.Services
|
||||
/// <para>All non-deleted descendants of the deleted documents are moved to the recycle bin.</para>
|
||||
/// <para>This operation is potentially dangerous and expensive.</para>
|
||||
/// </remarks>
|
||||
void DeleteOfTypes(IEnumerable<int> contentTypeIds, int userId = -1);
|
||||
void DeleteOfTypes(IEnumerable<int> contentTypeIds, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes versions of a document prior to a given date.
|
||||
/// </summary>
|
||||
void DeleteVersions(int id, DateTime date, int userId = -1);
|
||||
void DeleteVersions(int id, DateTime date, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a version of a document.
|
||||
/// </summary>
|
||||
void DeleteVersion(int id, int versionId, bool deletePriorVersions, int userId = -1);
|
||||
void DeleteVersion(int id, int versionId, bool deletePriorVersions, int userId = 0);
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -303,7 +303,7 @@ namespace Umbraco.Core.Services
|
||||
/// <summary>
|
||||
/// Moves a document under a new parent.
|
||||
/// </summary>
|
||||
void Move(IContent content, int parentId, int userId = -1);
|
||||
void Move(IContent content, int parentId, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Copies a document.
|
||||
@@ -311,7 +311,7 @@ namespace Umbraco.Core.Services
|
||||
/// <remarks>
|
||||
/// <para>Recursively copies all children.</para>
|
||||
/// </remarks>
|
||||
IContent Copy(IContent content, int parentId, bool relateToOriginal, int userId = -1);
|
||||
IContent Copy(IContent content, int parentId, bool relateToOriginal, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Copies a document.
|
||||
@@ -319,12 +319,12 @@ namespace Umbraco.Core.Services
|
||||
/// <remarks>
|
||||
/// <para>Optionaly recursively copies all children.</para>
|
||||
/// </remarks>
|
||||
IContent Copy(IContent content, int parentId, bool relateToOriginal, bool recursive, int userId = -1);
|
||||
IContent Copy(IContent content, int parentId, bool relateToOriginal, bool recursive, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Moves a document to the recycle bin.
|
||||
/// </summary>
|
||||
OperationResult MoveToRecycleBin(IContent content, int userId = -1);
|
||||
OperationResult MoveToRecycleBin(IContent content, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Empties the recycle bin.
|
||||
@@ -334,12 +334,12 @@ namespace Umbraco.Core.Services
|
||||
/// <summary>
|
||||
/// Sorts documents.
|
||||
/// </summary>
|
||||
bool Sort(IEnumerable<IContent> items, int userId = -1, bool raiseEvents = true);
|
||||
bool Sort(IEnumerable<IContent> items, int userId = 0, bool raiseEvents = true);
|
||||
|
||||
/// <summary>
|
||||
/// Sorts documents.
|
||||
/// </summary>
|
||||
bool Sort(IEnumerable<int> ids, int userId = -1, bool raiseEvents = true);
|
||||
bool Sort(IEnumerable<int> ids, int userId = 0, bool raiseEvents = true);
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -349,22 +349,22 @@ namespace Umbraco.Core.Services
|
||||
/// Saves and publishes a document.
|
||||
/// </summary>
|
||||
/// <remarks>Property values must first be published at document level.</remarks>
|
||||
PublishResult SaveAndPublish(IContent content, int userId = -1, bool raiseEvents = true);
|
||||
PublishResult SaveAndPublish(IContent content, int userId = 0, bool raiseEvents = true);
|
||||
|
||||
/// <summary>
|
||||
/// Saves and publishes a document branch.
|
||||
/// </summary>
|
||||
IEnumerable<PublishResult> SaveAndPublishBranch(IContent content, bool force, string culture = null, string segment = null, int userId = -1);
|
||||
IEnumerable<PublishResult> SaveAndPublishBranch(IContent content, bool force, string culture = null, string segment = null, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Saves and publishes a document branch.
|
||||
/// </summary>
|
||||
IEnumerable<PublishResult> SaveAndPublishBranch(IContent content, bool force, Func<IContent, bool> editing, Func<IContent, bool> publishValues, int userId = -1);
|
||||
IEnumerable<PublishResult> SaveAndPublishBranch(IContent content, bool force, Func<IContent, bool> editing, Func<IContent, bool> publishValues, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Unpublishes a document or optionally unpublishes a culture and/or segment for the document.
|
||||
/// </summary>
|
||||
UnpublishResult Unpublish(IContent content, string culture = null, string segment = null, int userId = -1);
|
||||
UnpublishResult Unpublish(IContent content, string culture = null, string segment = null, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether a document is path-publishable.
|
||||
@@ -381,7 +381,7 @@ namespace Umbraco.Core.Services
|
||||
/// <summary>
|
||||
/// Saves a document and raises the "sent to publication" events.
|
||||
/// </summary>
|
||||
bool SendToPublication(IContent content, int userId = -1);
|
||||
bool SendToPublication(IContent content, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Publishes and unpublishes scheduled documents.
|
||||
@@ -416,27 +416,27 @@ namespace Umbraco.Core.Services
|
||||
/// <summary>
|
||||
/// Creates a document.
|
||||
/// </summary>
|
||||
IContent Create(string name, Guid parentId, string documentTypeAlias, int userId = -1);
|
||||
IContent Create(string name, Guid parentId, string documentTypeAlias, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a document.
|
||||
/// </summary>
|
||||
IContent Create(string name, int parentId, string documentTypeAlias, int userId = -1);
|
||||
IContent Create(string name, int parentId, string documentTypeAlias, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a document.
|
||||
/// </summary>
|
||||
IContent Create(string name, IContent parent, string documentTypeAlias, int userId = -1);
|
||||
IContent Create(string name, IContent parent, string documentTypeAlias, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Creates and saves a document.
|
||||
/// </summary>
|
||||
IContent CreateAndSave(string name, int parentId, string contentTypeAlias, int userId = -1);
|
||||
IContent CreateAndSave(string name, int parentId, string contentTypeAlias, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Creates and saves a document.
|
||||
/// </summary>
|
||||
IContent CreateAndSave(string name, IContent parent, string contentTypeAlias, int userId = -1);
|
||||
IContent CreateAndSave(string name, IContent parent, string contentTypeAlias, int userId = 0);
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -25,11 +25,11 @@ namespace Umbraco.Core.Services
|
||||
IEnumerable<TItem> GetChildren(int id);
|
||||
bool HasChildren(int id);
|
||||
|
||||
void Save(TItem item, int userId = -1);
|
||||
void Save(IEnumerable<TItem> items, int userId = -1);
|
||||
void Save(TItem item, int userId = 0);
|
||||
void Save(IEnumerable<TItem> items, int userId = 0);
|
||||
|
||||
void Delete(TItem item, int userId = -1);
|
||||
void Delete(IEnumerable<TItem> item, int userId = -1);
|
||||
void Delete(TItem item, int userId = 0);
|
||||
void Delete(IEnumerable<TItem> item, int userId = 0);
|
||||
|
||||
|
||||
Attempt<string[]> ValidateComposition(TItem compo);
|
||||
@@ -41,15 +41,15 @@ namespace Umbraco.Core.Services
|
||||
/// <returns></returns>
|
||||
bool HasContainerInPath(string contentPath);
|
||||
|
||||
Attempt<OperationResult<OperationResultType, EntityContainer>> CreateContainer(int parentContainerId, string name, int userId = -1);
|
||||
Attempt<OperationResult> SaveContainer(EntityContainer container, int userId = -1);
|
||||
Attempt<OperationResult<OperationResultType, EntityContainer>> CreateContainer(int parentContainerId, string name, int userId = 0);
|
||||
Attempt<OperationResult> SaveContainer(EntityContainer container, int userId = 0);
|
||||
EntityContainer GetContainer(int containerId);
|
||||
EntityContainer GetContainer(Guid containerId);
|
||||
IEnumerable<EntityContainer> GetContainers(int[] containerIds);
|
||||
IEnumerable<EntityContainer> GetContainers(TItem contentType);
|
||||
IEnumerable<EntityContainer> GetContainers(string folderName, int level);
|
||||
Attempt<OperationResult> DeleteContainer(int containerId, int userId = -1);
|
||||
Attempt<OperationResult<OperationResultType, EntityContainer>> RenameContainer(int id, string name, int userId = -1);
|
||||
Attempt<OperationResult> DeleteContainer(int containerId, int userId = 0);
|
||||
Attempt<OperationResult<OperationResultType, EntityContainer>> RenameContainer(int id, string name, int userId = 0);
|
||||
|
||||
Attempt<OperationResult<MoveOperationStatusType>> Move(TItem moving, int containerId);
|
||||
Attempt<OperationResult<MoveOperationStatusType, TItem>> Copy(TItem copying, int containerId);
|
||||
|
||||
@@ -9,15 +9,15 @@ namespace Umbraco.Core.Services
|
||||
/// </summary>
|
||||
public interface IDataTypeService : IService
|
||||
{
|
||||
Attempt<OperationResult<OperationResultType, EntityContainer>> CreateContainer(int parentId, string name, int userId = -1);
|
||||
Attempt<OperationResult> SaveContainer(EntityContainer container, int userId = -1);
|
||||
Attempt<OperationResult<OperationResultType, EntityContainer>> CreateContainer(int parentId, string name, int userId = 0);
|
||||
Attempt<OperationResult> SaveContainer(EntityContainer container, int userId = 0);
|
||||
EntityContainer GetContainer(int containerId);
|
||||
EntityContainer GetContainer(Guid containerId);
|
||||
IEnumerable<EntityContainer> GetContainers(string folderName, int level);
|
||||
IEnumerable<EntityContainer> GetContainers(IDataType dataType);
|
||||
IEnumerable<EntityContainer> GetContainers(int[] containerIds);
|
||||
Attempt<OperationResult> DeleteContainer(int containerId, int userId = -1);
|
||||
Attempt<OperationResult<OperationResultType, EntityContainer>> RenameContainer(int id, string name, int userId = -1);
|
||||
Attempt<OperationResult> DeleteContainer(int containerId, int userId = 0);
|
||||
Attempt<OperationResult<OperationResultType, EntityContainer>> RenameContainer(int id, string name, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="IDataType"/> by its Name
|
||||
@@ -52,14 +52,14 @@ namespace Umbraco.Core.Services
|
||||
/// </summary>
|
||||
/// <param name="dataType"><see cref="IDataType"/> to save</param>
|
||||
/// <param name="userId">Id of the user issueing the save</param>
|
||||
void Save(IDataType dataType, int userId = -1);
|
||||
void Save(IDataType dataType, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Saves a collection of <see cref="IDataType"/>
|
||||
/// </summary>
|
||||
/// <param name="dataTypeDefinitions"><see cref="IDataType"/> to save</param>
|
||||
/// <param name="userId">Id of the user issueing the save</param>
|
||||
void Save(IEnumerable<IDataType> dataTypeDefinitions, int userId = -1);
|
||||
void Save(IEnumerable<IDataType> dataTypeDefinitions, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Saves a collection of <see cref="IDataType"/>
|
||||
@@ -78,7 +78,7 @@ namespace Umbraco.Core.Services
|
||||
/// </remarks>
|
||||
/// <param name="dataType"><see cref="IDataType"/> to delete</param>
|
||||
/// <param name="userId">Id of the user issueing the deletion</param>
|
||||
void Delete(IDataType dataType, int userId = -1);
|
||||
void Delete(IDataType dataType, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="IDataType"/> by its control Id
|
||||
|
||||
@@ -18,12 +18,12 @@ namespace Umbraco.Core.Services
|
||||
IPartialView GetPartialView(string path);
|
||||
IPartialView GetPartialViewMacro(string path);
|
||||
IEnumerable<IPartialView> GetPartialViewMacros(params string[] names);
|
||||
Attempt<IPartialView> CreatePartialView(IPartialView partialView, string snippetName = null, int userId = -1);
|
||||
Attempt<IPartialView> CreatePartialViewMacro(IPartialView partialView, string snippetName = null, int userId = -1);
|
||||
bool DeletePartialView(string path, int userId = -1);
|
||||
bool DeletePartialViewMacro(string path, int userId = -1);
|
||||
Attempt<IPartialView> SavePartialView(IPartialView partialView, int userId = -1);
|
||||
Attempt<IPartialView> SavePartialViewMacro(IPartialView partialView, int userId = -1);
|
||||
Attempt<IPartialView> CreatePartialView(IPartialView partialView, string snippetName = null, int userId = 0);
|
||||
Attempt<IPartialView> CreatePartialViewMacro(IPartialView partialView, string snippetName = null, int userId = 0);
|
||||
bool DeletePartialView(string path, int userId = 0);
|
||||
bool DeletePartialViewMacro(string path, int userId = 0);
|
||||
Attempt<IPartialView> SavePartialView(IPartialView partialView, int userId = 0);
|
||||
Attempt<IPartialView> SavePartialViewMacro(IPartialView partialView, int userId = 0);
|
||||
bool ValidatePartialView(PartialView partialView);
|
||||
bool ValidatePartialViewMacro(PartialView partialView);
|
||||
|
||||
@@ -45,14 +45,14 @@ namespace Umbraco.Core.Services
|
||||
/// </summary>
|
||||
/// <param name="stylesheet"><see cref="Stylesheet"/> to save</param>
|
||||
/// <param name="userId">Optional id of the user saving the stylesheet</param>
|
||||
void SaveStylesheet(Stylesheet stylesheet, int userId = -1);
|
||||
void SaveStylesheet(Stylesheet stylesheet, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a stylesheet by its name
|
||||
/// </summary>
|
||||
/// <param name="path">Name incl. extension of the Stylesheet to delete</param>
|
||||
/// <param name="userId">Optional id of the user deleting the stylesheet</param>
|
||||
void DeleteStylesheet(string path, int userId = -1);
|
||||
void DeleteStylesheet(string path, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Validates a <see cref="Stylesheet"/>
|
||||
@@ -79,14 +79,14 @@ namespace Umbraco.Core.Services
|
||||
/// </summary>
|
||||
/// <param name="script"><see cref="Script"/> to save</param>
|
||||
/// <param name="userId">Optional id of the user saving the script</param>
|
||||
void SaveScript(Script script, int userId = -1);
|
||||
void SaveScript(Script script, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a script by its name
|
||||
/// </summary>
|
||||
/// <param name="path">Name incl. extension of the Script to delete</param>
|
||||
/// <param name="userId">Optional id of the user deleting the script</param>
|
||||
void DeleteScript(string path, int userId = -1);
|
||||
void DeleteScript(string path, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Validates a <see cref="Script"/>
|
||||
@@ -189,7 +189,7 @@ namespace Umbraco.Core.Services
|
||||
/// </summary>
|
||||
/// <param name="template"><see cref="ITemplate"/> to save</param>
|
||||
/// <param name="userId">Optional id of the user saving the template</param>
|
||||
void SaveTemplate(ITemplate template, int userId = -1);
|
||||
void SaveTemplate(ITemplate template, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a template for a content type
|
||||
@@ -200,16 +200,16 @@ namespace Umbraco.Core.Services
|
||||
/// <returns>
|
||||
/// The template created
|
||||
/// </returns>
|
||||
Attempt<OperationResult<OperationResultType, ITemplate>> CreateTemplateForContentType(string contentTypeAlias, string contentTypeName, int userId = -1);
|
||||
Attempt<OperationResult<OperationResultType, ITemplate>> CreateTemplateForContentType(string contentTypeAlias, string contentTypeName, int userId = 0);
|
||||
|
||||
ITemplate CreateTemplateWithIdentity(string name, string content, ITemplate masterTemplate = null, int userId = -1);
|
||||
ITemplate CreateTemplateWithIdentity(string name, string content, ITemplate masterTemplate = null, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a template by its alias
|
||||
/// </summary>
|
||||
/// <param name="alias">Alias of the <see cref="ITemplate"/> to delete</param>
|
||||
/// <param name="userId">Optional id of the user deleting the template</param>
|
||||
void DeleteTemplate(string alias, int userId = -1);
|
||||
void DeleteTemplate(string alias, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Validates a <see cref="ITemplate"/>
|
||||
@@ -223,7 +223,7 @@ namespace Umbraco.Core.Services
|
||||
/// </summary>
|
||||
/// <param name="templates">List of <see cref="Template"/> to save</param>
|
||||
/// <param name="userId">Optional id of the user</param>
|
||||
void SaveTemplate(IEnumerable<ITemplate> templates, int userId = -1);
|
||||
void SaveTemplate(IEnumerable<ITemplate> templates, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// This checks what the default rendering engine is set in config but then also ensures that there isn't already
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace Umbraco.Core.Services
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItem"><see cref="IDictionaryItem"/> to save</param>
|
||||
/// <param name="userId">Optional id of the user saving the dictionary item</param>
|
||||
void Save(IDictionaryItem dictionaryItem, int userId = -1);
|
||||
void Save(IDictionaryItem dictionaryItem, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a <see cref="IDictionaryItem"/> object and its related translations
|
||||
@@ -94,7 +94,7 @@ namespace Umbraco.Core.Services
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItem"><see cref="IDictionaryItem"/> to delete</param>
|
||||
/// <param name="userId">Optional id of the user deleting the dictionary item</param>
|
||||
void Delete(IDictionaryItem dictionaryItem, int userId = -1);
|
||||
void Delete(IDictionaryItem dictionaryItem, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="ILanguage"/> by its id
|
||||
@@ -153,14 +153,14 @@ namespace Umbraco.Core.Services
|
||||
/// </summary>
|
||||
/// <param name="language"><see cref="ILanguage"/> to save</param>
|
||||
/// <param name="userId">Optional id of the user saving the language</param>
|
||||
void Save(ILanguage language, int userId = -1);
|
||||
void Save(ILanguage language, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a <see cref="ILanguage"/> by removing it and its usages from the db
|
||||
/// </summary>
|
||||
/// <param name="language"><see cref="ILanguage"/> to delete</param>
|
||||
/// <param name="userId">Optional id of the user deleting the language</param>
|
||||
void Delete(ILanguage language, int userId = -1);
|
||||
void Delete(ILanguage language, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the full dictionary key map.
|
||||
|
||||
@@ -39,14 +39,14 @@ namespace Umbraco.Core.Services
|
||||
/// </summary>
|
||||
/// <param name="macro"><see cref="IMacro"/> to delete</param>
|
||||
/// <param name="userId">Optional id of the user deleting the macro</param>
|
||||
void Delete(IMacro macro, int userId = -1);
|
||||
void Delete(IMacro macro, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Saves an <see cref="IMacro"/>
|
||||
/// </summary>
|
||||
/// <param name="macro"><see cref="IMacro"/> to save</param>
|
||||
/// <param name="userId">Optional id of the user saving the macro</param>
|
||||
void Save(IMacro macro, int userId = -1);
|
||||
void Save(IMacro macro, int userId = 0);
|
||||
|
||||
///// <summary>
|
||||
///// Gets a list all available <see cref="IMacroPropertyType"/> plugins
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Umbraco.Core.Services
|
||||
/// </summary>
|
||||
/// <param name="media">The <see cref="IMedia"/> to delete</param>
|
||||
/// <param name="userId">Id of the User deleting the Media</param>
|
||||
Attempt<OperationResult> MoveToRecycleBin(IMedia media, int userId = -1);
|
||||
Attempt<OperationResult> MoveToRecycleBin(IMedia media, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Permanently deletes an <see cref="IMedia"/> object
|
||||
@@ -36,7 +36,7 @@ namespace Umbraco.Core.Services
|
||||
/// </remarks>
|
||||
/// <param name="media">The <see cref="IMedia"/> to delete</param>
|
||||
/// <param name="userId">Id of the User deleting the Media</param>
|
||||
Attempt<OperationResult> Delete(IMedia media, int userId = -1);
|
||||
Attempt<OperationResult> Delete(IMedia media, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Saves a single <see cref="IMedia"/> object
|
||||
@@ -44,7 +44,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="media">The <see cref="IMedia"/> to save</param>
|
||||
/// <param name="userId">Id of the User saving the Media</param>
|
||||
/// <param name="raiseEvents">Optional boolean indicating whether or not to raise events.</param>
|
||||
Attempt<OperationResult> Save(IMedia media, int userId = -1, bool raiseEvents = true);
|
||||
Attempt<OperationResult> Save(IMedia media, int userId = 0, bool raiseEvents = true);
|
||||
|
||||
/// <summary>
|
||||
/// Saves a collection of <see cref="IMedia"/> objects
|
||||
@@ -52,7 +52,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="medias">Collection of <see cref="IMedia"/> to save</param>
|
||||
/// <param name="userId">Id of the User saving the Media</param>
|
||||
/// <param name="raiseEvents">Optional boolean indicating whether or not to raise events.</param>
|
||||
Attempt<OperationResult> Save(IEnumerable<IMedia> medias, int userId = -1, bool raiseEvents = true);
|
||||
Attempt<OperationResult> Save(IEnumerable<IMedia> medias, int userId = 0, bool raiseEvents = true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -82,7 +82,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="mediaTypeAlias">Alias of the <see cref="IMediaType"/></param>
|
||||
/// <param name="userId">Optional id of the user creating the media item</param>
|
||||
/// <returns><see cref="IMedia"/></returns>
|
||||
IMedia CreateMedia(string name, Guid parentId, string mediaTypeAlias, int userId = -1);
|
||||
IMedia CreateMedia(string name, Guid parentId, string mediaTypeAlias, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Creates an <see cref="IMedia"/> object using the alias of the <see cref="IMediaType"/>
|
||||
@@ -98,7 +98,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="mediaTypeAlias">Alias of the <see cref="IMediaType"/></param>
|
||||
/// <param name="userId">Optional id of the user creating the media item</param>
|
||||
/// <returns><see cref="IMedia"/></returns>
|
||||
IMedia CreateMedia(string name, int parentId, string mediaTypeAlias, int userId = -1);
|
||||
IMedia CreateMedia(string name, int parentId, string mediaTypeAlias, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Creates an <see cref="IMedia"/> object using the alias of the <see cref="IMediaType"/>
|
||||
@@ -114,7 +114,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="mediaTypeAlias">Alias of the <see cref="IMediaType"/></param>
|
||||
/// <param name="userId">Optional id of the user creating the media item</param>
|
||||
/// <returns><see cref="IMedia"/></returns>
|
||||
IMedia CreateMedia(string name, IMedia parent, string mediaTypeAlias, int userId = -1);
|
||||
IMedia CreateMedia(string name, IMedia parent, string mediaTypeAlias, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="IMedia"/> object by Id
|
||||
@@ -236,14 +236,14 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="media">The <see cref="IMedia"/> to move</param>
|
||||
/// <param name="parentId">Id of the Media's new Parent</param>
|
||||
/// <param name="userId">Id of the User moving the Media</param>
|
||||
void Move(IMedia media, int parentId, int userId = -1);
|
||||
void Move(IMedia media, int parentId, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes an <see cref="IMedia"/> object by moving it to the Recycle Bin
|
||||
/// </summary>
|
||||
/// <param name="media">The <see cref="IMedia"/> to delete</param>
|
||||
/// <param name="userId">Id of the User deleting the Media</param>
|
||||
void MoveToRecycleBin(IMedia media, int userId = -1);
|
||||
void MoveToRecycleBin(IMedia media, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Empties the Recycle Bin by deleting all <see cref="IMedia"/> that resides in the bin
|
||||
@@ -256,7 +256,7 @@ namespace Umbraco.Core.Services
|
||||
/// <remarks>This needs extra care and attention as its potentially a dangerous and extensive operation</remarks>
|
||||
/// <param name="mediaTypeId">Id of the <see cref="IMediaType"/></param>
|
||||
/// <param name="userId">Optional Id of the user deleting Media</param>
|
||||
void DeleteMediaOfType(int mediaTypeId, int userId = -1);
|
||||
void DeleteMediaOfType(int mediaTypeId, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes all media of the specified types. All Descendants of deleted media that is not of these types is moved to Recycle Bin.
|
||||
@@ -264,7 +264,7 @@ namespace Umbraco.Core.Services
|
||||
/// <remarks>This needs extra care and attention as its potentially a dangerous and extensive operation</remarks>
|
||||
/// <param name="mediaTypeIds">Ids of the <see cref="IMediaType"/>s</param>
|
||||
/// <param name="userId">Optional Id of the user issueing the delete operation</param>
|
||||
void DeleteMediaOfTypes(IEnumerable<int> mediaTypeIds, int userId = -1);
|
||||
void DeleteMediaOfTypes(IEnumerable<int> mediaTypeIds, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Permanently deletes an <see cref="IMedia"/> object
|
||||
@@ -275,7 +275,7 @@ namespace Umbraco.Core.Services
|
||||
/// </remarks>
|
||||
/// <param name="media">The <see cref="IMedia"/> to delete</param>
|
||||
/// <param name="userId">Id of the User deleting the Media</param>
|
||||
void Delete(IMedia media, int userId = -1);
|
||||
void Delete(IMedia media, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Saves a single <see cref="IMedia"/> object
|
||||
@@ -283,7 +283,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="media">The <see cref="IMedia"/> to save</param>
|
||||
/// <param name="userId">Id of the User saving the Media</param>
|
||||
/// <param name="raiseEvents">Optional boolean indicating whether or not to raise events.</param>
|
||||
void Save(IMedia media, int userId = -1, bool raiseEvents = true);
|
||||
void Save(IMedia media, int userId = 0, bool raiseEvents = true);
|
||||
|
||||
/// <summary>
|
||||
/// Saves a collection of <see cref="IMedia"/> objects
|
||||
@@ -291,7 +291,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="medias">Collection of <see cref="IMedia"/> to save</param>
|
||||
/// <param name="userId">Id of the User saving the Media</param>
|
||||
/// <param name="raiseEvents">Optional boolean indicating whether or not to raise events.</param>
|
||||
void Save(IEnumerable<IMedia> medias, int userId = -1, bool raiseEvents = true);
|
||||
void Save(IEnumerable<IMedia> medias, int userId = 0, bool raiseEvents = true);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="IMedia"/> object by its 'UniqueId'
|
||||
@@ -334,7 +334,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="id">Id of the <see cref="IMedia"/> object to delete versions from</param>
|
||||
/// <param name="versionDate">Latest version date</param>
|
||||
/// <param name="userId">Optional Id of the User deleting versions of a Content object</param>
|
||||
void DeleteVersions(int id, DateTime versionDate, int userId = -1);
|
||||
void DeleteVersions(int id, DateTime versionDate, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Permanently deletes specific version(s) from an <see cref="IMedia"/> object.
|
||||
@@ -343,7 +343,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="versionId">Id of the version to delete</param>
|
||||
/// <param name="deletePriorVersions">Boolean indicating whether to delete versions prior to the versionId</param>
|
||||
/// <param name="userId">Optional Id of the User deleting versions of a Content object</param>
|
||||
void DeleteVersion(int id, int versionId, bool deletePriorVersions, int userId = -1);
|
||||
void DeleteVersion(int id, int versionId, bool deletePriorVersions, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="IMedia"/> object from the path stored in the 'umbracoFile' property.
|
||||
@@ -395,7 +395,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="raiseEvents"></param>
|
||||
/// <returns>True if sorting succeeded, otherwise False</returns>
|
||||
bool Sort(IEnumerable<IMedia> items, int userId = -1, bool raiseEvents = true);
|
||||
bool Sort(IEnumerable<IMedia> items, int userId = 0, bool raiseEvents = true);
|
||||
|
||||
/// <summary>
|
||||
/// Creates an <see cref="IMedia"/> object using the alias of the <see cref="IMediaType"/>
|
||||
@@ -410,7 +410,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="mediaTypeAlias">Alias of the <see cref="IMediaType"/></param>
|
||||
/// <param name="userId">Optional id of the user creating the media item</param>
|
||||
/// <returns><see cref="IMedia"/></returns>
|
||||
IMedia CreateMediaWithIdentity(string name, IMedia parent, string mediaTypeAlias, int userId = -1);
|
||||
IMedia CreateMediaWithIdentity(string name, IMedia parent, string mediaTypeAlias, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Creates an <see cref="IMedia"/> object using the alias of the <see cref="IMediaType"/>
|
||||
@@ -425,7 +425,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="mediaTypeAlias">Alias of the <see cref="IMediaType"/></param>
|
||||
/// <param name="userId">Optional id of the user creating the media item</param>
|
||||
/// <returns><see cref="IMedia"/></returns>
|
||||
IMedia CreateMediaWithIdentity(string name, int parentId, string mediaTypeAlias, int userId = -1);
|
||||
IMedia CreateMediaWithIdentity(string name, int parentId, string mediaTypeAlias, int userId = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the content of a media as a stream.
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="userId">Optional Id of the user performing the import</param>
|
||||
/// <param name="raiseEvents">Optional parameter indicating whether or not to raise events</param>
|
||||
/// <returns>An enumrable list of generated content</returns>
|
||||
IEnumerable<IContent> ImportContent(XElement element, int parentId = -1, int userId = -1, bool raiseEvents = true);
|
||||
IEnumerable<IContent> ImportContent(XElement element, int parentId = -1, int userId = 0, bool raiseEvents = true);
|
||||
|
||||
/// <summary>
|
||||
/// Imports and saves package xml as <see cref="IContentType"/>
|
||||
@@ -24,7 +24,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="userId">Optional id of the User performing the operation. Default is zero (admin)</param>
|
||||
/// <param name="raiseEvents">Optional parameter indicating whether or not to raise events</param>
|
||||
/// <returns>An enumrable list of generated ContentTypes</returns>
|
||||
IEnumerable<IContentType> ImportContentTypes(XElement element, int userId = -1, bool raiseEvents = true);
|
||||
IEnumerable<IContentType> ImportContentTypes(XElement element, int userId = 0, bool raiseEvents = true);
|
||||
|
||||
/// <summary>
|
||||
/// Imports and saves package xml as <see cref="IContentType"/>
|
||||
@@ -34,7 +34,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="userId">Optional id of the User performing the operation. Default is zero (admin)</param>
|
||||
/// <param name="raiseEvents">Optional parameter indicating whether or not to raise events</param>
|
||||
/// <returns>An enumrable list of generated ContentTypes</returns>
|
||||
IEnumerable<IContentType> ImportContentTypes(XElement element, bool importStructure, int userId = -1, bool raiseEvents = true);
|
||||
IEnumerable<IContentType> ImportContentTypes(XElement element, bool importStructure, int userId = 0, bool raiseEvents = true);
|
||||
|
||||
/// <summary>
|
||||
/// Imports and saves package xml as <see cref="IDataType"/>
|
||||
@@ -43,7 +43,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="userId">Optional id of the User performing the operation. Default is zero (admin).</param>
|
||||
/// <param name="raiseEvents">Optional parameter indicating whether or not to raise events</param>
|
||||
/// <returns>An enumrable list of generated DataTypeDefinitions</returns>
|
||||
IEnumerable<IDataType> ImportDataTypeDefinitions(XElement element, int userId = -1, bool raiseEvents = true);
|
||||
IEnumerable<IDataType> ImportDataTypeDefinitions(XElement element, int userId = 0, bool raiseEvents = true);
|
||||
|
||||
/// <summary>
|
||||
/// Imports and saves the 'DictionaryItems' part of the package xml as a list of <see cref="IDictionaryItem"/>
|
||||
@@ -60,7 +60,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="userId">Optional id of the User performing the operation. Default is zero (admin)</param>
|
||||
/// <param name="raiseEvents">Optional parameter indicating whether or not to raise events</param>
|
||||
/// <returns>An enumerable list of generated languages</returns>
|
||||
IEnumerable<ILanguage> ImportLanguages(XElement languageElementList, int userId = -1, bool raiseEvents = true);
|
||||
IEnumerable<ILanguage> ImportLanguages(XElement languageElementList, int userId = 0, bool raiseEvents = true);
|
||||
|
||||
/// <summary>
|
||||
/// Imports and saves the 'Macros' part of a package xml as a list of <see cref="IMacro"/>
|
||||
@@ -69,7 +69,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="userId">Optional id of the User performing the operation</param>
|
||||
/// <param name="raiseEvents">Optional parameter indicating whether or not to raise events</param>
|
||||
/// <returns></returns>
|
||||
IEnumerable<IMacro> ImportMacros(XElement element, int userId = -1, bool raiseEvents = true);
|
||||
IEnumerable<IMacro> ImportMacros(XElement element, int userId = 0, bool raiseEvents = true);
|
||||
|
||||
/// <summary>
|
||||
/// Imports and saves package xml as <see cref="ITemplate"/>
|
||||
@@ -78,7 +78,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="userId">Optional id of the User performing the operation. Default is zero (admin)</param>
|
||||
/// <param name="raiseEvents">Optional parameter indicating whether or not to raise events</param>
|
||||
/// <returns>An enumrable list of generated Templates</returns>
|
||||
IEnumerable<ITemplate> ImportTemplates(XElement element, int userId = -1, bool raiseEvents = true);
|
||||
IEnumerable<ITemplate> ImportTemplates(XElement element, int userId = 0, bool raiseEvents = true);
|
||||
|
||||
/// <summary>
|
||||
/// Exports an <see cref="IContentType"/> to xml as an <see cref="XElement"/>
|
||||
|
||||
@@ -162,7 +162,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="contentTypeAlias">Alias of the <see cref="IContentType"/></param>
|
||||
/// <param name="userId">Optional id of the user creating the content</param>
|
||||
/// <returns><see cref="IContent"/></returns>
|
||||
public IContent Create(string name, Guid parentId, string contentTypeAlias, int userId = -1)
|
||||
public IContent Create(string name, Guid parentId, string contentTypeAlias, int userId = 0)
|
||||
{
|
||||
//fixme - what about culture?
|
||||
|
||||
@@ -182,7 +182,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="contentTypeAlias">The alias of the content type.</param>
|
||||
/// <param name="userId">The optional id of the user creating the content.</param>
|
||||
/// <returns>The content object.</returns>
|
||||
public IContent Create(string name, int parentId, string contentTypeAlias, int userId = -1)
|
||||
public IContent Create(string name, int parentId, string contentTypeAlias, int userId = 0)
|
||||
{
|
||||
//fixme - what about culture?
|
||||
|
||||
@@ -215,7 +215,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="contentTypeAlias">The alias of the content type.</param>
|
||||
/// <param name="userId">The optional id of the user creating the content.</param>
|
||||
/// <returns>The content object.</returns>
|
||||
public IContent Create(string name, IContent parent, string contentTypeAlias, int userId = -1)
|
||||
public IContent Create(string name, IContent parent, string contentTypeAlias, int userId = 0)
|
||||
{
|
||||
//fixme - what about culture?
|
||||
|
||||
@@ -246,7 +246,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="contentTypeAlias">The alias of the content type.</param>
|
||||
/// <param name="userId">The optional id of the user creating the content.</param>
|
||||
/// <returns>The content object.</returns>
|
||||
public IContent CreateAndSave(string name, int parentId, string contentTypeAlias, int userId = -1)
|
||||
public IContent CreateAndSave(string name, int parentId, string contentTypeAlias, int userId = 0)
|
||||
{
|
||||
//fixme - what about culture?
|
||||
|
||||
@@ -280,7 +280,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="contentTypeAlias">The alias of the content type.</param>
|
||||
/// <param name="userId">The optional id of the user creating the content.</param>
|
||||
/// <returns>The content object.</returns>
|
||||
public IContent CreateAndSave(string name, IContent parent, string contentTypeAlias, int userId = -1)
|
||||
public IContent CreateAndSave(string name, IContent parent, string contentTypeAlias, int userId = 0)
|
||||
{
|
||||
//fixme - what about culture?
|
||||
|
||||
@@ -858,7 +858,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
// fixme - kill all those raiseEvents
|
||||
|
||||
/// <inheritdoc />
|
||||
public OperationResult Save(IContent content, int userId = -1, bool raiseEvents = true)
|
||||
public OperationResult Save(IContent content, int userId = 0, bool raiseEvents = true)
|
||||
{
|
||||
var publishedState = content.PublishedState;
|
||||
if (publishedState != PublishedState.Published && publishedState != PublishedState.Unpublished)
|
||||
@@ -900,7 +900,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public OperationResult Save(IEnumerable<IContent> contents, int userId = -1, bool raiseEvents = true)
|
||||
public OperationResult Save(IEnumerable<IContent> contents, int userId = 0, bool raiseEvents = true)
|
||||
{
|
||||
var evtMsgs = EventMessagesFactory.Get();
|
||||
var contentsA = contents.ToArray();
|
||||
@@ -942,7 +942,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public PublishResult SaveAndPublish(IContent content, int userId = -1, bool raiseEvents = true)
|
||||
public PublishResult SaveAndPublish(IContent content, int userId = 0, bool raiseEvents = true)
|
||||
{
|
||||
var evtMsgs = EventMessagesFactory.Get();
|
||||
PublishResult result;
|
||||
@@ -1026,7 +1026,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public UnpublishResult Unpublish(IContent content, string culture = null, string segment = null, int userId = -1)
|
||||
public UnpublishResult Unpublish(IContent content, string culture = null, string segment = null, int userId = 0)
|
||||
{
|
||||
var evtMsgs = EventMessagesFactory.Get();
|
||||
|
||||
@@ -1189,7 +1189,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<PublishResult> SaveAndPublishBranch(IContent content, bool force, string culture = null, string segment = null, int userId = -1)
|
||||
public IEnumerable<PublishResult> SaveAndPublishBranch(IContent content, bool force, string culture = null, string segment = null, int userId = 0)
|
||||
{
|
||||
segment = segment?.ToLowerInvariant();
|
||||
|
||||
@@ -1201,7 +1201,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<PublishResult> SaveAndPublishBranch(IContent document, bool force,
|
||||
Func<IContent, bool> editing, Func<IContent, bool> publishValues, int userId = -1)
|
||||
Func<IContent, bool> editing, Func<IContent, bool> publishValues, int userId = 0)
|
||||
{
|
||||
var evtMsgs = EventMessagesFactory.Get();
|
||||
var results = new List<PublishResult>();
|
||||
@@ -1372,7 +1372,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="id">Id of the <see cref="IContent"/> object to delete versions from</param>
|
||||
/// <param name="versionDate">Latest version date</param>
|
||||
/// <param name="userId">Optional Id of the User deleting versions of a Content object</param>
|
||||
public void DeleteVersions(int id, DateTime versionDate, int userId = -1)
|
||||
public void DeleteVersions(int id, DateTime versionDate, int userId = 0)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -1402,7 +1402,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="versionId">Id of the version to delete</param>
|
||||
/// <param name="deletePriorVersions">Boolean indicating whether to delete versions prior to the versionId</param>
|
||||
/// <param name="userId">Optional Id of the User deleting versions of a Content object</param>
|
||||
public void DeleteVersion(int id, int versionId, bool deletePriorVersions, int userId = -1)
|
||||
public void DeleteVersion(int id, int versionId, bool deletePriorVersions, int userId = 0)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -1489,7 +1489,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="content">The <see cref="IContent"/> to move</param>
|
||||
/// <param name="parentId">Id of the Content's new Parent</param>
|
||||
/// <param name="userId">Optional Id of the User moving the Content</param>
|
||||
public void Move(IContent content, int parentId, int userId = -1)
|
||||
public void Move(IContent content, int parentId, int userId = 0)
|
||||
{
|
||||
// if moving to the recycle bin then use the proper method
|
||||
if (parentId == Constants.System.RecycleBinContent)
|
||||
@@ -1660,7 +1660,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="relateToOriginal">Boolean indicating whether the copy should be related to the original</param>
|
||||
/// <param name="userId">Optional Id of the User copying the Content</param>
|
||||
/// <returns>The newly created <see cref="IContent"/> object</returns>
|
||||
public IContent Copy(IContent content, int parentId, bool relateToOriginal, int userId = -1)
|
||||
public IContent Copy(IContent content, int parentId, bool relateToOriginal, int userId = 0)
|
||||
{
|
||||
return Copy(content, parentId, relateToOriginal, true, userId);
|
||||
}
|
||||
@@ -1675,7 +1675,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="recursive">A value indicating whether to recursively copy children.</param>
|
||||
/// <param name="userId">Optional Id of the User copying the Content</param>
|
||||
/// <returns>The newly created <see cref="IContent"/> object</returns>
|
||||
public IContent Copy(IContent content, int parentId, bool relateToOriginal, bool recursive, int userId = -1)
|
||||
public IContent Copy(IContent content, int parentId, bool relateToOriginal, bool recursive, int userId = 0)
|
||||
{
|
||||
var copy = content.DeepCloneWithResetIdentities();
|
||||
copy.ParentId = parentId;
|
||||
@@ -1771,7 +1771,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="content">The <see cref="IContent"/> to send to publication</param>
|
||||
/// <param name="userId">Optional Id of the User issueing the send to publication</param>
|
||||
/// <returns>True if sending publication was succesfull otherwise false</returns>
|
||||
public bool SendToPublication(IContent content, int userId = -1)
|
||||
public bool SendToPublication(IContent content, int userId = 0)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -1806,7 +1806,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="raiseEvents"></param>
|
||||
/// <returns>True if sorting succeeded, otherwise False</returns>
|
||||
public bool Sort(IEnumerable<IContent> items, int userId = -1, bool raiseEvents = true)
|
||||
public bool Sort(IEnumerable<IContent> items, int userId = 0, bool raiseEvents = true)
|
||||
{
|
||||
var itemsA = items.ToArray();
|
||||
if (itemsA.Length == 0) return true;
|
||||
@@ -1833,7 +1833,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="raiseEvents"></param>
|
||||
/// <returns>True if sorting succeeded, otherwise False</returns>
|
||||
public bool Sort(IEnumerable<int> ids, int userId = -1, bool raiseEvents = true)
|
||||
public bool Sort(IEnumerable<int> ids, int userId = 0, bool raiseEvents = true)
|
||||
{
|
||||
var idsA = ids.ToArray();
|
||||
if (idsA.Length == 0) return true;
|
||||
@@ -2211,7 +2211,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// </remarks>
|
||||
/// <param name="contentTypeId">Id of the <see cref="IContentType"/></param>
|
||||
/// <param name="userId">Optional Id of the user issueing the delete operation</param>
|
||||
public void DeleteOfTypes(IEnumerable<int> contentTypeIds, int userId = -1)
|
||||
public void DeleteOfTypes(IEnumerable<int> contentTypeIds, int userId = 0)
|
||||
{
|
||||
//TODO: This currently this is called from the ContentTypeService but that needs to change,
|
||||
// if we are deleting a content type, we should just delete the data and do this operation slightly differently.
|
||||
@@ -2287,7 +2287,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <remarks>This needs extra care and attention as its potentially a dangerous and extensive operation</remarks>
|
||||
/// <param name="contentTypeId">Id of the <see cref="IContentType"/></param>
|
||||
/// <param name="userId">Optional id of the user deleting the media</param>
|
||||
public void DeleteOfType(int contentTypeId, int userId = -1)
|
||||
public void DeleteOfType(int contentTypeId, int userId = 0)
|
||||
{
|
||||
DeleteOfTypes(new[] { contentTypeId }, userId);
|
||||
}
|
||||
@@ -2345,7 +2345,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
}
|
||||
|
||||
public void SaveBlueprint(IContent content, int userId = -1)
|
||||
public void SaveBlueprint(IContent content, int userId = 0)
|
||||
{
|
||||
//always ensure the blueprint is at the root
|
||||
if (content.ParentId != -1)
|
||||
@@ -2376,7 +2376,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
}
|
||||
|
||||
public void DeleteBlueprint(IContent content, int userId = -1)
|
||||
public void DeleteBlueprint(IContent content, int userId = 0)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -2387,7 +2387,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
}
|
||||
|
||||
public IContent CreateContentFromBlueprint(IContent blueprint, string name, int userId = -1)
|
||||
public IContent CreateContentFromBlueprint(IContent blueprint, string name, int userId = 0)
|
||||
{
|
||||
if (blueprint == null) throw new ArgumentNullException(nameof(blueprint));
|
||||
|
||||
@@ -2421,7 +2421,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
}
|
||||
|
||||
public void DeleteBlueprintsOfTypes(IEnumerable<int> contentTypeIds, int userId = -1)
|
||||
public void DeleteBlueprintsOfTypes(IEnumerable<int> contentTypeIds, int userId = 0)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -2448,7 +2448,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
}
|
||||
|
||||
public void DeleteBlueprintsOfType(int contentTypeId, int userId = -1)
|
||||
public void DeleteBlueprintsOfType(int contentTypeId, int userId = 0)
|
||||
{
|
||||
DeleteBlueprintsOfTypes(new[] { contentTypeId }, userId);
|
||||
}
|
||||
|
||||
@@ -377,7 +377,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
|
||||
#region Save
|
||||
|
||||
public void Save(TItem item, int userId = -1)
|
||||
public void Save(TItem item, int userId = 0)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -415,7 +415,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
}
|
||||
|
||||
public void Save(IEnumerable<TItem> items, int userId = -1)
|
||||
public void Save(IEnumerable<TItem> items, int userId = 0)
|
||||
{
|
||||
var itemsA = items.ToArray();
|
||||
|
||||
@@ -461,7 +461,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
|
||||
#region Delete
|
||||
|
||||
public void Delete(TItem item, int userId = -1)
|
||||
public void Delete(TItem item, int userId = 0)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -515,7 +515,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
}
|
||||
|
||||
public void Delete(IEnumerable<TItem> items, int userId = -1)
|
||||
public void Delete(IEnumerable<TItem> items, int userId = 0)
|
||||
{
|
||||
var itemsA = items.ToArray();
|
||||
|
||||
@@ -736,7 +736,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
|
||||
protected Guid ContainerObjectType => EntityContainer.GetContainerObjectType(ContainedObjectType);
|
||||
|
||||
public Attempt<OperationResult<OperationResultType, EntityContainer>> CreateContainer(int parentId, string name, int userId = -1)
|
||||
public Attempt<OperationResult<OperationResultType, EntityContainer>> CreateContainer(int parentId, string name, int userId = 0)
|
||||
{
|
||||
var evtMsgs = EventMessagesFactory.Get();
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
@@ -776,7 +776,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
}
|
||||
|
||||
public Attempt<OperationResult> SaveContainer(EntityContainer container, int userId = -1)
|
||||
public Attempt<OperationResult> SaveContainer(EntityContainer container, int userId = 0)
|
||||
{
|
||||
var evtMsgs = EventMessagesFactory.Get();
|
||||
|
||||
@@ -870,7 +870,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
}
|
||||
|
||||
public Attempt<OperationResult> DeleteContainer(int containerId, int userId = -1)
|
||||
public Attempt<OperationResult> DeleteContainer(int containerId, int userId = 0)
|
||||
{
|
||||
var evtMsgs = EventMessagesFactory.Get();
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
@@ -907,7 +907,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
}
|
||||
|
||||
public Attempt<OperationResult<OperationResultType, EntityContainer>> RenameContainer(int id, string name, int userId = -1)
|
||||
public Attempt<OperationResult<OperationResultType, EntityContainer>> RenameContainer(int id, string name, int userId = 0)
|
||||
{
|
||||
var evtMsgs = EventMessagesFactory.Get();
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
|
||||
#region Containers
|
||||
|
||||
public Attempt<OperationResult<OperationResultType, EntityContainer>> CreateContainer(int parentId, string name, int userId = -1)
|
||||
public Attempt<OperationResult<OperationResultType, EntityContainer>> CreateContainer(int parentId, string name, int userId = 0)
|
||||
{
|
||||
var evtMsgs = EventMessagesFactory.Get();
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
@@ -119,7 +119,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
}
|
||||
|
||||
public Attempt<OperationResult> SaveContainer(EntityContainer container, int userId = -1)
|
||||
public Attempt<OperationResult> SaveContainer(EntityContainer container, int userId = 0)
|
||||
{
|
||||
var evtMsgs = EventMessagesFactory.Get();
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
return OperationResult.Attempt.Succeed(evtMsgs);
|
||||
}
|
||||
|
||||
public Attempt<OperationResult> DeleteContainer(int containerId, int userId = -1)
|
||||
public Attempt<OperationResult> DeleteContainer(int containerId, int userId = 0)
|
||||
{
|
||||
var evtMsgs = EventMessagesFactory.Get();
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
@@ -186,7 +186,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
return OperationResult.Attempt.Succeed(evtMsgs);
|
||||
}
|
||||
|
||||
public Attempt<OperationResult<OperationResultType, EntityContainer>> RenameContainer(int id, string name, int userId = -1)
|
||||
public Attempt<OperationResult<OperationResultType, EntityContainer>> RenameContainer(int id, string name, int userId = 0)
|
||||
{
|
||||
var evtMsgs = EventMessagesFactory.Get();
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
@@ -331,7 +331,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// </summary>
|
||||
/// <param name="dataType"><see cref="IDataType"/> to save</param>
|
||||
/// <param name="userId">Id of the user issueing the save</param>
|
||||
public void Save(IDataType dataType, int userId = -1)
|
||||
public void Save(IDataType dataType, int userId = 0)
|
||||
{
|
||||
dataType.CreatorId = userId;
|
||||
|
||||
@@ -363,7 +363,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// </summary>
|
||||
/// <param name="dataTypeDefinitions"><see cref="IDataType"/> to save</param>
|
||||
/// <param name="userId">Id of the user issueing the save</param>
|
||||
public void Save(IEnumerable<IDataType> dataTypeDefinitions, int userId = -1)
|
||||
public void Save(IEnumerable<IDataType> dataTypeDefinitions, int userId = 0)
|
||||
{
|
||||
Save(dataTypeDefinitions, userId, true);
|
||||
}
|
||||
@@ -413,7 +413,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// </remarks>
|
||||
/// <param name="dataType"><see cref="IDataType"/> to delete</param>
|
||||
/// <param name="userId">Optional Id of the user issueing the deletion</param>
|
||||
public void Delete(IDataType dataType, int userId = -1)
|
||||
public void Delete(IDataType dataType, int userId = 0)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// </summary>
|
||||
/// <param name="stylesheet"><see cref="Stylesheet"/> to save</param>
|
||||
/// <param name="userId"></param>
|
||||
public void SaveStylesheet(Stylesheet stylesheet, int userId = -1)
|
||||
public void SaveStylesheet(Stylesheet stylesheet, int userId = 0)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -101,7 +101,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// </summary>
|
||||
/// <param name="path">Name incl. extension of the Stylesheet to delete</param>
|
||||
/// <param name="userId"></param>
|
||||
public void DeleteStylesheet(string path, int userId = -1)
|
||||
public void DeleteStylesheet(string path, int userId = 0)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -200,7 +200,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// </summary>
|
||||
/// <param name="script"><see cref="Script"/> to save</param>
|
||||
/// <param name="userId"></param>
|
||||
public void SaveScript(Script script, int userId = -1)
|
||||
public void SaveScript(Script script, int userId = 0)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -225,7 +225,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// </summary>
|
||||
/// <param name="path">Name incl. extension of the Script to delete</param>
|
||||
/// <param name="userId"></param>
|
||||
public void DeleteScript(string path, int userId = -1)
|
||||
public void DeleteScript(string path, int userId = 0)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -321,7 +321,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <returns>
|
||||
/// The template created
|
||||
/// </returns>
|
||||
public Attempt<OperationResult<OperationResultType, ITemplate>> CreateTemplateForContentType(string contentTypeAlias, string contentTypeName, int userId = -1)
|
||||
public Attempt<OperationResult<OperationResultType, ITemplate>> CreateTemplateForContentType(string contentTypeAlias, string contentTypeName, int userId = 0)
|
||||
{
|
||||
var template = new Template(contentTypeName,
|
||||
//NOTE: We are NOT passing in the content type alias here, we want to use it's name since we don't
|
||||
@@ -362,7 +362,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
return OperationResult.Attempt.Succeed<OperationResultType, ITemplate>(OperationResultType.Success, evtMsgs, template);
|
||||
}
|
||||
|
||||
public ITemplate CreateTemplateWithIdentity(string name, string content, ITemplate masterTemplate = null, int userId = -1)
|
||||
public ITemplate CreateTemplateWithIdentity(string name, string content, ITemplate masterTemplate = null, int userId = 0)
|
||||
{
|
||||
var template = new Template(name, name)
|
||||
{
|
||||
@@ -523,7 +523,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// </summary>
|
||||
/// <param name="template"><see cref="Template"/> to save</param>
|
||||
/// <param name="userId"></param>
|
||||
public void SaveTemplate(ITemplate template, int userId = -1)
|
||||
public void SaveTemplate(ITemplate template, int userId = 0)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -547,7 +547,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// </summary>
|
||||
/// <param name="templates">List of <see cref="Template"/> to save</param>
|
||||
/// <param name="userId">Optional id of the user</param>
|
||||
public void SaveTemplate(IEnumerable<ITemplate> templates, int userId = -1)
|
||||
public void SaveTemplate(IEnumerable<ITemplate> templates, int userId = 0)
|
||||
{
|
||||
var templatesA = templates.ToArray();
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
@@ -594,7 +594,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// </summary>
|
||||
/// <param name="alias">Alias of the <see cref="ITemplate"/> to delete</param>
|
||||
/// <param name="userId"></param>
|
||||
public void DeleteTemplate(string alias, int userId = -1)
|
||||
public void DeleteTemplate(string alias, int userId = 0)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -722,17 +722,17 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
}
|
||||
|
||||
public Attempt<IPartialView> CreatePartialView(IPartialView partialView, string snippetName = null, int userId = -1)
|
||||
public Attempt<IPartialView> CreatePartialView(IPartialView partialView, string snippetName = null, int userId = 0)
|
||||
{
|
||||
return CreatePartialViewMacro(partialView, PartialViewType.PartialView, snippetName, userId);
|
||||
}
|
||||
|
||||
public Attempt<IPartialView> CreatePartialViewMacro(IPartialView partialView, string snippetName = null, int userId = -1)
|
||||
public Attempt<IPartialView> CreatePartialViewMacro(IPartialView partialView, string snippetName = null, int userId = 0)
|
||||
{
|
||||
return CreatePartialViewMacro(partialView, PartialViewType.PartialViewMacro, snippetName, userId);
|
||||
}
|
||||
|
||||
private Attempt<IPartialView> CreatePartialViewMacro(IPartialView partialView, PartialViewType partialViewType, string snippetName = null, int userId = -1)
|
||||
private Attempt<IPartialView> CreatePartialViewMacro(IPartialView partialView, PartialViewType partialViewType, string snippetName = null, int userId = 0)
|
||||
{
|
||||
string partialViewHeader;
|
||||
switch (partialViewType)
|
||||
@@ -792,17 +792,17 @@ namespace Umbraco.Core.Services.Implement
|
||||
return Attempt<IPartialView>.Succeed(partialView);
|
||||
}
|
||||
|
||||
public bool DeletePartialView(string path, int userId = -1)
|
||||
public bool DeletePartialView(string path, int userId = 0)
|
||||
{
|
||||
return DeletePartialViewMacro(path, PartialViewType.PartialView, userId);
|
||||
}
|
||||
|
||||
public bool DeletePartialViewMacro(string path, int userId = -1)
|
||||
public bool DeletePartialViewMacro(string path, int userId = 0)
|
||||
{
|
||||
return DeletePartialViewMacro(path, PartialViewType.PartialViewMacro, userId);
|
||||
}
|
||||
|
||||
private bool DeletePartialViewMacro(string path, PartialViewType partialViewType, int userId = -1)
|
||||
private bool DeletePartialViewMacro(string path, PartialViewType partialViewType, int userId = 0)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -832,17 +832,17 @@ namespace Umbraco.Core.Services.Implement
|
||||
return true;
|
||||
}
|
||||
|
||||
public Attempt<IPartialView> SavePartialView(IPartialView partialView, int userId = -1)
|
||||
public Attempt<IPartialView> SavePartialView(IPartialView partialView, int userId = 0)
|
||||
{
|
||||
return SavePartialView(partialView, PartialViewType.PartialView, userId);
|
||||
}
|
||||
|
||||
public Attempt<IPartialView> SavePartialViewMacro(IPartialView partialView, int userId = -1)
|
||||
public Attempt<IPartialView> SavePartialViewMacro(IPartialView partialView, int userId = 0)
|
||||
{
|
||||
return SavePartialView(partialView, PartialViewType.PartialViewMacro, userId);
|
||||
}
|
||||
|
||||
private Attempt<IPartialView> SavePartialView(IPartialView partialView, PartialViewType partialViewType, int userId = -1)
|
||||
private Attempt<IPartialView> SavePartialView(IPartialView partialView, PartialViewType partialViewType, int userId = 0)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
|
||||
@@ -227,7 +227,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItem"><see cref="IDictionaryItem"/> to save</param>
|
||||
/// <param name="userId">Optional id of the user saving the dictionary item</param>
|
||||
public void Save(IDictionaryItem dictionaryItem, int userId = -1)
|
||||
public void Save(IDictionaryItem dictionaryItem, int userId = 0)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -256,7 +256,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItem"><see cref="IDictionaryItem"/> to delete</param>
|
||||
/// <param name="userId">Optional id of the user deleting the dictionary item</param>
|
||||
public void Delete(IDictionaryItem dictionaryItem, int userId = -1)
|
||||
public void Delete(IDictionaryItem dictionaryItem, int userId = 0)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -356,7 +356,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// </summary>
|
||||
/// <param name="language"><see cref="ILanguage"/> to save</param>
|
||||
/// <param name="userId">Optional id of the user saving the language</param>
|
||||
public void Save(ILanguage language, int userId = -1)
|
||||
public void Save(ILanguage language, int userId = 0)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -382,7 +382,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// </summary>
|
||||
/// <param name="language"><see cref="ILanguage"/> to delete</param>
|
||||
/// <param name="userId">Optional id of the user deleting the language</param>
|
||||
public void Delete(ILanguage language, int userId = -1)
|
||||
public void Delete(ILanguage language, int userId = 0)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// </summary>
|
||||
/// <param name="macro"><see cref="IMacro"/> to delete</param>
|
||||
/// <param name="userId">Optional id of the user deleting the macro</param>
|
||||
public void Delete(IMacro macro, int userId = -1)
|
||||
public void Delete(IMacro macro, int userId = 0)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -106,7 +106,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// </summary>
|
||||
/// <param name="macro"><see cref="IMacro"/> to save</param>
|
||||
/// <param name="userId">Optional Id of the user deleting the macro</param>
|
||||
public void Save(IMacro macro, int userId = -1)
|
||||
public void Save(IMacro macro, int userId = 0)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="mediaTypeAlias">Alias of the <see cref="IMediaType"/></param>
|
||||
/// <param name="userId">Optional id of the user creating the media item</param>
|
||||
/// <returns><see cref="IMedia"/></returns>
|
||||
public IMedia CreateMedia(string name, Guid parentId, string mediaTypeAlias, int userId = -1)
|
||||
public IMedia CreateMedia(string name, Guid parentId, string mediaTypeAlias, int userId = 0)
|
||||
{
|
||||
var parent = GetById(parentId);
|
||||
return CreateMedia(name, parent, mediaTypeAlias, userId);
|
||||
@@ -130,7 +130,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="mediaTypeAlias">The alias of the media type.</param>
|
||||
/// <param name="userId">The optional id of the user creating the media.</param>
|
||||
/// <returns>The media object.</returns>
|
||||
public IMedia CreateMedia(string name, int parentId, string mediaTypeAlias, int userId = -1)
|
||||
public IMedia CreateMedia(string name, int parentId, string mediaTypeAlias, int userId = 0)
|
||||
{
|
||||
var mediaType = GetMediaType(mediaTypeAlias);
|
||||
if (mediaType == null)
|
||||
@@ -160,7 +160,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="mediaTypeAlias">The alias of the media type.</param>
|
||||
/// <param name="userId">The optional id of the user creating the media.</param>
|
||||
/// <returns>The media object.</returns>
|
||||
public IMedia CreateMedia(string name, string mediaTypeAlias, int userId = -1)
|
||||
public IMedia CreateMedia(string name, string mediaTypeAlias, int userId = 0)
|
||||
{
|
||||
// not locking since not saving anything
|
||||
|
||||
@@ -190,7 +190,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="mediaTypeAlias">The alias of the media type.</param>
|
||||
/// <param name="userId">The optional id of the user creating the media.</param>
|
||||
/// <returns>The media object.</returns>
|
||||
public IMedia CreateMedia(string name, IMedia parent, string mediaTypeAlias, int userId = -1)
|
||||
public IMedia CreateMedia(string name, IMedia parent, string mediaTypeAlias, int userId = 0)
|
||||
{
|
||||
if (parent == null) throw new ArgumentNullException(nameof(parent));
|
||||
|
||||
@@ -219,7 +219,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="mediaTypeAlias">The alias of the media type.</param>
|
||||
/// <param name="userId">The optional id of the user creating the media.</param>
|
||||
/// <returns>The media object.</returns>
|
||||
public IMedia CreateMediaWithIdentity(string name, int parentId, string mediaTypeAlias, int userId = -1)
|
||||
public IMedia CreateMediaWithIdentity(string name, int parentId, string mediaTypeAlias, int userId = 0)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -251,7 +251,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="mediaTypeAlias">The alias of the media type.</param>
|
||||
/// <param name="userId">The optional id of the user creating the media.</param>
|
||||
/// <returns>The media object.</returns>
|
||||
public IMedia CreateMediaWithIdentity(string name, IMedia parent, string mediaTypeAlias, int userId = -1)
|
||||
public IMedia CreateMediaWithIdentity(string name, IMedia parent, string mediaTypeAlias, int userId = 0)
|
||||
{
|
||||
if (parent == null) throw new ArgumentNullException(nameof(parent));
|
||||
|
||||
@@ -749,7 +749,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="media">The <see cref="IMedia"/> to save</param>
|
||||
/// <param name="userId">Id of the User saving the Media</param>
|
||||
/// <param name="raiseEvents">Optional boolean indicating whether or not to raise events.</param>
|
||||
public void Save(IMedia media, int userId = -1, bool raiseEvents = true)
|
||||
public void Save(IMedia media, int userId = 0, bool raiseEvents = true)
|
||||
{
|
||||
((IMediaServiceOperations) this).Save(media, userId, raiseEvents);
|
||||
}
|
||||
@@ -807,7 +807,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="medias">Collection of <see cref="IMedia"/> to save</param>
|
||||
/// <param name="userId">Id of the User saving the Media</param>
|
||||
/// <param name="raiseEvents">Optional boolean indicating whether or not to raise events.</param>
|
||||
public void Save(IEnumerable<IMedia> medias, int userId = -1, bool raiseEvents = true)
|
||||
public void Save(IEnumerable<IMedia> medias, int userId = 0, bool raiseEvents = true)
|
||||
{
|
||||
((IMediaServiceOperations) this).Save(medias, userId, raiseEvents);
|
||||
}
|
||||
@@ -869,7 +869,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// </remarks>
|
||||
/// <param name="media">The <see cref="IMedia"/> to delete</param>
|
||||
/// <param name="userId">Id of the User deleting the Media</param>
|
||||
public void Delete(IMedia media, int userId = -1)
|
||||
public void Delete(IMedia media, int userId = 0)
|
||||
{
|
||||
((IMediaServiceOperations) this).Delete(media, userId);
|
||||
}
|
||||
@@ -947,7 +947,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="id">Id of the <see cref="IMedia"/> object to delete versions from</param>
|
||||
/// <param name="versionDate">Latest version date</param>
|
||||
/// <param name="userId">Optional Id of the User deleting versions of a Media object</param>
|
||||
public void DeleteVersions(int id, DateTime versionDate, int userId = -1)
|
||||
public void DeleteVersions(int id, DateTime versionDate, int userId = 0)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -971,7 +971,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
}
|
||||
|
||||
private void DeleteVersions(IScope scope, bool wlock, int id, DateTime versionDate, int userId = -1)
|
||||
private void DeleteVersions(IScope scope, bool wlock, int id, DateTime versionDate, int userId = 0)
|
||||
{
|
||||
var args = new DeleteRevisionsEventArgs(id, dateToRetain: versionDate);
|
||||
if (scope.Events.DispatchCancelable(DeletingVersions, this, args))
|
||||
@@ -994,7 +994,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="versionId">Id of the version to delete</param>
|
||||
/// <param name="deletePriorVersions">Boolean indicating whether to delete versions prior to the versionId</param>
|
||||
/// <param name="userId">Optional Id of the User deleting versions of a Media object</param>
|
||||
public void DeleteVersion(int id, int versionId, bool deletePriorVersions, int userId = -1)
|
||||
public void DeleteVersion(int id, int versionId, bool deletePriorVersions, int userId = 0)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -1034,7 +1034,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// </summary>
|
||||
/// <param name="media">The <see cref="IMedia"/> to delete</param>
|
||||
/// <param name="userId">Id of the User deleting the Media</param>
|
||||
public void MoveToRecycleBin(IMedia media, int userId = -1)
|
||||
public void MoveToRecycleBin(IMedia media, int userId = 0)
|
||||
{
|
||||
((IMediaServiceOperations) this).MoveToRecycleBin(media, userId);
|
||||
}
|
||||
@@ -1085,7 +1085,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="media">The <see cref="IMedia"/> to move</param>
|
||||
/// <param name="parentId">Id of the Media's new Parent</param>
|
||||
/// <param name="userId">Id of the User moving the Media</param>
|
||||
public void Move(IMedia media, int parentId, int userId = -1)
|
||||
public void Move(IMedia media, int parentId, int userId = 0)
|
||||
{
|
||||
// if moving to the recycle bin then use the proper method
|
||||
if (parentId == Constants.System.RecycleBinMedia)
|
||||
@@ -1243,7 +1243,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="raiseEvents"></param>
|
||||
/// <returns>True if sorting succeeded, otherwise False</returns>
|
||||
public bool Sort(IEnumerable<IMedia> items, int userId = -1, bool raiseEvents = true)
|
||||
public bool Sort(IEnumerable<IMedia> items, int userId = 0, bool raiseEvents = true)
|
||||
{
|
||||
var itemsA = items.ToArray();
|
||||
if (itemsA.Length == 0) return true;
|
||||
@@ -1432,7 +1432,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// </remarks>
|
||||
/// <param name="mediaTypeId">Id of the <see cref="IMediaType"/></param>
|
||||
/// <param name="userId">Optional id of the user deleting the media</param>
|
||||
public void DeleteMediaOfTypes(IEnumerable<int> mediaTypeIds, int userId = -1)
|
||||
public void DeleteMediaOfTypes(IEnumerable<int> mediaTypeIds, int userId = 0)
|
||||
{
|
||||
//TODO: This currently this is called from the ContentTypeService but that needs to change,
|
||||
// if we are deleting a content type, we should just delete the data and do this operation slightly differently.
|
||||
@@ -1497,7 +1497,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <remarks>This needs extra care and attention as its potentially a dangerous and extensive operation</remarks>
|
||||
/// <param name="mediaTypeId">Id of the <see cref="IMediaType"/></param>
|
||||
/// <param name="userId">Optional id of the user deleting the media</param>
|
||||
public void DeleteMediaOfType(int mediaTypeId, int userId = -1)
|
||||
public void DeleteMediaOfType(int mediaTypeId, int userId = 0)
|
||||
{
|
||||
DeleteMediaOfTypes(new[] { mediaTypeId }, userId);
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="userId">Optional Id of the user performing the import</param>
|
||||
/// <param name="raiseEvents">Optional parameter indicating whether or not to raise events</param>
|
||||
/// <returns>An enumrable list of generated content</returns>
|
||||
public IEnumerable<IContent> ImportContent(XElement element, int parentId = -1, int userId = -1, bool raiseEvents = true)
|
||||
public IEnumerable<IContent> ImportContent(XElement element, int parentId = -1, int userId = 0, bool raiseEvents = true)
|
||||
{
|
||||
if (raiseEvents)
|
||||
{
|
||||
@@ -337,7 +337,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="userId">Optional id of the User performing the operation. Default is zero (admin).</param>
|
||||
/// <param name="raiseEvents">Optional parameter indicating whether or not to raise events</param>
|
||||
/// <returns>An enumrable list of generated ContentTypes</returns>
|
||||
public IEnumerable<IContentType> ImportContentTypes(XElement element, int userId = -1, bool raiseEvents = true)
|
||||
public IEnumerable<IContentType> ImportContentTypes(XElement element, int userId = 0, bool raiseEvents = true)
|
||||
{
|
||||
return ImportContentTypes(element, true, userId);
|
||||
}
|
||||
@@ -350,7 +350,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="userId">Optional id of the User performing the operation. Default is zero (admin).</param>
|
||||
/// <param name="raiseEvents">Optional parameter indicating whether or not to raise events</param>
|
||||
/// <returns>An enumrable list of generated ContentTypes</returns>
|
||||
public IEnumerable<IContentType> ImportContentTypes(XElement element, bool importStructure, int userId = -1, bool raiseEvents = true)
|
||||
public IEnumerable<IContentType> ImportContentTypes(XElement element, bool importStructure, int userId = 0, bool raiseEvents = true)
|
||||
{
|
||||
if (raiseEvents)
|
||||
{
|
||||
@@ -856,7 +856,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="userId">Optional id of the user</param>
|
||||
/// <param name="raiseEvents">Optional parameter indicating whether or not to raise events</param>
|
||||
/// <returns>An enumrable list of generated DataTypeDefinitions</returns>
|
||||
public IEnumerable<IDataType> ImportDataTypeDefinitions(XElement element, int userId = -1, bool raiseEvents = true)
|
||||
public IEnumerable<IDataType> ImportDataTypeDefinitions(XElement element, int userId = 0, bool raiseEvents = true)
|
||||
{
|
||||
if (raiseEvents)
|
||||
{
|
||||
@@ -1190,7 +1190,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="userId">Optional id of the User performing the operation</param>
|
||||
/// <param name="raiseEvents">Optional parameter indicating whether or not to raise events</param>
|
||||
/// <returns>An enumerable list of generated languages</returns>
|
||||
public IEnumerable<ILanguage> ImportLanguages(XElement languageElementList, int userId = -1, bool raiseEvents = true)
|
||||
public IEnumerable<ILanguage> ImportLanguages(XElement languageElementList, int userId = 0, bool raiseEvents = true)
|
||||
{
|
||||
if (raiseEvents)
|
||||
{
|
||||
@@ -1231,7 +1231,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="userId">Optional id of the User performing the operation</param>
|
||||
/// <param name="raiseEvents">Optional parameter indicating whether or not to raise events</param>
|
||||
/// <returns></returns>
|
||||
public IEnumerable<IMacro> ImportMacros(XElement element, int userId = -1, bool raiseEvents = true)
|
||||
public IEnumerable<IMacro> ImportMacros(XElement element, int userId = 0, bool raiseEvents = true)
|
||||
{
|
||||
if (raiseEvents)
|
||||
{
|
||||
@@ -1502,7 +1502,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="userId">Optional user id</param>
|
||||
/// <param name="raiseEvents">Optional parameter indicating whether or not to raise events</param>
|
||||
/// <returns>An enumrable list of generated Templates</returns>
|
||||
public IEnumerable<ITemplate> ImportTemplates(XElement element, int userId = -1, bool raiseEvents = true)
|
||||
public IEnumerable<ITemplate> ImportTemplates(XElement element, int userId = 0, bool raiseEvents = true)
|
||||
{
|
||||
if (raiseEvents)
|
||||
{
|
||||
@@ -1579,7 +1579,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
|
||||
|
||||
public IEnumerable<IFile> ImportStylesheets(XElement element, int userId = -1, bool raiseEvents = true)
|
||||
public IEnumerable<IFile> ImportStylesheets(XElement element, int userId = 0, bool raiseEvents = true)
|
||||
{
|
||||
|
||||
if (raiseEvents)
|
||||
@@ -1670,7 +1670,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
set { _packageInstallation = value; }
|
||||
}
|
||||
|
||||
internal InstallationSummary InstallPackage(string packageFilePath, int userId = -1, bool raiseEvents = false)
|
||||
internal InstallationSummary InstallPackage(string packageFilePath, int userId = 0, bool raiseEvents = false)
|
||||
{
|
||||
var metaData = GetPackageMetaData(packageFilePath);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user