New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why Stores and renditions return InputStream and not resource #21
Comments
Hi Ladislav, Thanks for using Spring Content. We also have a port to Spring Boot 2 and will probably push that out in the release. Just trying to decide whether the next release should be 0.0.11 as originally planned. Or 0.1.0. My guess is, like the rest of Spring, we will have customer who stick on with Spring 1.x at least for a while. But that is an internal concern.
Spring team are aware of Spring Content. The desire on our part is that Spring Content becomes a part of Spring eventually. I can't speak for the Spring team so I can't say if that will happen for sure but it is what we the Spring Content team are actively working towards. Spring team needs to see an active project with lots of github stars and forks so we are both doing our bit to make that a reality and I thank you for that :-)
Awesome. Our guess was that we would need the ability to store renditions - not just create them on-demand - so they can be fetched more quickly. We just didn't have anyone asking for them at the time so we did MVP only to get the feature out of the door. More than happy to accept PRs here.
Sounds like a bug fix to me. Again, feel free to PR that. If you want to PR changes I presume that you need our internal Spring Boot 2 branch made available so that you can move your changes on that? Please let me know. |
Hi Warren,
Thx for response ;)
Ill check what happen when I do PR due to renamed folders. Ill see, maybe Ill turn back to original structure. I have to check Stores. I have to discus with my friend. And see also our project needs, we changed also RenditionProvider interface, due to our particular needs on transformation redirecting. Soooo many things to check ;) and sooo few time :) .... Ill try to do thing as soon as possible.
regards
Ladislav
Inviato da iPad
… Il giorno 05 apr 2018, alle ore 17:29, Paul Warren ***@***.***> ha scritto:
Hi Ladislav,
Thanks for using Spring Content. We also have a port to Spring Boot 2 and will probably push that out in the release. Just trying to decide whether the next release should be 0.0.11 as originally planned. Or 0.1.0. My guess is, like the rest of Spring, we will have customer who stick on with Spring 1.x at least for a while. But that is an internal concern.
We renamed "spring-content-" to "strg-spring-" so maybe in future it will not clash with spring it self.
Spring team are aware of Spring Content. The desire on our part is that Spring Content becomes a part of Spring eventually. I can't speak for the Spring team so I can't say if that will happen for sure but it is what we the Spring Content team are actively working towards. Spring team needs to see an active project with lots of github stars and forks so we are both doing our bit to make that a reality and I thank you for that :-)
"Is there any reason why Stores return InputStream and not Resource?"
ContentStore was our initial effort. Since then we have actually introduced an experimental Store API that comprises of a Store and an AssociativeStore. Store is essentially just a generic Spring ResourceLoader that does exactly as you say, return Spring Resources. AssociativeStore allow you to associate Resources and Entities. I would recommend that you go look at these interfaces. They are almost GA-able. All stores now implement both. AssociativeStore needs a little tweak. But mostly Spring Content REST needs updating to use these, rather than ContentStore.
I will add caching aspect to the renditions
Awesome. Our guess was that we would need the ability to store renditions - not just create them on-demand - so they can be fetched more quickly. We just didn't have anyone asking for them at the time so we did MVP only to get the feature out of the door. More than happy to accept PRs here.
Next one is: <video...> html5 tag
Sounds like a bug fix to me. Again, feel free to PR that.
If you want to PR changes I presume that you need our internal Spring Boot 2 branch made available so that you can move your changes on that? Please let me know.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hi Warren, I saw Store interface. Ok it should work, but why there is getResource with just string instead of Entity it self, so we can hide entity search and ID extraction directly in store instead do it on controller? Will you work on it in the future? Thank You |
Hi Ladislov, On Essentially, we think of Stores as generic Spring ResourceLoader's that can hand out fully-functional Spring Resource's that can be read, written to, deleted and that have identity. Hope that clarifies the situation. It would be very helpful to understand your timelines, the store(s) you are planning to use as within this track of work. We would be more than happy to prioritize our backlog to fit your requirements. Perhaps a conference call would be appropriate? You can find my email on my github profile. Shoot me an email and we can set up. Probably quicker than using this github issue. HTH |
In case it is useful I have pushed our spring-boot2 branch to wip/spring-boot2. We will probably release this work as 0.1.0. |
Thank you, Ladislav |
Hi Ladislav, thanks for this. I will try and look at this soonest. I am at a conference this week and away from my laptop for the most part so I just want to provide forewarning in case I don't. At first glance the code looks fine. Only thing I spotted so far was unnassociate. It needs to check whether the @ContentID is not also the Spring Data @id before nulling out the value otherwise we null out their Id as well which isn't good obviously. But I can add this code. In general it looks good. I am not sure what it takes to add codacy? I'll look into it. |
Hello Warren, Can You check my last PR?. It is there few days now, and I'm blocked on my devel. Then I'd like to change RenditionProvider interface similar to this:
Can we do some discussion about it? Regards |
Accepted that last PR. Sorry about that. I missed it for some reason. I think we can do some refactoring of the ContentStore methods to use the AssociativeStore methods but we can get to that anytime. Let's look at renditions first. On the one hand I like this suggestion. By taking a resource and handing another back this will immediately fit better into the Spring Content REST layer. And in fact probably make it possible to serve byte ranges request of renditions as well as just the actual content. Pretty neat. Not sure how much utility it will have. In reality I have only seen byte range requests used by movie players and adobe reader and custom implementations. But perhaps a word doc gets rendered as a PDF and adobe would use byte range requests to fetch pages at a time. It is nice that it would work for renditions as well as content. Usually the sign of a good abstraction. On the other hand this does make writing a rendition provider a little harder. I would be curious to see what a sample provider would look like for this? How much extra code is it to write in order to return a resource? But in general I like the concept of using |
Hello Warren. I’m on short holidays now, so I’ll write some notes from tablet now.:) We manage consistent number of document records a day, with our solution, and we do almost for each digital attachment text and pdf rendition. So for us ability to render is clue of content storage. And it must be fast as much as possible. So we did POC with apply spring-cache aspect on convert method. And it function with Resource, even with stream in it. (I have example of Cache implementation that handle also streams.) I had made some sort of Super Resource Wrapper which implement Resource and Inputstream interfaces. Cause we need Content entity during some rendition process, so I need move around a bit of more data then just plain content. Then I’m working on particular renderer which will forward rendition request to another copy of content-store in net. so we can handle also many different renderers with horizontal scalability. (the same composition of content-store application just with different renditions buildet in:) All managet trough spring microservice support, this I need study better, but architecture is already on the paper :) regards ladislav |
Hey @LadislavSopko. Just checking back in to let you know that I have also updated the README to include details for setting up eclipse and intellij IDEs with the relevant code formatting to make PRs a little easier to make and review. |
Hello,
I allready rebased my branches to 0.1.0 master :)
I have some time stress in other project :(
I'll be back with my changes as soon as possible.
2018-06-05 17:24 GMT+02:00 Paul Warren <notifications@github.com>:
… Hey @LadislavSopko <https://github.com/LadislavSopko>. Just checking back
in to let you know that 0.1.0 now supports Spring Boot 2 and moves the
Store and AssociativeStore APIs in the direction we have discussed.
I have also updated the README to include details for setting up eclipse
and intellij IDEs with the relevant code formatting to make PRs a little
easier to make and review.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#21 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALb9BlPSC1ZhQe1v8AYcFaSND9O3XQQ6ks5t5qK9gaJpZM4TGc5e>
.
|
Awesome. Likewise, if I get to it before you I will take a shot at re-vamping the renditions API as we have been discussing here. Talk soon. |
My friend is working on branch with code what I start to use, but it is not at level to be merged in production jet.
We had milestone til 31/07. It should be also with functional cache, too. Anyway we continue on code what I propose to You for discussion. Maby We will be able to commit some updates in about 2-3 weeks. Ill do speak with my friend in this days.
Ladislav
Inviato da Posta per Windows 10
Da: Paul Warren
Inviato: mercoledì 6 giugno 2018 06:09
A: paulcwarren/spring-content
Cc: Ladislav Sopko; Mention
Oggetto: Re: [paulcwarren/spring-content] Why Stores and renditions returnInputStream and not resource (#21)
Awesome. Likewise, if I get to it before you I will take a shot at re-vamping the renditions API as we have been discussing here. Talk soon.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hi @LadislavSopko, I wanted to check back in with you on this issue and PR. For the most part, I think I have slowly but surely moved spring-content in the direction we agreed upon. I think the last thing would be to include some variation of your RenditionProvider. Would you this still be useful to you? Thanks |
Closing due to inactivity. Please feel free to re-open. In the meantime I have added a stories to our backlog to:
|
Hello Warren!
First of all,
Nice Work!
I fork your spring-content and do some customization in.
We did port to spring boot 2.0.x (tests are green, all seems work)
We renamed "spring-content-" to "strg-spring-" so maybe in future it will not clash with spring it self.
I start to meet some strange behaviors. One what I meet yesterday was:
ContentEntityRestController.getContent(... ) ["ranged"] request handler do this call:
Resource r = ((Store)info.getImpementation()).getResource(cid);
And it finish in exception cause ContentStores are designed to return InputStream.
As I found, debugging my tryes, underline spring handling is more Resource oriented. So here is my question: "Is there any reason why Stores return InputStream and not Resource?" In all Implementations You get resource from storage and then you just return InputStream of resource anyway.
If there is no particular reason I will try change Store / renditions interface to work directly with Resources, so I will have more flexibility. I will add caching aspect to the renditions, cause we are strongly oriented in media conversion, so we need save as much resource moving up and down as possible.
Next one is: <video...> html5 tag from chrome call correctly call before described handler, instead of mozilla call other one, where underlying spring after try to make ranged response and fail cause InputStreamResource is not good for ranged response. I did small fix ( I return Resource it self ) and mozilla stream well too.
I'd like to be useful to you as much as possible in my work time :)
I'm at start of development, so I'm just looking around inside code for now, and I study how I'll move in the future.
Regards
Ladislav
The text was updated successfully, but these errors were encountered: