✅ Complete Flask web application with drag & drop interface ✅ BISSELL filename parsing and AEM path generation ✅ Token management and validation system ✅ File analysis and transformation preview ✅ Upload framework ready for AEM staging 🎯 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
103 lines
No EOL
4 KiB
Python
103 lines
No EOL
4 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Create test files and examples for the AEM File Uploader
|
|
|
|
This script creates test files with BISSELL naming conventions and shows usage examples.
|
|
"""
|
|
|
|
import os
|
|
from pathlib import Path
|
|
|
|
def create_test_files():
|
|
"""Create sample test files with BISSELL naming conventions."""
|
|
|
|
test_files = [
|
|
# Basic wet wash product
|
|
"5791356_wet_wash_p3084_crosswave_imagery_hero_rgb_mambo-red.tif",
|
|
|
|
# Dry canister with NCW (no colorway)
|
|
"5791356_dry_canister_p2829_pet-hair-eraser_imagery_hero_rgb_NCW.jpg",
|
|
|
|
# Product with custom descriptor
|
|
"5791356_consumables_boost_generic_generic_digital_banner_rgb_NCW_250x250banner1.png",
|
|
|
|
# Robot product (will be removed from DAM filename)
|
|
"12345678_dry_robot_p2990_crosswave-robot_imagery_hero_rgb_NCW_250x250banner1.jpg",
|
|
|
|
# Complex product with all components
|
|
"9876543_wet_wash_p3084_crosswave_imagery_lifestyle_cmyk_electric-blue_EcomAsset1.psd",
|
|
|
|
# Sanitaire product
|
|
"1111111_sanitaire_upright_p123_professional_parts_diagram_rgb_NCW.pdf",
|
|
|
|
# Stick vacuum with colorway
|
|
"2222222_dry_stick_p3025_iconpet_imagery_hero_rgb_copper-harbor.tif"
|
|
]
|
|
|
|
print("🎯 Creating test files with BISSELL naming conventions...")
|
|
|
|
for filename in test_files:
|
|
# Create empty file with some content
|
|
with open(filename, 'w') as f:
|
|
f.write(f"Test file: {filename}\n")
|
|
f.write("This is a placeholder file for testing AEM upload.\n")
|
|
f.write("In a real scenario, this would be an actual image or document file.\n")
|
|
|
|
print(f"✅ Created: {filename}")
|
|
|
|
print(f"\n📁 Created {len(test_files)} test files")
|
|
return test_files
|
|
|
|
def show_usage_examples():
|
|
"""Show usage examples."""
|
|
|
|
print("\n🚀 USAGE EXAMPLES:")
|
|
print("=" * 50)
|
|
|
|
print("\n1. ANALYSIS MODE (no uploads, just shows what would happen):")
|
|
print(" python aem_file_uploader.py *.tif")
|
|
print(" python aem_file_uploader.py *.jpg *.png")
|
|
print(" python aem_file_uploader.py --verbose *.tif")
|
|
|
|
print("\n2. STAGING MODE (actually uploads to staging area for testing):")
|
|
print(" export AEM_ACCESS_TOKEN='your_bearer_token_here'")
|
|
print(" python aem_file_uploader.py --staging *.tif")
|
|
print(" python aem_file_uploader.py --staging --verbose *.jpg")
|
|
|
|
print("\n3. WHAT HAPPENS:")
|
|
print(" ✓ Parses production filename using HTML tool logic")
|
|
print(" ✓ Shows where file SHOULD go in production")
|
|
print(" ✓ Renames file using DAM naming convention")
|
|
print(" ✓ In staging mode: uploads to staging area with production structure")
|
|
print(" /content/dam/zz-dam-staging-area-unpublished-assets/oliver/[production-structure]")
|
|
|
|
print("\n4. FILENAME TRANSFORMATION EXAMPLES:")
|
|
examples = [
|
|
("5791356_wet_wash_p3084_crosswave_imagery_hero_rgb_mambo-red.tif",
|
|
"p3084_crosswave_imagery_hero_rgb_mambo-red.tif"),
|
|
("5791356_dry_canister_p2829_pet-hair-eraser_imagery_hero_rgb_NCW.jpg",
|
|
"p2829_pet-hair-eraser_imagery_hero_rgb.jpg"),
|
|
("5791356_consumables_boost_generic_generic_digital_banner_rgb_NCW_250x250banner1.png",
|
|
"250x250banner1_generic_generic_digital_banner_rgb.png")
|
|
]
|
|
|
|
for original, renamed in examples:
|
|
print(f" Original: {original}")
|
|
print(f" Renamed: {renamed}")
|
|
print()
|
|
|
|
if __name__ == "__main__":
|
|
print("🎯 AEM File Uploader - Test File Creator and Examples")
|
|
print("=" * 60)
|
|
|
|
# Create test files
|
|
test_files = create_test_files()
|
|
|
|
# Show usage examples
|
|
show_usage_examples()
|
|
|
|
print("\n💡 TIP: Start with analysis mode to see what would happen:")
|
|
print(f" python aem_file_uploader.py {test_files[0]}")
|
|
|
|
print("\n🎭 Staging area URL:")
|
|
print(" https://author-p61603-e493702.adobeaemcloud.com/ui#/aem/assets.html/content/dam/zz-dam-staging-area-unpublished-assets/oliver") |