U4-10 - Media is content, it has all of the same features

Created by Matt Brailsford 20 Jun 2012, 10:44:24 Updated by Sarah Green 11 Feb 2013, 19:48:21

Relates to: U4-81

Relates to: U4-931

Is required for: U4-23


Jeroen Breuer 27 Jun 2012, 07:09:58

See this topic for feedback: https://groups.google.com/forum/#!topic/umbraco-dev/JFVBW4xbJjs.

Morten Christensen 10 Oct 2012, 10:49:18

I have done a refactoring to the model of the new api after having updated the database schema to the newly updated 4.10.0 one. The implications of this refactoring means that Media and Content are now practically the same. The only difference is that Content can be published while Media cannot and Content has templates, which Media does not have. What it enables is to have the same mixin-type functionality and fieldsets on both Content and Media.

The reason why we cannot make Media publishable at this point in time is due to the current caching model. If anyone wants to be able to Publish/Unpublish media then please create a feature request.

Jeroen Breuer 10 Oct 2012, 14:27:41

If media now has the same features as content does this mean that the validation also works? http://issues.umbraco.org/issue/U4-227

Morten Christensen 10 Oct 2012, 14:35:42

There isn't any validation in place in the new api yet, but as validation has to be in place in order for publishing to work properly http://issues.umbraco.org/issue/U4-737 then it will most likely be implemented as a "shared" feature for Content and Media.

Jeroen Breuer 10 Oct 2012, 14:43:16

Currently validation only works for published content and because media cannot be published I wonder if it should be a "shared" feature: http://our.umbraco.org/forum/ourumb-dev-forum/bugs/14022-Making-member-properties-mandatory-allows-blank-entries#comment51677.

Morten Christensen 10 Oct 2012, 15:02:08

The validation is a base feature for anything that has properties, which can be set to mandatory or some kind of regular expression. This means that it makes sense to create a base/shared feature which goes through properties and verifies whether that content (with its collection of properties) is valid. This validation can be used for publishing to ensure that invalid content isn't published, and it could also be used to ensure that invalid media isn't saved. But the latter is a UI concern which isn't part of this implementation. It might make sense to look at it for 6.2.0, but for now we just have the foundation in place in the api. The future will determine how the validation will be invoked for media.

Hope this makes sense.

bob baty-barr 06 Dec 2012, 19:32:26

does this mean that media links in RTE will now be dynamic? like ??

Funka! 06 Dec 2012, 21:47:56

Hi bob, I believe what you are asking can be found at U4-230.

Jeroen Breuer 14 Jan 2013, 21:16:35

If Media is the same as Content is it possible to use base media types with the API? Is there an example for this somewhere?

Ian Jepp 15 Jan 2013, 09:33:28

Does this mean that user (editor) security will be able to be set on media nodes/folders in the same manner as content nodes/folders?

Morten Christensen 15 Jan 2013, 09:44:53

@Ian We haven't changed anything with regards to the security model, so in that respect things remain the same. At least for the time being. You can however use the MediaProtect package for this type of functionality: http://our.umbraco.org/projects/website-utilities/media-protect

@Jeroen Both IContent and IMedia inherit from IContentTypeComposition, which has the Base Type/Mixin/Composition type functionality that enables you to have base media types. When you have a new MediaType all you do is mediaType.AddContentType(IMediaType otherMediaType); and you can choose to change the ParentId as well if that makes sense in the given scenario.

Ian Jepp 15 Jan 2013, 11:28:45

Morten, thanks for your help. However I think you have the wrong end of the stick regarding what we need/our question. The plugin you suggested allows us to protect which MEMBERS can view a media file publicly. What we want to know is if USERS can be granted editor/publisher/etc roles on media items/folders on a granular level akin to main content nodes. Hope this makes sense. Thanks Ian

Morten Christensen 15 Jan 2013, 13:02:59

@Ian okay, so more of an internal thing then restricting media on the frontend? But no nothing like this is currently planned for the Media section. The way this type of security works in umbraco its not directly reflected in the changes that was made in this part of the api.

Sarah Green 15 Jan 2013, 14:43:01

So still a long way to go before this requirement is delivered then

Funka! 15 Jan 2013, 20:19:44

I see also U4-23 which looks like what Ian is asking about? Regarding whether media should ever be "publishable" or not, I'm sure there is probably another issue number for that discussion already (or if not then could be created)?

Also (I haven't tested yet for myself) if this means we can have base media types now, this also completes U4-81 then, correct? Thanks everyone!

Dan White 11 Feb 2013, 19:37:35

  • 1 for Ian's request. This is something badly needed for large scales sites with 100 + editors. IMHO, the way Umbraco handles user permissions in general needs rethought. It's very difficult to make work when user's need access to multiple sections of a site that are completely separate from one another.

Sarah Green 11 Feb 2013, 19:48:21

"IMHO, the way Umbraco handles user permissions in general needs rethought. It's very difficult to make work when user's need access to multiple sections of a site that are completely separate from one another." +1

Priority: Task - Pri 1

Type: Feature (planned)

State: Fixed

Assignee: Morten Christensen

Difficulty: Normal

Category: Architecture

Backwards Compatible: False

Fix Submitted:

Affected versions: 4.11.3

Due in version: 6.0.0


Story Points: