Expand description
File attachments of revisions, with version history.
A revision holds named files; uploading a file with the same name again (case-insensitive) adds a new version instead of a second file. Every version stays downloadable, and any old version can be restored – as a new version, so the history is never rewritten. The bytes live in the content-addressed vault, so identical content is stored once.
Structs§
- Compare
Candidate - A model the 3D preview can be compared with: another version of the same file, or a version of the file of the same name in another revision of the item (graphical revision comparison).
- File
Text - A page of the text that was extracted from a file version for the
full-text search (see
textindex). - Stored
- Outcome of storing one upload.
- Upload
- A received upload that is already stored in the vault.
Constants§
- MAX_
TEXT_ PAGE_ CHARS - Most characters one
read_textcall returns.
Functions§
- all_
hashes - All distinct blob hashes referenced by the database (for
vault check). - apply_
bases - Attaches the parsed
basesto the uploads of the same name. - apply_
folders - Attaches the parsed folders to the uploads.
- attach
- Adds files / new versions to a revision that is checked out by the actor.
- check_
in - Check-in: stores the uploaded files as new versions and releases the check-out in one transaction – either both happen or neither.
- classify_
unclassified - Classifies the files that have no format yet (files from before the
format registry, or after
formatwas reset to NULL). Returns how many were classified. - clean_
content_ type - Normalises a client supplied content type; unknown values become
application/octet-stream. - compare_
candidates - The models a file version can be compared with, newest revision and
version first (at most 50; versions with the same content as
shownare left out). The file’s item is readable, so are its other revisions. - delete
- Removes a file (with all its versions) from an in-work revision. The blobs stay in the vault because other revisions may still reference them.
- ensure_
can_ attach - Fails early (before receiving an upload) if files cannot be attached.
- get
- A file the actor may read; hidden files answer like missing ones.
- get_
version - A file version (with the file name) the actor may read.
- list
- The files of a revision the actor may read.
- list_
many - The files of several revisions in one query, ordered by revision, folder and name.
- list_
many_ by_ revision list_manygrouped by revision (each group in folder and name order).- parse_
bases - Parses the
basesfield of an upload: a JSON object that maps file names to the version each upload is based on, either the version number (0= a new file) or the SHA-256 of the content the client checked out:{"hub.step": 3, "frame.iam": "9f86d0…"}. Keys are matched like file names on the server (case-insensitive). - parse_
folders - Parses the folder fields of an upload:
folder(one folder for every file of the request) andfolders(a JSON object{"file name": "folder"}for each file, e.g. from the desktop folder import; it wins overfolder). Returns the default folder and the folders by lower-case stored name. - precheck_
base - Checks a planned upload against the current file before its bytes are sent (chunked uploads announce their base first), so a conflict is reported before gigabytes are transferred. The binding check runs again when the version is stored.
- read_
text - Reads a page (
offset, at mostlimitcharacters, capped atMAX_TEXT_PAGE_CHARS) of the extracted text of a file of a revision (version: default the current one). Hidden project groups answer like a missing revision; nothing is read from the vault, only the text the upload stored for the search. - rescan_
references - Reads the references of the current file versions of the given formats again and replaces the stored ones – after a reader improved (e.g. SOLIDWORKS 2015+ files, whose compressed sections were not read before). Formats that are not scanned for references are skipped. Each version is replaced in its own transaction, so an interrupted run can simply be repeated. Returns how many versions were scanned.
- restore_
version - Rollback: makes the content of an older version the newest version.
- scan_
unscanned_ references - Scans the current versions that were stored before reference tracking existed (or before their format was known) for referenced CAD files. Returns how many versions were scanned.
- set_
folder - Changes the folder of a file (its place in the desktop working folder) while its revision is checked out by the actor.
- set_
retention - Chooses what happens to the old versions of a file:
allkeeps every version,latestlets the housekeeping remove the versions a newer one replaced (seeservices::retention::purge_superseded_versions). - stored_
name - The name a file gets on the server – the key for bases and versions.
- versions
- All versions of a file the actor may read, newest first.
- versions_
of_ revision - All versions of all files of a revision, newest first.