| |
342 |
342 |
v_filename, |
| |
343 |
343 |
v_description, |
| |
344 |
344 |
v_mime_type, |
| |
345 |
345 |
v_new_file_id, |
| |
346 |
346 |
copy_file__creation_user, |
| |
347 |
347 |
copy_file__creation_ip |
| |
348 |
348 |
); |
| |
349 |
349 |
|
| |
350 |
350 |
if v_indb_p |
| |
351 |
351 |
then |
| |
352 |
352 |
|
| |
353 |
353 |
|
| |
354 |
354 |
select lob into v_lob_id |
| |
355 |
355 |
from cr_revisions |
| |
356 |
356 |
where revision_id = v_live_revision; |
| |
357 |
357 |
|
| |
358 |
358 |
|
| |
359 |
359 |
v_new_lob_id := empty_lob(); |
| |
360 |
360 |
|
| |
361 |
361 |
|
| |
362 |
|
select lob_copy(v_lob_id,v_new_lob_id); |
| |
|
362 |
perform lob_copy(v_lob_id,v_new_lob_id); |
| |
363 |
363 |
|
| |
364 |
364 |
|
| |
365 |
365 |
update cr_revisions |
| |
366 |
366 |
set lob = v_new_lob_id, |
| |
367 |
367 |
content_length = v_content_length |
| |
368 |
368 |
where revision_id = v_new_version_id; |
| |
369 |
369 |
|
| |
370 |
370 |
else |
| |
371 |
371 |
|
| |
372 |
372 |
|
| |
373 |
373 |
select content into v_file_path |
| |
374 |
374 |
from cr_revisions |
| |
375 |
375 |
where revision_id = v_live_revision; |
| |
376 |
376 |
|
| |
377 |
377 |
|
| |
378 |
378 |
update cr_revisions |
| |
379 |
379 |
set content = v_file_path, |
| |
380 |
380 |
content_length = v_content_length |
| |
381 |
381 |
where revision_id = v_new_version_id; |
| |
382 |
382 |
|
|
| |
385 |
385 |
perform acs_object__update_last_modified(copy_file__target_folder_id); |
| |
386 |
386 |
|
| |
387 |
387 |
return v_new_version_id; |
| |
388 |
388 |
|
| |
389 |
389 |
end;' language 'plpgsql'; |
| |
390 |
390 |
|
| |
391 |
391 |
|
| |
392 |
392 |
create function file_storage__move_file ( |
| |
393 |
393 |
|
| |
394 |
394 |
|
| |
395 |
395 |
|
| |
396 |
396 |
|
| |
397 |
397 |
integer, |
| |
398 |
398 |
integer |
| |
399 |
399 |
) returns integer as ' -- 0 for success |
| |
400 |
400 |
declare |
| |
401 |
401 |
move_file__file_id alias for $1; |
| |
402 |
402 |
move_file__target_folder_id alias for $2; |
| |
403 |
403 |
begin |
| |
404 |
404 |
|
| |
405 |
|
select content_item__move( |
| |
|
405 |
perform content_item__move( |
| |
406 |
406 |
move_file__file_id, |
| |
407 |
407 |
move_file__target_folder_id |
| |
408 |
408 |
); |
| |
409 |
409 |
|
| |
410 |
410 |
perform acs_object__update_last_modified(move_file__target_folder_id); |
| |
411 |
411 |
|
| |
412 |
412 |
return 0; |
| |
413 |
413 |
end;' language 'plpgsql'; |
| |
414 |
414 |
|
| |
415 |
415 |
|
| |
416 |
416 |
create function file_storage__get_title ( |
| |
417 |
417 |
|
| |
418 |
418 |
|
| |
419 |
419 |
|
| |
420 |
420 |
|
| |
421 |
421 |
integer |
| |
422 |
422 |
) returns varchar as ' |
| |
423 |
423 |
declare |
| |
424 |
424 |
get_title__item_id alias for $1; |
| |
425 |
425 |
v_title cr_items.name%TYPE; |