# FirstSpirit FS-CLI Export/Sync Directory Structure ## Overview This document describes the structure and file formats used when exporting FirstSpirit templates using FS-CLI (FSDevTools). The export creates a hierarchical file system structure that mirrors the FirstSpirit project structure, preserving all template configurations, forms, rules, and output channels. ## General Structure The FS-CLI export follows a consistent pattern: ``` sync_dir/ ├── .FirstSpirit/ # Export metadata (do not version control) │ ├── Files_*.txt # List of all exported files with checksums │ └── Import_*.txt # Import metadata │ └── TemplateStore/ # Template Store root ├── FormatTemplates/ # Text formatting templates ├── LinkTemplates/ # Link templates ├── PageTemplates/ # Page templates ├── SectionTemplates/ # Section templates (content modules) ├── Schemes/ # Database schema templates ├── Scripts/ # Script templates └── Workflows/ # Workflow definitions ``` ### Key Principles 1. **Folder hierarchy mirrors FirstSpirit structure**: The file system replicates the exact folder structure from the FirstSpirit project 2. **One folder per element**: Each FirstSpirit template/element gets its own directory 3. **Consistent file naming**: Files use standardized names based on their purpose 4. **Multiple files per template**: Templates are decomposed into separate files for different aspects (form, output, rules, etc.) ## Template Store Structure ### Template Types and Locations | Template Type | Directory | Purpose | |--------------|-----------|---------| | **Page Templates** | `TemplateStore/PageTemplates/` | Define page framework and structure | | **Section Templates** | `TemplateStore/SectionTemplates/` | Content modules inserted into pages | | **Format Templates** | `TemplateStore/FormatTemplates/` | Text formatting options for editors | | **Link Templates** | `TemplateStore/LinkTemplates/` | Link type configurations | | **Table Templates** | `TemplateStore/Schemes/` | Database schema templates | | **Script Templates** | `TemplateStore/Scripts/` | BeanShell scripts and functions | | **Workflows** | `TemplateStore/Workflows/` | Approval and release workflows | ## File Types Reference Each template directory contains a combination of the following files, depending on the template type: ### Core Files (All Templates) #### StoreElement.xml **Purpose**: Core template metadata and configuration **Contains**: - Template ID (`id` attribute) - unique identifier - Template reference name (`filename` or `name` attribute) - Template type (`type` attribute: `page`, `section`, `format`, etc.) - Display names (multilingual via `` elements) - Channel/extension mappings (`` elements) - Template body definitions (``) - Format template style definitions (`