Specification » History » Version 6

Alexander Blum, 03/08/2023 03:03 AM

1 1 Alexander Blum
{{toc}}
2 1 Alexander Blum
3 1 Alexander Blum
# General
4 1 Alexander Blum
5 1 Alexander Blum
## Object Processing
6 1 Alexander Blum
7 1 Alexander Blum
### Commits
8 1 Alexander Blum
9 1 Alexander Blum
* Web users provide the system with metadata on objects as information basis for the distribution of money
10 1 Alexander Blum
* The system needs to balance the need of web users to change the metadata and the stability of the information basis
11 1 Alexander Blum
* Artists, Releases, Creations have to be committed by the web users as a conscious act
12 1 Alexander Blum
    * No data is published before a commit
13 1 Alexander Blum
    * Web users are able to distinguish public/private fields after a commit
14 1 Alexander Blum
    * A commit of a set of objects (all fields, public fields) is saved as rendered text for evidence
15 1 Alexander Blum
* Creations do not need to have content to be committable
16 1 Alexander Blum
* Content with a relation to a Creation is autocommitted, when the creation is committed
17 1 Alexander Blum
* Before a commit, web users may edit the object freely
18 1 Alexander Blum
* Committing an object implies committing all objects down the hierarchy (see [[Workflows#Licenser-Cascades|Cascades]])
19 1 Alexander Blum
* After a commit, web users may
20 1 Alexander Blum
    * edit only data not relevant for the distribution or object to frequent changes:
21 1 Alexander Blum
        * adding/removing members of an Artist
22 1 Alexander Blum
        * adding a Release to a Creation
23 1 Alexander Blum
        * changing Release metadata
24 1 Alexander Blum
    * trigger a dispute request for changing relevant data:
25 1 Alexander Blum
        * deleting an object (implies creation of duplicate for references)
26 1 Alexander Blum
        * adding/removing a contributor to a Creation
27 1 Alexander Blum
        * adding/removing a original/derivative Creation
28 1 Alexander Blum
        * adding/removing licenses to Releases of Creations
29 1 Alexander Blum
        * adding/removing the Content assigned to a Creation
30 1 Alexander Blum
        * removing a Release from a Creation
31 1 Alexander Blum
* After a commit, administrators may
32 1 Alexander Blum
    * revise the object(s)
33 1 Alexander Blum
    * reject the object(s)
34 1 Alexander Blum
* A successful claim dispute (see [[Workflows#Commit]]) causes the object to be uncommitted
35 1 Alexander Blum
* Uncommitted objects should be recommitted again as soon as possible by the web user
36 1 Alexander Blum
    * if the artist name or creation title is changed on recommit, all admins of referencing objects are informed via email/webinterface
37 1 Alexander Blum
    * if a referenced object is deleted before recommit, a duplicate for all references is created and referenced instead
38 1 Alexander Blum
* Created / Uncommitted objects
39 1 Alexander Blum
    * are promoted on the web user dashboard
40 1 Alexander Blum
    * excluded from searches (via add/list/etc), except
41 1 Alexander Blum
        * web users can add own uncommitted objects to other own uncommitted objects
42 1 Alexander Blum
        * web users can see but not add own uncommitted objects to other committed objects
43 1 Alexander Blum
44 1 Alexander Blum
### Disputes
45 1 Alexander Blum
46 1 Alexander Blum
* A dispute is the process of mediation in a conflict between web users
47 1 Alexander Blum
* A dispute has a
48 1 Alexander Blum
    * code: Sequence
49 1 Alexander Blum
    * state: Selection (requested, assigned, resolved)
50 1 Alexander Blum
    * case: Selection (list of usecases?)
51 1 Alexander Blum
    * object: Reference (to the disputed objects)
52 1 Alexander Blum
    * assignee: User
53 1 Alexander Blum
    * request_party: Party
54 1 Alexander Blum
    * request_text: Text (user statement)
55 1 Alexander Blum
    * request_time: DateTime
56 1 Alexander Blum
    * resolved_time: DateTime
57 1 Alexander Blum
    * comments: Comment (many comments by administrators)
58 1 Alexander Blum
* A dispute comment has a
59 1 Alexander Blum
    * dispute: Dispute
60 1 Alexander Blum
    * text: Text
61 1 Alexander Blum
    * time: DateTime
62 1 Alexander Blum
* A dispute may be triggered by a web user on several occasions
63 1 Alexander Blum
    * The web user [[Specification#Claims|claims]] ownership of an already claimed object
64 1 Alexander Blum
    * The web user claims authorship of a Content marked as a duplicate
65 1 Alexander Blum
    * The web user requests a change/deletion of [[Specification#Commits|commited]] content
66 1 Alexander Blum
* A dispute can be requested, assigned and resolved (see [[Workflows#Dispute]])
67 1 Alexander Blum
* A dispute is requested via a dispute form including
68 1 Alexander Blum
    * The disputed object
69 1 Alexander Blum
    * The issue category
70 1 Alexander Blum
    * The user motivation
71 1 Alexander Blum
* A dispute is handled by an assignee
72 1 Alexander Blum
* The assignee can add many comments
73 1 Alexander Blum
* The assignee can mark the dispute as resolved
74 1 Alexander Blum
75 1 Alexander Blum
# Licensing
76 4 Alexander Blum
77 4 Alexander Blum
## Tariff System
78 4 Alexander Blum
79 4 Alexander Blum
* A creation can have several tariff categories represented by different collecting societies
80 1 Alexander Blum
81 5 Alexander Blum
## Collection
82 5 Alexander Blum
83 5 Alexander Blum
## Allocation
84 5 Alexander Blum
    * Invoice
85 5 Alexander Blum
86 5 Alexander Blum
## Declaration
87 5 Alexander Blum
88 5 Alexander Blum
## Utilisation
89 5 Alexander Blum
* Tariff
90 5 Alexander Blum
* UtilisationCreationList ([[Usecases#Examples]])
91 5 Alexander Blum
* UtilisationIndicator (Base, Relevance, Adjustments)
92 5 Alexander Blum
* ContextIndicator
93 5 Alexander Blum
* ...
94 5 Alexander Blum
95 5 Alexander Blum
## Indicators
96 5 Alexander Blum
97 5 Alexander Blum
* UtilisationIndicator
98 5 Alexander Blum
* ContextIndicators (for each tariff)
99 5 Alexander Blum
100 1 Alexander Blum
# Repertoire
101 1 Alexander Blum
102 2 Alexander Blum
## Rights Management
103 1 Alexander Blum
104 3 Alexander Blum
* A rightsholder
105 2 Alexander Blum
    * must hold a right
106 2 Alexander Blum
        * Copyright
107 2 Alexander Blum
        * Ancillary Copyright
108 2 Alexander Blum
    * must have an object to which the right belongs
109 2 Alexander Blum
        * Creation
110 2 Alexander Blum
        * Release
111 2 Alexander Blum
    * must have a contribution depending on the object and right
112 2 Alexander Blum
        * Creation
113 2 Alexander Blum
            * Copyright
114 2 Alexander Blum
                * Lyrics
115 2 Alexander Blum
                * Composition
116 2 Alexander Blum
            * Ancillary Copyright:
117 2 Alexander Blum
                * Instrument
118 2 Alexander Blum
                * Production
119 2 Alexander Blum
                * Mixing
120 2 Alexander Blum
                * Mastering
121 2 Alexander Blum
        * Release
122 2 Alexander Blum
            * Copyright
123 2 Alexander Blum
                * Artwork
124 2 Alexander Blum
                * Text
125 2 Alexander Blum
                * Layout
126 2 Alexander Blum
            * Ancillary Copyright
127 2 Alexander Blum
                * Production
128 2 Alexander Blum
                * Mixing
129 2 Alexander Blum
                * Mastering
130 2 Alexander Blum
    * may have a start and end date
131 2 Alexander Blum
    * may be restricted to a territory
132 2 Alexander Blum
    * may have a successor
133 2 Alexander Blum
    * may be represented by a collecting society
134 1 Alexander Blum
    * may have a list of instruments for Creation -> Ancillary Copyright -> Instrument
135 3 Alexander Blum
* Rightsholder subjects for creations and releases are Artists
136 1 Alexander Blum
137 1 Alexander Blum
## Object processing
138 1 Alexander Blum
139 1 Alexander Blum
### Claims
140 1 Alexander Blum
141 1 Alexander Blum
* Artist, Releases, and Creations are unclaimed, offered or claimed
142 1 Alexander Blum
* Unclaimed objects are objects, which don't belong to a web user
143 1 Alexander Blum
* Offered objects are objects, which might belong to a web user and are offered to be claimed by the web user (e.g. on registration)
144 1 Alexander Blum
* Claimed objects are objects, which "belong" to at least one web user
145 1 Alexander Blum
* Web users can (see [[Workflows#Claim]]) claim
146 1 Alexander Blum
    * unclaimed and offered objects in general
147 1 Alexander Blum
    * a solo artist for the current web user
148 1 Alexander Blum
    * a group artist for a solo artist
149 1 Alexander Blum
    * a compilation release for a solo artist (role: producer)
150 1 Alexander Blum
    * a split/artist release for an artist
151 1 Alexander Blum
    * a creation for an artist
152 1 Alexander Blum
* A claim implies a request for admin rights, where applicable
153 1 Alexander Blum
* Revised objects are visually promoted on the object list/details
154 1 Alexander Blum
* Unclaiming/Claiming/Revising an object implies unclaiming/claiming/revising all objects down the hierarchy (see [[Workflows#Creative-Cascades|Cascades]])
155 1 Alexander Blum
* Claiming an unclaimed object results in an uncommitted object
156 1 Alexander Blum
* Claiming a claimed object
157 1 Alexander Blum
    * results in a [[Specification#Disputes|dispute]]
158 1 Alexander Blum
    * may result in in an uncommitted object, if the disputing party proves to be right
159 1 Alexander Blum
160 1 Alexander Blum
### Foreign objects
161 1 Alexander Blum
162 1 Alexander Blum
* During object creation, a web user may create several new, [[Specification#Claims|unclaimed]] foreign objects
163 1 Alexander Blum
* When a web user creates a new Artist, he may create many member Artists specified by a name and an email
164 1 Alexander Blum
* When a web user creates a new Creation, he may create
165 1 Alexander Blum
    * many contributor Artists specified by group (yes/no), a name and an email
166 1 Alexander Blum
    * many original/derivative Creations specified by the creation and the artist name, resulting in
167 1 Alexander Blum
        * a new/referenced Artist object: artist name
168 1 Alexander Blum
        * a new Creation object: Artist
169 1 Alexander Blum
    * many track Creations specified by the creation and the artist name, resulting in
170 1 Alexander Blum
        * a new/referenced Artist object: artist name
171 1 Alexander Blum
        * a new Creation object: Artist
172 1 Alexander Blum
* Foreign objects are auto [[Specification#Commits|commited]]
173 1 Alexander Blum
* Foreign objects may be added by others
174 1 Alexander Blum
    * resulting in a duplicate for information separation
175 1 Alexander Blum
    * referencing the duplicated foreign object for deduplication
176 1 Alexander Blum
* Foreign objects are editable
177 1 Alexander Blum
    * by the web user, which created the foreign object, if
178 1 Alexander Blum
        * the object was created by the web user
179 1 Alexander Blum
        * the object is not [[Specification#Claims|claimed]]
180 1 Alexander Blum
        * the object was not part of a distribution, yet
181 1 Alexander Blum
    * by the object admin of the object, which the foreign object was created for
182 1 Alexander Blum
183 1 Alexander Blum
## File Processing
184 1 Alexander Blum
185 1 Alexander Blum
### Intermediate storage for archive
186 1 Alexander Blum
187 1 Alexander Blum
* Files are stored on an intermediate file server
188 1 Alexander Blum
* For every stage of a file there is a corresponding folder `STAGE`
189 1 Alexander Blum
* For each change of processing state, all files are moved into the next `STAGE` folder
190 1 Alexander Blum
* For each folder `STAGE` there is a folder per `USER`
191 1 Alexander Blum
    * Folderstructure for optimized filesystemaccess
192 1 Alexander Blum
    * Semantic information for manual administrative interventions
193 1 Alexander Blum
* The filenames of the files are
194 1 Alexander Blum
    * the `HASH` of the filename for temporary uploads
195 1 Alexander Blum
    * the `UUID` of the content in the database for all other stages
196 1 Alexander Blum
* For each file `[UUID|HASH]` there is a file `[UUID|HASH].checksums`
197 1 Alexander Blum
    * Content: Checksums for each single upload chunk
198 1 Alexander Blum
    * Format: CSV (begin, end, algorithm, checksum)
199 1 Alexander Blum
* For each file `[UUID|HASH]` there is a file `UUID.checksum`
200 1 Alexander Blum
    * Content: Checksum of the whole file
201 1 Alexander Blum
    * Format: Plain text
202 1 Alexander Blum
* The full syntax for a file is
203 1 Alexander Blum
    * `./STAGE/USER/UUID(.checksum(s))`
204 1 Alexander Blum
    * `./temporary/USER/HASH(.checksum(s))`
205 1 Alexander Blum
* Examples of file paths
206 1 Alexander Blum
    * `./temporary/4/82d5582443e9f8d35d3ec798662255e46e9e8138c290b626a74a3bee9382d430`
207 1 Alexander Blum
    * `./temporary/4/82d5582443e9f8d35d3ec798662255e46e9e8138c290b626a74a3bee9382d430.checksums`
208 1 Alexander Blum
    * `./uploaded/4/35f0c169-6594-4bf3-b285-451d2aa8c61e`
209 1 Alexander Blum
    * `./uploaded/4/35f0c169-6594-4bf3-b285-451d2aa8c61e.checksums`
210 1 Alexander Blum
    * `./previewed/4/35f0c169-6594-4bf3-b285-451d2aa8c61e`
211 1 Alexander Blum
    * `./checksummed/4/35f0c169-6594-4bf3-b285-451d2aa8c61e`
212 1 Alexander Blum
    * `./checksummed/4/35f0c169-6594-4bf3-b285-451d2aa8c61e.checksum`
213 1 Alexander Blum
    * `./checksummed/4/35f0c169-6594-4bf3-b285-451d2aa8c61e.checksums`
214 1 Alexander Blum
    * `./fingerprinted/4/35f0c169-6594-4bf3-b285-451d2aa8c61e`
215 1 Alexander Blum
    * `./dropped/4/35f0c169-6594-4bf3-b285-451d2aa8c61e`
216 1 Alexander Blum
    * `./rejected/4/35f0c169-6594-4bf3-b285-451d2aa8c61e`
217 1 Alexander Blum
218 1 Alexander Blum
219 1 Alexander Blum
### Permanent storage for user content
220 1 Alexander Blum
221 1 Alexander Blum
* User content is stored on a permanent file server
222 1 Alexander Blum
* For every content type of a file there is a corresponding folder `CONTENTYPE` (e.g. 'previews')
223 1 Alexander Blum
* For each folder `CONTENTYPE` there is a folder per `USER`
224 1 Alexander Blum
    * Folderstructure for optimized filesystemaccess
225 1 Alexander Blum
    * Semantic information for manual administrative interventions
226 1 Alexander Blum
* The filenames of the files are
227 1 Alexander Blum
    * the `UUID` of the content in the database
228 1 Alexander Blum
* The full syntax for a file is
229 1 Alexander Blum
    * `./CONTENTTYPE/USER/UUID`
230 1 Alexander Blum
* Examples of file paths
231 1 Alexander Blum
    * `./previews/4/35f0c169-6594-4bf3-b285-451d2aa8c61e`
232 1 Alexander Blum
    * `./excerpts/4/35f0c169-6594-4bf3-b285-451d2aa8c61e`
233 1 Alexander Blum
234 1 Alexander Blum
### Stages
235 1 Alexander Blum
236 1 Alexander Blum
* For an overview of the workflow, see [[Workflows#File-Processing|Workflow]]
237 1 Alexander Blum
* Each stage of file processing results in a corresponding processing state
238 1 Alexander Blum
    1. Upload *(uploaded)*
239 1 Alexander Blum
    2. Process
240 1 Alexander Blum
        * Preview *(previewed)*
241 1 Alexander Blum
        * Checksum *(checksummed)*
242 1 Alexander Blum
        * Fingerprint *(fingerprinted)*
243 1 Alexander Blum
    5. Drop *(dropped)*
244 1 Alexander Blum
    6. Archive *(archived)*
245 1 Alexander Blum
* There is a special state for user requested deletions *(tobedeleted)*
246 1 Alexander Blum
* Before a file is being processed at any stage, a file <UUID>.lock will be created to signal other processes to skip the file. The lockfile will be deleted after the file <UUID> has been moved to the next stage folder.
247 1 Alexander Blum
248 1 Alexander Blum
#### Upload a file
249 1 Alexander Blum
250 1 Alexander Blum
* Users are allowed to upload content only, if it belongs to them
251 1 Alexander Blum
* Upload of a file in chunks
252 1 Alexander Blum
    * The chunk size is 1MiB (1024*1024 Byte)
253 1 Alexander Blum
    * The chunk position is given by the header `Content-Range` (chunk start, chunk end, total size)
254 1 Alexander Blum
    * A HASH of the user given filename is used as temporary filename
255 1 Alexander Blum
    * The file is stored in `./storage/temporary/USER/HASH`
256 1 Alexander Blum
* For each uploaded chunk
257 1 Alexander Blum
    * A checksum of the chunk is calculated, while the chunk is still in RAM
258 1 Alexander Blum
    * The checksum is appended to `./storage/temporary/USER/HASH.checksums` (CSV: begin, end, algorithm, checksum)
259 1 Alexander Blum
    * The database is queried for a duplicate of the checksum for early abuse detection
260 1 Alexander Blum
        * The chunk checksum collisions are tracked in the user session
261 1 Alexander Blum
        * Certain checksums are whitelisted (e.g. silence in different formats with/without headers)
262 1 Alexander Blum
        * Above a configurable threshold (e.g. 150), the user upload is restricted temporarily
263 1 Alexander Blum
        * The threshold violations are tracked in the database
264 1 Alexander Blum
    * The chunk is appended to `./storage/temporary/USER/HASH`
265 1 Alexander Blum
* When the upload is finished
266 1 Alexander Blum
    * A Uuid is generated
267 1 Alexander Blum
    * If the validation of the fileextension or mimetype fails, further processing is aborted
268 1 Alexander Blum
        * The files are moved to `./storage/rejected/USER/UUID(.checksums)`
269 1 Alexander Blum
        * The Content is saved to the database (processing state: rejected, rejection reason: format_error, path)
270 1 Alexander Blum
    * The files are moved to `./storage/uploaded/USER/UUID(.checksums)`
271 1 Alexander Blum
    * The Content is saved to the database (processing state: uploaded, path, storage_hostname)
272 1 Alexander Blum
    * The Checksums are saved to the database
273 1 Alexander Blum
274 1 Alexander Blum
#### Create a preview
275 1 Alexander Blum
276 1 Alexander Blum
* For each file in `./storage/uploaded`
277 1 Alexander Blum
    * The file is locked during processing
278 1 Alexander Blum
    * If the associated Content (processing state, processing hostname, storage hostname) is not valid, further processing is aborted
279 1 Alexander Blum
        * The files are moved to `./storage/unknown/(USER/)UUID(.checksums)`
280 1 Alexander Blum
        * The Content is updated, if possible (processing state: unkown, path)
281 1 Alexander Blum
    * An excerpt for analysis and statistics is taken and stored in `./content/excerpt/UUID[1]/UUID[2]/UUID`
282 1 Alexander Blum
        * Lenght: 60 seconds out of the middle of the file
283 1 Alexander Blum
        * Quality: Minimum for fingerprint recognition (11025 Hz, 16 bit, mono)
284 1 Alexander Blum
    * A preview is created and stored in `./content/previews/UUID[1]/UUID[2]/UUID`
285 1 Alexander Blum
        * Quality: Minimum for acceptable user experience (12bit, mono, 16kHz, ogg)
286 1 Alexander Blum
        * Configuration: fade in, fade out, segment interval, segment length, segment crossfade
287 1 Alexander Blum
    * If preview or excerpt creation fails, further processing is aborted
288 1 Alexander Blum
        * The files are moved to `./storage/rejected/USER/UUID(.checksums)`
289 1 Alexander Blum
        * The Content is rejected (rejection reason: format_error, path)
290 1 Alexander Blum
    * The files are moved to `./storage/previewed/USER/UUID(.checksums)`
291 1 Alexander Blum
    * The audio properties are saved to the database (length, channels, sample rate, sample width)
292 1 Alexander Blum
    * The Content is updated (processing state: previewed, path)
293 1 Alexander Blum
294 1 Alexander Blum
#### Calculate a checksum
295 1 Alexander Blum
296 1 Alexander Blum
* For each file in `./storage/previewed`
297 1 Alexander Blum
    * The file is locked during processing
298 1 Alexander Blum
    * If the associated Content (processing state, processing hostname, storage hostname) is not valid, further processing is aborted
299 1 Alexander Blum
        * The files are moved to `./storage/unknown/(USER/)UUID(.checksums)`
300 1 Alexander Blum
        * The Content is updated, if possible (processing state: unkown, path)
301 1 Alexander Blum
    * Checksums for each chunk of 1MiB (1024*1024 Byte) are calculated and saved to the database, if not present
302 1 Alexander Blum
    * A checksum for the whole file is calculated and stored in `./storage/previewed/USER/UUID.checksum`
303 1 Alexander Blum
    * If the checksum is already present in the database, further processing is aborted
304 1 Alexander Blum
        * The preview and excerpt is deleted
305 1 Alexander Blum
        * The files are moved to `./storage/rejected/USER/UUID(.checksum(s))`
306 1 Alexander Blum
        * The Content is rejected (rejection reason: checksum_collision, duplicate of: Content, path)
307 1 Alexander Blum
    * The files are moved to `./storage/checksummed/USER/UUID(.checksum(s))`
308 1 Alexander Blum
    * The Checksum is saved to the database
309 1 Alexander Blum
    * The Content is updated (processing state: checksummed, path)
310 1 Alexander Blum
311 1 Alexander Blum
#### Calculate a fingerprint
312 1 Alexander Blum
313 1 Alexander Blum
* For each file in `./storage/checksummed`
314 1 Alexander Blum
    * The file is locked during processing
315 1 Alexander Blum
    * If the associated Content (processing state, processing hostname, storage hostname) is not valid, further processing is aborted
316 1 Alexander Blum
        * The files are moved to `./storage/unknown/(USER/)UUID(.checksums)`
317 1 Alexander Blum
        * The Content is updated, if possible (processing state: unkown, path)
318 1 Alexander Blum
    * The fingerprint is created
319 1 Alexander Blum
    * If the fingerprint is already present in the database, further processing is aborted
320 1 Alexander Blum
        * The preview and excerpt is deleted
321 1 Alexander Blum
        * The files are moved to `./storage/rejected/USER/UUID(.checksum(s))`
322 1 Alexander Blum
        * The Content is rejected (rejection reason: fingerprint_collision, duplicate of: Content, path)
323 1 Alexander Blum
    * The fingerprint is ingested into the database (primary key: Content Uuid)
324 1 Alexander Blum
    * A FingerprintLog is saved to the database (timestamp, user, algorithm, version)
325 1 Alexander Blum
    * The files are moved to `./storage/fingerprinted/USER/UUID(.checksum(s))`
326 1 Alexander Blum
    * The Content is updated (processing state: fingerprinted, path)
327 1 Alexander Blum
328 1 Alexander Blum
#### Drop a file
329 1 Alexander Blum
330 1 Alexander Blum
* For each file in `./storage/fingerprinted`
331 1 Alexander Blum
    * The file is locked during processing
332 1 Alexander Blum
    * If the associated Content (processing state, processing hostname, storage hostname) is not valid, further processing is aborted
333 1 Alexander Blum
        * The files are moved to `./storage/unknown/(USER/)UUID(.checksums)`
334 1 Alexander Blum
        * The Content is updated, if possible (processing state: unkown, path)
335 1 Alexander Blum
    * The files are moved to `./storage/dropped/USER/UUID(.checksum(s))`
336 1 Alexander Blum
    * The Content is updated (processing state: dropped, path)
337 1 Alexander Blum
338 1 Alexander Blum
#### Archive a file
339 1 Alexander Blum
340 1 Alexander Blum
* For further details, see
341 1 Alexander Blum
    * [[Specification#Archiving-of-the-files|Archiving of the files]]
342 1 Alexander Blum
    * [[Specification#Orchestration-of-the-archiving|Orchestration of the archiving]]
343 1 Alexander Blum
* For each file in `./storage/dropped`
344 1 Alexander Blum
    * The file is locked during processing
345 1 Alexander Blum
    * If the associated Content (processing state, processing hostname, storage hostname) is not valid, further processing is aborted
346 1 Alexander Blum
        * The files are moved to `./storage/unknown/(USER/)UUID(.checksum(s))`
347 1 Alexander Blum
        * The Content is updated, if possible (processing state: unkown)
348 1 Alexander Blum
    * The files are moved to `./storage/dropped.closed/UUID(.checksum(s))`
349 1 Alexander Blum
    * The Storehouse target `LOCATION`s are copied from `./storage/targets/` to `./storage/dropped.closed.targets/`
350 1 Alexander Blum
    * Until there is no `LOCATION` in `./storage/dropped.closed.targets/` left
351 1 Alexander Blum
        * Until the checksums of the whole files are valid on the target machine
352 1 Alexander Blum
            * The files `UUID(.checksum(s))` in `./storage/dropped.closed/` are copied to `LOCATION:./UUID[1]/UUID[2]/`
353 1 Alexander Blum
        * The target location `./storage/dropped.closed.targets/LOCATION` is deleted
354 1 Alexander Blum
    * The target location folder `./storage/dropped.closed.targets/` is deleted
355 1 Alexander Blum
    * The Content is updated (processing state: archived, archive: Archive, path)
356 1 Alexander Blum
357 1 Alexander Blum
#### Delete a file
358 1 Alexander Blum
359 1 Alexander Blum
* A user may request the deletion of uncommited Content
360 1 Alexander Blum
* A corresponding files might be only deleted, if the content is in the state 'uploaded' or 'rejected'
361 1 Alexander Blum
* Further the request for the deletion needs to trigger the deletion of
362 1 Alexander Blum
     * the Content object
363 1 Alexander Blum
     * the preview and excerpt file
364 1 Alexander Blum
     * the entry in the echoprint server referencing the deleted Content object (maybe decentralized)
365 1 Alexander Blum
366 1 Alexander Blum
## Archiving
367 1 Alexander Blum
368 1 Alexander Blum
### Objects
369 1 Alexander Blum
370 1 Alexander Blum
#### Archiving
371 1 Alexander Blum
372 1 Alexander Blum
* The archiving process is coordinated via objects in the Database shown here [[Databasemodels#Archiving|as diagram]]
373 1 Alexander Blum
    * Physical: [[Specification#Storehouse|Storehouse]], [[Specification#Harddisk|Harddisk]], [[Specification#Filesystem|Filesystem]], [[Specification#Content|Content]]
374 1 Alexander Blum
    * Logical: [[Specification#HarddiskLabel|HarddiskLabel]], [[Specification#FilesystemLabel|FilesystemLabel]]
375 1 Alexander Blum
    * Integrity: [[Specification#Checksum|Checksum]], [[Specification#HarddiskTest|HarddiskTest]]
376 1 Alexander Blum
* The archiving objects are administered via tryton client and [[Scripts]]
377 1 Alexander Blum
378 1 Alexander Blum
#### Storehouse
379 1 Alexander Blum
380 1 Alexander Blum
Physical storage location
381 1 Alexander Blum
382 1 Alexander Blum
* has a code
383 1 Alexander Blum
* has an admin user
384 1 Alexander Blum
* may have a detailed description
385 1 Alexander Blum
* may have many Harddisks
386 1 Alexander Blum
387 1 Alexander Blum
#### Harddisk
388 1 Alexander Blum
389 1 Alexander Blum
Physical harddisks
390 1 Alexander Blum
391 1 Alexander Blum
* has uuids (host, harddisk)
392 1 Alexander Blum
* has checksums (harddisk)
393 1 Alexander Blum
* has a HarddiskLabel
394 1 Alexander Blum
* has a Storehouse
395 1 Alexander Blum
* has a version (for Harddisks with the same HarddiskLabel per Storehouse)
396 1 Alexander Blum
* has a closed state
397 1 Alexander Blum
* has a on-/offline state
398 1 Alexander Blum
* has an usage state
399 1 Alexander Blum
* has a creator (tryton user)
400 1 Alexander Blum
* has a function to generate a label sticker
401 1 Alexander Blum
* may have a local position (e.g. "Shelf1")
402 1 Alexander Blum
* may have many Filesystems
403 1 Alexander Blum
* may have many HarddiskTests
404 1 Alexander Blum
* may have a health state (result of the tests)
405 1 Alexander Blum
406 1 Alexander Blum
#### Filesystem
407 1 Alexander Blum
408 1 Alexander Blum
Filesystems on a harddisk
409 1 Alexander Blum
410 1 Alexander Blum
* has uuids (partition, raid, raid sub, crypto, lvm, filesystem)
411 1 Alexander Blum
* has checksums (partition, raid, raid sub, crypto, lvm, filesystem)
412 1 Alexander Blum
* has an FilesystemLabel
413 1 Alexander Blum
* has a Harddisk
414 1 Alexander Blum
* has a closed state
415 1 Alexander Blum
* has partitioning information (partition number)
416 1 Alexander Blum
* has raid information (raid type, raid number, raid total)
417 1 Alexander Blum
418 1 Alexander Blum
#### Content
419 1 Alexander Blum
420 1 Alexander Blum
Contents on a filesystem
421 1 Alexander Blum
422 1 Alexander Blum
* has a file
423 1 Alexander Blum
* may have one FilesystemLabel
424 1 Alexander Blum
425 1 Alexander Blum
#### HarddiskLabel
426 1 Alexander Blum
427 1 Alexander Blum
Label for Harddisks containing the same Filesystems
428 1 Alexander Blum
429 1 Alexander Blum
* has a code
430 1 Alexander Blum
* may have many Harddisks
431 1 Alexander Blum
432 1 Alexander Blum
#### FilesystemLabel
433 1 Alexander Blum
434 1 Alexander Blum
Label for Filesystems containing the same Contents
435 1 Alexander Blum
436 1 Alexander Blum
* has a code
437 1 Alexander Blum
* may have many Filesystems
438 1 Alexander Blum
* may have many Contents
439 1 Alexander Blum
440 1 Alexander Blum
#### Checksum
441 1 Alexander Blum
442 1 Alexander Blum
Checksum, e.g. sha256
443 1 Alexander Blum
444 1 Alexander Blum
* has a timestamp
445 1 Alexander Blum
* has a begin (first Byte)
446 1 Alexander Blum
* has an end (last Byte)
447 1 Alexander Blum
* has an algorithm
448 1 Alexander Blum
449 1 Alexander Blum
#### HarddiskTest
450 1 Alexander Blum
451 1 Alexander Blum
Integrity tests of harddisks
452 1 Alexander Blum
453 1 Alexander Blum
* has a timestamp
454 1 Alexander Blum
* has a user, which performed the test
455 1 Alexander Blum
* has a health state (sane + error for each checksum of Harddisk and Filesystem)
456 1 Alexander Blum
457 1 Alexander Blum
### Identification with uuids
458 1 Alexander Blum
459 1 Alexander Blum
* A uuid is a Universally Unique Identifier
460 1 Alexander Blum
* Harddisks, Filesystems and Content are identified with uuids
461 1 Alexander Blum
* A Harddisk is identified with a combination of the uuids
462 1 Alexander Blum
    * Host
463 1 Alexander Blum
    * Harddisk
464 1 Alexander Blum
* A Filesystem is identified with with a combination of the uuids
465 1 Alexander Blum
    * Partition
466 1 Alexander Blum
    * Raid
467 1 Alexander Blum
    * Raid Sub
468 1 Alexander Blum
    * Crypto
469 1 Alexander Blum
    * LVM
470 1 Alexander Blum
    * Filesystem
471 1 Alexander Blum
* The uuids of a Harddisk and a contained Filesystem are strictly hierarchical:
472 1 Alexander Blum
    * Host > Harddisk > Partition > Raid > Raid Sub > Crypto > LVM > Filesystem
473 1 Alexander Blum
* A Content is identified with exactly one uuid
474 1 Alexander Blum
475 1 Alexander Blum
### Integrity tests with checksums
476 1 Alexander Blum
477 1 Alexander Blum
* When a Harddisk is finalized, the follwing Checksums are saved into the database
478 1 Alexander Blum
    * Checksum of the Harddisk: Harddisk
479 1 Alexander Blum
    * Checksums of the Filesystem: Partition, Raid, Raid Sub, Crypto, LVM, Filesystem
480 1 Alexander Blum
* For each Content the following Checksums are saved to database
481 1 Alexander Blum
    * Checksum for the whole file
482 1 Alexander Blum
    * Checksums for each upload chunk
483 1 Alexander Blum
* All checksums are additionally saved on the harddisk as second indepentend source
484 1 Alexander Blum
    * Harddisk/Filesystem: on a metadata partition
485 1 Alexander Blum
    * File/Chunks: on the filesystem
486 1 Alexander Blum
* A checksum of the metadata partition is saved only on the harddisk
487 1 Alexander Blum
* Regularly schedulled (e.g. biannual) integrity tests ensure the logterm integrity of all Harddisks
488 1 Alexander Blum
    * For each test
489 1 Alexander Blum
        * Check of uuids
490 1 Alexander Blum
        * Check of checksum of metadata partition
491 1 Alexander Blum
        * Activation of crypto and raid
492 1 Alexander Blum
        * Check of checksums of filesystems /dev/disk/by-uuid/...
493 1 Alexander Blum
        * On error:
494 1 Alexander Blum
            * Feedback Admin
495 1 Alexander Blum
            * Write HarddiskTest (state: error_filesystem)
496 1 Alexander Blum
            * Check of Checksumms of all files
497 1 Alexander Blum
        * Write HarddiskTest (state: sane)
498 1 Alexander Blum
    * An error might be tracked down to the resolution of the uploads chunks, if neccessary
499 1 Alexander Blum
500 1 Alexander Blum
501 1 Alexander Blum
### Archiving of the files
502 1 Alexander Blum
503 1 Alexander Blum
* The files associated with a Content are stored on a filesystem
504 1 Alexander Blum
* Each file is named after the Content Uuid: `UUID`
505 1 Alexander Blum
* Each file is associated with two other files by convention:
506 1 Alexander Blum
    * `UUID.checksum`: checksum of the whole file
507 1 Alexander Blum
    * `UUID.checksums`: checksums of all upload chunks
508 1 Alexander Blum
* Each file is stored in the folder `./UUID[0]/UUID[1]/`
509 1 Alexander Blum
    * Folderstructure for optimized filesystemaccess
510 1 Alexander Blum
    * No semantic information (e.g. USER) to avoid the need for corrections
511 1 Alexander Blum
* The full syntax for a file is
512 1 Alexander Blum
    * `./UUID[0]/UUID[1]/UUID(.checksum(s))`
513 1 Alexander Blum
* Examples of file paths
514 1 Alexander Blum
    * `./3/5/35f0c169-6594-4bf3-b285-451d2aa8c61e`
515 1 Alexander Blum
516 1 Alexander Blum
517 1 Alexander Blum
### Orchestration of the archiving
518 1 Alexander Blum
519 1 Alexander Blum
* Files on an [[Specification#Intermediate-storage-for-archive|intermediate storage]] may be archived in many storehouses
520 1 Alexander Blum
* The URLs to the storehouse machines are stored in STOREHOUSECODE target files
521 1 Alexander Blum
* The mappings of all intermediate storages to storehouses are administered on an central orchestration machine
522 1 Alexander Blum
    * Syntax: `./STORAGE/STOREHOUSECODE`
523 1 Alexander Blum
    * Example: `./storage001/DÜ1`
524 1 Alexander Blum
* The mapping of a single intermediate storage to storehouses are mirrored to this intermediate storage
525 1 Alexander Blum
    * Syntax: `./storage/targets/STOREHOUSECODE`
526 1 Alexander Blum
    * Example: `./storage/targets/DÜ1`
527 1 Alexander Blum
* The files on the intermediate storage are synchronized with the files on the orchestration machine for orchestration
528 1 Alexander Blum
529 1 Alexander Blum
530 1 Alexander Blum
### Human readable label sticker
531 1 Alexander Blum
532 1 Alexander Blum
* For each Harddisk, a label sticker may be generated
533 1 Alexander Blum
* Header: `PURPOSE-STOREHOUSECODE-CONTAINERLABELCODE (RAIDTYPE: RAIDNUMBER/RAIDTOTAL)`
534 1 Alexander Blum
    * `PURPOSE`: "UCR" ("User Content Repertoire")
535 1 Alexander Blum
    * `STOREHOUSECODE`: Code of the Storehouse, e.g. "DÜ1" for the first storehouse in Düsseldorf
536 1 Alexander Blum
    * `CONTAINERLABELCODE`: Incremental, padded to 5 digits, e.g. 00001
537 1 Alexander Blum
    * `RAIDTYPE`: Typ of the raid
538 1 Alexander Blum
    * `RAIDNUMBER`: number of the harddisk in the raid
539 1 Alexander Blum
    * `RAIDTOTAL`: total number of harddisks in the raid
540 1 Alexander Blum
* Details: List of `ARCHIVELABELCODE`s
541 1 Alexander Blum
    * `ARCHIVELABELCODE`: Label of the Archive
542 1 Alexander Blum
543 1 Alexander Blum
# Sort
544 1 Alexander Blum
545 1 Alexander Blum
* Only more liberal licenses should be allowed.