Document Reports
DocuDesk provides comprehensive document analysis through its reporting system. This page explains how document reports work and how they can help you ensure your documents meet privacy, accessibility, and readability standards.
Overview
The Document Reports system in DocuDesk enables you to:
- Identify files containing personal data
- Categorize the types of personal data present
- Track anonymization status
- Manage retention periods
- Document the legal basis for processing
- Maintain an audit trail of privacy-related actions
- Analyze documents for personal data that may require anonymization
- Check documents for WCAG accessibility compliance
- Assess the language level and readability of documents
- Track document changes through file hashing
- Generate detailed reports with actionable recommendations
Automatic Report Generation
DocuDesk can automatically generate reports for documents as they are uploaded or modified in Nextcloud. This process works as follows:
- When a file is created or modified in Nextcloud, DocuDesk detects the event
- A document log entry is created to maintain an audit trail
- If reporting is enabled, DocuDesk checks if a report already exists for the current version of the file
- If no report exists (or the file has changed), a new report is created with a 'pending' status
- Depending on the configuration, the report is either:
- Processed immediately (synchronous processing)
- Queued for processing by a background job (asynchronous processing)
- The report is updated with the analysis results once processing is complete
Report Generation Workflow
The following sequence diagram illustrates the report generation process:
Configuration Options
The report generation process can be configured through the DocuDesk settings page:
- Enable Reporting: Turn automatic report generation on or off
- Enable Anonymization: Turn automatic anonymization of sensitive data on or off
- Synchronous Processing: Choose between immediate processing or background job processing
- Confidence Threshold: Set the minimum confidence level for entity detection (0-100%)
- Store Original Text: Choose whether to store the original document text in reports
Processing Modes
DocuDesk supports two processing modes for report generation:
Synchronous Processing
In synchronous mode, reports are generated immediately when a file is created or modified. This provides instant feedback but may impact performance for large files or high-traffic environments.
Asynchronous Processing (Recommended for Production)
In asynchronous mode, reports are queued for processing by a background job that runs periodically. This is more efficient for large environments as it:
- Reduces the impact on user experience
- Allows for better resource management
- Handles large volumes of documents more effectively
- Prevents timeouts when processing large files
The background job processes pending reports in batches, updating their status as they are completed.
Document Report Object
The DocumentReport object is the core component for document analysis. It contains the results of various analyses performed on a document, including anonymization, WCAG compliance, and language level assessments.
Key Properties
| Property | Type | Description |
|---|---|---|
| id | string | Unique identifier for the report |
| nodeId | string | Nextcloud node ID of the document |
| fileName | string | Name of the document |
| filePath | string | Full path to the document in Nextcloud |
| fileType | string | MIME type of the document (e.g., application/pdf) |
| fileExtension | string | File extension (e.g., pdf, docx) |
| fileSize | integer | Size of the file in bytes |
| fileHash | string | Hash of the file content to determine if a new report is needed |
| fileText | string | The extracted text content from the document, used for analysis |
| status | string | Status of the report generation (pending, processing, completed, failed) |
| errorMessage | string | Error message if report processing failed |
| riskScore | float | Numerical score indicating overall risk level (0-100) |
| riskLevel | string | Risk level classification (low, medium, high) based on risk score, or unknown if report is not completed |
| anonymizationResults | object | Results of anonymization analysis |
| entities | object | List of entities found made during anonymization |
| wcagComplianceResults | object | Results of WCAG compliance analysis |
| languageLevelResults | object | Results of language level analysis |
| retentionPeriod | integer | Retention period in days (0 for indefinite) |
| retentionExpiry | date-time | Date when the retention period expires |
| legalBasis | string | Legal basis for processing the data under GDPR |
| dataController | string | Name of the data controller |
Report Status Values
Reports can have the following status values:
- pending: The report has been created but not yet processed
- processing: The report is currently being processed
- completed: The report has been successfully processed
- failed: The report processing failed (check errorMessage for details)
Handling Non-Text Documents
DocuDesk's anonymization capabilities rely on text extraction from documents. However, certain file types cannot be processed for text content, which affects how DocuDesk handles these documents.
Unsupported Document Types
The following document types typically cannot be processed for text extraction:
- Images: JPEG, PNG, GIF, BMP, WebP, etc.
- Videos: MP4, AVI, MOV, WebM, etc.
- Audio: MP3, WAV, FLAC, etc.
- Binary files: EXE, DLL, etc.
- Encrypted documents: Documents with password protection or encryption
- Scanned documents without OCR: Image-based PDFs without text layers
How DocuDesk Handles These Files
When DocuDesk encounters a file that cannot be processed for text extraction:
- A report is still created for the document
- The report status is set to 'completed'
- The anonymizationResults object will include:
containsPersonalData: false(since no text could be analyzed)anonymizationStatus: 'not_required'entitiesFound: [](empty array)totalEntitiesFound: 0
- The report will include an informational note indicating that text extraction was not possible
- The riskLevel will typically be set to 'unknown' since risk assessment requires text analysis
Example Report for Non-Text Document
{
"id": "abc123",
"nodeId": "456",
"fileName": "image.jpg",
"filePath": "/path/to/image.jpg",
"fileType": "image/jpeg",
"fileExtension": "jpg",
"fileSize": 1024000,
"fileHash": "a1b2c3d4e5f6",
"status": "completed",
"riskLevel": "unknown",
"anonymizationResults": {
"containsPersonalData": false,
"entitiesFound": [],
"totalEntitiesFound": 0,
"dataCategories": [],
"anonymizationStatus": "not_required"
},
"errorMessage": "No text could be extracted from this document type"
}
Best Practices for Non-Text Documents
When working with non-text documents that might contain sensitive information:
- Manual Review: Visually inspect images and videos for personal data
- Metadata Cleaning: Remove EXIF data from images which may contain location or device information
- OCR Processing: Consider using OCR tools on scanned documents before uploading
- Alternative Formats: When possible, provide text-based alternatives for important image-based content
- Custom Tagging: Use DocuDesk's manual tagging features to mark non-text documents that contain sensitive information
Report Creation Process
When a file event occurs (creation or modification), DocuDesk follows these steps to create or update reports:
Simplified Event Handling
DocuDesk has streamlined the report creation process by:
- Centralizing Decision Logic: All decisions about whether to create reports and how to process them are now made in the ReportingService
- Automatic Processing Mode: The system automatically determines whether to process reports synchronously based on configuration settings
- Single Responsibility: Event listeners simply pass events to the ReportingService without making any decisions
This approach ensures consistent behavior and makes the system easier to maintain and extend.
Report Update Logic
When a file is modified, DocuDesk updates the existing report rather than creating a new one:
This logic ensures that reports are always up-to-date with the latest version of a file, while avoiding unnecessary processing when the file content hasn't changed.