imulus/Archetype — pull request #141 by kjac (2014-05-29 09:47:33+00:00)
Title: Support upload and imagecropper datatypes (issue #114)

This PR allows the use of upload and imagecropper datatypes directly in an Archetype. Issue #114 contains details of the problem. To solve this, the following has been changed/added:
* Use the file manager on the client to register the selected files within an Archetype on the topmost containing Archetype, in order to have these sent to the ```PropertyValueEditor.ConvertEditorToDb()``` method as ```editorValue.AdditionalData``` on save/publish.
* Enrich the datatypes returned from ```ArchetypeDataTypeController.GetByGuid()``` with any missing prevalues from the datatype default prevalues. For this particular PR it's necessary to add the missing default prevalues to support the imagecropper focal point, but other datatypes might also depend on their default prevalues to function correctly on the client, so in a broader perspective this might be a valuable addition.

I've tested this with multiple levels of nested Archetypes and it seems to work fine with nesting as well.

I know of two issues with this solution:
* You can't upload two different files with the same file name at once within the same Archetype. If you do, the first matching file will be used for both uploads.
* If you on the same PE select a file, then another file without saving first, both selected files appear to be uploaded, even though only the last one is used. This is partially due to the complexity surrounding nested Archetypes. Umbraco cleans up the temporary upload directory on disk so there's no "disk space leaking" involved, it's merely an overhead in the request length.

Please note that this PR is built upon the changes from PR #129.