deploy.sh pulls latest code from origin/main, sets file permissions, and validates PHP syntax. Safe to run on initial setup or any update. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .gitignore | ||
| config.php | ||
| deploy.sh | ||
| index.html | ||
| README.md | ||
OMG Static - H&M Agent
A web-based tool for managing H&M documents through the One2Edit API. Provides automated image relinking, document exporting, and image status checking.
Features
Relink Images
Automatically relinks missing images in H&M documents using intelligent matching algorithms.
- Link by File — Process a single document by Document ID
- Link by Folder — Batch process all documents in a folder
Image Status
Check the link status of all images across multiple documents in a folder. Shows per-document and folder-level summaries of linked vs missing images.
Export INDD
Bulk export InDesign documents from a folder to assets.
Export PDF
Bulk export PDF documents with R100 filtering and name transformation (R100 → RATIOS).
Ratio Check
Validate image aspect ratios against expected values.
Architecture
Session Management
All document operations use One2Edit session management:
document.session.open— Create edit session- Perform operations with session ID
document.session.save— Commit changesdocument.session.close— Release session
Image Matching
- H&M sRGB Logo → Hardcoded asset
68626a50da85f5bf560161ed - H&M CMYK Logo → Hardcoded asset
68626a4a0eb4d535b80789cb - Generic Images — Searches campaign folder structure (RGB/CMYK) with fuzzy matching
Campaign Folder Structure
Assets/
└── [Campaign Folder Name]/
└── Links/
├── RGB/
└── CMYK/
Usage
- Open
index.htmlin a web browser - Select an action from the dropdown
- Fill in the required parameters
- Click "Submit" to execute
Action Parameters
| Action | Parameters |
|---|---|
| Relink Images | Link method (File/Folder), Document ID or Folder ID |
| Image Status | Folder ID |
| Export INDD | Folder ID |
| Export PDF | Folder ID |
| Ratio Check | Input Path, Expected Ratio, Tolerance |
Configuration
API credentials and asset configuration are loaded from config.php via AJAX at runtime.
Performance Settings
- Relink Delay: 5s between image relink operations
- Document Delay: 2s between document processing
- Status Check Delay: 500ms between document status checks
File Structure
├── index.html # Main application (single-page)
├── config.php # API credentials and asset configuration
├── .gitignore
└── README.md
Troubleshooting
- Enable debug logging via "Show Debug Log" button for API request/response details
- Session issues: Sessions auto-expire; check debug log for session IDs if operations fail
- CMYK detection: Files ending with
39L_TAC330.tifroute to CMYK folder; all others default to RGB
Last Updated: February 2025 License: Internal Use Only