Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[submodule "web/documentserver-example/nodejs/public/assets/document-templates"]
path = web/documentserver-example/nodejs/public/assets/document-templates
url = https://github.com/Euro-Office/document-templates
branch = main/default
branch = main
[submodule "web/documentserver-example/nodejs/public/assets/document-formats"]
path = web/documentserver-example/nodejs/public/assets/document-formats
url = https://github.com/Euro-Office/document-formats
Expand All @@ -11,37 +11,37 @@
[submodule "web/documentserver-example/csharp-mvc/assets/document-templates"]
path = web/documentserver-example/csharp-mvc/assets/document-templates
url = https://github.com/Euro-Office/document-templates
branch = main/default
branch = main
[submodule "web/documentserver-example/csharp-mvc/assets/document-formats"]
path = web/documentserver-example/csharp-mvc/assets/document-formats
url = https://github.com/Euro-Office/document-formats
[submodule "web/documentserver-example/php/assets/document-templates"]
path = web/documentserver-example/php/assets/document-templates
url = https://github.com/Euro-Office/document-templates
branch = main/default
branch = main
[submodule "web/documentserver-example/php/assets/document-formats"]
path = web/documentserver-example/php/assets/document-formats
url = https://github.com/Euro-Office/document-formats
[submodule "web/documentserver-example/python/assets/document-templates"]
path = web/documentserver-example/python/assets/document-templates
url = https://github.com/Euro-Office/document-templates
branch = main/default
branch = main
[submodule "web/documentserver-example/java/src/main/resources/assets/document-templates"]
path = web/documentserver-example/java/src/main/resources/assets/document-templates
url = https://github.com/Euro-Office/document-templates
branch = main/default
branch = main
[submodule "web/documentserver-example/ruby/assets/document-templates"]
path = web/documentserver-example/ruby/assets/document-templates
url = https://github.com/Euro-Office/document-templates
branch = main/default
branch = main
[submodule "web/documentserver-example/java-spring/src/main/resources/assets/document-templates"]
path = web/documentserver-example/java-spring/src/main/resources/assets/document-templates
url = https://github.com/Euro-Office/document-templates
branch = main/default
branch = main
[submodule "web/documentserver-example/go/static/assets/document-templates"]
path = web/documentserver-example/go/static/assets/document-templates
url = https://github.com/Euro-Office/document-templates
branch = main/default
branch = main
[submodule "web/documentserver-example/go/static/assets/document-formats"]
path = web/documentserver-example/go/static/assets/document-formats
url = https://github.com/Euro-Office/document-formats
Expand All @@ -57,11 +57,11 @@
[submodule "web/documentserver-example/csharp/assets/document-templates"]
path = web/documentserver-example/csharp/assets/document-templates
url = https://github.com/Euro-Office/document-templates
branch = main/default
branch = main
[submodule "web/documentserver-example/csharp/assets/document-formats"]
path = web/documentserver-example/csharp/assets/document-formats
url = https://github.com/Euro-Office/document-formats
[submodule "web/documentserver-example/php-laravel/public/assets/document-templates"]
path = web/documentserver-example/php-laravel/public/assets/document-templates
url = https://github.com/Euro-Office/document-templates
branch = main/default
branch = main
56 changes: 56 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,62 @@ You should change `http://documentserver` to your server address in these files:
* [Ruby](https://github.com/Euro-Office/document-server-integration/tree/main/web/documentserver-example/ruby) - `web/documentserver-example/ruby/app/configuration/configuration.rb`


## Quick Start — minimal Docker test environment

The repository ships a `docker-compose.yml` that starts a self-contained
Euro-Office DocumentServer with the Node.js integration example enabled
automatically. No extra configuration or manual service start is required.

**Prerequisites:** Docker with the Compose plugin (v2).

**1. Start the container:**

```bash
docker compose up -d
```

**2. Wait until the server is ready** — monitor the logs:

```bash
docker logs -f eo-documentserver
```

The server is ready when you see:

```
INFO success: docservice entered RUNNING state
```

**3. Open the example in your browser:**

```
http://localhost:8080/example/
```

To open a specific file type directly in the editor:

```
http://localhost:8080/example/editor?fileExt=docx&userid=uid-1&lang=en&directUrl=false
```

| Parameter | Description |
|-----------|-------------|
| `fileExt` | Extension of the new blank document (`docx`, `xlsx`, `pptx`) |
| `userid` | Any user identifier (e.g. `uid-1`) |
| `lang` | UI language — exact locale (`en-US`) or two-letter code with `default` fallback (`en`) |
| `directUrl` | Set `true` to pass the file URL directly to the browser |

**Stop and remove the container:**

```bash
docker compose down
```

> **Security note:** The compose file sets `JWT_SECRET=secret`. This is
> intentionally insecure and is only suitable for local development and
> testing. Never expose this setup to a public network.


## API methods for test examples

The methods described below are available for all of the test examples.
Expand Down
17 changes: 6 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,11 @@
# INFO success: docservice entered RUNNING state
#
# -----------------------------------------------------------------------------
# Start the example application
# -----------------------------------------------------------------------------
#
# The example Node.js application is not started automatically.
# After the container is running, start it manually with:
#
# docker exec -it eo-documentserver supervisorctl start ds-example
#
# -----------------------------------------------------------------------------
# Access the example
# -----------------------------------------------------------------------------
#
# Open the example in your browser:
# The example Node.js application starts automatically (EXAMPLE_ENABLED=true).
# Open the example in your browser once the container is running:
#
# http://localhost:8080/example/
#
Expand All @@ -50,7 +42,10 @@ name: minimal-documentserver-test

services:
documentserver:
image: euro-office/documentserver:latest
image: ghcr.io/euro-office/documentserver:latest
environment:
EXAMPLE_ENABLED: "true"
JWT_SECRET: "secret"
container_name: eo-documentserver
ports:
- "8080:80"
Submodule document-formats updated 1 files
+1 −29 README.md
2 changes: 1 addition & 1 deletion web/documentserver-example/csharp/assets/document-formats
Submodule document-formats updated 1 files
+1 −29 README.md
Submodule document-formats updated 1 files
+1 −29 README.md
13 changes: 11 additions & 2 deletions web/documentserver-example/nodejs/helpers/docManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,17 @@
const fileName = this.getCorrectName(demoName); // get the correct file name if such a name already exists

// copy sample document of a necessary extension to the storage path
this.copyFile(path.join(__dirname, '..', 'public', 'assets', 'document-templates', isSample
? 'sample' : 'new', demoName), this.storagePath(fileName));
let templatePath;
if (isSample) {
templatePath = path.join(__dirname, '..', 'public', 'assets', 'document-templates', 'sample', demoName);
} else {
// templates are organised by locale subdirectory (e.g. new/en-US/new.docx); fall back to new/default/
const lang = this.getLang();
const langPath = path.join(__dirname, '..', 'public', 'assets', 'document-templates', 'new', lang, demoName);
const defaultPath = path.join(__dirname, '..', 'public', 'assets', 'document-templates', 'new', 'default', demoName);

Check failure on line 149 in web/documentserver-example/nodejs/helpers/docManager.js

View workflow job for this annotation

GitHub Actions / Lint

This line has a length of 121. Maximum allowed is 120
templatePath = this.existsSync(langPath) ? langPath : defaultPath;
}
this.copyFile(templatePath, this.storagePath(fileName));

this.saveFileData(fileName, userid, username); // save file data to the file

Expand Down
Submodule document-formats updated 1 files
+1 −29 README.md
2 changes: 1 addition & 1 deletion web/documentserver-example/php/assets/document-formats
Submodule document-formats updated 1 files
+1 −29 README.md
2 changes: 1 addition & 1 deletion web/documentserver-example/php/assets/document-templates
2 changes: 1 addition & 1 deletion web/documentserver-example/python/assets/document-formats
Submodule document-formats updated 1 files
+1 −29 README.md
2 changes: 1 addition & 1 deletion web/documentserver-example/ruby/assets/document-formats
Submodule document-formats updated 1 files
+1 −29 README.md
2 changes: 1 addition & 1 deletion web/documentserver-example/ruby/assets/document-templates
Loading