Comments (6)
Hi @bilak,
You are exactly on point with this issue, @paulcwarren and I both spoke about this awhile back. I created a story for us to take a look next week. Depending on the outcome a PR might be just what we need!
Have a great weekend!
from spring-content.
Hi Lukas,
Firstly, thanks for the inputs thus far. Very helpful. We think we know how we should achieve this so we thought we would run it past you.
We probably want to add a PlacementStrategy
bean with a getLocation
method that, given an ID, returns a path
(probably a String, but maybe a URI?).
This path
can then be used with an expanded ResourceTemplate
service (currently AbstractResourceTemplate
) that exposes Spring Resource
objects and their streams.
DefaultXYZRepositoryImpl
's can use this PlacementStrategy
bean together with the ResourceTemplate
to implement their ContentStore
functionality. I imagine at least SC FS and SC S3 will want to make use of this. We need to look into Mongo's GridFS - it may well be capable of support this too - and if it does we would probably support placement there too. On the flip-side though it probably doesn't make any sense for SC JPA as that just stores BLOBs in a table but that is of less concern to us as most content management services would likely not choose to use this storage method.
The other reason for creating an expanded ResourceTemplate
(and for keeping the placement strategy separate from it) is to enable application's that don't want full CM functionality to also do content access (in the same developer friendly way) thus increasing the appeal of Spring Content.
This probably represents quite a bit of work, but definitely both required and worthwhile. We will try pick this up this week/early next.
from spring-content.
Hi Paul,
interesting ideas. I don't know much about S3 and Mongo but I've got another ideas for FS. From current implementation it looks like when I want new FS content store (CS) then I need to create new entity/spring repository/content repository for it. There could be an option where all contents will be stored in one entity/content store and somehow partitioned. Let's create annotation @FileSystemPartition
(or maybe some name which fits better) for entity field which will split contents in partitions on FS (e.g. /filesystemroot/partition1 /filesystemroot/partition2). For this there also need to be some @ContentId
generator which will guarantee the correct "sequence" id generation.
interface PartitionContentIdGenerator {
Object generateIdForPartition(Object partition);
}
Maybe parameter and return type should be of Long type.
I was working on something similar today, but was interrupted by other project. If I have time during next days I will try to create some branch and post my ideas.
from spring-content.
Atm the root of the content store is configured globally but I think you are right it should be configurable on a per content repository basis and that could very well be done via an annotation on the content repository interface, or something like that. Sounds like a different issue to me though so I created this issue to keep it separate from from this placement strategies one.
from spring-content.
Hi guys,
try to look at this commit and tell me what do you think about it. It isn't finished yet, but I want to listen from you if that could be way how the FS can perform. I must implement somehow the configuration for SimplePartitionDefinition or generally for PartitionDefinition and I'm thinking about DB config or application.yml config. What do you think?
from spring-content.
@bilak we have implemented a pluggable storage strategy with a UUID-based implementation for SC Filesystem and SC S3. We believe this will resolve this issue for you.
You can find more information in the filesystem docs. See 3.3.1. Storage Model.
from spring-content.
Related Issues (20)
- 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
- If-Match HTTP header gets ignored by a concurrent PUT after DELETE on the content of an entity HOT 1
- Filesize and filename are not set after a multipart/form POST http request to create entity with content HOT 1
- Events emitted twice HOT 2
- Relation "Blobs" not found HOT 2
- Multipart request to create entity and content in single request fails with http 400 HOT 1
- Multipart request to create entity and content in one request fail to create entity when file is missing
- Adding content to s3-storage fails with http 500 when using spring boot 3.2.1+ HOT 2
- Allow overriding name of content field in multipart payload
- Unable to Use Azure Data Storage in Springboot
- Unable to Use Azure Data Storage in Springboot HOT 3
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.