Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Aug 18, 2025

This PR extends the dataset download information to provide better traceability and user understanding as requested in issue #2147.

Changes Made

1. Renamed manifest file for clarity

  • Changed filename from manifest.json to general_metadata.json for better user comprehension
  • Updated file generation and archive inclusion in ExportController.cs

2. Added download metadata fields

Extended the ApiDatasetModel with three new properties:

  • DownloadSource: The base URL of the BEXIS2 instance (e.g., "https://www.bexis.uni-jena.de/")
  • DownloadDateTime: Timestamp when the download was initiated
  • DownloadedBy: Username of the authenticated user or "anonymous" for unauthenticated downloads

3. Implementation details

  • Download source extracted from HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority)
  • Download timestamp uses DateTime.Now with consistent en-US culture formatting
  • User information retrieved from HttpContext.Current.User.Identity.Name
  • Comprehensive error handling with graceful fallbacks (e.g., "unknown" for URL, "anonymous" for user)

4. Example output

The enhanced general_metadata.json now includes:

{
  "Id": 123,
  "Version": 1,
  "Title": "Sample Dataset",
  "DownloadSource": "https://www.bexis.uni-jena.de/",
  "DownloadDateTime": "8/18/2025 9:08:50 PM", 
  "DownloadedBy": "john.doe",
  ...existing fields...
}

Backward Compatibility

All changes are purely additive - existing functionality remains unchanged and API consumers will continue to work without modification. The new fields provide additional valuable metadata without breaking existing workflows.

Files Modified

  • Console/BExIS.Web.Shell/Areas/DIM/BExIS.Modules.Dim.UI/Models/API/ApiModels.cs
  • Console/BExIS.Web.Shell/Areas/DIM/BExIS.Modules.Dim.UI/Helpers/ApiDatasetHelper.cs
  • Console/BExIS.Web.Shell/Areas/DIM/BExIS.Modules.Dim.UI/Controllers/ExportController.cs

Fixes #2147.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits August 18, 2025 21:05
Co-authored-by: geofranzi <15946467+geofranzi@users.noreply.github.com>
Co-authored-by: geofranzi <15946467+geofranzi@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Extend download information Extend download information with source, timestamp, and user details Aug 18, 2025
@Copilot Copilot AI requested a review from geofranzi August 18, 2025 21:10
Copilot finished work on behalf of geofranzi August 18, 2025 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extend download information
2 participants