Opened 10 years ago

Closed 10 years ago

#17 closed enhancement (fixed)

add filesystem/ability to store files

Reported by: dcohen Owned by: dstillman
Priority: critical Milestone: 1.0 Beta 1
Component: data layer Version: 1.0
Keywords: Cc:

Description

necessary for the storage of web page snapshots, images, PDFs, etc.

Change History (3)

comment:1 Changed 10 years ago by dstillman

  • Status changed from new to assigned

comment:2 Changed 10 years ago by dstillman

(In [379]) Addresses #17, add filesystem/ability to store files

Not finished, but enough to give David something to work with

No BLOBs -- just linking/importing of files and loaded documents

New Scholar.Item methods:

incrementFileCount() (used internally)
decrementFileCount() (used internally)
isFile()
numFiles()
getFile() -- returns nsILocalFile or false if associated file doesn't exist (note: always returns false for items with LINK_MODE_LINKED_URL, since they have no files -- use getFileURL() instead)
getFileURL() -- returns URL string
getFileLinkMode() -- compare to Scholar.Files.LINK_MODE_* constants: LINKED_FILE, IMPORTED_FILE, LINKED_URL, IMPORTED_URL
getFileMimeType() -- mime type of file (e.g. text/plain)
getFileCharset() -- charsetID of file
getFiles() -- array of file itemIDs this file is a source for

New Scholar.Files methods:

importFromFile(nsIFile file [, int sourceItemID])
linkFromFile(nsIFile file [, int sourceItemID])
importFromDocument(nsIDOMDocument document [, int sourceItemID])
linkFromDocument(nsIDOMDocument document [, int sourceItemID])

New class Scholar.FileTypes -- partially implemented, not yet used

New class Scholar.CharacterSets -- same as other *Types classes:
getID(idOrName)
getName(idOrName)
getTypes() (aliased to getAll(), which I'll probably change the others to as well)

Charsets table with all official character sets (copied from Mozilla source)

Renamed Item.setNoteSource() to setSource() and Item.getNoteSource() to getSource() and adjusted to handle both notes and files

comment:3 Changed 10 years ago by dstillman

  • Resolution set to fixed
  • Status changed from assigned to closed

Closing this from r379 -- we can use new tickets for remaining features and bugs

Note: See TracTickets for help on using tickets.