Comments (16)
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.
from spring-content.
from spring-content.
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?
Then mongo store does not implement it at all. Is it just work in progress or you forget to add it there. (other stores implements it). I'm trying to understand how to communicate faster with you, cause I'm in decision processes and we have to decide which way to take in our development. If I'll work with spring-content, I need to understand how much stops or eventual refactors I'll have to do in the future.
I have to make some sort of time table to my customer.
Thank You
Ladislav
from spring-content.
Hi Ladislov,
Store
and AssociativeStore
are currently experimental API. That said we are looking to GA it soon as it seems to work ok. So these will be the next set of stories we will pick up.
On Store
we actually have Store.getResource(SID location)
; i.e. it is generic, not just String and depends on the Store's declared ID type. If that is String
then the method will be getResource(String location)
(and incidentally it would implement Spring's resource loader interface). However, if the Store was typed to MyCustomId
for example then it would be getResource(MyCustomId location)
. We do have a story on the backlog to add a AssociativeStore.getResource(E entity)
along with AssociativeStore.associate(Entity e, Resource r)
and AssociativeStore.unassociate(E entity)
. We just finished implementing Store
and AssociativeStore
on the Spring Content JPA module. As you say Mongo's Store implementation still needs doing. As do the tweaks to Spring Content REST to use Store and AssociativeStore instead of ContentStore.
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
_Paul
from spring-content.
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.
from spring-content.
Thank you,
Ill try to move my code to other branch, then Ill continue.
Ladislav
from spring-content.
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.
from spring-content.
Hello Warren,
Can You check my last PR?. It is there few days now, and I'm blocked on my devel.
It pass all tests except Codacy which pop up again.
Then I'd like to change RenditionProvider interface similar to this:
public interface RenditionProvider {
public String consumes();
public Boolean consumes(String fromMimeType);
public String[] produces();
public RenditionCapability isCapable(String fromMimeType, String toMimeType);
@Deprecated
public InputStream convert(InputStream fromInputSource, String toMimeType);
public Resource convert(Resource fromResource, String toMimeType);
}
RenditionCapability
is an enum for determine how much I'm capable to do some rendition
Cause there can exists more different renderers but each of them can have different quality.
Can we do some discussion about it?
Regards
Ladislav.
from spring-content.
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 Resource
from spring-content.
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 :)
Ill be back in few days.
regards
ladislav
from spring-content.
Hey @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.
from spring-content.
from spring-content.
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.
from spring-content.
from spring-content.
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. Store
and AssociativeStore
are both now Resource-based and supported by all storage modules. Plus all of the store abstractions are now fairly cleanly supported by the latest spring content REST module.
I think the last thing would be to include some variation of your RenditionProvider. Would you this still be useful to you?
Thanks
from spring-content.
Closing due to inactivity. Please feel free to re-open. In the meantime I have added a stories to our backlog to:
- refactor the rendition provider interface to use Resource
- provide the ability to access to the entity in rendition providers
from spring-content.
Related Issues (20)
- Circular references in `AzureStorageConfiguration` during application startup HOT 1
- Spring-Content-JPA 2.9.0 nullpointer exception trying to setContent HOT 3
- Unable to use @EnableS3Stores in junit test annotated with @DataJpaTest HOT 9
- LockingAndVersioningRepositoryImpl seems to be shared between multiple repositories but caches EntityInformation HOT 2
- S3ContentStore, FilesystemContentStore, etc extend deprecated ContentStore HOT 2
- spring-content-fs depends on old version of Hibernate
- Fail to set content on nested content properties when using JPA. HOT 2
- @ContentLength field is set to 0 instead of null for nullable types
- POST to content-property without content-type results in NPE / HTTP-500 HOT 1
- Link relation and path configured with @RestResource ignored for content properties with multiple capital letters HOT 1
- Do not include junit as compile dependency
- Exception with unsetContent using SB3 and SC3.0.4 JPA Starter HOT 1
- File download not working on windows platform HOT 1
- How do I configure com.github.paulcwarren:spring-content-bom for spring boot kotlin gradle? HOT 1
- Hibernate dependency error HOT 4
- No suitable HttpMessageConverter found to read request body into object of type class com.example.demo.entity.client.image.Avatar from request with content type of image/png;charset=UTF-8 HOT 8
- Investigation into the cause of `java.lang.NullPointerException: Cannot invoke "org.springframework.content.commons.storeservice.StoreInfo.getInterface()" because the return value of "internal.org.springframework.content.rest.io.StoreResource.getStoreInfo()" is null`
- Maven build error with Graal VM on Spring Content HOT 4
- Crash when use FileSystemResourceLoader in the latest version of spring boot HOT 1
- Not compatible with Spring Boot 3.2: method Assert.notNull(Object) does not exist HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-content.