1. I try to use FileSystem provider, and it looks like it don't support preview :-(.
2. When I try pick up another file, filesystem provider don't start from current directory.
3. Is it possible to modify FS provider to store only filename without additional properties, like extension and size. I don't need it and on picture intensive site it make cached xml bigger.
Thanks for the suggestions, I'll address them individually bellow:
1) This was left out of the current version as you have very little control over what types of file you can select from, so to be able show previews would require a fair bit of work as they would all require a different way of creating a thumbnail. I guess the easiest would be to just show a generic thumbnail based upon the extension (similar to the dropbox provider).
2) This was left out also as it would require additional information to be saved regarding the open path. It is entirely possible that the same file will be available in multiple locations (see the Scribd provider for instance, you can access files by category, catalog or alphabeticaly) so would require this additional information to be stored. I also didn't deem it important as the built in media picker functions in this way aswell.
3) The FileSystem provider should only store the file path. All providers store a single string value to represent the selected file. Any meta data information is retreived by XSLT extension methods which reconnect and retreive the extra details. If you want to do something differently, you can simply create your own extension method.
On a side note. Many of the providers (including the FileSystem provider) were created to inspire, rather than be a final solution. The idea behind the Universal Media Picker is to provide a simple interface to create your own custom pickers. If you want to have a go at extending the FileSystem provider though, you are more than welcome, and you can grab the source from codeplex.
Not exactly as you wrote, for xslt it can be simple string. But for working with value in c# (like import) it's xml, not single string. I expect there is no way
4) Is there any way how to add thumbnail next to filename (I'm interested in pics only)
5) Do you plan support for using multiple providers for single field? Let user to decide if it take media from filesystem, scribd or facebook...
3) Sorry, yea, I didn't do a very good job of explaining did i =) It is a single <value /> XML node, with dataTypeId attribute and string value. Unfortunatley there isn't really a way around that. Each value needs to hold a reference to the data type definition id so that it is able to retreive any configuration values for reconnecting to the 3rd party apis (so for the FileSystem provider, it's things like the root folder) which can be unique per defintion (ie data type).
4) It is possible, it's just to what extent you want to go. If your root folder is within the wwroot, you could just link to the image file (you can easily set the preview URL of a MediaItem) is the thubnails are forced to fit the area. If the are outside the root, you may want to just create a httphandler to fetch the file, and return the bytes (see dropbox provider for an example). As I say, you can do this however you like, just set the MediaItems PreviewUrl property when returned from the various Provider methods to a value URL to an image and it'll just work.
5) It's not something I've planned to do / add as the config could get a bit confusing, and it would again require additional data to be stored against each node which I didn't really want to do at this point. Thinking about it though, there is no reason you couldn't write a CompositeProvider that can merge multiple provider sources togther and just proxy the various providers? Unfortunatley this isn't something I've got the time to do myself at the moment, but you are more than welcome to give it a go.
Im'not sure i descripe 3) enough, I'm not not interested in preview in modal dialog, but when displaying property placed on tab. Is your answer about it?
I'm simply looking for filesystem picker which can display preview of selected picture and I'm not sure I should extend provider of UMP or filepicker from uComponents.
Filepicker allow me to change paht quickly by changing path directly and store value as simple path (small plus) and UMP has nice possibilities with other providers in future...
Ahh, I see what you mean now. UMP doesn't currently support that type of preview yet, though it wouldn't be too dificuilt for me to add as it could just use the PreviewUrl of the MediaItem which gets returned from GetMediaItemById. It would then just be up to you to return a valid URL (as described in option 4 above).
All have a look at adding the preview, and will probably make it an option as per the existing Media Picker.
FileSystem Provider
Hallo,
1. I try to use FileSystem provider, and it looks like it don't support preview :-(.
2. When I try pick up another file, filesystem provider don't start from current directory.
3. Is it possible to modify FS provider to store only filename without additional properties, like extension and size. I don't need it and on picture intensive site it make cached xml bigger.
Thanks
Petr
Hey Petr,
Thanks for the suggestions, I'll address them individually bellow:
1) This was left out of the current version as you have very little control over what types of file you can select from, so to be able show previews would require a fair bit of work as they would all require a different way of creating a thumbnail. I guess the easiest would be to just show a generic thumbnail based upon the extension (similar to the dropbox provider).
2) This was left out also as it would require additional information to be saved regarding the open path. It is entirely possible that the same file will be available in multiple locations (see the Scribd provider for instance, you can access files by category, catalog or alphabeticaly) so would require this additional information to be stored. I also didn't deem it important as the built in media picker functions in this way aswell.
3) The FileSystem provider should only store the file path. All providers store a single string value to represent the selected file. Any meta data information is retreived by XSLT extension methods which reconnect and retreive the extra details. If you want to do something differently, you can simply create your own extension method.
On a side note. Many of the providers (including the FileSystem provider) were created to inspire, rather than be a final solution. The idea behind the Universal Media Picker is to provide a simple interface to create your own custom pickers. If you want to have a go at extending the FileSystem provider though, you are more than welcome, and you can grab the source from codeplex.
http://umpp4umb.codeplex.com/SourceControl/list/changesets
All the best
Matt
Hi Matt,
thank you for your answers, and I have another one or two before I go to sources :-).
3) When I look into stored property it looks like UMP store value like this
Not exactly as you wrote, for xslt it can be simple string. But for working with value in c# (like import) it's xml, not single string. I expect there is no way
4) Is there any way how to add thumbnail next to filename (I'm interested in pics only)
5) Do you plan support for using multiple providers for single field? Let user to decide if it take media from filesystem, scribd or facebook...
Thank you
Petr
Hey Petr,
3) Sorry, yea, I didn't do a very good job of explaining did i =) It is a single <value /> XML node, with dataTypeId attribute and string value. Unfortunatley there isn't really a way around that. Each value needs to hold a reference to the data type definition id so that it is able to retreive any configuration values for reconnecting to the 3rd party apis (so for the FileSystem provider, it's things like the root folder) which can be unique per defintion (ie data type).
4) It is possible, it's just to what extent you want to go. If your root folder is within the wwroot, you could just link to the image file (you can easily set the preview URL of a MediaItem) is the thubnails are forced to fit the area. If the are outside the root, you may want to just create a httphandler to fetch the file, and return the bytes (see dropbox provider for an example). As I say, you can do this however you like, just set the MediaItems PreviewUrl property when returned from the various Provider methods to a value URL to an image and it'll just work.
5) It's not something I've planned to do / add as the config could get a bit confusing, and it would again require additional data to be stored against each node which I didn't really want to do at this point. Thinking about it though, there is no reason you couldn't write a CompositeProvider that can merge multiple provider sources togther and just proxy the various providers? Unfortunatley this isn't something I've got the time to do myself at the moment, but you are more than welcome to give it a go.
Hope that's made things a bit clearer for you.
Many thanks
Matt
Hi, Matt,
Im'not sure i descripe 3) enough, I'm not not interested in preview in modal dialog, but when displaying property placed on tab. Is your answer about it?
I'm simply looking for filesystem picker which can display preview of selected picture and I'm not sure I should extend provider of UMP or filepicker from uComponents.
Filepicker allow me to change paht quickly by changing path directly and store value as simple path (small plus) and UMP has nice possibilities with other providers in future...
Thanks Petr
Hi Petr,
Ahh, I see what you mean now. UMP doesn't currently support that type of preview yet, though it wouldn't be too dificuilt for me to add as it could just use the PreviewUrl of the MediaItem which gets returned from GetMediaItemById. It would then just be up to you to return a valid URL (as described in option 4 above).
All have a look at adding the preview, and will probably make it an option as per the existing Media Picker.
Thanks for the suggestion.
Matt
Hi Matt, Thanks for your answers.
is working on a reply...