# SciLMi Outline Bridge (Lucee 6 / ColdFusion)

Bridge-Service fuer SciLMi, der Inhalte aus Outline per API holt, lokal cached und als fertige HTML-`div` ausliefert.

## Features

- Outline-Import per API (`documents.list`, `documents.info`)
- Lokaler Cache:
  - Datei-basiert (Default)
  - MySQL-basiert
- Transformationspipeline:
  - Text-Replacements
  - Keyword-Verlinkung
  - Custom-CSS-Injektion
- Ausgabe:
  - JSON-API (`/api/page.cfm`)
  - Direktes HTML-Embed (`/embed/div.cfm`)
  - jQuery Loader (`/assets/bridge.js`)

## Projektstruktur

- `Application.cfc`
- `config/bridge-config.json`
- `components/BridgeService.cfc`
- `components/storage/FileCacheStorage.cfc`
- `components/storage/MySQLStorage.cfc`
- `api/sync.cfm`
- `api/page.cfm`
- `embed/div.cfm`
- `assets/bridge.js`
- `db/mysql_schema.sql`

## Setup

1. `config/bridge-config.json` anpassen:
   - `outline.baseUrl`
   - `outline.apiToken`
   - optional `outline.collectionId`
   - `bridge.syncToken`
2. Cache-Modus waehlen:
   - `cache.driver = "file"` oder `"mysql"`
3. Bei MySQL:
   - Tabelle mit `db/mysql_schema.sql` anlegen
   - Lucee Datasource-Namen in `cache.mysqlDatasource` eintragen

## Endpoints

### 1) Voll-Sync

`GET /api/sync.cfm?token=DEIN_SYNC_TOKEN`

- Holt Seiten aus Outline und schreibt sie in den Cache.

### 2) Seite als JSON

`GET /api/page.cfm?slug=DEIN_SLUG`

oder

`GET /api/page.cfm?id=DEINE_ID`

Optional:

- `refresh=1` erzwingt Neuladen aus Outline

### 3) Seite als fertiges Div

`GET /embed/div.cfm?slug=DEIN_SLUG`

oder

`GET /embed/div.cfm?id=DEINE_ID`

## Externe Einbindung (AJAX)

```html
<div class="scilmi-outline-embed"
     data-bridge-base="https://bridge.example.org"
     data-outline-slug="dein-slug">
</div>
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script src="https://bridge.example.org/assets/bridge.js"></script>
```

## Hinweise

- Aktuell ist der Markdown->HTML Parser bewusst leichtgewichtig (Basis-Markup).
- Fuer produktive, komplexe Markdown-Inhalte kann spaeter ein erweiterter Parser angebunden werden.
- Transformationsregeln sind komplett in `config/bridge-config.json` steuerbar.


22.03.2026

local
http://127.0.0.1:7066/api/page.cfm?slug=before-the-implementation-of-the-scilmi-framework-F9YzWjSeAB
http://127.0.0.1:7066/index.cfm?slug=before-the-implementation-of-the-scilmi-framework-F9YzWjSeAB&outline=before-the-implementation-of-the-scilmi-framework-F9YzWjSeAB
http://127.0.0.1:7066/embed/div.cfm?slug=before-the-implementation-of-the-scilmi-framework-F9YzWjSeAB
http://127.0.0.1:7066/demo-router.cfm?outline=scilmi-lesson-planning-WsIb0fRlyy

hole liste aller seiten:
http://127.0.0.1:7066/api/outline-list.cfm

ierieren über alle seiten und cachen.



original outline-wiki:
https://wiki.scilmi.eu/collection/wiki-1lwYgpnJ5B/alphabetical

http://scilmi.onlum.ch/demo-router.cfm?outline=open-up-your-mind-fh5IbshZLW





collections:
nur
- WIKI
- Scilmi Courses
