Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions 13/umbraco-cms/extending/filesystemproviders/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ For inspiration on building a custom file system, have a look at the [Azure Blob

### Accessing the media file system from code

{% hint style="warning" %}
The example below uses `UmbracoAuthorizedApiController` which has been removed from Umbraco 14. Use `ManagementApiControllerBase` class instead.
{% endhint %}

Since the default media file system can be swapped with custom implementations, you should never access the implementation directly. Umbraco uses a manager class called `MediaFileManager`. You can get a reference to this manager class via dependency injection in the constructor for your custom class or controller:

```csharp
Expand Down
10 changes: 9 additions & 1 deletion 13/umbraco-cms/implementation/composing.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Below is a list of collections with their corresponding 'collection type' and ho
| ContentIndexHandlers | Lazy | Type scanned for `IContentIndexHandler` |
| Dashboards | Weighted | Package.manifest & Explicit Registration |
| DataEditors | Lazy | Type scanned for `IDataEditor` |
| DataValueReferenceFactories | Ordered | Explicit Registration - Empty by default |
| DataValueReferenceFactories | Ordered | Explicit Registration - Empty by default |
| EditorValidators | Lazy | Type scanned for `IEditorValidator` |
| EmbedProviders | Ordered | Explicit Registration |
| FilterHandlers | Lazy | Type scanned for `IFilterHandler` |
Expand Down Expand Up @@ -341,6 +341,10 @@ The runtime has detected an up-to-date Umbraco install and is running.

## Example of using Ordered Collections and adding types explicitly

{% hint style="warning" %}
The example below uses `UmbracoAuthorizedApiController` which has been removed from Umbraco 14. Use `ManagementApiControllerBase` class instead.
{% endhint %}

You may wish to create an Umbraco package that allows package consumers to extend and add additional functionality. In this example, we show how you can use the `OrderedCollectionBuilderBase`.

```csharp
Expand Down Expand Up @@ -431,6 +435,10 @@ public class SomeBackofficeApiController : UmbracoAuthorizedApiController

## Example of using Lazy Collections with Type Scanning

{% hint style="warning" %}
The example below uses `UmbracoAuthorizedApiController` which has been removed from Umbraco 14. Use `ManagementApiControllerBase` class instead.
{% endhint %}

You may wish to create an Umbraco package that allows package consumers to extend and add additional functionality. In this example, we show how you can use the `LazyCollectionBuilderBase` to scan assemblies that implement your interface by using the `TypeLoader`

{% hint style="warning" %}
Expand Down
4 changes: 4 additions & 0 deletions 13/umbraco-cms/implementation/controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ public class ExampleController : UmbracoController

* **WebAPI**

{% hint style="warning" %}
`UmbracoAuthorizedApiController` and `UmbracoAuthorizedJsonController` have been removed from Umbraco 14. Use`ManagementApiControllerBase` class instead.
{% endhint %}

A base class implementation for authorized auto-routed Umbraco API controllers is inherited from: `Umbraco.Cms.Web.BackOffice.Controllers.UmbracoAuthorizedApiController`. This controller inherits from `Umbraco.Cms.Web.Common.Controllers.UmbracoApiController` it is auto-routed. This controller is also attributed with `Umbraco.Cms.Web.Common.Attributes.IsBackOfficeAttribute` to ensure that it is routed correctly to be authenticated for the backoffice.

Another base class implementation for the backoffice is `Umbraco.Cms.Web.BackOffice.Controllers.UmbracoAuthorizedJsonController`. It inherits from `Umbraco.Cms.Web.BackOffice.Controllers.UmbracoAuthorizedApiController` but has some special filters applied to it to automatically handle anti-forgery tokens for use with AngularJS in the backoffice.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

The UserService acts as a "gateway" to Umbraco data for operations which are related to Users.

* **Namespace:** `Umbraco.Core.Services`
* **Assembly:** `Umbraco.Core.dll`
* **Namespace:** `Umbraco.Core.Services`
* **Assembly:** `Umbraco.Core.dll`

All samples listed in this document will require references to the following dll:

Expand All @@ -21,6 +21,13 @@ using Umbraco.Core.Services;

### Services property

{% hint style="warning" %}

* `UmbracoAuthorizedApiController` has been removed from Umbraco 14. Use `ManagementApiControllerBase` class instead.
* `UmbracoApiController` is obsolete in Umbraco 14 and will be removed in Umbraco 15.

{% endhint %}

If you wish to use the UserService in a class that inherits from one of the Umbraco base classes (eg. `SurfaceController`, `UmbracoApiController` or `UmbracoAuthorizedApiController`), you can access the service through a local `Services` property:

```csharp
Expand Down Expand Up @@ -53,7 +60,6 @@ If neither a `Services` property or Dependency Injection is available, you can a
IUserService userService = Umbraco.Core.Composing.Current.Services.UserService;
```


## Samples

* [**Create a new user**](create-a-new-user.md)<br />Quick sample showing how to create a new backoffice user; including setting a password, assigning the user to a user group, and setting the name of the user.
11 changes: 9 additions & 2 deletions 13/umbraco-cms/reference/querying/imembermanager.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ _memberManager.IsLoggedIn()

### Dependency Injection

{% hint style="warning" %}

* `UmbracoAuthorizedApiController` has been removed from Umbraco 14. Use `ManagementApiControllerBase` class instead.
* `UmbracoApiController` is obsolete in Umbraco 14 and will be removed in Umbraco 15.

{% endhint %}

If you wish to use the `IMemberManager` in a class that inherits from one of the Umbraco base classes (eg. `SurfaceController`, `UmbracoApiController`, or `UmbracoAuthorizedApiController`), you can use Dependency Injection. For instance, if you have registered your own class in Umbraco's dependency injection, you can specify the `IMemberManager` interface in your constructor:

```csharp
Expand Down Expand Up @@ -139,7 +146,7 @@ Returns the user id of a user

```
@{
var userId = await _memberManager.GetUserIdAsync(user);
var userId = await _memberManager.GetUserIdAsync(user);
}
```

Expand Down Expand Up @@ -213,6 +220,6 @@ Validates that a user's credentials are correct without logging them in.

```
@{
var isValidCredentials = await _memberManager.ValidateCredentialsAsync(userName, password);
var isValidCredentials = await _memberManager.ValidateCredentialsAsync(userName, password);
}
```
4 changes: 4 additions & 0 deletions 13/umbraco-cms/reference/routing/authorized.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ description: "Requirements for authenticating requests for the backoffice"

# Backoffice authentication

{% hint style="warning" %}
`UmbracoAuthorizedApiController` and `UmbracoAuthorizedJsonController` have been removed from Umbraco 14. Use `ManagementApiControllerBase` class instead.
{% endhint %}

In order for Umbraco to authenticate a request for the backoffice, the routing needs to be specific. Any URL that routes to:

> /umbraco/backoffice/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ For more information about areas, Urls and routing see the [routing section](rou

## Backoffice controllers

% hint style="warning" %}
`UmbracoAuthorizedApiController` and `UmbracoAuthorizedJsonController` have been removed from Umbraco 14. Use `ManagementApiControllerBase` class instead.
{% endhint %}

If you are creating a controller to work within the Umbraco backoffice then you will need to ensure that it is secured properly by inheriting from: `UmbracoAuthorizedApiController` or `UmbracoAuthorizedJsonController`. This controller type will auto-route your controller like the above examples except that it will add another segment to the path: 'backoffice'.

`~/Umbraco/backoffice/Api/[YourControllerName]`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ _This section will describe how to secure your Umbraco Api controllers based on

### Inheriting from UmbracoAuthorizedApiController

{% hint style="warning" %}
`UmbracoAuthorizedApiController` has been removed from Umbraco 14. Use `ManagementApiControllerBase` class instead.
{% endhint %}

Probably the easiest way to ensure your controller is secured for only backoffice users is to inherit from `Umbraco.Cms.Web.BackOffice.Controllers.UmbracoAuthorizedApiController`. This is essentially the same as applying `[Authorize(Policy = AuthorizationPolicies.BackOfficeAccess)]` to your controller (see below).

The `UmbracoAuthorizedApiController` is automatically routed. Check out the [routing documentation](../authorized.md) for more information on this topic.
Expand Down
2 changes: 1 addition & 1 deletion 14/umbraco-cms/extending/backoffice-tours.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: A guide configuring backoffice tours in Umbraco
# Backoffice Tours

{% hint style="warning" %}
This article is a work in progress and will be updated after Umbraco 14 release.
This article is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
{% endhint %}

Backoffice Tours are a way to create helpful guides for how to work in the Umbraco backoffice.
Expand Down
2 changes: 1 addition & 1 deletion 14/umbraco-cms/extending/dashboards.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: >-
# Dashboard

{% hint style="warning" %}
This page is a work in progress. It has been migrated but the content is waiting to be updated for the new Backoffice.
This article is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
{% endhint %}

Each section of the Umbraco backoffice has its own set of default dashboards.
Expand Down
4 changes: 4 additions & 0 deletions 14/umbraco-cms/extending/embedded-media-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ description: A guide to creating a custom embed providers in Umbraco

# Embedded Media Providers

{% hint style="warning" %}
This article is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
{% endhint %}

The Rich Text Editor in Umbraco has an 'Embed' button, that when pressed, slides open a panel. This panel enables editors to paste the URL of a third-party media resource to embed in content.

![The Rich Text Editor Embed Button](images/Embed-Button.png)
Expand Down
6 changes: 6 additions & 0 deletions 14/umbraco-cms/extending/filesystemproviders/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ For inspiration on building a custom file system, have a look at the [Azure Blob

### Accessing the media file system from code

{% hint style="warning" %}
`UmbracoAuthorizedApiController` has been removed from Umbraco 14. Use`ManagementApiControllerBase` class instead.

Read the [Creating a Backoffice API article](../../tutorials/creating-a-backoffice-api/README.md) for a comprehensive guide to writing APIs for the Management API.
{% endhint %}

Since the default media file system can be swapped with custom implementations, you should never access the implementation directly. Umbraco uses a manager class called `MediaFileManager`. You can get a reference to this manager class via dependency injection in the constructor for your custom class or controller:

```csharp
Expand Down
4 changes: 4 additions & 0 deletions 14/umbraco-cms/extending/language-files/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ description: >-

# Language Files & Localization

{% hint style="warning" %}
The Language Files & Localization articles are a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
{% endhint %}

Localization files are used to translate:

* The Umbraco backoffice user interface so that end users can use Umbraco in their native language. This is particularly important for content editors who do not speak English.
Expand Down
2 changes: 1 addition & 1 deletion 14/umbraco-cms/extending/property-editors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Guide on how to work with and create Property Editors in Umbraco
# Property Editors

{% hint style="warning" %}
This page is a work in progress. It will be updated as the software evolves.
The Property Editor articles are a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
{% endhint %}

This section describes how to work with and create Property Editors. A property editor is the editor used to insert content into Umbraco. [See here for definition](../../fundamentals/backoffice/property-editors/)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Build a Block Editor

{% hint style="warning" %}
This guide is currently being re-evaluated, as it might not work as intended.
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
{% endhint %}

Before reading this document we highly recommend that you familiarise yourself with[the basics of developing a custom Property Editor for Umbraco](../../tutorials/creating-a-property-editor/).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Declaring your property editor

{% hint style="warning" %}
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
{% endhint %}

Generally Umbraco supports two different ways to declare a property editor. Most commonly one would create a `package.manifest` file, and then use it for declaring one or more property editors. But as an alternative, property editors can also be declared using C#.

A property editor consists of a number of mandatory properties, and some optional ones as well. As such, the outer JSON object for the property editor has the following properties:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Content Picker Value Converter Example

{% hint style="warning" %}
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
{% endhint %}

```csharp
using System;
using Umbraco.Cms.Core;
Expand Down
6 changes: 6 additions & 0 deletions 14/umbraco-cms/extending/property-editors/package-manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ description: An extension begins with a Package Manifest

# Package Manifest

{% hint style="warning" %}
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
{% endhint %}

A Package is declared via an Umbraco Package Manifest. This describes the Package and declares one or more UI Extensions.

{% hint style="warning" %}
Expand All @@ -23,6 +27,7 @@ Before Umbraco 14, the manifest was declared in a `package.manifest` file instea
{% endhint %}

{% code title="umbraco-package.json" %}

```json
{
"name": "Sir Trevor",
Expand All @@ -44,6 +49,7 @@ Before Umbraco 14, the manifest was declared in a `package.manifest` file instea
]
}
```

{% endcode %}

## Sample Manifest with Csharp
Expand Down
4 changes: 4 additions & 0 deletions 14/umbraco-cms/extending/property-editors/property-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ description: Guide on how to implement Property Actions for Property Editors in

# Property Actions

{% hint style="warning" %}
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
{% endhint %}

Property Actions are a built-in feature that provide a generic place for secondary functionality for property editors.

Property Actions appear as a small button next to the label of the property, which expands to show the available actions. They are defined and implemented in the Property Editor, making it open as to what a Property Action is.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ description: "A guide to creating a custom property value converter in Umbraco"

# Property Value Converters

{% hint style="warning" %}
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
{% endhint %}

A Property Value Converter converts a property editor's database-stored value to another type. The converted value can be accessed from MVC Razor or any other Published Content API.

For example the standard Umbraco Core "Content Picker" stores a nodeId as `String` type. However if you implement a converter it could return an `IPublishedContent` object.
Expand Down Expand Up @@ -102,14 +106,14 @@ Do not use this cache level unless you know exactly what you're doing. We recomm

The property value will be cached until its _element_ is modified. The element is what holds (or owns) the property. For example:

- For properties used at the page level, the element is the entire page.
- For properties used at the page level, the element is the entire page.
- For properties contained within Block List items, the element is the individual Block List item.

This is the most commonly used cache level and should be your default, unless you have specific reasons to do otherwise.
This is the most commonly used cache level and should be your default, unless you have specific reasons to do otherwise.

#### `PropertyCacheLevel.Elements`

The property value will be cached until _any_ element (see above) is changed. This means that any change to any page will clear the property value cache.
The property value will be cached until _any_ element (see above) is changed. This means that any change to any page will clear the property value cache.

This is particularly useful for property values that contain references to other content or elements. For example, this cache level is utilized by the Content Picker to clear its property values from the cache upon content updates.

Expand Down Expand Up @@ -165,7 +169,7 @@ public object ConvertSourceToIntermediate(IPublishedElement owner, IPublishedPro

This method converts the Intermediate to an Object. The returned value is used by the `GetPropertyValue<T>` method of `IPublishedContent`.

The below example converts the nodeId (converted to `Int` or `Udi` by *ConvertSourceToIntermediate*) into an 'IPublishedContent' object.
The below example converts the nodeId (converted to `Int` or `Udi` by _ConvertSourceToIntermediate_) into an 'IPublishedContent' object.

```csharp
public object ConvertIntermediateToObject(IPublishedElement owner, IPublishedPropertyType propertyType, PropertyCacheLevel referenceCacheLevel, object inter, bool preview)
Expand Down
4 changes: 4 additions & 0 deletions 14/umbraco-cms/extending/property-editors/tracking.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ description: >-

