Ticket #2340 (closed tweak: obsolete)

Opened 15 years ago

Last modified 13 years ago

resource-management-r0 -- Change the way Sophie handles large resources

Reported by: deyan Owned by: meddle
Priority: major Milestone: X3
Component: uncategorized Version: 2.0
Keywords: Cc: deyan
Category: unknown Effort:
Importance: Ticket_group:
Estimated Number of Hours: 0 Add Hours to Ticket: 0
Billable?: yes Total Hours: 0
Analysis_owners: deyan Design_owners: meddle
Imp._owners: meddle Test_owners:
Analysis_reviewers: meddle Changelog: Changelog
Design_reviewers: pap Imp._reviewers: pap, deyan
Test_reviewers: Analysis_score: 3.5
Design_score: 3.5 Imp._score: 4
Test_score: 0

Description

  • Make the "Link" and "Copy to files" always visible
  • Make the default action for large resources "Link" with "Copy to files" checked
  • If the book was never saved, the contents should be linked from a temporary directory and moved on save.

Change History

comment:1 Changed 15 years ago by deyan

  • Type changed from bug to tweak

comment:2 Changed 15 years ago by deyan

  • Owner set to deyan
  • Status changed from new to s1a_analysis_started

comment:3 Changed 15 years ago by deyan

  • Status changed from s1a_analysis_started to s1b_analysis_finished

comment:4 Changed 15 years ago by meddle

  • Status changed from s1b_analysis_finished to s1c_analysis_ok
  • Analysis_reviewers set to meddle
  • Analysis_score changed from 0 to 3.5
  • I don't like the name of the task, it is not a bugfix. I think a proper name is CLIENT_SIDE_LARGE_RESOURCES_R0.
  • I think that this task can include and fixing the exceptions thrown when the linked resource is missing. So I will try to fix it if I have time.

comment:5 Changed 15 years ago by meddle

  • Cc deyan added

comment:6 Changed 15 years ago by meddle

  • Design_owners set to meddle
  • Owner changed from deyan to meddle
  • Status changed from s1c_analysis_ok to s2a_design_started

comment:7 Changed 15 years ago by meddle

  • Status changed from s2a_design_started to s2b_design_finished
  • We will use the temporary directory of the OS to store linked "relative" files if the book is not saved yet.
  • The temporary directory will be retrieved with the System property java.io.tmpdir
    • In it a directory with the name of the unsaved book will be created (UUID string, unique).
    • All the files will be stored there, we will not use createTmpFile methods, because they change the names of the files and don't save the directory structure.
    • All the directories and files there will be marked with the File#deleteOnExit() method.
  • In the ResourceFilesUtil will be added public static void copyResources(ResourceH resource, File fileToBeSaved) method that copies the files from the temporary directory to the true relative '_files' directory of the book.
  • The ResourceFilesUtil's getFilesDir methods will work with memory resources, but will retrieve the directory in the temporary dir.
  • In the SaveDocUtil public static boolean saveBookToFile(BookDocView bookDocView) will have the following changes after the file to save the book is determined:
    if (resAcc.getLocation().startsWith(LocationPrefix.MEMORY) 
    	&& ResourceFilesUtil.hasFileDirectory(book)) {
    	ResourceFilesUtil.copyResources(book, file);
    }
    
    
  • Modified the BinDataChooser to have the checkbox for copying resources in the relative dir always enabled when link is choosen and by default checked.
  • There are tests:

comment:8 Changed 15 years ago by pap

  • Status changed from s2b_design_finished to s2c_design_ok
  • Design_score changed from 0 to 3.5
  • Design_reviewers set to pap
  • Seems generally ok.
  • As I told you the addition to SaveDocUtil seems unnecessary and maybe the new method in ResourceFilesUtil
  • I think that it is better to use patches than branches when possible.
  • Also I like the way you link files but sometimes it is useful to see the changes to those files.

comment:9 Changed 15 years ago by meddle

  • Status changed from s2c_design_ok to s3a_implementation_started
  • Imp._owners set to meddle
  • Use the browser to view the changes :)
  • I thought the task will be more complex, that is why I use branch.

comment:10 Changed 15 years ago by meddle

  • Status changed from s3a_implementation_started to s3b_implementation_finished

Implementation done.

  • Now all the large resources by default are inserted as 'link and copy'.
  • When the user opens a book with linked resource and it can not be found there is no exception thrown
  • There is exception when the resource that is linked is removed while playing. The problem is that the BinSourceNotFoundException is thrown in the AudioThread of the NativeMediaHandler and not in the EDT so it can not be caught. I tried some solutions but after two hours I decided that the problem is not trivial so it should be in its own ticket.

Implementation code:

comment:11 Changed 15 years ago by meddle

I had some problems with the track so:
implementation

comment:12 Changed 15 years ago by meddle

I fixed the exception with the missing resource adding a BrokenAudioChunk that holds the error. If the chunk is broken one, the media view shows it's problem.

comment:13 Changed 15 years ago by deyan

  • Milestone set to X3

Batch update from file query.csv

comment:14 Changed 15 years ago by pap

  • Status changed from s3b_implementation_finished to s3c_implementation_ok
  • Imp._score changed from 0 to 4
  • Imp._reviewers set to pap, deyan
  • Commited in [8743].
  • I have no serious objection

comment:15 Changed 13 years ago by meddle

  • Status changed from s3c_implementation_ok to closed
  • Resolution set to obsolete

Closing all the tickets before M Y1

Note: See TracTickets for help on using tickets.