#!/usr/bin/env python3 """ Test script to demonstrate MASTERASSETIDS field with multiple master asset IDs This creates a test JSON structure showing how multiple master assets would be linked """ import json # Example: A localized asset (derivative) that references TWO master assets # Master 1: fc5c389776516bb58044c7d4bf479da458599baf (tracking: BqB8vo) # Master 2: ad3948d72ea8550a338a600ae87a1bdd1968b066 (tracking: SfUQ7m) test_field_structure = { 'id': 'FERRERO.MASTERASSETIDS', 'parent_table_id': 'FERRERO.TABULAR.FIELD.MASTERASSETIDS', 'type': 'com.artesia.metadata.MetadataTableField', 'values': [ # First master asset ID { 'cascading_domain_value': False, 'domain_value': True, 'is_locked': False, 'value': { 'field_value': { 'type': 'string', 'value': 'fc5c389776516bb58044c7d4bf479da458599baf' }, 'type': 'com.artesia.metadata.DomainValue' } }, # Second master asset ID { 'cascading_domain_value': False, 'domain_value': True, 'is_locked': False, 'value': { 'field_value': { 'type': 'string', 'value': 'ad3948d72ea8550a338a600ae87a1bdd1968b066' }, 'type': 'com.artesia.metadata.DomainValue' } }, # Third master asset ID (optional) { 'cascading_domain_value': False, 'domain_value': True, 'is_locked': False, 'value': { 'field_value': { 'type': 'string', 'value': '020d76f957ec9f4ec0b18035a2d012cd3fd376c2' }, 'type': 'com.artesia.metadata.DomainValue' } } ] } print("=" * 80) print("MULTIPLE MASTER ASSET IDS - TEST STRUCTURE") print("=" * 80) print() print("Field ID:", test_field_structure['id']) print("Parent Table:", test_field_structure['parent_table_id']) print("Number of Master Asset IDs:", len(test_field_structure['values'])) print() print("Master Asset IDs:") for i, value_obj in enumerate(test_field_structure['values'], 1): master_id = value_obj['value']['field_value']['value'] print(f" {i}. {master_id}") print() print("Full JSON Structure:") print("-" * 80) print(json.dumps(test_field_structure, indent=2)) print() print("=" * 80) print("TESTING NOTES") print("=" * 80) print() print("To test if DAM accepts multiple IDs:") print("1. Check if FERRERO.TABULAR.FIELD.MASTERASSETIDS schema allows multiple rows") print("2. Verify with DAM admin if field has 'Allow Multiple Values' enabled") print("3. Test upload with this structure to PPR environment") print() print("Current Implementation:") print(" - Code adds ONE master ID (from tracking ID lookup)") print(" - Supports Many-to-Many relationship conceptually") print(" - Array structure ready for multiple values") print() print("To enable multiple IDs in production:") print(" - Agency tool needs to send list of master tracking IDs") print(" - Database schema needs multiple master references") print(" - Code modification needed to look up multiple masters") print()