Commit b016bf5
committed
uploadGeneratetoken: Add support to optionally create new revision
Backported from PR midasplatform#146
This commit updates the "uploadGeneratetoken" API introducing the new
parameter "create_additional_revision" allowing to optionally change
the default behavior and ensure a new revision is created when:
- a bitstream associated with the file already exists on the server
- and the checksum parameter is specified
- and the item updated has at least one revision
Since the http uploader doesn't specify the "checksum" parameter, the
problem is only reproducible using the web API.
For example, considering the following configuration:
folder
|--- item1 --- revision1
| |--- bitstream1 (filename1)
|
|--- item2 --- revision1
| |--- bitstream2 (filename2)
By default, trying to associate bitstream1 with item2 will result in
this configuration:
folder
|--- item1 --- revision1
| |--- bitstream1 (filename1)
|
|--- item2 --- revision1
| |--- bitstream2 (filename2)
| |--- bitstream1 (filename1)
By setting the option "create_additional_revision" to True, the
following configuration will be obtained:
folder
|--- item1 --- revision1
| |--- bitstream1 (filename1)
|
|--- item2 -|--- revision1
| | |--- bitstream2 (filename2)
| |
| |--- revision2
| | |--- bitstream1 (filename1)1 parent f7cf0ab commit b016bf5
File tree
2 files changed
+16
-3
lines changed- core/controllers/components
- modules/api/controllers/components
2 files changed
+16
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
289 | 293 | | |
290 | 294 | | |
291 | 295 | | |
| |||
372 | 376 | | |
373 | 377 | | |
374 | 378 | | |
| 379 | + | |
375 | 380 | | |
376 | 381 | | |
377 | | - | |
| 382 | + | |
378 | 383 | | |
379 | | - | |
| 384 | + | |
| 385 | + | |
380 | 386 | | |
381 | 387 | | |
382 | | - | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
383 | 392 | | |
384 | 393 | | |
385 | 394 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
310 | 314 | | |
311 | 315 | | |
312 | 316 | | |
| |||
0 commit comments