|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Project Overview |
| 6 | + |
| 7 | +This is **server.dmsmail**, a Plone 4.3-based Document Management System (DMS) built by IMIO for managing documents and email workflows. It runs on **Python 2.7** exclusively. |
| 8 | + |
| 9 | +The build system is **zc.buildout** with **mr.developer** for managing 70+ source packages checked out under `src/`. |
| 10 | + |
| 11 | +## Build & Development Commands |
| 12 | + |
| 13 | +```bash |
| 14 | +make setup # Create Python 2.7 virtualenv and install requirements |
| 15 | +make buildout # Run buildout (creates standard site on first run) |
| 16 | +bin/instance1 fg # Start instance1 in foreground (port 8081) |
| 17 | +``` |
| 18 | + |
| 19 | +## Testing |
| 20 | + |
| 21 | +```bash |
| 22 | +bin/testme # Run imio.dms.mail tests (primary test target) |
| 23 | +bin/test -s <package.name> # Run tests for a specific package |
| 24 | +bin/test -s imio.dms.mail -t test_name # Run a single test |
| 25 | +``` |
| 26 | + |
| 27 | +### Robot / GUI Tests |
| 28 | + |
| 29 | +```bash |
| 30 | +make robot-server # Start robot test server on port 55001 |
| 31 | +make doc opt='-i "RUN1"' # Run doc.robot tests (can filter by tag/name) |
| 32 | +make gui-test opt='-t "* response"' # Run dmsmail.robot GUI tests |
| 33 | +``` |
| 34 | + |
| 35 | +### Linting |
| 36 | + |
| 37 | +Flake8 config: max-line-length=120, ignores E122/E126/E121/E226/E203/E704/W503/W504. |
| 38 | + |
| 39 | +## Architecture |
| 40 | + |
| 41 | +### Buildout Configuration Chain |
| 42 | + |
| 43 | +`buildout.cfg` → `buildout-main.cfg` → extends `base.cfg` + `port.cfg` + `amqp.cfg` + `dev.cfg` + `test.cfg` |
| 44 | + |
| 45 | +- **base.cfg**: Core Zope instance definition, ZCML loading, eggs |
| 46 | +- **port.cfg**: All port assignments (instance1=8081, debug=8089, ZEO=8080, LibreOffice=2002, Solr=8983) |
| 47 | +- **dev.cfg**: Auto-checkout of all source packages, debug mode, extends `sources-dev.cfg` |
| 48 | +- **test.cfg**: Test runners (test, testme, coverage, coverageme, robot) |
| 49 | +- **versions-base.cfg** / **versions-dev.cfg**: Pinned package versions |
| 50 | + |
| 51 | +### Key Packages |
| 52 | + |
| 53 | +- **imio.dms.mail** (`src/imio.dms.mail/`): Core DMS mail application — content types, workflows, views, event subscribers. This is where most development happens. |
| 54 | +- **imio.dms.policy** (`src/imio.dms.policy/`): Policy/integration layer, ZCML entry point |
| 55 | +- **collective.dms.mailcontent**: Mail content type definitions |
| 56 | +- **collective.dms.basecontent**: Base DMS content types |
| 57 | +- **collective.contact.\***: Contact management subsystem |
| 58 | +- **collective.eeafaceted.\***: Faceted navigation/dashboard/batch actions |
| 59 | +- **collective.documentgenerator**: Document generation via LibreOffice/appy |
| 60 | +- **imio.zamqp.\***: AMQP async processing (RabbitMQ) |
| 61 | +- **imio.esign**: E-signature support |
| 62 | + |
| 63 | +### External Services |
| 64 | + |
| 65 | +- **LibreOffice** on port 2002 (document conversion/generation) |
| 66 | +- **Solr** on port 8983 (optional search engine) |
| 67 | +- **ZEO** on port 8080 (shared ZODB server, optional for dev) |
| 68 | +- **Keycloak** for SSO/OIDC authentication |
| 69 | +- **RabbitMQ** for AMQP async tasks |
| 70 | + |
| 71 | +### Important Directories |
| 72 | + |
| 73 | +- `src/`: All 70+ source packages managed by mr.developer |
| 74 | +- `Extensions/`: Zope external methods (demo.py, corrections.py, imports.py) |
| 75 | +- `parts/omelette/`: Symlink forest of all installed packages (useful for navigation) |
| 76 | +- `var/filestorage/Data.fs`: ZODB database file |
| 77 | +- `var/blobstorage/`: Binary blob storage |
| 78 | + |
| 79 | +### Conventions |
| 80 | + |
| 81 | +- Namespace packages use `imio.*`, `imio.dms.*`, `collective.*` patterns |
| 82 | +- Content types use Dexterity (not Archetypes) |
| 83 | +- Site configuration via GenericSetup profiles in `profiles/` directories |
| 84 | +- Event handling through `subscribers.py` and `setuphandlers.py` |
| 85 | +- Data migration uses transmogrifier pipelines |
| 86 | + |
| 87 | +## CI |
| 88 | + |
| 89 | +GitHub Actions (`.github/workflows/main.yml`): runs `bin/testme` on Ubuntu 22.04 with Python 2.7.18 and Plone 4.3. Coverage published to Coveralls (skipped on branch 3.1.X). |
0 commit comments