No description
Find a file
Vadym Samoilenko 9195a3eee8 Add idempotent deployment script
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>
2026-03-02 14:03:23 +00:00
.gitignore Implement basic authentication with login page 2025-12-04 14:09:14 -05:00
config.php Add Azure AD SSO authentication via MSAL.js 2026-03-02 13:36:11 +00:00
deploy.sh Add idempotent deployment script 2026-03-02 14:03:23 +00:00
index.html Add Azure AD SSO authentication via MSAL.js 2026-03-02 13:36:11 +00:00
README.md Update README to reflect current project state 2026-02-27 11:49:38 -05:00

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

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:

  1. document.session.open — Create edit session
  2. Perform operations with session ID
  3. document.session.save — Commit changes
  4. document.session.close — Release session

Image Matching

  1. H&M sRGB Logo → Hardcoded asset 68626a50da85f5bf560161ed
  2. H&M CMYK Logo → Hardcoded asset 68626a4a0eb4d535b80789cb
  3. Generic Images — Searches campaign folder structure (RGB/CMYK) with fuzzy matching

Campaign Folder Structure

Assets/
└── [Campaign Folder Name]/
    └── Links/
        ├── RGB/
        └── CMYK/

Usage

  1. Open index.html in a web browser
  2. Select an action from the dropdown
  3. Fill in the required parameters
  4. 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.tif route to CMYK folder; all others default to RGB

Last Updated: February 2025 License: Internal Use Only