# Tracking References

{% hint style="warning" %}
This page is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
{% endhint %}

Property editors can be extended further to track entity references that may be selected or referenced inside the property editor. For example in the core of the CMS we have added this to numerous property editors.

A good example of this is the Media Picker. The CMS stores a reference to the selected media item, enabling the identification of content nodes that use that particular media item. This avoids it being accidentally deleted if it is being used.
Expand Down
4 changes: 4 additions & 0 deletions 14/umbraco-cms/extending/section-trees/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ description: "An explanation on sections and trees in Umbraco"

# Sections & Trees

{% hint style="warning" %}
The Section & Trees articles are a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
{% endhint %}

The Umbraco backoffice consists of sections (sometimes referred to as applications) which contain Trees.

Each section is identified by its name in the top navigation ribbon of the Umbraco Backoffice.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

The Block Editors are property editors that enabled you to build advanced editor tools using a set of predefined Document Types.

{% hint style="warning" %}
This article is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
{% endhint %}

Umbraco CMS currently ships with two Block Editors: the Block List and the Block Grid.

## [Block List](block-list-editor.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

The **Block Grid** property editor enables editors to layout their content in the Umbraco backoffice. The content is made of Blocks that can contain different types of data.

{% hint style="warning" %}
This article is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
{% endhint %}

## Sample configuration

When testing out the property editor, you can use a set of predefined Blocks. The option will only be possible when there are no other Data Types using the Block Grid property editor.
Expand Down
Loading