Compare commits

..

9 Commits

1362 changed files with 102929 additions and 77898 deletions

View File

@ -1,31 +0,0 @@
name: Artifact Csharp MVC
on:
workflow_dispatch:
push:
branches: [master]
paths: ['web/documentserver-example/csharp-mvc/**']
pull_request:
branches: [master]
paths: ['web/documentserver-example/csharp-mvc/**']
jobs:
artifact:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Build Artifact
run: |
cd ${{ github.workspace }}
cwd=$(pwd)
git submodule update --init --recursive
cd ./web/documentserver-example/csharp-mvc
mkdir -p ./deploy/'DotNet (Csharp MVC) Example'
rsync -av --exclude='deploy' ./ ./deploy/'DotNet (Csharp MVC) Example'
rm -rf ./deploy/'DotNet (Csharp MVC) Example'/assets/.git
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: DotNet.Csharp.MVC.Example
path: ${{ github.workspace }}/web/documentserver-example/csharp-mvc/deploy

View File

@ -1,30 +0,0 @@
name: Artifact Csharp
on:
workflow_dispatch:
push:
branches: [master]
paths: ['web/documentserver-example/csharp/**']
pull_request:
branches: [master]
paths: ['web/documentserver-example/csharp/**']
jobs:
artifact:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Build Artifact
run: |
cd ${{ github.workspace }}
git submodule update --init --recursive
cd ./web/documentserver-example/csharp
mkdir -p ./deploy/'DotNet (Csharp) Example'
rsync -av --exclude='deploy' ./ ./deploy/'DotNet (Csharp) Example'
rm -rf ./deploy/'DotNet (Csharp) Example'/assets/.git
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: DotNet.Csharp.Example
path: ${{ github.workspace }}/web/documentserver-example/csharp/deploy

View File

@ -1,32 +0,0 @@
name: Artifact Golang
on:
workflow_dispatch:
push:
branches: [master]
paths: ['web/documentserver-example/go/**']
pull_request:
branches: [master]
paths: ['web/documentserver-example/go/**']
jobs:
artifact:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Build Artifact
run: |
cd ${{ github.workspace }}
cwd=$(pwd)
git submodule update --init --recursive
cd ./web/documentserver-example/go
mkdir -p ./deploy/'Go Example'
rsync -av --exclude='deploy' ./ ./deploy/'Go Example'
rm -rf ./deploy/'Go Example'/static/assets/document-formats/.git
rm -rf ./deploy/'Go Example'/static/assets/document-templates/.git
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: Go.Example
path: ${{ github.workspace }}/web/documentserver-example/go/deploy

View File

@ -1,31 +0,0 @@
name: Artifact Java
on:
workflow_dispatch:
push:
branches: [master]
paths: ['web/documentserver-example/java/**']
pull_request:
branches: [master]
paths: ['web/documentserver-example/java/**']
jobs:
artifact:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Build Artifact
run: |
cd ${{ github.workspace }}
git submodule update --init --recursive
cd ./web/documentserver-example/java
mkdir -p ./deploy/'Java Example'
rsync -av --exclude='deploy' ./ ./deploy/'Java Example'
rm -rf ./deploy/'Java Example'/src/main/resources/assets/document-formats/.git
rm -rf ./deploy/'Java Example'/src/main/resources/assets/document-templates/.git
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: Java.Example
path: ${{ github.workspace }}/web/documentserver-example/java/deploy

View File

@ -1,31 +0,0 @@
name: Artifact Nodejs
on:
workflow_dispatch:
push:
branches: [master]
paths: ['web/documentserver-example/nodejs/**']
pull_request:
branches: [master]
paths: ['web/documentserver-example/nodejs/**']
jobs:
artifact:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Build Artifact
run: |
cd ${{ github.workspace }}
git submodule update --init --recursive
cd ./web/documentserver-example/nodejs
mkdir -p ./deploy/'Node.js Example'
rsync -av --exclude='deploy' ./ ./deploy/'Node.js Example'
rm -rf ./deploy/'Node.js Example'/public/assets/document-formats/.git
rm -rf ./deploy/'Node.js Example'/public/assets/document-templates/.git
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: Node.js.Example
path: ${{ github.workspace }}/web/documentserver-example/nodejs/deploy

View File

@ -1,31 +0,0 @@
name: Artifact PHP Laravel
on:
workflow_dispatch:
push:
branches: [master]
paths: ['web/documentserver-example/php-laravel/**']
pull_request:
branches: [master]
paths: ['web/documentserver-example/php-laravel/**']
jobs:
artifact:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Build Artifact
run: |
cd ${{ github.workspace }}
git submodule update --init --recursive
cd ./web/documentserver-example/php-laravel
mkdir -p ./deploy/'PHP Laravel Example'
rsync -av --exclude='deploy' ./ ./deploy/'PHP Laravel Example'
rm -rf ./deploy/'PHP Laravel Example'/public/assets/document-formats/.git
rm -rf ./deploy/'PHP Laravel Example'/public/assets/document-templates/.git
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: PHP-Laravel.Example
path: ${{ github.workspace }}/web/documentserver-example/php-laravel/deploy

View File

@ -1,31 +0,0 @@
name: Artifact PHP
on:
workflow_dispatch:
push:
branches: [master]
paths: ['web/documentserver-example/php/**']
pull_request:
branches: [master]
paths: ['web/documentserver-example/php/**']
jobs:
artifact:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Build Artifact
run: |
cd ${{ github.workspace }}
git submodule update --init --recursive
cd ./web/documentserver-example/php
mkdir -p ./deploy/'PHP Example'
rsync -av --exclude='deploy' ./ ./deploy/'PHP Example'
rm -rf ./deploy/'PHP Example'/assets/document-formats/.git
rm -rf ./deploy/'PHP Example'/assets/document-templates/.git
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: PHP.Example
path: ${{ github.workspace }}/web/documentserver-example/php/deploy

View File

@ -1,31 +0,0 @@
name: Artifact Python
on:
workflow_dispatch:
push:
branches: [master]
paths: ['web/documentserver-example/python/**']
pull_request:
branches: [master]
paths: ['web/documentserver-example/python/**']
jobs:
artifact:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Build Artifact
run: |
cd ${{ github.workspace }}
git submodule update --init --recursive
cd ./web/documentserver-example/python
mkdir -p ./deploy/'Python Example'
rsync -av --exclude='deploy' ./ ./deploy/'Python Example'
rm -rf ./deploy/'Python Example'/assets/document-formats/.git
rm -rf ./deploy/'Python Example'/assets/document-templates/.git
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: Python.Example
path: ${{ github.workspace }}/web/documentserver-example/python/deploy

View File

@ -1,31 +0,0 @@
name: Artifact Ruby
on:
workflow_dispatch:
push:
branches: [master]
paths: ['web/documentserver-example/ruby/**']
pull_request:
branches: [master]
paths: ['web/documentserver-example/ruby/**']
jobs:
artifact:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Build Artifact
run: |
cd ${{ github.workspace }}
git submodule update --init --recursive
cd ./web/documentserver-example/ruby
mkdir -p ./deploy/'Ruby Example'
rsync -av --exclude='deploy' ./ ./deploy/'Ruby Example'
rm -rf ./deploy/'Ruby Example'/public/assets/document-formats/.git
rm -rf ./deploy/'Ruby Example'/public/assets/document-templates/.git
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: Ruby.Example
path: ${{ github.workspace }}/web/documentserver-example/ruby/deploy

View File

@ -1,32 +0,0 @@
name: Artifact Java Spring
on:
workflow_dispatch:
push:
branches: [master]
paths: ['web/documentserver-example/java-spring/**']
pull_request:
branches: [master]
paths: ['web/documentserver-example/java-spring/**']
jobs:
artifact:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Build Artifact
run: |
cd ${{ github.workspace }}
cwd=$(pwd)
git submodule update --init --recursive
cd ./web/documentserver-example/java-spring
mkdir -p ./deploy/'Java Spring Example'
rsync -av --exclude='deploy' ./ ./deploy/'Java Spring Example'
rm -rf ./deploy/'Java Spring Example'/src/main/resources/assets/document-formats/.git
rm -rf ./deploy/'Java Spring Example'/src/main/resources/assets/document-templates/.git
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: Java.Spring.Example
path: ${{ github.workspace }}/web/documentserver-example/java-spring/deploy

View File

@ -1,27 +0,0 @@
name: Create Tag
on:
push:
branches: [master]
paths-ignore:
- '.github/**'
- '**/AUTHORS.md'
- '**/LICENSE'
- '**/README.md'
jobs:
create-tag:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Get Info
run: |
echo "version=$(grep -Eo '[0-9]+(\.[0-9]+)+' CHANGELOG.md | head -n 1)" >> $GITHUB_OUTPUT
id: info
- name: Create Tag
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
git tag -a 'v${{ steps.info.outputs.version }}' -m 'Release/v${{ steps.info.outputs.version }}'
git push origin 'v${{ steps.info.outputs.version }}'

View File

@ -1,35 +0,0 @@
name: Licenses Csharp MVC
on:
workflow_dispatch:
push:
branches: [master, develop]
paths: ['web/documentserver-example/csharp-mvc/**']
pull_request:
branches: [master, develop]
paths: ['web/documentserver-example/csharp-mvc/**']
jobs:
licences:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup .NET SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '9.0.x'
- name: Restore Packages
run: dotnet restore
working-directory: ./web/documentserver-example/csharp-mvc
- name: Get Repository License
id: license
run: |
license="${{ (github.event.repository.license.spdx_id) || (github.event.repository.licenses[0]) }}"
echo "License detected: $license"
echo "license=$license" >> $GITHUB_OUTPUT
- name: Check Licenses
uses: ONLYOFFICE/check-licenses@v1
with:
project_license: ${{ steps.license.outputs.license }}
working_directory: ./web/documentserver-example/csharp-mvc

View File

@ -1,35 +0,0 @@
name: Licenses Csharp
on:
workflow_dispatch:
push:
branches: [master, develop]
paths: ['web/documentserver-example/csharp/**']
pull_request:
branches: [master, develop]
paths: ['web/documentserver-example/csharp/**']
jobs:
licences:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup .NET SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '9.0.x'
- name: Restore Packages
run: dotnet restore
working-directory: ./web/documentserver-example/csharp
- name: Get Repository License
id: license
run: |
license="${{ (github.event.repository.license.spdx_id) || (github.event.repository.licenses[0]) }}"
echo "License detected: $license"
echo "license=$license" >> $GITHUB_OUTPUT
- name: Check Licenses
uses: ONLYOFFICE/check-licenses@v1
with:
project_license: ${{ steps.license.outputs.license }}
working_directory: ./web/documentserver-example/csharp

View File

@ -1,33 +0,0 @@
name: Licenses Go
on:
workflow_dispatch:
push:
branches: [master, develop]
paths: ['web/documentserver-example/go/**']
pull_request:
branches: [master, develop]
paths: ['web/documentserver-example/go/**']
jobs:
licences:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Submodule Update
run: |
cd ${{ github.workspace }}
cwd=$(pwd)
git submodule update --init --recursive
- name: Get Repository License
id: license
run: |
license="${{ (github.event.repository.license.spdx_id) || (github.event.repository.licenses[0]) }}"
echo "License detected: $license"
echo "license=$license" >> $GITHUB_OUTPUT
- name: Check Licenses
uses: ONLYOFFICE/check-licenses@v1
with:
project_license: ${{ steps.license.outputs.license }}
working_directory: ./web/documentserver-example/go

View File

@ -1,33 +0,0 @@
name: Licenses Java
on:
workflow_dispatch:
push:
branches: [master, develop]
paths: ['web/documentserver-example/java/**']
pull_request:
branches: [master, develop]
paths: ['web/documentserver-example/java/**']
jobs:
licences:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Java 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Get Repository License
id: license
run: |
license="${{ (github.event.repository.license.spdx_id) || (github.event.repository.licenses[0]) }}"
echo "License detected: $license"
echo "license=$license" >> $GITHUB_OUTPUT
- name: Check Licenses
uses: ONLYOFFICE/check-licenses@v1
with:
project_license: ${{ steps.license.outputs.license }}
working_directory: ./web/documentserver-example/java

View File

@ -1,38 +0,0 @@
name: Licenses Nodejs
on:
workflow_dispatch:
push:
branches: [master, develop]
paths: ['web/documentserver-example/nodejs/**']
pull_request:
branches: [master, develop]
paths: ['web/documentserver-example/nodejs/**']
env:
NODE_VERSION: 16
jobs:
licences:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install Dependencies
run: npm install
working-directory: ./web/documentserver-example/nodejs
- name: Get Repository License
id: license
run: |
license="${{ (github.event.repository.license.spdx_id) || (github.event.repository.licenses[0]) }}"
echo "License detected: $license"
echo "license=$license" >> $GITHUB_OUTPUT
- name: Check Licenses
uses: ONLYOFFICE/check-licenses@v1
with:
project_license: ${{ steps.license.outputs.license }}
working_directory: ./web/documentserver-example/nodejs

View File

@ -1,47 +0,0 @@
name: Licenses PHP Laravel
on:
workflow_dispatch:
push:
branches: [master, develop]
paths: ['web/documentserver-example/php-laravel/**']
pull_request:
branches: [master, develop]
paths: ['web/documentserver-example/php-laravel/**']
jobs:
licences:
runs-on: ubuntu-latest
strategy:
matrix:
php: [8.2]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json, dom, curl, libxml, mbstring
coverage: none
- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install Dependensies - Composer
run: composer install
working-directory: ./web/documentserver-example/php-laravel
- name: Install Dependensies - NPM
run: npm install
working-directory: ./web/documentserver-example/php-laravel
- name: Get Repository License
id: license
run: |
license="${{ (github.event.repository.license.spdx_id) || (github.event.repository.licenses[0]) }}"
echo "License detected: $license"
echo "license=$license" >> $GITHUB_OUTPUT
- name: Check Licenses
uses: ONLYOFFICE/check-licenses@v1
with:
project_license: ${{ steps.license.outputs.license }}
working_directory: ./web/documentserver-example/php-laravel

View File

@ -1,36 +0,0 @@
name: Licenses PHP
on:
workflow_dispatch:
push:
branches: [master, develop]
paths: ['web/documentserver-example/php/**']
pull_request:
branches: [master, develop]
paths: ['web/documentserver-example/php/**']
jobs:
licences:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: cs2pr, phpcs
- name: Install Dependensies
run: composer install
working-directory: ./web/documentserver-example/php
- name: Get Repository License
id: license
run: |
license="${{ (github.event.repository.license.spdx_id) || (github.event.repository.licenses[0]) }}"
echo "License detected: $license"
echo "license=$license" >> $GITHUB_OUTPUT
- name: Check Licenses
uses: ONLYOFFICE/check-licenses@v1
with:
project_license: ${{ steps.license.outputs.license }}
working_directory: ./web/documentserver-example/php

View File

@ -1,55 +0,0 @@
name: Licenses Python
on:
workflow_dispatch:
push:
branches: [master, develop]
paths: ['web/documentserver-example/python/**']
pull_request:
branches: [master, develop]
paths: ['web/documentserver-example/python/**']
jobs:
licences:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install PIP
run: |
python -m pip install --upgrade pip==20.3.4
pip install tomli
working-directory: ./web/documentserver-example/python
- name: Generate requirements.txt from pyproject.toml
run: |
python - <<'EOF'
import tomli
with open('pyproject.toml', 'rb') as f:
d = tomli.load(f)
deps = d.get('project', {}).get('dependencies', [])
dev = d.get('project', {}).get('optional-dependencies', {}).get('development', [])
with open('requirements.txt', 'w') as out:
out.write('\n'.join(deps + dev))
print('Generated requirements.txt:')
print('\n'.join(deps + dev))
EOF
working-directory: ./web/documentserver-example/python
- name: Install Dependencies
run: |
pip install -r requirements.txt
working-directory: ./web/documentserver-example/python
- name: Get Repository License
id: license
run: |
license="${{ (github.event.repository.license.spdx_id) || (github.event.repository.licenses[0]) }}"
echo "License detected: $license"
echo "license=$license" >> $GITHUB_OUTPUT
- name: Check Licenses
uses: ONLYOFFICE/check-licenses@v1
with:
project_license: ${{ steps.license.outputs.license }}
working_directory: ./web/documentserver-example/python

View File

@ -1,34 +0,0 @@
name: Licenses Ruby
on:
workflow_dispatch:
push:
branches: [master, develop]
paths: ['web/documentserver-example/ruby/**']
pull_request:
branches: [master, develop]
paths: ['web/documentserver-example/ruby/**']
jobs:
licences:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Bundler globally
run: sudo gem install bundler
- name: Bundle Install globally
run: |
sudo bundle install
working-directory: ./web/documentserver-example/ruby
- name: Get Repository License
id: license
run: |
license="${{ (github.event.repository.license.spdx_id) || (github.event.repository.licenses[0]) }}"
echo "License detected: $license"
echo "license=$license" >> $GITHUB_OUTPUT
- name: Check Licenses
uses: ONLYOFFICE/check-licenses@v1
with:
project_license: ${{ steps.license.outputs.license }}
working_directory: ./web/documentserver-example/ruby

View File

@ -1,38 +0,0 @@
name: Licenses Java Spring
on:
workflow_dispatch:
push:
branches: [master, develop]
paths: ['web/documentserver-example/java-spring/**']
pull_request:
branches: [master, develop]
paths: ['web/documentserver-example/java-spring/**']
jobs:
licences:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Java 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Check Licenses
run: |
rm mvnw
rm mvnw.cmd
working-directory: ./web/documentserver-example/java-spring
- name: Get Repository License
id: license
run: |
license="${{ (github.event.repository.license.spdx_id) || (github.event.repository.licenses[0]) }}"
echo "License detected: $license"
echo "license=$license" >> $GITHUB_OUTPUT
- name: Check Licenses
uses: ONLYOFFICE/check-licenses@v1
with:
project_license: ${{ steps.license.outputs.license }}
working_directory: ./web/documentserver-example/java-spring

View File

@ -1,29 +0,0 @@
name: Golangci
on:
workflow_dispatch:
push:
branches: [master]
paths: ['web/documentserver-example/go/**']
pull_request:
branches: [master, develop]
paths: ['web/documentserver-example/go/**']
jobs:
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./web/documentserver-example/go
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23.10'
- name: Lint Golangci
run: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
golangci-lint run

View File

@ -3,10 +3,10 @@ name: Lint Java
on:
workflow_dispatch:
push:
branches: [master]
branches: [master, main]
paths: ['web/documentserver-example/java/**']
pull_request:
branches: [master, develop]
branches: [master, main, develop]
paths: ['web/documentserver-example/java/**']
jobs:

View File

@ -3,10 +3,10 @@ name: ESLint
on:
workflow_dispatch:
push:
branches: [master]
branches: [master, main]
paths: ['web/documentserver-example/nodejs/**']
pull_request:
branches: [master, develop]
branches: [master, main, develop]
paths: ['web/documentserver-example/nodejs/**']
env:

View File

@ -1,37 +0,0 @@
name: Laravel Pint
on:
workflow_dispatch:
push:
branches: [master]
paths: ['web/documentserver-example/php-laravel/**']
pull_request:
branches: [master, develop]
paths: ['web/documentserver-example/php-laravel/**']
jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [8.2]
defaults:
run:
working-directory: ./web/documentserver-example/php-laravel
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json, dom, curl, libxml, mbstring
coverage: none
- name: Install Pint
run: composer global require laravel/pint
- name: Run Pint
run: pint --test

View File

@ -3,10 +3,10 @@ name: PHPCs
on:
workflow_dispatch:
push:
branches: [master]
branches: [master, main]
paths: ['web/documentserver-example/php/**']
pull_request:
branches: [master, develop]
branches: [master, main, develop]
paths: ['web/documentserver-example/php/**']
jobs:
@ -17,13 +17,13 @@ jobs:
working-directory: ./web/documentserver-example/php
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
php-version: '8.1'
tools: cs2pr, phpcs
- name: Lint
run: phpcs src index.php
- name: Run phpcs
run: phpcs -q --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml --ignore=node_modules,bower_components,vendor ./

View File

@ -3,10 +3,10 @@ name: PyLint
on:
workflow_dispatch:
push:
branches: [master]
branches: [master, main]
paths: ['web/documentserver-example/python/**']
pull_request:
branches: [master, develop]
branches: [master, main, develop]
paths: ['web/documentserver-example/python/**']
jobs:
@ -21,17 +21,20 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: '3.10'
- name: Install Dependencies
run: |
make dev
python -m pip install --upgrade pip
pip install flake8
pip install pylint
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint Flake8
run: |
make lint
# TODO: Configure mypy
# - name: Types mypy
# run: |
# make types
flake8 ./**/*.py --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 ./**/*.py --count --max-complexity=10 --max-line-length=79 --statistics
- name: Lint Pylint
run: |
pylint ./**/*.py

View File

@ -3,10 +3,10 @@ name: Rubocop
on:
workflow_dispatch:
push:
branches: [master]
branches: [master, main]
paths: ['web/documentserver-example/ruby/**']
pull_request:
branches: [master, develop]
branches: [master, main, develop]
paths: ['web/documentserver-example/ruby/**']
jobs:
@ -16,22 +16,16 @@ jobs:
run:
working-directory: ./web/documentserver-example/ruby
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.2'
- name: Update Submodules
run: |
git submodule update --init --recursive
- name: Install Dependencies
run: |
bundle install
- name: Rubocop
run: |
bundle exec rubocop
- name: Checkout Repository
uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
- name: Install dependencies
run: |
bundle install
- name: Rubocop
run: |
gem install rubocop
rubocop

View File

@ -3,10 +3,10 @@ name: Lint Spring
on:
workflow_dispatch:
push:
branches: [master]
branches: [master, main]
paths: ['web/documentserver-example/java-spring/**']
pull_request:
branches: [master, develop]
branches: [master, main, develop]
paths: ['web/documentserver-example/java-spring/**']
jobs:

View File

@ -1,146 +0,0 @@
name: Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Clone Submodules
run: |
cd ${{ github.workspace }}
git submodule update --init --recursive
- name: Get Info
run: |
echo "version=$(grep -Eo '[0-9]+(\.[0-9]+)+' CHANGELOG.md | head -n 1)" >> $GITHUB_OUTPUT
id: info
- name: Generate Changelog
run: |
awk '/## [0-9]/{p++} p; /## [0-9]/{if (p > 1) exit}' CHANGELOG.md | awk 'NR>2 {print last} {last=$0}' > RELEASE.md
- name: Build Csharp MVC Artifact
run: |
cd ${{ github.workspace }}
cd ./web/documentserver-example/csharp-mvc
mkdir -p ./'DotNet (Csharp MVC) Example'
rsync -av --exclude='DotNet (Csharp MVC) Example' ./ ./'DotNet (Csharp MVC) Example'
cd ./'DotNet (Csharp MVC) Example'/assets
rm -rf .git
- name: Build Csharp Artifact
run: |
cd ${{ github.workspace }}
cd ./web/documentserver-example/csharp
mkdir -p ./'DotNet (Csharp) Example'
rsync -av --exclude='DotNet (Csharp) Example' ./ ./'DotNet (Csharp) Example'
rm -rf ./'DotNet (Csharp) Example'/assets/.git
- name: Build Java Artifact
run: |
cd ${{ github.workspace }}
cd ./web/documentserver-example/java
mkdir -p ./'Java Example'
rsync -av --exclude='Java Example' ./ ./'Java Example'
rm -rf ./'Java Example'/src/main/resources/assets/document-formats/.git
rm -rf ./'Java Example'/src/main/resources/assets/document-templates/.git
- name: Build Nodejs Artifact
run: |
cd ${{ github.workspace }}
cd ./web/documentserver-example/nodejs
mkdir -p ./'Node.js Example'
rsync -av --exclude='Node.js Example' ./ ./'Node.js Example'
rm -rf ./'Node.js Example'/public/assets/document-formats/.git
rm -rf ./'Node.js Example'/public/assets/document-templates/.git
- name: Build PHP Artifact
run: |
cd ${{ github.workspace }}
cd ./web/documentserver-example/php
mkdir -p ./'PHP Example'
rsync -av --exclude='PHP Example' ./ ./'PHP Example'
rm -rf ./'PHP Example'/assets/document-formats/.git
rm -rf ./'PHP Example'/assets/document-templates/.git
- name: Build PHP Laravel Artifact
run: |
cd ${{ github.workspace }}
cd ./web/documentserver-example/php-laravel
mkdir -p ./'PHP Laravel Example'
rsync -av --exclude='PHP Laravel Example' ./ ./'PHP Laravel Example'
rm -rf ./'PHP Laravel Example'/public/assets/document-formats/.git
rm -rf ./'PHP Laravel Example'/public/assets/document-templates/.git
- name: Build Python Artifact
run: |
cd ${{ github.workspace }}
cd ./web/documentserver-example/python
mkdir -p ./'Python Example'
rsync -av --exclude='Python Example' ./ ./'Python Example'
rm -rf ./'Python Example'/assets/document-formats/.git
rm -rf ./'Python Example'/assets/document-templates/.git
- name: Build Ruby Artifact
run: |
cd ${{ github.workspace }}
cd ./web/documentserver-example/ruby
mkdir -p ./'Ruby Example'
rsync -av --exclude='Ruby Example' ./ ./'Ruby Example'
rm -rf ./'Ruby Example'/public/assets/document-formats/.git
rm -rf ./'Ruby Example'/public/assets/document-templates/.git
- name: Build Spring Artifact
run: |
cd ${{ github.workspace }}
cd ./web/documentserver-example/java-spring
mkdir -p ./'Java Spring Example'
rsync -av --exclude='Java Spring Example' ./ ./'Java Spring Example'
rm -rf ./'Java Spring Example'/src/main/resources/assets/document-formats/.git
rm -rf ./'Java Spring Example'/src/main/resources/assets/document-templates/.git
- name: Build Go Artifact
run: |
cd ${{ github.workspace }}
cd ./web/documentserver-example/go
mkdir -p .'Go Example'
rsync -av --exclude='Go Example' ./ ./'Go Example'
rm -rf ./'Go Example'/static/assets/document-formats/.git
rm -rf ./'Go Example'/static/assets/document-templates/.git
- name: Pack Artifacts
run: |
cd ${{ github.workspace }}/web/documentserver-example/csharp-mvc
zip -r DotNet.Csharp.MVC.Example.zip ./'DotNet (Csharp MVC) Example'
cd ${{ github.workspace }}/web/documentserver-example/csharp
zip -r DotNet.Csharp.Example.zip ./'DotNet (Csharp) Example'
cd ${{ github.workspace }}/web/documentserver-example/java
zip -r Java.Example.zip ./'Java Example'
cd ${{ github.workspace }}/web/documentserver-example/nodejs
zip -r Node.js.Example.zip ./'Node.js Example'
cd ${{ github.workspace }}/web/documentserver-example/php
zip -r PHP.Example.zip ./'PHP Example'
cd ${{ github.workspace }}/web/documentserver-example/php-laravel
zip -r PHP.Laravel.Example.zip ./'PHP Laravel Example'
cd ${{ github.workspace }}/web/documentserver-example/python
zip -r Python.Example.zip ./'Python Example'
cd ${{ github.workspace }}/web/documentserver-example/ruby
zip -r Ruby.Example.zip ./'Ruby Example'
cd ${{ github.workspace }}/web/documentserver-example/java-spring
zip -r Java.Spring.Example.zip ./'Java Spring Example'
cd ${{ github.workspace }}/web/documentserver-example/go
zip -r Go.Example.zip ./'Go Example'
- name: Create Release
uses: ncipollo/release-action@v1
id: create_release
with:
bodyFile: RELEASE.md
artifacts: "
${{ github.workspace }}/web/documentserver-example/csharp-mvc/DotNet.Csharp.MVC.Example.zip,
${{ github.workspace }}/web/documentserver-example/csharp/DotNet.Csharp.Example.zip,
${{ github.workspace }}/web/documentserver-example/java/Java.Example.zip,
${{ github.workspace }}/web/documentserver-example/nodejs/Node.js.Example.zip,
${{ github.workspace }}/web/documentserver-example/php/PHP.Example.zip,
${{ github.workspace }}/web/documentserver-example/php-laravel/PHP.Laravel.Example.zip,
${{ github.workspace }}/web/documentserver-example/python/Python.Example.zip,
${{ github.workspace }}/web/documentserver-example/ruby/Ruby.Example.zip,
${{ github.workspace }}/web/documentserver-example/java-spring/Java.Spring.Example.zip,
${{ github.workspace }}/web/documentserver-example/go/Go.Example.zip
"
tag: v${{ steps.info.outputs.version }}

11
.gitignore vendored
View File

@ -11,14 +11,9 @@
**/.vscode/
**/.vs/
**/.idea
.classpath
.project
.settings/
*.iml
*.iws
.DS_Store
/web/documentserver-example/java/target/
/web/documentserver-example/java-spring/target/
/web/documentserver-example/csharp/packages
/web/documentserver-example/csharp-mvc/packages
/web/documentserver-example/java-spring/documents/
/web/documentserver-example/csharp-mvc-react/packages
/web/documentserver-example/csharp-mvc-react/Scripts/React/node_modules
/web/documentserver-example/csharp-mvc-react/Scripts/React/dist

82
.gitmodules vendored
View File

@ -1,64 +1,36 @@
[submodule "web/documentserver-example/nodejs/public/assets/document-templates"]
path = web/documentserver-example/nodejs/public/assets/document-templates
[submodule "web/documentserver-example/nodejs/public/assets"]
path = web/documentserver-example/nodejs/public/assets
url = https://github.com/ONLYOFFICE/document-templates
branch = main/default
[submodule "web/documentserver-example/nodejs/public/assets/document-formats"]
path = web/documentserver-example/nodejs/public/assets/document-formats
url = https://github.com/ONLYOFFICE/document-formats
[submodule "web/documentserver-example/csharp-mvc/assets/document-templates"]
path = web/documentserver-example/csharp-mvc/assets/document-templates
branch = main/en
[submodule "web/documentserver-example/java/src/main/resources/assets"]
path = web/documentserver-example/java/src/main/resources/assets
url = https://github.com/ONLYOFFICE/document-templates
branch = main/default
[submodule "web/documentserver-example/csharp-mvc/assets/document-formats"]
path = web/documentserver-example/csharp-mvc/assets/document-formats
url = https://github.com/ONLYOFFICE/document-formats
[submodule "web/documentserver-example/php/assets/document-templates"]
path = web/documentserver-example/php/assets/document-templates
branch = main/en
[submodule "web/documentserver-example/php/assets"]
path = web/documentserver-example/php/assets
url = https://github.com/ONLYOFFICE/document-templates
branch = main/default
[submodule "web/documentserver-example/php/assets/document-formats"]
path = web/documentserver-example/php/assets/document-formats
url = https://github.com/ONLYOFFICE/document-formats
[submodule "web/documentserver-example/python/assets/document-templates"]
path = web/documentserver-example/python/assets/document-templates
branch = main/en
[submodule "web/documentserver-example/python/assets"]
path = web/documentserver-example/python/assets
url = https://github.com/ONLYOFFICE/document-templates
branch = main/default
[submodule "web/documentserver-example/java/src/main/resources/assets/document-templates"]
path = web/documentserver-example/java/src/main/resources/assets/document-templates
branch = main/en
[submodule "web/documentserver-example/csharp-mvc/assets"]
path = web/documentserver-example/csharp-mvc/assets
url = https://github.com/ONLYOFFICE/document-templates
branch = main/default
[submodule "web/documentserver-example/ruby/assets/document-templates"]
path = web/documentserver-example/ruby/assets/document-templates
branch = main/en
[submodule "web/documentserver-example/csharp/assets"]
path = web/documentserver-example/csharp/assets
url = https://github.com/ONLYOFFICE/document-templates
branch = main/default
[submodule "web/documentserver-example/java-spring/src/main/resources/assets/document-templates"]
path = web/documentserver-example/java-spring/src/main/resources/assets/document-templates
branch = main/en
[submodule "web/documentserver-example/ruby/public/assets"]
path = web/documentserver-example/ruby/public/assets
url = https://github.com/ONLYOFFICE/document-templates
branch = main/default
[submodule "web/documentserver-example/go/static/assets/document-templates"]
path = web/documentserver-example/go/static/assets/document-templates
branch = main/en
[submodule "web/documentserver-example/java-spring/src/main/resources/assets"]
path = web/documentserver-example/java-spring/src/main/resources/assets
url = https://github.com/ONLYOFFICE/document-templates
branch = main/default
[submodule "web/documentserver-example/go/static/assets/document-formats"]
path = web/documentserver-example/go/static/assets/document-formats
url = https://github.com/ONLYOFFICE/document-formats
[submodule "web/documentserver-example/python/assets/document-formats"]
path = web/documentserver-example/python/assets/document-formats
url = https://github.com/ONLYOFFICE/document-formats
[submodule "web/documentserver-example/ruby/assets/document-formats"]
path = web/documentserver-example/ruby/assets/document-formats
url = https://github.com/ONLYOFFICE/document-formats
[submodule "web/documentserver-example/java/src/main/resources/assets/document-formats"]
path = web/documentserver-example/java/src/main/resources/assets/document-formats
url = https://github.com/ONLYOFFICE/document-formats
[submodule "web/documentserver-example/csharp/assets/document-templates"]
path = web/documentserver-example/csharp/assets/document-templates
branch = main/en
[submodule "web/documentserver-example/csharp-mvc-react/assets"]
path = web/documentserver-example/csharp-mvc-react/assets
url = https://github.com/ONLYOFFICE/document-templates
branch = main/default
[submodule "web/documentserver-example/csharp/assets/document-formats"]
path = web/documentserver-example/csharp/assets/document-formats
url = https://github.com/ONLYOFFICE/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/ONLYOFFICE/document-templates
branch = main/default
branch = main/en

326
3rd-Party.license Normal file
View File

@ -0,0 +1,326 @@
Document Server integration example uses code from the following 3rd party projects.
web/documentserver-example/csharp
jQuery - jQuery is a new kind of JavaScript Library. jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. NOTE: This package is maintained on behalf of the library owners by the NuGet Community Packages project at https://nugetpackages.codeplex.com/ (https://jquery.org/license/)
License: MIT
License File: jQuery.license
jQuery.BlockUI - The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser. (https://github.com/malsup/blockui/)
License: MIT, GPL
License File: jQuery.BlockUI.license
jQuery.FileUpload - File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads. (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.FileUpload.license
jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.iframe-transport.license
jQuery.UI - jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according to jQuery's event-driven architecture (find something, manipulate it) and is themeable, making it easy for developers of any skill level to integrate and extend into their own code. (https://jquery.org/license/)
License: MIT
License File: jQuery.UI.license
web/documentserver-example/csharp-mvc
Entity Framework - Entity Framework is an object-relational mapper that enables .NET developers to work with relational data using domain-specific objects. (https://docs.microsoft.com/en-us/ef/ef6/resources/licenses/ef5/enu)
License: MICROSOFT SOFTWARE SUPPLEMENTAL TERMS, MICROSOFT SOFTWARE LICENSE TERMS
License File: EntityFramework.license
jQuery - jQuery is a new kind of JavaScript Library. jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. NOTE: This package is maintained on behalf of the library owners by the NuGet Community Packages project at https://nugetpackages.codeplex.com/ (https://jquery.org/license/)
License: MIT
License File: jQuery.license
jQuery.BlockUI - The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser. (https://github.com/malsup/blockui/)
License: MIT, GPL
License File: jQuery.BlockUI.license
jQuery.FileUpload - File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads. (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.FileUpload.license
jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.iframe-transport.license
jQuery.UI - jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according to jQuery's event-driven architecture (find something, manipulate it) and is themeable, making it easy for developers of any skill level to integrate and extend into their own code. (https://jquery.org/license/)
License: MIT
License File: jQuery.UI.license
Microsoft.Web.Infrastructure - This package contains the Microsoft.Web.Infrastructure assembly that lets you dynamically register HTTP modules at run time. (https://www.microsoft.com/web/webpi/eula/aspnetmvc3update-eula.htm)
License: MS-EULA License
License File: Microsoft.Web.Infrastructure.license
Newtonsoft.Json - Json.NET is a popular high-performance JSON framework for .NET (https://licenses.nuget.org/MIT)
License: MIT
License File: Newtonsoft.Json.license
WebGrease - Web Grease is a suite of tools for optimizing javascript, css files and images. (https://www.microsoft.com/web/webpi/eula/aspnetcomponent_rtw_ENU.htm)
License: MICROSOFT .NET LIBRARY LICENSE
License File: WebGrease.license
web/documentserver-example/java
jQuery - jQuery is a new kind of JavaScript Library. jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. NOTE: This package is maintained on behalf of the library owners by the NuGet Community Packages project at https://nugetpackages.codeplex.com/ (https://jquery.org/license/)
License: MIT
License File: jQuery.license
jQuery.BlockUI - The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser. (https://github.com/malsup/blockui/)
License: MIT, GPL
License File: jQuery.BlockUI.license
jQuery.FileUpload - File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads. (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.FileUpload.license
jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.iframe-transport.license
jQuery.UI - jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according to jQuery's event-driven architecture (find something, manipulate it) and is themeable, making it easy for developers of any skill level to integrate and extend into their own code. (https://jquery.org/license/)
License: MIT
License File: jQuery.UI.license
Prime JWT - is intended to be fast and easy to use. Prime JWT has a single external dependency on Jackson. (https://github.com/ws-apps/prime-jwt/blob/master/LICENSE)
License: Apache 2.0
License File: prime-jwt.license
web/documentserver-example/java-spring
jQuery - jQuery is a new kind of JavaScript Library. jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. NOTE: This package is maintained on behalf of the library owners by the NuGet Community Packages project at https://nugetpackages.codeplex.com/ (https://jquery.org/license/)
License: MIT
License File: jQuery.license
jQuery.BlockUI - The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser. (https://github.com/malsup/blockui/)
License: MIT, GPL
License File: jQuery.BlockUI.license
jQuery.FileUpload - File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads. (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.FileUpload.license
jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.iframe-transport.license
jQuery.UI - jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according to jQuery's event-driven architecture (find something, manipulate it) and is themeable, making it easy for developers of any skill level to integrate and extend into their own code. (https://jquery.org/license/)
License: MIT
License File: jQuery.UI.license
Prime JWT - is intended to be fast and easy to use. Prime JWT has a single external dependency on Jackson. (https://github.com/ws-apps/prime-jwt/blob/master/LICENSE)
License: Apache 2.0
License File: prime-jwt.license
Spring Boot - Helps create Spring-powered, production-grade applications and services. Has external dependencies on Spring Framework. (https://github.com/spring-projects/spring-boot/blob/main/LICENSE.txt)
License: Apache 2.0
License File: spring-boot.license
Spring Boot Devtools - Provides fast application restarts, LiveReload, and configurations for enhanced development experience. (https://github.com/spring-projects/spring-boot/blob/main/LICENSE.txt)
License: Apache 2.0
License File: spring-boot.license
Spring Boot Starter Thymeleaf - A modern server-side Java template engine for both web and standalone environments. (https://github.com/spring-projects/spring-boot/blob/main/LICENSE.txt)
License: Apache 2.0
License File: spring-boot.license
Spring Data JPA - Persist data in SQL stores with Java Persistence API using Spring Data and Hibernate. (https://github.com/spring-projects/spring-data-jpa/blob/main/LICENSE.txt)
License: Apache 2.0
License File: spring-data-jpa.license
H2 Database Engine - This software contains unmodified binary redistributions for H2 database engine. H2 is a relational DBMS that can be embedded in java applications. (https://h2database.com/html/license.html)
License: MPL 2.0 or EPL 1.0
License File: h2database.license
JSON.simple - JSON.simple is a simple Java toolkit for JSON. You can use JSON.simple to encode or decode JSON text. (https://github.com/fangyidong/json-simple/blob/master/LICENSE.txt)
License: Apache 2.0
License File: JSON.simple.license
Gson - Gson is a Java library that can be used to convert Java Objects into their JSON representation. (https://github.com/google/gson/blob/master/LICENSE)
License: Apache 2.0
License File: gson.license
Jackson Databind - General-purpose data-binding functionality and tree-model for Jackson Data Processor. (https://github.com/FasterXML/jackson-databind/blob/master/LICENSE)
License: Apache 2.0
License File: jackson-databind.license
web/documentserver-example/nodejs
body-parser - Node.js body parsing middleware. (https://github.com/expressjs/body-parser/blob/master/LICENSE)
License: MIT
License File: body-parser.license
config - Node-config organizes hierarchical configurations for your app deployments. (https://github.com/lorenwest/node-config/blob/master/LICENSE)
License: MIT
License File: config.license
debug - A tiny JavaScript debugging utility modelled after Node.js core's debugging technique. (https://github.com/visionmedia/debug/blob/master/LICENSE)
License: MIT
License File: debug.license
ejs - Embedded JavaScript templates (https://github.com/mde/ejs/blob/main/LICENSE)
License: Apache 2.0
License File: ejs.license
express - Fast, unopinionated, minimalist web framework for node. (https://github.com/mde/ejs/blob/main/LICENSE)
License: MIT
License File: express.license
fast-xml-parser - Validate XML, Parse XML to JS/JSON and vice versa, or parse XML to Nimn rapidly without C/C++ based libraries and no callback. (https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/LICENSE)
License: MIT
License File: fast-xml-parser.license
formidable - A Node.js module for parsing form data, especially file uploads. (https://github.com/node-formidable/formidable/blob/master/LICENSE)
License: MIT
License File: formidable.license
he - a robust HTML entity encoder/decoder written in JavaScript. (https://github.com/mathiasbynens/he/blob/master/LICENSE-MIT.txt)
License: MIT
License File: he.license
jQuery - jQuery is a new kind of JavaScript Library. jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. NOTE: This package is maintained on behalf of the library owners by the NuGet Community Packages project at https://nugetpackages.codeplex.com/ (https://jquery.org/license/)
License: MIT
License File: jQuery.license
jQuery.BlockUI - The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser. (https://github.com/malsup/blockui/)
License: MIT, GPL
License File: jQuery.BlockUI.license
jQuery.FileUpload - File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads. (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.FileUpload.license
jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.iframe-transport.license
jQuery.UI - jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according to jQuery's event-driven architecture (find something, manipulate it) and is themeable, making it easy for developers of any skill level to integrate and extend into their own code. (https://jquery.org/license/)
License: MIT
License File: jQuery.UI.license
jsonwebtoken - An implementation of JSON Web Tokens. (https://github.com/auth0/node-jsonwebtoken/blob/master/LICENSE)
License: MIT
License File: jsonwebtoken.license
jwa - A JSON Web Algorithms implementation focusing (exclusively, at this point) on the algorithms necessary for JSON Web Signatures. (https://github.com/auth0/node-jwa/blob/master/LICENSE)
License: MIT
License File: jwa.license
log4js - This is a conversion of the log4js framework to work with node. (https://github.com/log4js-node/log4js-node/blob/master/LICENSE)
License: MIT
License File: log4js.license
mime - A comprehensive, compact MIME type module. (https://github.com/broofa/mime/blob/master/LICENSE)
License: MIT
License File: mime.license
serve-favicon - Node.js middleware for serving a favicon. (https://github.com/expressjs/serve-favicon/blob/master/LICENSE)
License: MIT
License File: serve-favicon.license
urllib - Request HTTP URLs in a complex world — basic and digest authentication, redirections, cookies, timeout and more. (https://github.com/node-modules/urllib/blob/master/LICENSE)
License: MIT
License File: urllib.license
web/documentserver-example/php
jQuery - jQuery is a new kind of JavaScript Library. jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. NOTE: This package is maintained on behalf of the library owners by the NuGet Community Packages project at https://nugetpackages.codeplex.com/ (https://jquery.org/license/)
License: MIT
License File: jQuery.license
jQuery.BlockUI - The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser. (https://github.com/malsup/blockui/)
License: MIT, GPL
License File: jQuery.BlockUI.license
jQuery.FileUpload - File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads. (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.FileUpload.license
jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.iframe-transport.license
jQuery.UI - jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according to jQuery's event-driven architecture (find something, manipulate it) and is themeable, making it easy for developers of any skill level to integrate and extend into their own code. (https://jquery.org/license/)
License: MIT
License File: jQuery.UI.license
web/documentserver-example/ruby
byebug - Byebug is a Ruby debugger. (https://github.com/deivid-rodriguez/byebug/blob/master/LICENSE)
License: BSD-2-Clause
License File: byebug.license
coffee-rails - CoffeeScript adapter for the Rails asset pipeline. (https://github.com/rails/coffee-rails/blob/master/MIT-LICENSE)
License: MIT
License File: coffee-rails.license
jbuilder - Create JSON structures via a Builder-style DSL (https://github.com/rails/jbuilder/blob/master/MIT-LICENSE)
License: MIT
License File: jbuilder.license
jQuery - jQuery is a new kind of JavaScript Library. jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. NOTE: This package is maintained on behalf of the library owners by the NuGet Community Packages project at https://nugetpackages.codeplex.com/ (https://jquery.org/license/)
License: MIT
License File: jQuery.license
jQuery.BlockUI - The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser. (https://github.com/malsup/blockui/)
License: MIT, GPL
License File: jQuery.BlockUI.license
jQuery.FileUpload - File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads. (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.FileUpload.license
jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.iframe-transport.license
jQuery.UI - jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according to jQuery's event-driven architecture (find something, manipulate it) and is themeable, making it easy for developers of any skill level to integrate and extend into their own code. (https://jquery.org/license/)
License: MIT
License File: jQuery.UI.license
jquery-rails - This gem provides jQuery and the jQuery-ujs driver for your Rails 4+ application. (https://github.com/rails/jquery-rails/blob/master/MIT-LICENSE)
License: MIT
License File: jquery-rails.license
rails - Rails is a web-application framework that includes everything needed to create database-backed web applications according to the Model-View-Controller (MVC) pattern. (https://github.com/rails/rails/blob/v6.0.3.2/MIT-LICENSE)
License: MIT
License File: rails.license
sass-rails - This gem provides official integration for Ruby on Rails projects with the Sass stylesheet language. (https://github.com/rails/sass-rails/blob/master/MIT-LICENSE)
License: MIT
License File: sass-rails.license
sdoc - rdoc generator html with javascript search index. (https://github.com/zzak/sdoc/blob/master/LICENSE)
License: MIT
License File: sdoc.license
sqlite3 - This module allows Ruby programs to interface with the SQLite3 database engine (www.sqlite.org). (https://github.com/sparklemotion/sqlite3-ruby/blob/master/LICENSE)
License: BSD-3-Clause
License File: sqlite3.license
turbolinks - Rails engine for Turbolinks 5 support (https://github.com/turbolinks/turbolinks-rails/blob/master/LICENSE)
License: MIT
License File: turbolinks.license
tzinfo-data - TZInfo::Data contains data from the IANA Time Zone database packaged as Ruby modules for use with TZInfo. (https://github.com/tzinfo/tzinfo-data/blob/master/LICENSE)
License: MIT
License File: tzinfo-data.license
uglifier - Uglifier minifies JavaScript files by wrapping UglifyJS to be accessible in Ruby (https://github.com/lautis/uglifier/blob/master/LICENSE.txt)
License: MIT
License File: uglifier.license
uuid - UUID generator for producing universally unique identifiers based on RFC 4122 (https://github.com/assaf/uuid/blob/master/MIT-LICENSE)
License: MIT
License File: uuid.license
web-console - A debugging tool for your Ruby on Rails applications. (https://github.com/rails/web-console/blob/master/MIT-LICENSE)
License: MIT
License File: web-console.license

View File

@ -1,172 +1,6 @@
# Change Log
- nodejs: wopi CopyPasteRestrictions for anonymous
- update insertImage formats
- new mobile index page view
- update action icons
- php-laravel: 5 editor icons on index page
- java-spring: 5 editor icons on index page
- ruby: display mode buttons by actions
- python: display mode buttons by actions
- php: display mode buttons by actions
- java: display mode buttons by actions
- go: display mode buttons by actions
- csharp-mvc: display mode buttons by actions
- csharp: display mode buttons by actions
- nodejs: display mode buttons by actions
- nodejs: wopi UserCanOnlyComment
## 1.15.0
- php-laravel: fix custom jwt header
- formats for ds v9.1
- user role
- start filling
- update demo files
- set users by parts
- open the conversion dialog box with a gray check mark on the type selection step
- preload frame moved from uploading popup
- change tab title on rename
- change uploaded file name in popup if converted
- features tips for anonymous
- view odg, md
- edit xlsb
- support vsdx in diagram editor
## 1.14.1
- nodejs: formats for ds v9.1
## 1.14.0
- nodejs: set users by parts
- nodejs: preload frame moved from uploading popup
- nodejs: view odg, md
- nodejs: edit xlsb
- nodejs: support vsdx in diagram editor
- nodejs: fix wopi verification
- nodejs: user role
- nodejs: start filling
- ur skin language
- change preload.html address
## 1.13.0
- nodejs: rename in wopi
- nodejs: using faviconUrl from WOPI discovery
- nodejs: wopi proof key verification
- golang: new integration example
- golang: upload files to the server
- golang: create blank files and files with sample content
- golang: edit uploaded files in onlyoffice editor
- golang: delete files on the server
- golang: show files history
- php-laravel: new integration example
- php-laravel: upload files to the server
- php-laravel: create blank files and files with sample content
- php-laravel: edit uploaded files in onlyoffice editor
- php-laravel: delete files on the server
- php-laravel: create, edit, and submit pdf forms
- php-laravel: show forgotten files on a seperate page
- php-laravel: fetch files
- php-laravel: integrate sdk
- jwt token lifetime from config
- onUserActionRequired
- support pages, numbers, key formats
- support hwp, hwpx formats
- restore by url
- refresh config
- on uploading xml convert to supported type only
- converting function on index page
- editing by default
- change reference source
- filename in editor page title
- close editor
## 1.12.0
- nodejs: refresh config
- nodejs: support pages, numbers, key formats
- nodejs: support hwp, hwpx formats
- sq-AL skin language
## 1.11.0
- he-IL skin language
- ConvertService.ashx address replaced with converter
- coauthoring/CommandService.ashx address replaced with command
- without submitForm in viewer
## 1.10.0
- nodejs: converting function on index page
- java-spring: using java docs-integration-sdk
- tabs menu
- creating and editing pdf instead docxf
- filling by default
- forgotten files
- delete all files
- save as for pdf
- handling conversion -9 error
- change inserted image
- different goback for users
## 1.9.0
- nodejs: filling by default
- nodejs: docxf, oform as pdf documentType
- nodejs: creating and editing pdf instead docxf
- nodejs: wopi formsubmit icon
- nodejs: close editor
- en-GB, sr-Cyrl-RS skin languages
- switching from filling to editing
- fill permission in embedded mode
## 1.8.0
- nodejs: pdf, djvu, xps, oxps as pdf documentType
- nodejs: filling pdf
- version number to page meta
- ar, sr-Latn-RS skin languages
- getting history via api
- using a repo with a list of formats
- convert after uploading only tagged formats
- link in referenceData
- setUsers for region protection
- onRequestOpen method
- user avatar
- trimming long name of uploading file
- onRequestSelectDocument method
- onRequestSelectSpreadsheet method
- key in referenceData
- restore from history
## 1.7.0
- nodejs: onRequestSelectDocument method
- nodejs: onRequestSelectSpreadsheet method
- nodejs: onRequestOpen
- nodejs: submitForm
- nodejs: key in referenceData
- nodejs: change reference source
- nodejs: using a repo with a list of formats
- nodejs: delete file without reloading the page
- nodejs: getting history by a separate request
- nodejs: restore from history
- php: using a repo with a list of formats
- php: restore from history
- python: restore from history
- ruby: restore from history
- csharp-mvc: getting history by a separate request
- csharp-mvc: restore from history
- csharp: getting history by a separate request
- csharp: restore from history
## 1.6.0
- nodejs: setUsers for region protection
- si skin languages
- fix "no" skin languages
- anonymous can't change viewer to edit
- referenceData
- anonymous can't protect file
- separate setting for checking the token in requests
- php: linter refactoring
- horizontal scroll fix for Internet Explorer
- save file with extension from response after conversation
- conversation to ooxml
## 1.5.1
- update jquery
- added csharp mvc with react
## 1.5.0
- nodejs: added wopi putRelativeFile action

View File

@ -1,25 +1,71 @@
## Integration examples
These test examples are simple document management systems that can be built into your application for testing.
Test examples are simple document management systems that can be built into your application for testing.
Do NOT use these integration examples on your own server without proper code modifications!
In case you enabled any of the test examples, disable it before going for production.
These examples show the way to integrate [ONLYOFFICE Docs][2] into your own website or application using one of the programming languages.
The package contains examples written in .Net (C# MVC), .Net (C#), Go, Java, Java Spring, Node.js, PHP, PHP (Laravel), Python and Ruby.
The package contains examples written in .Net (C# MVC), .Net (C#), Java, Node.js, PHP and Ruby.
You should change `http://documentserver` to your server address in these files:
* [.Net (C# MVC)](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/csharp-mvc) - `web/documentserver-example/csharp-mvc/web.appsettings.config`
* [.Net (C#)](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/csharp) - `web/documentserver-example/csharp/settings.config`
* [Go](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/go) - `web\documentserver-example\go\config\configuration.json`
* [Java](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/java) - `web/documentserver-example/java/src/main/resources/settings.properties`
* [Java Spring](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/java-spring) - `web/documentserver-example/java-spring/src/main/resources/application.properties`
* [Node.js](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/nodejs) - `web/documentserver-example/nodejs/config/default.json`
* [PHP](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/php) - `web/documentserver-example/php/src/configuration/ConfigurationManager.php`
* [PHP (Laravel)](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/php-laravel) - `web/documentserver-example/php-laravel/.env.example`
* [Python](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/python) - `web/documentserver-example/python/src/configuration/configuration.py`
* [Ruby](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/ruby) - `web/documentserver-example/ruby/app/configuration/configuration.rb`
* [PHP](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/php) - `web/documentserver-example/php/config.php`
* [Ruby](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/ruby) - `web/documentserver-example/ruby/config/application.rb`
More information on how to use these examples can be found here: [https://api.onlyoffice.com/docs/docs-api/samples/language-specific-examples/](https://api.onlyoffice.com/docs/docs-api/samples/language-specific-examples/)
More information on how to use these examples can be found here: [http://api.onlyoffice.com/editors/demopreview](http://api.onlyoffice.com/editors/demopreview "http://api.onlyoffice.com/editors/demopreview")
## API methods for test examples
The methods described below are available for all of the test examples.
### POST `/upload`
| | |
| ---------------------- | ------------------------------------------------------------ |
| **Summary** | Upload file to test example via request |
| **URL** | /upload |
| **Method** | POST |
| **Request<br>Headers** | `Content-Type: multipart/form-data` |
| **Request<br>Body** | `uploadedFile=@<filepath>`<br> `filepath` - file for uploading<br />Multipart body with the file binary contents |
| **Response** | **Code:** 200 OK <br />**Content on success:**<br /> `{ "filename": <filename>}`<br />**Content on error:**<br /> `{ "error": "Uploaded file not found" }` <br /> Or <br /> `{ "error": "File size is incorrect" }` |
| **Sample** | `curl -X POST -F uploadedFile=@filename.docx http://localhost/upload` |
### DELETE `/file`
| | |
| ------------------ | ------------------------------------------------------------ |
| **Summary** | Delete one file or all files |
| **URL** | /file |
| **Method** | DELETE |
| ****URL Params**** | **Optional:**<br /> `filename=[string]` - file for deleting. <br /> *WARNING! Without this parameter, all files will be deleted* |
| **Response** | **Code:** 200 OK <br /> **Success:**<br /> `{ "success": true }` |
| **Sample** | **Delete one file:**<br />`curl -X DELETE http://localhost/file?filename=filename.docx`<br />**Delete all files:**<br />`curl -X DELETE http://localhost/file`<br /> |
### GET `/files`
| | |
| ------------------ | ------------------------------------------------------------ |
| **Summary** | Get information about all files |
| **URL** | /files |
| **Method** | GET |
| **Response** | **Code:** 200 OK <br /> **Success:**<br /> `[{ "version": <file_version>, "id": <file_id>, "contentLength": <file_size_in_kilobytes>, "pureContentLength": <file_size_in_bytes>, "title": <file_name>, "updated": <last_change_date>}, ..., {...}]` |
| **Sample** | `curl -X GET http://localhost/files/` |
### GET `/files/file/{fileId}`
| | |
| ------------------ | ------------------------------------------------------------ |
| **Summary** | Get information about a file by file id |
| **URL** | /files/file/{fileId} |
| **Method** | GET |
| **Response** | **Code:** 200 OK <br />**Content on success:**<br /> `[{ "version": <file_version>, "id": <file_id>, "contentLength": <file_size_in_kilobytes>, "pureContentLength": <file_size_in_bytes>, "title": <file_name>, "updated": <last_change_date>}]`<br />**Content on error:**<br /> `"File not found"` |
| **Sample** | `curl -X GET http://localhost/files/{fileId}` |
## Important security info

View File

@ -6,11 +6,13 @@
<RootDir Condition="$(RootDir)==''">..\..\</RootDir>
<DirCSharp>$(RootDir)web\documentserver-example\csharp\</DirCSharp>
<DirMvc>$(RootDir)web\documentserver-example\csharp-mvc\</DirMvc>
<DirMvcReact>$(RootDir)web\documentserver-example\csharp-mvc-react\</DirMvcReact>
</PropertyGroup>
<ItemGroup>
<ProjectToBuild Include="$(DirCSharp)OnlineEditorsExample.sln"/>
<ProjectToBuild Include="$(DirMvc)OnlineEditorsExampleMVC.sln"/>
<ProjectToBuild Include="$(DirMvcReact)OnlineEditorsExampleMVCreact.sln"/>
</ItemGroup>
<Target Name="Build">

View File

@ -8,6 +8,8 @@
<DirCSharp>$(RootDir)web\documentserver-example\csharp\</DirCSharp>
<NameMvc>$(To)DotNet (Csharp MVC) Example</NameMvc>
<DirMvc>$(RootDir)web\documentserver-example\csharp-mvc\</DirMvc>
<NameMvcReact>$(To)DotNet (Csharp MVC react) Example</NameMvcReact>
<DirMvcReact>$(RootDir)web\documentserver-example\csharp-mvc-react\</DirMvcReact>
<NameJava>$(To)Java Example</NameJava>
<DirJava>$(RootDir)web\documentserver-example\java\</DirJava>
<NameSpring>$(To)Java Spring Example</NameSpring>
@ -26,17 +28,23 @@
<RemoveDir Directories="$(To)" ContinueOnError="true" />
<ItemGroup>
<ZipFilesCSharp Include="$(DirCSharp)**" Exclude="$(DirCSharp).vs\**;$(DirCSharp)bin\*.pdb;$(DirCSharp)bin\*.xml;$(DirCSharp)obj\**;$(DirCSharp)packages\**;$(DirCSharp)**\.git" />
<ZipFilesCSharp Include="$(DirCSharp)**" Exclude="$(DirCSharp)obj\**;$(DirCSharp)**\.git" />
</ItemGroup>
<Copy SourceFiles="@(ZipFilesCSharp)" DestinationFiles="@(ZipFilesCSharp->'$(NameCSharp)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Zip Files="$(NameCSharp)" WorkingDirectory="$(To)" ZipFileName="$(NameCSharp).zip" />
<ItemGroup>
<ZipFilesMVC Include="$(DirMvc)**" Exclude="$(DirMvc).vs\**;$(DirMvc)bin\*.pdb;$(DirMvc)bin\*.xml;$(DirMvc)obj\**;$(DirMvc)packages\**;$(DirMvc)**\.git" />
<ZipFilesMVC Include="$(DirMvc)**" Exclude="$(DirMvc)obj\**;$(DirMvc)**\.git" />
</ItemGroup>
<Copy SourceFiles="@(ZipFilesMVC)" DestinationFiles="@(ZipFilesMVC->'$(NameMvc)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Zip Files="$(NameMvc)" WorkingDirectory="$(To)" ZipFileName="$(NameMvc).zip" />
<ItemGroup>
<ZipFilesMVCreact Include="$(DirMvcReact)**" Exclude="$(DirMvcReact).vs\**;$(DirMvcReact)bin\*.pdb;$(DirMvcReact)bin\*.xml;$(DirMvcReact)obj\**;$(DirMvcReact)packages\**;$(DirMvcReact)**\.git;$(DirMvcReact)Scripts\React\node_modules\**" />
</ItemGroup>
<Copy SourceFiles="@(ZipFilesMVCreact)" DestinationFiles="@(ZipFilesMVCreact->'$(NameMvcReact)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Zip Files="$(NameMvcReact)" WorkingDirectory="$(To)" ZipFileName="$(NameMvcReact).zip" />
<ItemGroup>
<ZipFilesJava Include="$(DirJava)**" Exclude="$(DirJava)**\.git" />
</ItemGroup>

View File

@ -0,0 +1,41 @@
ONLYOFFICE Applications example uses code from the following 3rd party projects:
Entity Framework - Entity Framework is an object-relational mapper that enables .NET developers to work with relational data using domain-specific objects. (https://docs.microsoft.com/en-us/ef/ef6/resources/licenses/ef5/enu)
License: MICROSOFT SOFTWARE SUPPLEMENTAL TERMS, MICROSOFT SOFTWARE LICENSE TERMS
License File: EntityFramework.license
jQuery - jQuery is a new kind of JavaScript Library. jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. NOTE: This package is maintained on behalf of the library owners by the NuGet Community Packages project at https://nugetpackages.codeplex.com/ (https://jquery.org/license/)
License: MIT
License File: jQuery.license
jQuery.BlockUI - The jQuery BlockUI Plugin lets you simulate synchronous behavior when using AJAX, without locking the browser. (https://github.com/malsup/blockui/)
License: MIT, GPL
License File: jQuery.BlockUI.license
jQuery.FileUpload - File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads. (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.FileUpload.license
jQuery.iframe-transport - jQuery Iframe Transport Plugin for File Upload (https://github.com/blueimp/jQuery-File-Upload/blob/master/LICENSE.txt)
License: MIT
License File: jQuery.iframe-transport.license
jQuery.UI - jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according to jQuery's event-driven architecture (find something, manipulate it) and is themeable, making it easy for developers of any skill level to integrate and extend into their own code. (https://jquery.org/license/)
License: MIT
License File: jQuery.UI.license
JWT - JWT (JSON Web Token) Implementation for .NET (Public Domain) (https://github.com/jwt-dotnet/jwt/)
License: MIT
License File: JWT.license
Microsoft.Web.Infrastructure - This package contains the Microsoft.Web.Infrastructure assembly that lets you dynamically register HTTP modules at run time. (https://www.microsoft.com/web/webpi/eula/aspnetmvc3update-eula.htm)
License: MS-EULA License
License File: Microsoft.Web.Infrastructure.license
Newtonsoft.Json - Json.NET is a popular high-performance JSON framework for .NET (https://github.com/JamesNK/Newtonsoft.Json)
License: MIT
License File: Newtonsoft.Json.license
WebGrease - Web Grease is a suite of tools for optimizing javascript, css files and images. (https://www.microsoft.com/web/webpi/eula/aspnetcomponent_rtw_ENU.htm)
License: MICROSOFT .NET LIBRARY LICENSE
License File: WebGrease.license

View File

@ -0,0 +1,56 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System.Web.Optimization;
namespace OnlineEditorsExampleMVCreact
{
public class BundleConfig
{
// register bundles
public static void RegisterBundles(BundleCollection bundles)
{
// create a jquery script bundle
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js",
"~/Scripts/jquery-ui.js",
"~/Scripts/jquery.blockUI.js",
"~/Scripts/jquery.iframe-transport.js",
"~/Scripts/jquery.fileupload.js",
"~/Scripts/jquery.dropdownToggle.js"
));
// create the main script bundle
bundles.Add(new ScriptBundle("~/bundles/scripts").Include(
"~/Scripts/jscript.js"
));
// create a style bundle
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/stylesheet.css",
"~/Content/jquery-ui.css",
"~/Content/media.css"
));
// create an editor style bundle
bundles.Add(new StyleBundle("~/Content/editor").Include(
"~/Content/editor.css"
));
}
}
}

View File

@ -1,7 +1,6 @@
<?php
/**
* (c) Copyright Ascensio System SIA 2026
/**
*
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -14,18 +13,19 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
namespace App\UseCases\Common\Http;
using System.Web.Mvc;
use UnexpectedValueException;
class DownloadFileRequest
namespace OnlineEditorsExampleMVCreact
{
public function __construct(public string $url)
public class FilterConfig
{
if (! filter_var($url, FILTER_VALIDATE_URL)) {
throw new UnexpectedValueException("$url is not a valid URL");
// register global filters
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
}
}
}

View File

@ -1,7 +1,6 @@
<?php
/**
* (c) Copyright Ascensio System SIA 2026
/**
*
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -14,23 +13,27 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
namespace App\UseCases\Docs\Command;
using System.Web.Mvc;
using System.Web.Routing;
use App\OnlyOffice\Miscellaneous\CommandRequest;
use Exception;
use Illuminate\Support\Facades\Log;
class ForceSaveCommad
namespace OnlineEditorsExampleMVCreact
{
public function __invoke(ForceSaveRequest $request): void
public class RouteConfig
{
try {
app(CommandRequest::class)
->forceSave($request->key);
} catch (Exception $e) {
Log::debug($e->getMessage());
// register routes
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
// create a route map
routes.MapRoute(
name: "Default",
url: "{action}",
defaults: new { controller = "Home", action = "Index" }
);
}
}
}
}

View File

@ -1,6 +1,6 @@
/**
/**
*
* (c) Copyright Ascensio System SIA 2026
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -15,14 +15,15 @@
* limitations under the License.
*
*/
package handlers
import "fmt"
using System.Web.Http;
type HandlerExistsError struct {
Code int
}
func (e *HandlerExistsError) Error() string {
return fmt.Sprintf("A Handler with code %d exists", e.Code)
namespace OnlineEditorsExampleMVCreact
{
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
}
}
}

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2026
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -34,7 +34,7 @@ body {
text-decoration: none;
}
.form {
#root {
height: 100%;
}

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

Before

Width:  |  Height:  |  Size: 781 B

After

Width:  |  Height:  |  Size: 781 B

View File

Before

Width:  |  Height:  |  Size: 547 B

After

Width:  |  Height:  |  Size: 547 B

View File

Before

Width:  |  Height:  |  Size: 425 B

After

Width:  |  Height:  |  Size: 425 B

View File

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M19 6H5L5 15H19V6ZM5 4C3.89543 4 3 4.89543 3 6V15C3 16.1046 3.89543 17 5 17H10V18H6V20H18V18H14V17H19C20.1046 17 21 16.1046 21 15V6C21 4.89543 20.1046 4 19 4H5Z" fill="#444444"/>
</svg>

After

Width:  |  Height:  |  Size: 331 B

View File

Before

Width:  |  Height:  |  Size: 507 B

After

Width:  |  Height:  |  Size: 507 B

View File

Before

Width:  |  Height:  |  Size: 757 B

After

Width:  |  Height:  |  Size: 757 B

View File

@ -0,0 +1,5 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="4" y="6" width="16" height="13" rx="1" stroke="#444444" stroke-width="2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.148 8.69651C13.8858 8.43384 13.4601 8.43384 13.1979 8.69651V8.69651C12.9362 8.95858 12.9362 9.38302 13.1979 9.64509L15.3401 11.7908C15.7296 12.1809 15.7299 12.8126 15.3409 13.2031L13.1967 15.3554C12.9357 15.6173 12.9357 16.041 13.1967 16.3029V16.3029C13.4591 16.5663 13.8855 16.5663 14.1478 16.3029L17.3302 13.1086V13.1086C17.668 12.7702 17.668 12.2222 17.3302 11.8838L14.148 8.69651Z" fill="#444444"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.85199 16.3035C10.1142 16.5662 10.5399 16.5662 10.8021 16.3035V16.3035C11.0638 16.0414 11.0638 15.617 10.8021 15.3549L8.65987 13.2092C8.2704 12.8191 8.27006 12.1874 8.65911 11.7969L10.8033 9.64461C11.0643 9.38266 11.0643 8.959 10.8033 8.69706V8.69706C10.5409 8.43371 10.1145 8.43371 9.85218 8.69706L6.66983 11.8914V11.8914C6.33201 12.2298 6.33201 12.7778 6.66983 13.1162L9.85199 16.3035Z" fill="#444444"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 593 B

After

Width:  |  Height:  |  Size: 593 B

View File

@ -0,0 +1,8 @@
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 3C0 1.34315 1.34315 0 3 0H21.674C22.4697 0 23.2327 0.316071 23.7953 0.87868L29.1213 6.20465C29.6839 6.76726 30 7.53032 30 8.32597V37C30 38.6569 28.6569 40 27 40H3C1.34315 40 0 38.6569 0 37V3Z" fill="#3779A6"/>
<path d="M22.9167 0L30.0001 7.08333H25.9167C24.2599 7.08333 22.9167 5.74019 22.9167 4.08333V0Z" fill="#1D5880"/>
<path d="M6.17627 14.7059H23.8233V15.8823H6.17627V14.7059Z" fill="white"/>
<path d="M6.17627 18.5294H23.8233V19.7059H6.17627V18.5294Z" fill="white"/>
<path d="M6.17627 22.3529H23.8233V23.5294H6.17627V22.3529Z" fill="white"/>
<path d="M6.17627 26.1765H23.8233V27.3529H6.17627V26.1765Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 738 B

View File

@ -0,0 +1,6 @@
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 3C0 1.34315 1.34315 0 3 0H22.9167L30 7.08333V37C30 38.6569 28.6569 40 27 40H3C1.34315 40 0 38.6569 0 37V3Z" fill="#27ABA3"/>
<path d="M22.9165 0L29.9998 7.08333H25.9165C24.2597 7.08333 22.9165 5.74019 22.9165 4.08333V0Z" fill="#008078"/>
<rect x="6.5" y="15.5" width="17" height="5" stroke="white"/>
<rect x="6.5" y="23.5" width="17" height="5" stroke="white"/>
</svg>

After

Width:  |  Height:  |  Size: 477 B

View File

@ -0,0 +1,8 @@
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 3C0 1.34315 1.34315 0 3 0H22.9167L30 7.08333V37C30 38.6569 28.6569 40 27 40H3C1.34315 40 0 38.6569 0 37V3Z" fill="#F36700"/>
<path d="M22.9167 0L30.0001 7.08333H25.9168C24.2599 7.08333 22.9167 5.74019 22.9167 4.08333V0Z" fill="#AB531F"/>
<path d="M6.17627 16.1275H23.8233V17.3039H6.17627V16.1275Z" fill="white"/>
<path d="M6.17627 28.7745L6.17627 16.1275L7.35274 16.1275L7.35274 28.7745H6.17627Z" fill="white"/>
<path d="M23.8233 16.1275V28.7745H22.6469V16.1275L23.8233 16.1275Z" fill="white"/>
<path d="M6.17627 27.598H23.8233V28.7745H6.17627L6.17627 27.598Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 691 B

View File

@ -0,0 +1,6 @@
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M30 7.44186L22 0H3C1.22739 0 0 0.822551 0 2.32558V37.2093C0 38.7123 1.22739 40 3 40H27C28.7726 40 30 38.7123 30 37.2093V7.44186Z" fill="#D0D5DA"/>
<path d="M24.1042 7.27273H29.9631L22 0V5.32334C22 6.4105 22.949 7.27273 24.1042 7.27273Z" fill="#646464"/>
<path d="M16.9562 22.3485H12.9746V17.803H10.9839L14.9654 14.1667L18.947 17.803H16.9562V22.3485Z" fill="#646464"/>
<path d="M20.9378 23.7121C20.9378 24.1666 20.4401 24.6212 19.9424 24.6212H9.98848C9.49078 24.6212 8.99309 24.1666 8.99309 23.7121V22.3485C8.99309 21.8939 9.49078 21.4394 9.98848 21.4394H10.9839V20.0757H9.49078C8.49539 20.0757 7.5 20.9848 7.5 21.8939V24.1666C7.5 25.0757 8.61982 25.9848 9.49078 25.9848H20.4401C21.3111 25.9848 22.4309 25.0757 22.4309 24.1666V21.8939C22.4309 20.9848 21.4355 20.0757 20.4401 20.0757H18.947V21.4394H19.9424C20.4401 21.4394 20.9378 21.8939 20.9378 22.3485V23.7121Z" fill="#646464"/>
</svg>

After

Width:  |  Height:  |  Size: 992 B

View File

@ -0,0 +1,12 @@
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 3C0 1.34315 1.34315 0 3 0H22.9167L30 7.08333V37C30 38.6569 28.6569 40 27 40H3C1.34315 40 0 38.6569 0 37V3Z" fill="#78A73B"/>
<path d="M22.9167 0L30.0001 7.08333H25.9168C24.2599 7.08333 22.9167 5.74019 22.9167 4.08333V0Z" fill="#5A7D2B"/>
<path d="M6.17644 15.2941H23.8235V16.4706H6.17644V15.2941Z" fill="white"/>
<path d="M6.17644 19.1177H23.8235V20.2941H6.17644V19.1177Z" fill="white"/>
<path d="M6.17644 22.9412H23.8235V24.1177H6.17644V22.9412Z" fill="white"/>
<path d="M6.17644 26.7647H23.8235V27.9412H6.17644V26.7647Z" fill="white"/>
<path d="M5.88232 27.9412L5.88232 15.2941L7.0588 15.2941L7.0588 27.9412H5.88232Z" fill="white"/>
<path d="M11.4706 27.9412L11.4706 15.2941L12.647 15.2941V27.9412H11.4706Z" fill="white"/>
<path d="M17.0588 27.9412L17.0588 15.2941L18.2353 15.2941V27.9412H17.0588Z" fill="white"/>
<path d="M22.647 27.9412V15.2941H23.8235V27.9412H22.647Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1004 B

View File

Before

Width:  |  Height:  |  Size: 233 B

After

Width:  |  Height:  |  Size: 233 B

View File

@ -0,0 +1,12 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2.84616 1H10.8462L14.8462 5V15H2.84616V1Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.8462 5L10.8462 1H2.84616V15H14.8462V5ZM10.8462 0L15.8462 5V16H1.84616V0H10.8462Z" fill="#BFBFBF"/>
<rect x="3.84616" y="10" width="10" height="4" fill="#3779A6"/>
<path d="M3.84616 4H4.84616V5H3.84616V4Z" fill="#BFBFBF"/>
<path d="M3.84616 6H4.84616V7H3.84616V6Z" fill="#BFBFBF"/>
<path d="M4.84616 8H3.84616V9H4.84616V8Z" fill="#BFBFBF"/>
<path d="M12.8462 8H5.84616V9H12.8462V8Z" fill="#BFBFBF"/>
<path d="M7.84616 6H5.84616V7H7.84616V6Z" fill="#BFBFBF"/>
<path d="M12.8462 4H5.84616V5H12.8462V4Z" fill="#BFBFBF"/>
<path opacity="0.3" d="M9.84616 1H10.8462V4H14.8462L15.8462 5H9.84616V1Z" fill="#333333"/>
</svg>

After

Width:  |  Height:  |  Size: 832 B

View File

@ -0,0 +1,12 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2 1H10L14 5V15H2V1Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M14 5L10 1H2V15H14V5ZM10 0L15 5V16H1V0H10Z" fill="#BFBFBF"/>
<rect x="3" y="10" width="10" height="4" fill="#F36700"/>
<path d="M3 4H4V5H3V4Z" fill="#BFBFBF"/>
<path d="M3 6H4V7H3V6Z" fill="#BFBFBF"/>
<path d="M4 8H3V9H4V8Z" fill="#BFBFBF"/>
<path d="M12 8H5V9H12V8Z" fill="#BFBFBF"/>
<path d="M7 6H5V7H7V6Z" fill="#BFBFBF"/>
<path d="M12 4H5V5H12V4Z" fill="#BFBFBF"/>
<path opacity="0.3" d="M9 1H10V4H14L15 5H9V1Z" fill="#333333"/>
</svg>

After

Width:  |  Height:  |  Size: 631 B

View File

@ -0,0 +1,12 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M2.84592 1H10.8459L14.8459 5V15H2.84592V1Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.8459 5L10.8459 1H2.84592V15H14.8459V5ZM10.8459 0L15.8459 5V16H1.84592V0H10.8459Z" fill="#BFBFBF"/>
<rect x="3.84592" y="10" width="10" height="4" fill="#78A73B"/>
<path d="M3.84592 4H4.84592V5H3.84592V4Z" fill="#BFBFBF"/>
<path d="M3.84592 6H4.84592V7H3.84592V6Z" fill="#BFBFBF"/>
<path d="M4.84592 8H3.84592V9H4.84592V8Z" fill="#BFBFBF"/>
<path d="M12.8459 8H5.84592V9H12.8459V8Z" fill="#BFBFBF"/>
<path d="M7.84592 6H5.84592V7H7.84592V6Z" fill="#BFBFBF"/>
<path d="M12.8459 4H5.84592V5H12.8459V4Z" fill="#BFBFBF"/>
<path opacity="0.3" d="M9.84592 1H10.8459V4H14.8459L15.8459 5H9.84592V1Z" fill="#333333"/>
</svg>

After

Width:  |  Height:  |  Size: 832 B

View File

Before

Width:  |  Height:  |  Size: 488 B

After

Width:  |  Height:  |  Size: 488 B

View File

Before

Width:  |  Height:  |  Size: 673 B

After

Width:  |  Height:  |  Size: 673 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8 3C6.89543 3 6 3.89543 6 5V19C6 20.1046 6.89543 21 8 21H16C17.1046 21 18 20.1046 18 19V5C18 3.89543 17.1046 3 16 3H8ZM16.8462 6H7.15385V18H16.8462V6ZM10.3846 4H13.6154V5H10.3846V4ZM12 20C12.2974 20 12.5385 19.7761 12.5385 19.5C12.5385 19.2239 12.2974 19 12 19C11.7026 19 11.4615 19.2239 11.4615 19.5C11.4615 19.7761 11.7026 20 12 20Z" fill="#444444"/>
</svg>

After

Width:  |  Height:  |  Size: 506 B

View File

Before

Width:  |  Height:  |  Size: 549 B

After

Width:  |  Height:  |  Size: 549 B

View File

Before

Width:  |  Height:  |  Size: 438 B

After

Width:  |  Height:  |  Size: 438 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2026
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -16,7 +16,7 @@
*
*/
@media (min-width: 1280px) and (max-width: 1380px) {
@media (min-width: 1280px) and (max-width: 1380px) {
.copy {
margin-right: 6.5%;
}
@ -34,22 +34,18 @@
}
.tableHeaderCellFileName {
width: 29%;
width: 25%;
}
.tableHeaderCellEditors {
width: 12%;
width: 13%;
}
.tableHeaderCellViewers {
width: 15%;
width: 29%;
text-align: right;
}
.tableHeaderCellAction {
width: 23%;
}
.tableHeaderCellDownload {
width: 21%;
padding-right: 18px;
@ -83,9 +79,7 @@
margin-left: 0;
}
.tableRow,
.storedHeader,
menu.links {
.tableRow {
width: 90%;
}
@ -125,8 +119,7 @@
.contentCells-icon{
width: 5%;
}
.tableRow,
menu.links {
.tableRow {
width: 55%;
}
@ -182,15 +175,9 @@
}
@media (max-width: 715px) {
.tableRow,
.storedHeader,
menu.links {
.tableRow {
width: 45%;
}
.storedHeaderClearAll{
padding-right: 24px;
}
}
@media (max-width: 670px) and (min-width: 620px){
.main-panel{
@ -226,25 +213,20 @@
.tableRow td:first-child {
flex-grow: 0;
width: 26%;
}
.tableHeaderCellFileName {
width: 15%;
}
.tableHeaderCellFileName {
width: 16%;
}
.tableHeaderCellEditors {
width: 3%;
width: 13%;
}
.tableHeaderCellViewers {
text-align: right;
width: 9%;
}
.tableHeaderCellAction{
width: 11%;
padding-right: 82px;
width: 37%;
}
.tableHeaderCellDownload {
@ -259,24 +241,19 @@
}
.tableHeaderCellEditors {
width: 13%;
width: 26%;
text-align: left;
}
.tableHeaderCellFileName {
width: 29%;
width: 17%;
}
.tableHeaderCellViewers {
width: 6%;
width: 27%;
text-align: right;
}
.tableHeaderCellAction{
width: 18%;
padding-right: 54px;
}
.tableHeaderCellDownload {
padding-right: 18px;
width: 20%;
@ -286,9 +263,7 @@
padding-left: 0;
}
.tableRow,
.storedHeader,
menu.links {
.tableRow {
width: 75%;
}
@ -298,21 +273,12 @@
.tableRow td:first-child {
flex-grow: 0;
width: 25%;
margin-right: auto;
width: 15%;
}
.contentCells-icon {
width: 3%;
}
.firstContentCellViewers {
margin-left: 0;
}
.storedHeaderClearAll {
padding-right: 39px;
}
}
@media (max-width: 890px) and (min-width: 769px ) {
@ -320,16 +286,14 @@
width: 20%;
}
.contentCells-shift {
padding-right: 27px;
padding-right: 28px;
}
.main-panel {
width: 580px;
}
.tableRow,
.storedHeader,
menu.links {
.tableRow {
width: 95%;
}
@ -349,33 +313,23 @@
}
.tableHeaderCellFileName {
width: 22%;
width: 20%;
}
.tableHeaderCellEditors {
text-align: left;
width: 1%;
width: 31%;
}
.tableHeaderCellViewers {
width: 15%;
}
.tableHeaderCellAction {
width: 19%;
padding-right: 45px;
}
.storedHeaderClearAll {
padding-right: 29px;
width: 18%;
}
}
@media (max-width: 890px) {
.tableRow td:first-child {
max-width: 22%;
max-width: 17%;
}
#portal-info {
max-width: 60vw;
}
@ -453,6 +407,60 @@
padding: 16px 0 6px;
}
.tableRow {
width: 40%;
}
.tableRow td {
border: none;
}
.firstContentCellShift {
border: none;
flex-basis: 10%;
flex-grow: 1;
}
.downloadContentCellShift {
max-width: 7%;
margin-right: -11px;
margin-left: auto;
}
.contentCells-icon {
width: 13%;
}
.tableRow td:last-child {
width: 12%;
padding-right: 40px;
border: none;
}
.contentCells-shift {
padding-right: 35px;
}
.downloadContentCellShift:after {
width: 85%;
}
.firstContentCellViewers {
margin-left: 0;
border-bottom: 1px solid #e5e5e5 !important;
}
.firstContentCellViewers ~ td {
border-bottom: 1px solid #e5e5e5;
}
.tableRow td:first-child{
border: none;
width: 85%;
}
.contentCellsEmpty{
display: none;
width: 1%;
}
/* Mobile Upload*/
.blockUI.blockMsg.blockPage.ui-dialog.ui-widget.ui-corner-all.ui-widget-content.ui-draggable {
width: 344px !important;
@ -494,17 +502,6 @@
justify-content: space-between;
align-items: center;
}
.buttonsMobile.indent {
margin-bottom: 0;
flex-wrap: nowrap;
}
.button.file-type:hover,
.button.file-type {
height: 28px;
width: 100px;
margin-bottom: 10px !important;
font-size: 9px;
}
.button.gray{
margin: 0;
}
@ -516,18 +513,103 @@
height: 56px;
margin-bottom: 24px !important;
}
.button.hoar{
width: 18%;
height: 27px;
margin-bottom: 7px !important;
}
@media (max-width: 560px) and (min-width: 510px) {
.contentCells-icon {
width: 13%;
}
.button.converting{
width: 126px;
margin-top: 0;
.downloadContentCellShift {
padding-right: 45px;
max-width: 4%;
}
}
@media (max-width: 420px) {
@media (max-width: 510px) and (min-width: 470px) {
.tableRow {
width: 35%;
}
.tableRow td:first-child{
width: 83%;
}
.contentCells-icon {
width: 13%;
}
.downloadContentCellShift {
max-width: 6%;
padding-right: 37px;
}
.firstContentCellShift {
flex-basis: 9%;
}
.tableRow td:last-child {
padding-right: 28px;
}
}
@media (max-width: 470px) and (min-width: 420px) {
.tableRow {
width: 30%;
}
.tableRow td:first-child{
width: 85%;
}
.contentCells-icon {
width: 11%;
}
.downloadContentCellShift {
max-width: 3%;
padding-right: 37px;
padding-left: 0;
}
.firstContentCellShift {
margin-left: 1px;
flex-basis: 14%;
}
.tableRow td:last-child {
width: 5%;
padding-right: 63px;
}
.firstContentCellViewers{
padding-right: 2px;
width: 12%;
}
.contentCellsEmpty{
display: none;
}
}
@media (max-width: 420px) and (min-width: 320px) {
.tableRow {
width: 25%;
}
.tableRow td:last-child {
width: 6%;
padding-right: 16px;
}
.downloadContentCellShift {
max-width: 4%;
margin-right: -18px;
margin-left: -1px;
}
.firstContentCellShift {
flex-basis: 2%;
}
.contentCells-icon{
width: 10%;
}
footer table td {
margin: 0;
padding-right: 5px;
@ -538,6 +620,10 @@
padding-right: 5px;
margin: 0;
}
.firstContentCellViewers{
padding-right: 2px;
width: 11%;
}
}
@media (max-width: 1160px) {
@ -546,15 +632,19 @@
}
}
@media (min-width: 593px) {
.contentCellsEmpty {
display: none;
}
}
@media (max-width: 769px) and (min-width: 715px){
.tableRow,
.storedHeader,
menu.links {
.tableRow{
width: 50%;
}
.storedHeaderClearAll{
padding-right: 26px;
}
@media (max-width: 510px) {
.tableRow td:first-child{
flex-grow: 0;
}
}
@media (max-width: 1100px) and (min-width: 890px){
@ -571,7 +661,7 @@
max-width: 45%;
}
}
@media (max-width: 600px) {
@media (max-width: 600px) and (min-width: 320px) {
.main-panel{
display: flex;
flex-direction: column;
@ -592,255 +682,3 @@
max-width:15%;
}
}
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
.tableRow td:first-child{
max-width: none;
}
}
@media (max-width: 592px) {
body.menu-open {
overflow: hidden;
}
header {
min-width: auto;
height: fit-content;
}
header a {
display: block;
}
header img {
margin: 0;
}
header, footer {
position: -webkit-sticky; /* Safari */
position: sticky;
top: 0;
z-index: 100;
}
.center {
width: 100%;
margin: 0;
}
.left-panel {
background-color: rgba(186, 186, 186, 0.6);
display: none;
align-items: start;
width: 100%;
margin: 0;
position: fixed;
left: 0;
height: calc(100% - 44px);
z-index: 101;
}
.left-panel.active {
display: flex;
}
.help-block {
height: 100%;
margin: 0;
background-color: #F5F5F5;
width: 248px;
padding-left: 16px;
padding-top: 33px;
padding-bottom: 33px;
padding-right: 40px;
box-sizing: border-box;
overflow-y: auto;
overflow-x: hidden;
}
.table-main {
width: 100%;
}
.mobile-close-btn {
display: block;
width: 48px;
height: 48px;
background-color: #E2E2E2;
border-radius: 2px;
border-color: #E2E2E2;
color: #808080;
cursor: pointer;
outline: inherit;
border: none;
}
.main-panel {
width: 100%;
left: 0;
padding: 28px 16px;
}
#portal-info {
width: 100%;
max-width: fit-content;
}
menu.links {
width: 100%;
margin-top: 0;
padding: 0;
}
span.portal-name {
font-size: 16px;
}
span.portal-descr:first-child {
font-size: 13px;
}
span.portal-descr {
font-size: 12px;
}
.user-descr {
width: 100%;
max-width: none;
min-width: auto;
border-bottom: 1px solid #E5E5E5;
padding: 12px 0;
margin: 0;
cursor: pointer;
}
.user-descr ul {
display: none;
}
.user-descr ul.active {
display: block;
}
.user-descr b {
font-size: 13px;
display: flex;
align-items: center;
column-gap: 8px;
margin: 0;
}
.user-descr b::before {
content: url("../images/plus.svg");
display: inline-block;
width: 24px;
height: 24px;
}
.storedHeader {
width: 100%;
}
.storedHeaderClearAll {
padding-right: 0;
}
.scroll-table-body {
top: 36px;
}
.scroll-table-body tr:first-child {
padding-top: 0;
}
.tableRow {
border-bottom: 1px solid #e5e5e5;
padding: 12px 0;
width: 100%;
flex-wrap: nowrap;
}
.tableRow td:first-child {
width: 100%;
}
.tableRow td:last-child {
display: block;
width: 24px;
}
.contentCells {
padding: 0;
font-size: 13px;
}
.contentCells-icon {
width: auto;
display: none;
}
.stored-edit {
height: 12px;
padding: 6px 0 6px 34px;
}
.stored-edit span {
font-size: 13px;
}
.header-list {
font-size: 16px;
}
.firstContentCellViewers {
margin: 0;
}
.firstContentCellViewers ~ td {
border-bottom: none !important;
}
.downloadContentCellShift:after {
display: none;
}
.main-nav {
display: none;
}
.responsive-nav {
height: 44px;
display: flex;
flex-direction: row;
margin: 0;
align-items: center;
column-gap: 16px;
padding: 10px 16px;
width: 100%;
box-sizing: border-box;
list-style: none;
}
.main {
height: calc(100% - 124px);
}
.user-block-table {
height: auto;
}
.upload-panel {
padding: 12px 0;
}
.user-block-table td select {
height: 48px;
padding-left: 12px;
border-radius: 6px;
border-color: #aaaaaa;
}
.user-block-table tr:last-child {
display: none;
}
}

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2026
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -16,7 +16,7 @@
*
*/
html {
html {
height: 100%;
width: 100%;
}
@ -27,14 +27,14 @@ body {
color: #333333;
font-family: Open Sans;
font-size: 12px;
font-style: normal;
font-style: normal;
font-weight: normal;
height: 100%;
margin: 0;
overflow-y: overlay;
padding: 0;
text-decoration: none;
overflow-x: hidden;
overflow-x:hidden;
}
form {
@ -65,21 +65,13 @@ header img {
margin: 10px 0 22px 32px;
}
.responsive-nav {
display: none;
}
.mobile-close-btn {
display: none;
}
.center {
position: relative;
position:relative;
margin: 0 auto 0;
width: 1152px;
}
.main{
.main {
display: table;
height: calc(100% - 112px);
min-height: 536px;
@ -91,7 +83,7 @@ header img {
min-height: 536px;
}
.section{
.section {
height: 100%;
padding: 0;
vertical-align: top;
@ -160,19 +152,19 @@ label .checkbox {
}
.try-editor.word {
background-image: url("../images/file_docx.svg");
background-image: url("images/file_docx.svg");
}
.try-editor.cell {
background-image: url("../images/file_xlsx.svg");
background-image: url("images/file_xlsx.svg");
}
.try-editor.slide {
background-image: url("../images/file_pptx.svg");
background-image: url("images/file_pptx.svg");
}
.try-editor.form {
background-image: url("../images/file_pdf.svg");
background-image: url("images/file_docxf.svg");
}
.side-option {
@ -187,7 +179,7 @@ label .checkbox {
align-items: center;
border-radius: 3px;
box-sizing: border-box;
cursor:pointer;
cursor: pointer;
display: inline-block;
font-weight: 600;
letter-spacing: 0.08em;
@ -238,86 +230,13 @@ label .checkbox {
color: #FF6F3D;
}
.button.converting {
margin-top: -20px;
padding: 16px 16px;
}
.button.converting.wide {
padding: 16px 29px;
}
.button.hoar {
background: #EFEFEF;
border: 1px solid #EFEFEF;
margin-right: 7px;
margin-bottom: 7px;
width: 13%;
padding-left: 0;
padding-right: 0;
font-size: 11px;
}
.button.hoar.disable {
opacity: 30%;
cursor: default;
}
.button.hoar:not(.disable):hover {
background: #FF6F3D;
border: 1px solid #FF6F3D;
color: #FFFFFF;
}
.button.hoar.orange {
background: #FF6F3D;
border: 1px solid #FF6F3D;
color: #FFFFFF;
cursor: default;
}
.button.hoar.orange.disable {
background: #444444;
border: 1px solid #444444;
color: #FFFFFF;
cursor: default;
opacity: 100%;
}
.button.file-type {
font-size: 11px;
color: #FFFFFF;
padding: 8px 8px;
margin-right: 10px;
}
.button.file-type.disable {
cursor: default;
}
.button.file-type.pale {
opacity: 30%;
}
.button.file-type.document {
background: #446995;
}
.button.file-type.spreadsheet {
background: #40865C;
}
.button.file-type.presentation {
background: #AA5252;
}
.upload-panel {
float: left;
padding: 24px 0;
}
.file-upload {
background: url(../images/file_upload.svg) no-repeat 0 transparent;
background: url("images/file_upload.svg") no-repeat 0 transparent;
cursor: pointer;
display: block;
font-size: 14px;
@ -352,43 +271,6 @@ label .checkbox {
border-bottom: 1px solid #D0D5DA;
}
.links {
display: flex;
padding: 0;
column-gap: 30px;
align-items: center;
list-style: none;
border-bottom: 1px solid #E2E2E2;
margin: 0;
margin-bottom: 24px;
}
.links li {
padding: 4px;
border-bottom: 2px solid transparent;
margin-bottom: -1px;
}
.links li.active {
border-bottom: 2px solid #FF6F3D;
}
.links li.active a {
color: #FF6F3D;
}
.links li.active a img {
filter: invert(55%) sepia(67%) saturate(2727%) hue-rotate(335deg) brightness(104%) contrast(101%);
}
.links a {
display: inline-block;
padding: 2px 0;
line-height: 20px;
font-size: 13px;
text-decoration: none;
}
#mainProgress {
color: #333333;
display: none;
@ -396,7 +278,7 @@ label .checkbox {
margin: 30px 40px;
}
#mainProgress .uploadFileName{
#mainProgress .uploadFileName {
background-position: left center;
background-repeat: no-repeat;
display: block;
@ -426,34 +308,8 @@ label .checkbox {
display: none;
}
#convertingProgress {
color: #333333;
display: none;
font-size: 12px;
margin: 30px 35px;
}
#convertingProgress .convertFileName{
background-position: left center;
background-repeat: no-repeat;
display: block;
font-size: 14px;
line-height: 160%;
overflow: hidden;
padding-left: 28px;
margin-bottom: 16px;
text-overflow: ellipsis;
white-space: nowrap;
}
#convertingProgress .describeUpload {
line-height: 150%;
letter-spacing: -0.02em;
padding: 16px 0;
}
.error-message {
background: url(../images/error.svg) no-repeat scroll 4px 10px;
background: url("images/error.svg") no-repeat scroll 4px 10px;
color: #CB0000;
display: none;
line-height: 160%;
@ -473,26 +329,16 @@ label .checkbox {
padding-left: 35px;
}
.waiting {
opacity: 30%;
}
.current {
background-image: url("../images/loader16.gif");
background-image: url("images/loader16.gif");
}
.done {
background-image: url("../images/done.svg");
background-image: url("images/done.svg");
}
.error {
background-image: url("../images/notdone.svg");
}
.convertPercent {
color: #FF6F3D;
font-weight: 700;
display: inline;
background-image: url("images/notdone.svg");
}
.step-descr {
@ -502,15 +348,15 @@ label .checkbox {
line-height: 188%;
}
.step-descr.disable {
display: none;
}
.progress-descr {
letter-spacing: -0.02em;
line-height: 150%;
}
#loadScripts {
display: none;
}
#iframeScripts {
position: absolute;
visibility: hidden;
@ -525,11 +371,11 @@ footer {
left: 0;
bottom: 0;
}
footer > .center{
footer > .center {
width: 100%;
}
footer table {
width: 100%;
width:100%;
border-spacing: 0;
}
@ -546,16 +392,16 @@ footer table tr {
footer table td {
display: block;
position: relative;
position:relative;
padding-left: 32px;
}
footer a,
footer a:hover,
footer a,
footer a:hover,
footer a:visited {
color: #FF6F3D;
font-size: 14px;
line-height: 120%;
line-height: 120%;
}
footer a:hover {
@ -565,12 +411,11 @@ footer table tr td:first-child {
margin-left: 14%;
}
.copy {
color: #aaaaaa;
width: max-content;
position: relative;
margin-left: auto;
margin-right: 14%;
/*padding-left: 510px;*/
color:#aaaaaa;
width:max-content;
position:relative;
margin-left:auto;
margin-right:14%;
}
.help-block {
@ -604,33 +449,19 @@ footer table tr td:first-child {
white-space: nowrap;
}
.convertFileName.word,
.stored-edit.word,
.uploadFileName.word {
background-image: url("../images/icon_docx.svg");
background-image: url("images/icon_docx.svg");
}
.convertFileName.cell,
.stored-edit.cell,
.uploadFileName.cell {
background-image: url("../images/icon_xlsx.svg");
background-image: url("images/icon_xlsx.svg");
}
.convertFileName.slide,
.stored-edit.slide,
.stored-edit.slide,
.uploadFileName.slide {
background-image: url("../images/icon_pptx.svg");
}
.convertFileName.pdf,
.stored-edit.pdf,
.uploadFileName.pdf {
background-image: url("../images/icon_pdf.svg");
}
.stored-edit.diagram,
.uploadFileName.diagram {
background-image: url("../images/icon_vsdx.svg");
background-image: url("images/icon_pptx.svg");
}
.stored-edit span {
@ -650,14 +481,14 @@ footer table tr td:first-child {
-webkit-border-radius: 0 !important;
color: #F5F5F5 !important;
font-size: 16px !important;
font-weight: 600!important;
font-weight: 600 !important;
line-height: 133%;
letter-spacing: -0.02em;
padding: 14px 16px 14px 46px !important;
}
.dialog-close {
background: url(../images/close.svg) no-repeat scroll left top;
background: url("images/close.svg") no-repeat scroll left top;
cursor: pointer;
float: right;
font-size: 1px;
@ -684,11 +515,6 @@ footer table tr td:first-child {
visibility: hidden;
}
.convertTable {
margin-top: 10px;
margin-left: 35px;
}
.tableRow {
background: transparent;
-moz-transition: all 0.2s ease-in-out;
@ -706,7 +532,7 @@ footer table tr td:first-child {
padding-top: 10px;
}
.tableHeader tr{
.tableHeader tr {
background: transparent;
cursor: default;
height: 40px;
@ -727,32 +553,27 @@ footer table tr td:first-child {
width: 37%;
}
.tableHeaderCellEditors{
.tableHeaderCellEditors {
width: 29%;
}
.tableHeaderCellViewers{
.tableHeaderCellViewers {
width: 11%;
}
.tableHeaderCellAction{
width: 13%;
text-align: right;
padding-right: 88px;
}
.tableHeaderCellDownload{
.tableHeaderCellDownload {
width: 13%;
text-align: right;
padding-right: 20px;
}
.tableHeaderCellRemove{
.tableHeaderCellRemove {
text-align: left;
}
.contentCells {
display: block;
border-bottom: 1px solid #EFEFEF;
font-family: 'Open Sans', sans-serif;
font-size: 16px;
padding: 4px;
@ -764,45 +585,22 @@ footer table tr td:first-child {
}
.contentCells-shift {
padding-right: 43px;
padding-right: 44px;
}
.contentCells-icon {
width: 4%;
}
.storedHeader {
display: flex;
width: 100%;
justify-content: space-between;
align-items: center;
}
.storedHeaderClearAll {
padding-right: 52px;
}
.clear-all {
display: inline-block;
width: 100px;
padding: 2px;
outline: 1px solid #E5E5E5;
text-align: center;
cursor:pointer;
text-transform: uppercase;
background-color: #F5F5F5;
color: #666666;
}
.select-user {
color: #444444;
font-family: Open Sans;
font-size: 12px!important;
font-weight: normal!important;
line-height: 16px!important;
font-size: 12px !important;
font-weight: normal !important;
line-height: 16px !important;
}
.info{
.info {
cursor: pointer;
margin: -2px 5px;
}
@ -828,7 +626,7 @@ footer table tr td:first-child {
width: 100%;
}
.icon-action {
.icon-delete {
cursor: pointer;
}
@ -898,13 +696,6 @@ html {
overflow-x: hidden;
}
.typeButtonsRow {
width: 100%;
display: flex;
flex-wrap: wrap;
flex-direction: row;
position: relative;
}
.tableRow {
width: 100%;
@ -915,18 +706,18 @@ html {
}
.tableRow td:first-child {
display: flex;
flex-grow: 1;
max-width: 29%;
}
.tableRow td:first-child {
display: flex;
flex-grow: 1;
max-width: 25%;
}
.tableHeaderCellFileName {
width: 24%;
width: 30%;
}
.tableHeaderCellEditors {
width: 17%;
width: 28%;
}
.tableHeaderCellViewers {
@ -950,16 +741,6 @@ html {
margin-left: 25px;
}
.buttonsMobile.indent{
padding-left: 35px;
margin-top: 10px;
margin-bottom: 10px;
}
.invisible {
display: none;
}
.tooltip {
background: #FFFFFF;
border-radius: 5px;
@ -984,103 +765,3 @@ html {
top: 50%;
transform: translate(-50%, -50%);
}
.tableRow td:last-child {
display: none;
}
#mobileContextMenu {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
background-color: rgba(51, 51, 51, 0.3);
display: flex;
justify-content: center;
align-items: flex-end;
z-index: 100;
opacity: 0;
visibility: hidden;
transition: opacity 0.3s ease, visibility 0s linear 0.4s;
}
#mobileContextMenu.active {
visibility: visible;
opacity: 1;
transition: opacity 0.3s ease;
}
#mobileContextMenu .context-body {
width: 100%;
max-height: 100%;
transform: translateY(100%);
transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
overflow-y: auto;
overflow-x: hidden;
scrollbar-width: none;
}
#mobileContextMenu.active .context-body {
transform: translateY(0);
}
#mobileContextMenu table {
background-color: white;
width: 100%;
margin-top: 150px;
padding-bottom: 96px;
}
#mobileContextMenu thead {
padding: 12px 16px 0;
height: 48px;
position: sticky;
top: -1px;
display: flex;
align-items: center;
background-color: white;
}
#mobileContextMenu thead:not(.is-pinned)::after {
content: '';
position: absolute;
left: 16px;
right: 16px;
bottom: 0px;
height: 1px;
background: #e2e2e2;
}
#mobileContextMenu thead.is-pinned {
box-shadow: 0px 4px 6px 0px #CCCCCC4D;
transition: all 0.4s ease-out;
}
#mobileContextMenu tbody {
padding: 0 16px;
display: block
}
#mobileContextMenu tr {
display: block;
padding: 12px;
}
.context-section {
padding: 24px 0 6px !important;
font-size: 13px;
font-weight: 600;
color: #808080;
}
#mobileContextMenu a:not(.stored-edit) {
display: flex;
flex-direction: row;
align-items: center;
text-decoration: none;
}
#mobileContextMenu img {
margin-right: 8px;
}

View File

@ -0,0 +1,59 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System;
using System.IO;
using System.Web.Mvc;
using OnlineEditorsExampleMVCreact.Helpers;
using OnlineEditorsExampleMVCreact.Models;
namespace OnlineEditorsExampleMVCreact.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
// viewing file in the editor
public ActionResult Editor(string fileName, string editorsMode, string editorsType, string directUrl)
{
var file = new FileModel
{
Mode = editorsMode, // editor mode: edit or view
Type = editorsType, // editor type: desktop, mobile, embedded
FileName = Path.GetFileName(fileName), // file name
IsEnabledDirectUrl = directUrl != null ? Convert.ToBoolean(directUrl) : false
};
return View("Editor", file);
}
// creating a sample document
public ActionResult Sample(string fileExt, bool? sample)
{
var fileName = DocManagerHelper.CreateDemo(fileExt, sample ?? false); // create a sample document
var id = Request.Cookies.GetOrDefault("uid", null);
var user = Users.getUser(id);
DocManagerHelper.CreateMeta(fileName, user.id, user.name); // create meta information for the sample document
Response.Redirect(Url.Action("Editor", "Home", new { fileName = fileName }));
return null;
}
}
}

View File

@ -0,0 +1 @@
<%@ Application Codebehind="Global.asax.cs" Inherits="OnlineEditorsExampleMVCreact.MvcApplication" Language="C#" %>

View File

@ -0,0 +1,39 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
namespace OnlineEditorsExampleMVCreact
{
public class MvcApplication : HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
WebApiConfig.Register(GlobalConfiguration.Configuration);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
}
}

View File

@ -0,0 +1,452 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Configuration;
using System.Web.Script.Serialization;
using OnlineEditorsExampleMVCreact.Models;
using System.Net;
namespace OnlineEditorsExampleMVCreact.Helpers
{
public class DocManagerHelper
{
// get max file size
public static long MaxFileSize
{
get
{
long size;
long.TryParse(WebConfigurationManager.AppSettings["filesize-max"], out size);
return size > 0 ? size : 5 * 1024 * 1024;
}
}
// get all the supported file extensions
public static List<string> FileExts
{
get { return ViewedExts.Concat(EditedExts).Concat(ConvertExts).Concat(FillFormExts).ToList(); }
}
// get file extensions that can be viewed
public static List<string> ViewedExts
{
get { return (WebConfigurationManager.AppSettings["files.docservice.viewed-docs"] ?? "").Split(new char[] { '|', ',' }, StringSplitOptions.RemoveEmptyEntries).ToList(); }
}
public static List<string> FillFormExts
{
get { return (WebConfigurationManager.AppSettings["files.docservice.fillform-docs"] ?? "").Split(new char[] { '|', ',' }, StringSplitOptions.RemoveEmptyEntries).ToList(); }
}
// get file extensions that can be edited
public static List<string> EditedExts
{
get { return (WebConfigurationManager.AppSettings["files.docservice.edited-docs"] ?? "").Split(new char[] { '|', ',' }, StringSplitOptions.RemoveEmptyEntries).ToList(); }
}
// get file extensions that can be converted
public static List<string> ConvertExts
{
get { return (WebConfigurationManager.AppSettings["files.docservice.convert-docs"] ?? "").Split(new char[] { '|', ',' }, StringSplitOptions.RemoveEmptyEntries).ToList(); }
}
// get current user host address
public static string CurUserHostAddress(string userAddress = null)
{
return Regex.Replace(userAddress ?? HttpContext.Current.Request.UserHostAddress, "[^0-9a-zA-Z.=]", "_");
}
// get the storage path of the file
public static string StoragePath(string fileName, string userAddress = null)
{
var directory = "";
if (!string.IsNullOrEmpty(WebConfigurationManager.AppSettings["storage-path"]) && Path.IsPathRooted(WebConfigurationManager.AppSettings["storage-path"]))
{
directory = WebConfigurationManager.AppSettings["storage-path"] + "\\";
}
else
{
directory = HttpRuntime.AppDomainAppPath + WebConfigurationManager.AppSettings["storage-path"] + CurUserHostAddress(userAddress) + "\\";
}
if (!Directory.Exists(directory))
{
Directory.CreateDirectory(directory);
}
return directory + (fileName.Contains("\\") ? fileName : Path.GetFileName(fileName));
}
// get the path to the forcesaved file version
public static string ForcesavePath(string fileName, string userAddress, Boolean create)
{
// create the directory to this file version
var directory = "";
if (!string.IsNullOrEmpty(WebConfigurationManager.AppSettings["storage-path"]) && Path.IsPathRooted(WebConfigurationManager.AppSettings["storage-path"]))
{
directory = WebConfigurationManager.AppSettings["storage-path"] + "\\";
}
else
{
directory = HttpRuntime.AppDomainAppPath + WebConfigurationManager.AppSettings["storage-path"] + CurUserHostAddress(userAddress) + "\\";
}
if (!Directory.Exists(directory))
{
return "";
}
// create the directory to the history of this file version
directory = directory + Path.GetFileName(fileName) + "-hist" + "\\";
if (!Directory.Exists(directory))
{
if (create)
{
Directory.CreateDirectory(directory);
}
else
{
return "";
}
}
// get the path to the given file
directory = directory + Path.GetFileName(fileName);
if (!File.Exists(directory))
{
if (!create)
{
return "";
}
}
return directory;
}
// get the history directory
public static string HistoryDir(string storagePath)
{
return storagePath += "-hist";
}
// get the path to the file version by the history path and file version
public static string VersionDir(string histPath, int version)
{
return Path.Combine(histPath, version.ToString());
}
// get the path to the file version by the file name, user address and file version
public static string VersionDir(string fileName, string userAddress, int version)
{
return VersionDir(HistoryDir(StoragePath(fileName, userAddress)), version);
}
// get the file version by the history path
public static int GetFileVersion(string historyPath)
{
if (!Directory.Exists(historyPath)) return 1; // if the history path doesn't exist, then the file version is 1
return Directory.EnumerateDirectories(historyPath).Count() + 1; // take only directories from the history folder and count them
}
// get the file version by the file name and user address
public static int GetFileVersion(string fileName, string userAddress)
{
return GetFileVersion(HistoryDir(StoragePath(fileName, userAddress)));
}
// get a file name with an index if the file with such a name already exists
public static string GetCorrectName(string fileName, string userAddress = null)
{
var baseName = Path.GetFileNameWithoutExtension(fileName);
var ext = Path.GetExtension(fileName).ToLower();
var name = baseName + ext;
for (var i = 1; File.Exists(StoragePath(name, userAddress)); i++) // run through all the files with such a name in the storage directory
{
name = baseName + " (" + i + ")" + ext; // and add an index to the base name
}
return name;
}
// get all the stored files from the user host address
public static List<FileInfo> GetStoredFiles()
{
var directory = "";
if (!string.IsNullOrEmpty(WebConfigurationManager.AppSettings["storage-path"]) && Path.IsPathRooted(WebConfigurationManager.AppSettings["storage-path"]))
{
directory = WebConfigurationManager.AppSettings["storage-path"] + "\\";
}
else
{
directory = HttpRuntime.AppDomainAppPath + WebConfigurationManager.AppSettings["storage-path"] + CurUserHostAddress(null) + "\\";
}
if (!Directory.Exists(directory)) return new List<FileInfo>();
var directoryInfo = new DirectoryInfo(directory);
// take files from the root directory
List<FileInfo> storedFiles = directoryInfo.GetFiles("*.*", SearchOption.TopDirectoryOnly).ToList();
return storedFiles;
}
// create demo document
public static string CreateDemo(string fileExt, bool withContent)
{
var demoName = (withContent ? "sample." : "new.") + fileExt; // create sample or new template file with the necessary extension
var demoPath = "assets\\" + (withContent ? "sample\\" : "new\\"); // get the path to the sample document
var fileName = GetCorrectName(demoName); // get a file name with an index if the file with such a name already exists
File.Copy(HttpRuntime.AppDomainAppPath + demoPath + demoName, StoragePath(fileName)); // copy file to the storage directory
return fileName;
}
// create meta information
public static void CreateMeta(string fileName, string uid, string uname, string userAddress = null)
{
var histDir = HistoryDir(StoragePath(fileName, userAddress)); // create history directory
Directory.CreateDirectory(histDir);
// create createdInfo.json file with meta information in the history directory (creation time, user id and name)
File.WriteAllText(Path.Combine(histDir, "createdInfo.json"), new JavaScriptSerializer().Serialize(new Dictionary<string, object> {
{ "created", DateTime.Now.ToString("yyyy'-'MM'-'dd HH':'mm':'ss") },
{ "id", uid },
{ "name", uname }
}));
}
// get file url
public static string GetFileUri(string fileName, Boolean forDocumentServer)
{
var uri = new UriBuilder(GetServerUrl(forDocumentServer))
{
Path = HttpRuntime.AppDomainAppVirtualPath
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
+ CurUserHostAddress() + "/"
+ fileName,
Query = ""
};
return uri.ToString();
}
// get the path url
public static string GetPathUri(string path)
{
var uri = new UriBuilder(GetServerUrl(true))
{
Path = HttpRuntime.AppDomainAppVirtualPath + "/" + path,
Query = ""
};
return uri.ToString();
}
// get the server url
public static string GetServerUrl(Boolean forDocumentServer)
{
if (forDocumentServer && !WebConfigurationManager.AppSettings["files.docservice.url.example"].Equals(""))
{
return WebConfigurationManager.AppSettings["files.docservice.url.example"];
}
else
{
var uri = new UriBuilder(HttpContext.Current.Request.Url) { Query = "" };
var requestHost = HttpContext.Current.Request.Headers["Host"];
if (!string.IsNullOrEmpty(requestHost))
uri = new UriBuilder(uri.Scheme + "://" + requestHost);
return uri.ToString();
}
}
// get the callback url
public static string GetCallback(string fileName)
{
var callbackUrl = new UriBuilder(GetServerUrl(true))
{
Path =
HttpRuntime.AppDomainAppVirtualPath
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
+ "webeditor.ashx",
Query = "type=track"
+ "&fileName=" + HttpUtility.UrlEncode(fileName)
+ "&userAddress=" + HttpUtility.UrlEncode(CurUserHostAddress(HttpContext.Current.Request.UserHostAddress))
};
return callbackUrl.ToString();
}
// get url to the created file
public static string GetCreateUrl(FileUtility.FileType fileType)
{
var createUrl = new UriBuilder(GetServerUrl(false))
{
Path =
HttpRuntime.AppDomainAppVirtualPath
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
+ "Sample",
Query = "fileExt=" + DocManagerHelper.GetInternalExtension(fileType).Trim('.')
};
return createUrl.ToString();
}
// create the public history url
public static string GetHistoryDownloadUrl(string filename, string version, string file, Boolean isServer = true)
{
var userAddress = "&userAddress=" + HttpUtility.UrlEncode(CurUserHostAddress(HttpContext.Current.Request.UserHostAddress));
var downloadUrl = new UriBuilder(GetServerUrl(isServer))
{
Path =
HttpRuntime.AppDomainAppVirtualPath
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
+ "webeditor.ashx",
Query = "type=downloadhistory"
+ "&fileName=" + HttpUtility.UrlEncode(filename)
+ userAddress
+ "&ver=" + version
+ "&file="+ file
};
return downloadUrl.ToString();
}
// get url to download a file
public static string GetDownloadUrl(string fileName, Boolean isServer = true)
{
var userAddress = isServer ? "&userAddress=" + HttpUtility.UrlEncode(CurUserHostAddress(HttpContext.Current.Request.UserHostAddress)) : "";
var downloadUrl = new UriBuilder(GetServerUrl(isServer))
{
Path =
HttpRuntime.AppDomainAppVirtualPath
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
+ "webeditor.ashx",
Query = "type=download"
+ "&fileName=" + HttpUtility.UrlEncode(fileName)
+ userAddress
};
return downloadUrl.ToString();
}
// get an editor internal extension
public static string GetInternalExtension(FileUtility.FileType fileType)
{
switch (fileType)
{
case FileUtility.FileType.Word: // .docx for word file type
return ".docx";
case FileUtility.FileType.Cell: // .xlsx for cell file type
return ".xlsx";
case FileUtility.FileType.Slide: // .pptx for slide file type
return ".pptx";
default:
return ".docx"; // the default file type is .docx
}
}
// get image url for templates
public static string GetTemplateImageUrl(FileUtility.FileType fileType)
{
var path = new UriBuilder(GetServerUrl(true)) // templates image url in the "From Template" section
{
Path = HttpRuntime.AppDomainAppVirtualPath
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
+ "Content\\images\\"
};
switch (fileType)
{
case FileUtility.FileType.Word: // for word file type
return path + "file_docx.svg";
case FileUtility.FileType.Cell: // for cell file type
return path + "file_xlsx.svg";
case FileUtility.FileType.Slide: // for slide file type
return path + "file_pptx.svg";
default:
return path + "file_docx.svg"; // the default value
}
}
// get file information
public static List<Dictionary<string, object>> GetFilesInfo(string fileId = null)
{
var files = new List<Dictionary<string, object>>();
// run through all the stored files
foreach (var file in GetStoredFiles())
{
// write all the parameters to the map
var dictionary = new Dictionary<string, object>();
dictionary.Add("version", GetFileVersion(file.Name, null));
dictionary.Add("id", ServiceConverter.GenerateRevisionId(DocManagerHelper.CurUserHostAddress() + "/" + file.Name + "/" + File.GetLastWriteTime(DocManagerHelper.StoragePath(file.Name, null)).GetHashCode()));
dictionary.Add("contentLength", Math.Round(file.Length / 1024.0, 2) + " KB");
dictionary.Add("pureContentLength", file.Length);
dictionary.Add("title", file.Name);
dictionary.Add("updated", file.LastWriteTime.ToString());
// get file information by its id
if (fileId != null)
{
if (fileId.Equals(dictionary["id"]))
{
files.Add(dictionary);
break;
}
}
else
{
files.Add(dictionary);
}
}
return files;
}
// enable certificate ignore
public static void VerifySSL()
{
// hack. http://ubuntuforums.org/showthread.php?t=1841740
if(WebConfigurationManager.AppSettings["files.docservice.verify-peer-off"].Equals("true")) {
ServicePointManager.ServerCertificateValidationCallback += (s, ce, ca, p) => true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
}
}
public static Dictionary<string, string> GetLanguages()
{
var languages = new Dictionary<string, string>();
String[] couples = (WebConfigurationManager.AppSettings["files.docservice.languages"] ?? "").Split('|');
foreach (string couple in couples)
{
String[] tmp = couple.Split(':');
languages.Add(tmp[0],tmp[1]);
}
return languages;
}
public static string GetDirectUrl()
{
string isEnabledDirectUrl = HttpUtility.ParseQueryString(HttpContext.Current.Request.Url.Query).Get("directUrl");
return isEnabledDirectUrl != null ? isEnabledDirectUrl : "false";
}
}
}

View File

@ -0,0 +1,271 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Web.Configuration;
using System.Web.Helpers;
using System.Web.Script.Serialization;
namespace OnlineEditorsExampleMVCreact.Helpers
{
/// <summary>
/// Class service api conversion
/// </summary>
public static class ServiceConverter
{
/// <summary>
/// Static constructor
/// </summary>
static ServiceConverter()
{
DocumentConverterUrl = (WebConfigurationManager.AppSettings["files.docservice.url.site"] ?? "") + (WebConfigurationManager.AppSettings["files.docservice.url.converter"] ?? "");
Int32.TryParse(WebConfigurationManager.AppSettings["files.docservice.timeout"], out ConvertTimeout);
ConvertTimeout = ConvertTimeout > 0 ? ConvertTimeout : 120000;
}
#region private fields
/// <summary>
/// Timeout to request conversion
/// </summary>
private static readonly int ConvertTimeout;
/// <summary>
/// Url to the service of conversion
/// </summary>
private static readonly string DocumentConverterUrl;
#endregion
#region public method
/// <summary>
/// The method is to convert the file to the required format
/// </summary>
/// <param name="documentUri">Uri for the document to convert</param>
/// <param name="fromExtension">Document extension</param>
/// <param name="toExtension">Extension to which to convert</param>
/// <param name="documentRevisionId">Key for caching on service</param>
/// <param name="isAsync">Perform conversions asynchronously</param>
/// <param name="convertedDocumentUri">Uri to the converted document</param>
/// <returns>The percentage of conversion completion</returns>
/// <example>
/// string convertedDocumentUri;
/// GetConvertedUri("http://helpcenter.onlyoffice.com/content/GettingStarted.pdf", ".pdf", ".docx", "http://helpcenter.onlyoffice.com/content/GettingStarted.pdf", false, out convertedDocumentUri);
/// </example>
/// <exception>
/// </exception>
public static int GetConvertedUri(string documentUri,
string fromExtension,
string toExtension,
string documentRevisionId,
bool isAsync,
out string convertedDocumentUri,
string filePass = null,
string lang = null)
{
convertedDocumentUri = string.Empty;
// check if the fromExtension parameter is defined; if not, get it from the document url
fromExtension = string.IsNullOrEmpty(fromExtension) ? Path.GetExtension(documentUri).ToLower() : fromExtension;
// check if the file name parameter is defined; if not, get random uuid for this file
var title = Path.GetFileName(documentUri);
title = string.IsNullOrEmpty(title) ? Guid.NewGuid().ToString() : title;
// get document key
documentRevisionId = string.IsNullOrEmpty(documentRevisionId)
? documentUri
: documentRevisionId;
documentRevisionId = GenerateRevisionId(documentRevisionId);
// specify request parameters
var request = (HttpWebRequest)WebRequest.Create(DocumentConverterUrl);
request.Method = "POST";
request.ContentType = "application/json";
request.Accept = "application/json";
request.Timeout = ConvertTimeout;
// write all the necessary parameters to the body object
var body = new Dictionary<string, object>() {
{ "async", isAsync },
{ "filetype", fromExtension.Trim('.') },
{ "key", documentRevisionId },
{ "outputtype", toExtension.Trim('.') },
{ "title", title },
{ "url", documentUri },
{ "password", filePass },
{ "region", lang }
};
if (JwtManager.Enabled)
{
// create payload object
var payload = new Dictionary<string, object>
{
{ "payload", body }
};
var payloadToken = JwtManager.Encode(payload); // encode the payload object to the payload token
var bodyToken = JwtManager.Encode(body); // encode the body object to the body token
// create header token
string JWTheader = string.IsNullOrEmpty(WebConfigurationManager.AppSettings["files.docservice.header"]) ? "Authorization" : WebConfigurationManager.AppSettings["files.docservice.header"];
request.Headers.Add(JWTheader, "Bearer " + payloadToken);
body.Add("token", bodyToken);
}
var bytes = Encoding.UTF8.GetBytes(new JavaScriptSerializer().Serialize(body));
request.ContentLength = bytes.Length;
using (var requestStream = request.GetRequestStream()) // get the request stream
{
requestStream.Write(bytes, 0, bytes.Length); // and write the serialized body object to it
}
DocManagerHelper.VerifySSL();
string dataResponse;
using (var response = request.GetResponse())
using (var stream = response.GetResponseStream()) // get the response stream
{
if (stream == null) throw new Exception("Response is null");
using (var reader = new StreamReader(stream))
{
dataResponse = reader.ReadToEnd(); // and read it
}
}
return GetResponseUri(dataResponse, out convertedDocumentUri);
}
/// <summary>
/// Translation key to a supported form.
/// </summary>
/// <param name="expectedKey">Expected key</param>
/// <returns>Supported key</returns>
public static string GenerateRevisionId(string expectedKey)
{
// if the expected key length is greater than 20, it is hashed and a fixed length value is stored in the string format
if (expectedKey.Length > 20) expectedKey = expectedKey.GetHashCode().ToString();
var key = Regex.Replace(expectedKey, "[^0-9-.a-zA-Z_=]", "_");
return key.Substring(key.Length - Math.Min(key.Length, 20)); // the resulting key length is 20 or less
}
#endregion
#region private method
/// <summary>
/// Processing document received from the editing service
/// </summary>
/// <param name="jsonDocumentResponse">The resulting json from editing service</param>
/// <param name="responseUri">Uri to the converted document</param>
/// <returns>The percentage of conversion completion</returns>
private static int GetResponseUri(string jsonDocumentResponse, out string responseUri)
{
if (string.IsNullOrEmpty(jsonDocumentResponse)) throw new ArgumentException("Invalid param", "jsonDocumentResponse");
var responseFromService = Json.Decode(jsonDocumentResponse);
if (jsonDocumentResponse == null) throw new WebException("Invalid answer format");
var errorElement = responseFromService.error; // if an error occurs
if (errorElement != null) ProcessResponseError(Convert.ToInt32(errorElement)); // then get an error message
// check if the conversion is completed and save the result to a variable
var isEndConvert = responseFromService.endConvert;
int resultPercent;
responseUri = string.Empty;
if (isEndConvert) // if the conversion is completed
{
responseUri = responseFromService.fileUrl; // get the file url
resultPercent = 100;
}
else // if the conversion isn't completed
{
resultPercent = responseFromService.percent; // get the percentage value
if (resultPercent >= 100) resultPercent = 99;
}
return resultPercent;
}
/// <summary>
/// Generate an error code table
/// </summary>
/// <param name="errorCode">Error code</param>
private static void ProcessResponseError(int errorCode)
{
var errorMessage = string.Empty;
const string errorMessageTemplate = "Error occurred in the ConvertService.ashx: {0}";
switch (errorCode)
{
case -8:
// public const int c_nErrorFileVKey = -8;
errorMessage = String.Format(errorMessageTemplate, "Error document VKey");
break;
case -7:
// public const int c_nErrorFileRequest = -7;
errorMessage = String.Format(errorMessageTemplate, "Error document request");
break;
case -6:
// public const int c_nErrorDatabase = -6;
errorMessage = String.Format(errorMessageTemplate, "Error database");
break;
case -5:
// public const int c_nErrorUnexpectedGuid = -5;
errorMessage = String.Format(errorMessageTemplate, "Incorrect password");
break;
case -4:
// public const int c_nErrorDownloadError = -4;
errorMessage = String.Format(errorMessageTemplate, "Error download error");
break;
case -3:
// public const int c_nErrorConvertationError = -3;
errorMessage = String.Format(errorMessageTemplate, "Error convertation error");
break;
case -2:
// public const int c_nErrorConvertationTimeout = -2;
errorMessage = String.Format(errorMessageTemplate, "Error convertation timeout");
break;
case -1:
// public const int c_nErrorUnknown = -1;
errorMessage = String.Format(errorMessageTemplate, "Error convertation unknown");
break;
case 0:
// public const int c_nErrorNo = 0;
break;
default:
errorMessage = "ErrorCode = " + errorCode;
break;
}
throw new Exception(errorMessage);
}
#endregion
}
}

View File

@ -0,0 +1,60 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using JWT;
using JWT.Algorithms;
using JWT.Builder;
using JWT.Serializers;
using System.Collections.Generic;
using System.Web.Configuration;
namespace OnlineEditorsExampleMVCreact.Helpers
{
public static class JwtManager
{
private static readonly string Secret;
public static readonly bool Enabled;
static JwtManager()
{
Secret = WebConfigurationManager.AppSettings["files.docservice.secret"] ?? ""; // get token secret from the config parameters
Enabled = !string.IsNullOrEmpty(Secret); // check if the token is enabled
}
// encode a payload object into a token using a secret key
public static string Encode(IDictionary<string, object> payload)
{
var encoder = new JwtEncoder(new HMACSHA256Algorithm(),
new JsonNetSerializer(),
new JwtBase64UrlEncoder());
return encoder.Encode(payload, Secret);
}
// decode a token into a payload object using a secret key
public static string Decode(string token)
{
if (!Enabled || string.IsNullOrEmpty(token)) return "";
return JwtBuilder.Create()
.WithAlgorithm(new HMACSHA256Algorithm())
.WithSecret(Secret)
.MustVerifySignature()
.Decode(token);
}
}
}

View File

@ -0,0 +1,360 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System;
using System.IO;
using System.Net;
using System.Collections.Generic;
using System.Web.Script.Serialization;
using System.Web.Configuration;
using System.Linq;
using System.Web;
using System.Text;
namespace OnlineEditorsExampleMVCreact.Helpers
{
public class TrackManager
{
// read request body
public static Dictionary<string, object> readBody(HttpContext context)
{
string body;
try
{
// read request body by streams and check if it is correct
using (var receiveStream = context.Request.InputStream)
using (var readStream = new StreamReader(receiveStream))
{
body = readStream.ReadToEnd();
if (string.IsNullOrEmpty(body)) context.Response.Write("{\"error\":1,\"message\":\"Request stream is empty\"}");
}
}
catch (Exception e)
{
throw new HttpException((int)HttpStatusCode.BadRequest, e.Message);
}
var jss = new JavaScriptSerializer();
var fileData = jss.Deserialize<Dictionary<string, object>>(body);
// check if the document token is enabled
if (JwtManager.Enabled)
{
string JWTheader = string.IsNullOrEmpty(WebConfigurationManager.AppSettings["files.docservice.header"]) ? "Authorization" : WebConfigurationManager.AppSettings["files.docservice.header"];
string token = null;
// if the document token is in the data
if (fileData.ContainsKey("token"))
{
token = JwtManager.Decode(fileData["token"].ToString()); // decode it
}
else if (context.Request.Headers.AllKeys.Contains(JWTheader, StringComparer.InvariantCultureIgnoreCase)) // if the Authorization header exists
{
var headerToken = context.Request.Headers.Get(JWTheader).Substring("Bearer ".Length);
token = JwtManager.Decode(headerToken); // decode its part after Authorization prefix
}
else // otherwise, an error occurs
{
context.Response.Write("{\"error\":1,\"message\":\"JWT expected\"}");
}
if (token != null && !token.Equals("")) // invalid signature error
{
fileData = jss.Deserialize<Dictionary<string, object>>(token);
if (fileData.ContainsKey("payload"))
fileData = (Dictionary<string, object>)fileData["payload"];
}
else
{
context.Response.Write("{\"error\":1,\"message\":\"JWT validation failed\"}");
}
}
return fileData;
}
// file saving process
public static int processSave(Dictionary<string, object> fileData, string fileName, string userAddress)
{
if (string.IsNullOrEmpty((string)fileData["url"])) {
throw new Exception("DownloadUrl is null");
}
var downloadUri = (string)fileData["url"];
string curExt = Path.GetExtension(fileName).ToLower(); // get current file extension
var downloadExt = "." + (string)fileData["filetype"]; // get the extension of the downloaded file
var newFileName = fileName;
// convert downloaded file to the file with the current extension if these extensions aren't equal
if (!curExt.Equals(downloadExt, StringComparison.InvariantCultureIgnoreCase))
{
try
{
// convert file and give url to a new file
string newFileUri;
var result = ServiceConverter.GetConvertedUri(downloadUri, downloadExt, curExt, ServiceConverter.GenerateRevisionId(downloadUri), false, out newFileUri);
if (string.IsNullOrEmpty(newFileUri))
{
// get the correct file name if it already exists
newFileName = DocManagerHelper.GetCorrectName(Path.GetFileNameWithoutExtension(fileName) + downloadExt, userAddress);
}
else
{
downloadUri = newFileUri;
}
}
catch (Exception)
{
newFileName = DocManagerHelper.GetCorrectName(Path.GetFileNameWithoutExtension(fileName) + downloadExt, userAddress);
}
}
DocManagerHelper.VerifySSL();
try
{
var bytesFile = DownloadFile(downloadUri); // download document file
var storagePath = DocManagerHelper.StoragePath(newFileName, userAddress); // get the file path
var histDir = DocManagerHelper.HistoryDir(storagePath); // get the path to the history directory
if (!Directory.Exists(histDir)) Directory.CreateDirectory(histDir);
var versionDir = DocManagerHelper.VersionDir(histDir, DocManagerHelper.GetFileVersion(histDir)); // get the path to the file version
if (!Directory.Exists(versionDir)) Directory.CreateDirectory(versionDir); // if the path doesn't exist, create it
// get the path to the previous file version and move it to the storage directory
File.Move(DocManagerHelper.StoragePath(fileName, userAddress), Path.Combine(versionDir, "prev" + curExt));
SaveFile(bytesFile, storagePath);// save document file
byte[] bytesChanges = DownloadFile((string)fileData["changesurl"]); // download changes file
SaveFile(bytesChanges, Path.Combine(versionDir, "diff.zip")); // save file changes to the diff.zip archive
var hist = fileData.ContainsKey("changeshistory") ? (string)fileData["changeshistory"] : null;
if (string.IsNullOrEmpty(hist) && fileData.ContainsKey("history"))
{
var jss = new JavaScriptSerializer();
hist = jss.Serialize(fileData["history"]);
}
if (!string.IsNullOrEmpty(hist))
{
File.WriteAllText(Path.Combine(versionDir, "changes.json"), hist); // write the history changes to the changes.json file
}
File.WriteAllText(Path.Combine(versionDir, "key.txt"), (string)fileData["key"]); // write the key value to the key.txt file
string forcesavePath = DocManagerHelper.ForcesavePath(newFileName, userAddress, false); // get the path to the forcesaved file version
if (!forcesavePath.Equals("")) // if the forcesaved file version exists
{
File.Delete(forcesavePath); // remove it
}
} catch (Exception)
{
return 1;
}
return 0;
}
// file force saving process
public static int processForceSave(Dictionary<string, object> fileData, string fileName, string userAddress)
{
if ( string.IsNullOrEmpty((string)fileData["url"])) {
throw new Exception("DownloadUrl is null");
}
var downloadUri = (string)fileData["url"];
string curExt = Path.GetExtension(fileName).ToLower(); // get current file extension
var downloadExt = "." + (string)fileData["filetype"]; // get the extension of the downloaded file
Boolean newFileName = false;
// convert downloaded file to the file with the current extension if these extensions aren't equal
if (!curExt.Equals(downloadExt))
{
try
{
// convert file and give url to a new file
string newFileUri;
var result = ServiceConverter.GetConvertedUri(downloadUri, downloadExt, curExt, ServiceConverter.GenerateRevisionId(downloadUri), false, out newFileUri);
if (string.IsNullOrEmpty(newFileUri))
{
newFileName = true;
}
else
{
downloadUri = newFileUri;
}
}
catch (Exception)
{
newFileName = true;
}
}
DocManagerHelper.VerifySSL();
try
{
var bytesFile = DownloadFile(downloadUri); // download document file
string forcesavePath = "";
Boolean isSubmitForm = fileData["forcesavetype"].ToString().Equals("3"); // SubmitForm
if (isSubmitForm) // if the form is submitted
{
if (newFileName)
{
fileName = DocManagerHelper.GetCorrectName(Path.GetFileNameWithoutExtension(fileName) + "-form" + downloadExt, userAddress); // get the correct file name if it already exists
} else
{
fileName = DocManagerHelper.GetCorrectName(Path.GetFileNameWithoutExtension(fileName) + "-form" + curExt, userAddress);
}
forcesavePath = DocManagerHelper.StoragePath(fileName, userAddress);
}
else
{
if (newFileName)
{
fileName = DocManagerHelper.GetCorrectName(Path.GetFileNameWithoutExtension(fileName) + downloadExt, userAddress);
}
forcesavePath = DocManagerHelper.ForcesavePath(fileName, userAddress, false);
if (string.IsNullOrEmpty(forcesavePath)) // create forcesave path if it doesn't exist
{
forcesavePath = DocManagerHelper.ForcesavePath(fileName, userAddress, true);
}
}
SaveFile(bytesFile, forcesavePath);// save document file
if (isSubmitForm)
{
var jss = new JavaScriptSerializer();
var actions = jss.Deserialize<List<object>>(jss.Serialize(fileData["actions"]));
var action = jss.Deserialize<Dictionary<string, object>>(jss.Serialize(actions[0]));
var user = action["userid"].ToString(); // get the user id
DocManagerHelper.CreateMeta(fileName, user, "Filling Form", userAddress); // create meta data for the forcesaved file
}
} catch (Exception)
{
return 1;
}
return 0;
}
// create a command request
public static void commandRequest(string method, string key, object meta = null)
{
DocManagerHelper.VerifySSL();
string documentCommandUrl = WebConfigurationManager.AppSettings["files.docservice.url.site"] + WebConfigurationManager.AppSettings["files.docservice.url.command"];
var request = (HttpWebRequest)WebRequest.Create(documentCommandUrl);
request.Method = "POST";
request.ContentType = "application/json";
var body = new Dictionary<string, object>() {
{ "c", method },
{ "key", key }
};
if (meta != null)
{
body.Add("meta", meta);
}
// check if a secret key to generate token exists or not
if (JwtManager.Enabled)
{
var payload = new Dictionary<string, object>
{
{ "payload", body }
};
var payloadToken = JwtManager.Encode(payload); // encode a payload object into a header token
var bodyToken = JwtManager.Encode(body); // encode body into a body token
string JWTheader = string.IsNullOrEmpty(WebConfigurationManager.AppSettings["files.docservice.header"]) ? "Authorization" : WebConfigurationManager.AppSettings["files.docservice.header"];
request.Headers.Add(JWTheader, "Bearer " + payloadToken); // add a header Authorization with a header token and Authorization prefix in it
body.Add("token", bodyToken);
}
var bytes = Encoding.UTF8.GetBytes(new JavaScriptSerializer().Serialize(body));
request.ContentLength = bytes.Length;
using (var requestStream = request.GetRequestStream())
{
// write bytes to the output stream
requestStream.Write(bytes, 0, bytes.Length);
}
string dataResponse;
using (var response = request.GetResponse()) // get the response
using (var stream = response.GetResponseStream())
{
if (stream == null) throw new Exception("Response is null");
using (var reader = new StreamReader(stream))
{
dataResponse = reader.ReadToEnd(); // and read it
}
}
// convert stream to json string
var jss = new JavaScriptSerializer();
var responseObj = jss.Deserialize<Dictionary<string, object>>(dataResponse);
if (!responseObj["error"].ToString().Equals("0"))
{
throw new Exception(dataResponse);
}
}
// save file
private static void SaveFile(byte[] data, string path)
{
using (var fs = File.Open(path, FileMode.Create))
{
fs.Write(data, 0, data.Length);
}
}
// save file information from the url to the file specified
private static byte[] DownloadFile(string url)
{
if (string.IsNullOrEmpty(url)) throw new ArgumentException("url"); // url isn't specified
var req = (HttpWebRequest)WebRequest.Create(url);
req.Timeout = 5000;
using (var stream = req.GetResponse().GetResponseStream()) // get input stream of the file information from the url
{
if (stream == null) throw new Exception("stream is null");
using (MemoryStream memoryStream = new MemoryStream())
{
stream.CopyTo(memoryStream);
return memoryStream.ToArray();
}
}
}
}
}

View File

@ -0,0 +1,204 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System.Collections.Generic;
using System.Linq;
namespace OnlineEditorsExampleMVCreact.Helpers
{
public class Users
{
static List<string> descr_user_1 = new List<string>()
{
"File author by default",
"Doesnt belong to any group",
"Can review all the changes",
"Can perform all actions with comments",
"The file favorite state is undefined",
"Can create files from templates using data from the editor",
"Can see the information about all users"
};
static List<string> descr_user_2 = new List<string>()
{
"Belongs to Group2",
"Can review only his own changes or changes made by users with no group",
"Can view comments, edit his own comments and comments left by users with no group. Can remove his own comments only",
"This file is marked as favorite",
"Can create new files from the editor",
"Can see the information about users from Group2 and users who dont belong to any group"
};
static List<string> descr_user_3 = new List<string>()
{
"Belongs to Group3",
"Can review changes made by Group2 users",
"Can view comments left by Group2 and Group3 users. Can edit comments left by the Group2 users",
"This file isnt marked as favorite",
"Cant copy data from the file to clipboard",
"Cant download the file",
"Cant print the file",
"Can create new files from the editor",
"Can see the information about Group2 users"
};
static List<string> descr_user_0 = new List<string>()
{
"The name is requested when the editor is opened",
"Doesnt belong to any group",
"Can review all the changes",
"Can perform all actions with comments",
"The file favorite state is undefined",
"Can't mention others in comments",
"Can't create new files from the editor",
"Cant see anyones information",
"Can't rename files from the editor",
"Can't view chat",
"View file without collaboration",
};
private static List<User> users = new List<User>() {
new User(
"uid-1",
"John Smith",
"smith@example.com",
"",
null,
new Dictionary<string, object>(),
null,
null,
new List<string>(),
descr_user_1,
true
),
new User(
"uid-2",
"Mark Pottato",
"pottato@example.com",
"group-2",
new List<string>() { "group-2", "" },
new Dictionary<string, object>()
{
{ "view", "" },
{ "edit", new List<string>() { "group-2", "" } },
{ "remove", new List<string>() { "group-2" } }
},
new List<string>() { "group-2", "" },
true,
new List<string>(),
descr_user_2,
false
),
new User(
"uid-3",
"Hamish Mitchell",
"mitchell@example.com",
"group-3",
new List<string>() { "group-2" },
new Dictionary<string,object>()
{
{ "view", new List<string>() { "group-2", "group-3" } },
{ "edit", new List<string>() { "group-2" } },
{ "remove", new List<string>() { } }
},
new List<string>() { "group-2" },
false,
new List<string>() { "copy", "download", "print" },
descr_user_3,
false
),
new User(
"uid-0",
null,
null,
"",
null,
new Dictionary<string,object>(),
new List<string>(),
null,
new List<string>(),
descr_user_0,
false
)
};
// get a user by id specified
public static User getUser(string id)
{
foreach(User user in users)
{
if (user.id.Equals(id)) return user;
}
return users[0];
}
// get a list of all the users
public static List<User> getAllUsers()
{
return users;
}
// get a list of users with their names and emails for mentions
public static List<Dictionary<string, object>> getUsersForMentions(string id)
{
List<Dictionary<string, object>> usersData = new List<Dictionary<string, object>>();
foreach (User user in users)
{
if (!user.id.Equals(id) && user.name != null && user.email != null)
{
usersData.Add(new Dictionary<string, object>()
{
{"name", user.name },
{"email", user.email }
});
}
}
return usersData;
}
}
public class User
{
public string id;
public string name;
public string email;
public string group;
public List<string> reviewGroups;
public Dictionary<string, object> commentGroups;
public bool? favorite;
public List<string> deniedPermissions;
public List<string> descriptions;
public bool templates;
public List<string> userInfoGroups;
public User(string id, string name, string email, string group, List<string> reviewGroups, Dictionary<string, object> commentGroups, List<string> userInfoGroups, bool? favorite, List<string> deniedPermissions, List<string> descriptions, bool templates)
{
this.id = id;
this.name = name;
this.email = email;
this.group = group;
this.reviewGroups = reviewGroups;
this.commentGroups = commentGroups;
this.favorite = favorite;
this.deniedPermissions = deniedPermissions;
this.descriptions = descriptions;
this.templates = templates;
this.userInfoGroups = userInfoGroups;
}
}
}

View File

@ -0,0 +1,41 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System.Web;
namespace OnlineEditorsExampleMVCreact.Helpers
{
public static class Utils
{
// get the request header or return the default one
public static string GetOrDefault(this HttpRequest request, string header, string def)
{
var value = request[header];
if (value != null) return value;
return def;
}
// get a cookie from the cookie collection or return the default one
public static string GetOrDefault(this HttpCookieCollection cookies, string cookie, string def)
{
var cook = cookies[cookie];
if (cook != null && !string.IsNullOrEmpty(cook.Value)) return cook.Value;
return def;
}
}
}

View File

@ -0,0 +1,482 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Web;
using System.Web.Configuration;
using System.Web.Mvc;
using System.Web.Script.Serialization;
using OnlineEditorsExampleMVCreact.Helpers;
namespace OnlineEditorsExampleMVCreact.Models
{
// create file model
public class FileModel
{
public string Mode { get; set; } // editor mode
public string Type { get; set; } // editor type
public bool IsEnabledDirectUrl { get; set; } // is enabled direct url
// get file url for Document Server
public string FileUri
{
get { return DocManagerHelper.GetFileUri(FileName, true); }
}
// get file url for user
public string FileUriUser
{
get { return Path.IsPathRooted(WebConfigurationManager.AppSettings["storage-path"]) ? DownloadUrl + "&dmode=emb" : DocManagerHelper.GetFileUri(FileName, false); }
}
public string FileName { get; set; } // file name
// get document type
public string DocumentType
{
get { return FileUtility.GetFileType(FileName).ToString().ToLower(); }
}
// get document key
public string Key
{
get { return ServiceConverter.GenerateRevisionId(DocManagerHelper.CurUserHostAddress() + "/" + FileName + "/" + File.GetLastWriteTime(DocManagerHelper.StoragePath(FileName, null)).GetHashCode()); }
}
// get the callback url
public string CallbackUrl
{
get { return DocManagerHelper.GetCallback(FileName); }
}
public string DownloadUrl
{
get { return DocManagerHelper.GetDownloadUrl(FileName); }
}
// get the document config
public string GetDocConfig(HttpRequest request, UrlHelper url)
{
var jss = new JavaScriptSerializer();
var ext = Path.GetExtension(FileName).ToLower(); // get file extension
var editorsMode = Mode ?? "edit"; // get editor mode
var canEdit = DocManagerHelper.EditedExts.Contains(ext); // check if the file with such an extension can be edited
var id = request.Cookies.GetOrDefault("uid", null);
var user = Users.getUser(id); // get the user
if ((!canEdit && editorsMode.Equals("edit") || editorsMode.Equals("fillForms")) && DocManagerHelper.FillFormExts.Contains(ext)) {
editorsMode = "fillForms";
canEdit = true;
}
var submitForm = editorsMode.Equals("fillForms") && id.Equals("uid-1") && false; // check if the Submit form button is displayed or not
var mode = canEdit && editorsMode != "view" ? "edit" : "view"; // set the mode parameter: change it to view if the document can't be edited
// favorite icon state
bool? favorite = user.favorite;
var actionLink = request.GetOrDefault("actionLink", null); // get the action link (comment or bookmark) if it exists
var actionData = string.IsNullOrEmpty(actionLink) ? null : jss.DeserializeObject(actionLink); // get action data for the action link
var directUrl = DocManagerHelper.GetDownloadUrl(FileName, false);
var createUrl = DocManagerHelper.GetCreateUrl(FileUtility.GetFileType(FileName));
var templatesImageUrl = DocManagerHelper.GetTemplateImageUrl(FileUtility.GetFileType(FileName)); // image url for templates
var templates = new List<Dictionary<string, string>>
{
new Dictionary<string, string>()
{
{ "image", "" },
{ "title", "Blank" },
{ "url", createUrl },
},
new Dictionary<string, string>()
{
{ "image", templatesImageUrl },
{ "title", "With sample content" },
{ "url", createUrl + "&sample=true" },
}
};
// specify the document config
var config = new Dictionary<string, object>
{
{ "type", Type ?? "desktop" },
{ "documentType", DocumentType },
{
"document", new Dictionary<string, object>
{
{ "title", FileName },
{ "url", DownloadUrl },
{ "directUrl", IsEnabledDirectUrl ? directUrl : "" },
{ "fileType", ext.Trim('.') },
{ "key", Key },
{
"info", new Dictionary<string, object>
{
{ "owner", "Me" },
{ "uploaded", DateTime.Now.ToShortDateString() },
{ "favorite", favorite}
}
},
{
// the permission for the document to be edited and downloaded or not
"permissions", new Dictionary<string, object>
{
{ "comment", editorsMode != "view" && editorsMode != "fillForms" && editorsMode != "embedded" && editorsMode != "blockcontent" },
{ "copy", !user.deniedPermissions.Contains("copy") },
{ "download", !user.deniedPermissions.Contains("download") },
{ "edit", canEdit && (editorsMode == "edit" || editorsMode == "view" || editorsMode == "filter" || editorsMode == "blockcontent") },
{ "print", !user.deniedPermissions.Contains("print") },
{ "fillForms", editorsMode != "view" && editorsMode != "comment" && editorsMode != "embedded" && editorsMode != "blockcontent" },
{ "modifyFilter", editorsMode != "filter" },
{ "modifyContentControl", editorsMode != "blockcontent" },
{ "review", canEdit && (editorsMode == "edit" || editorsMode == "review") },
{ "chat", !user.id.Equals("uid-0") },
{ "reviewGroups", user.reviewGroups },
{ "commentGroups", user.commentGroups },
{ "userInfoGroups", user.userInfoGroups }
}
}
}
},
{
"editorConfig", new Dictionary<string, object>
{
{ "actionLink", actionData },
{ "mode", mode },
{ "lang", request.Cookies.GetOrDefault("ulang", "en") },
{ "callbackUrl", CallbackUrl }, // absolute URL to the document storage service
{ "coEditing", editorsMode == "view" && user.id.Equals("uid-0") ?
new Dictionary<string, object>{
{"mode", "strict"},
{"change", false}
} : null },
{ "createUrl", !user.id.Equals("uid-0") ? createUrl : null },
{ "templates", user.templates ? templates : null },
{
// the user currently viewing or editing the document
"user", new Dictionary<string, object>
{
{ "id", !user.id.Equals("uid-0") ? user.id : null },
{ "name", user.name },
{ "group", user.group }
}
},
{
// the parameters for the embedded document type
"embedded", new Dictionary<string, object>
{
{ "saveUrl", directUrl }, // the absolute URL that will allow the document to be saved onto the user personal computer
{ "embedUrl", directUrl }, // the absolute URL to the document serving as a source file for the document embedded into the web page
{ "shareUrl", directUrl }, // the absolute URL that will allow other users to share this document
{ "toolbarDocked", "top" } // the place for the embedded viewer toolbar (top or bottom)
}
},
{
// the parameters for the editor interface
"customization", new Dictionary<string, object>
{
{ "about", true }, // the About section display
{ "comments", true },
{ "feedback", true }, // the Feedback & Support menu button display
{ "forcesave", false }, // adds the request for the forced file saving to the callback handler
{ "submitForm", submitForm }, // if the Submit form button is displayed or not
{
"goback", new Dictionary<string, object> // settings for the Open file location menu button and upper right corner button
{
{ "url", DocManagerHelper.GetServerUrl(false) } // the absolute URL to the website address which will be opened when clicking the Open file location menu button
}
}
}
}
}
}
};
// if the secret key to generate token exists
if (JwtManager.Enabled)
{
// encode the document config into a token
var token = JwtManager.Encode(config);
config.Add("token", token);
}
return jss.Serialize(config);
}
// get the document history
public void GetHistory(out string history, out string historyData)
{
var storagePath = WebConfigurationManager.AppSettings["storage-path"];
var jss = new JavaScriptSerializer();
var histDir = DocManagerHelper.HistoryDir(DocManagerHelper.StoragePath(FileName, null));
history = null;
historyData = null;
if (DocManagerHelper.GetFileVersion(histDir) > 0) // if the file was modified (the file version is greater than 0)
{
var currentVersion = DocManagerHelper.GetFileVersion(histDir);
var hist = new List<Dictionary<string, object>>();
var histData = new Dictionary<string, object>();
for (var i = 1; i <= currentVersion; i++) // run through all the file versions
{
var obj = new Dictionary<string, object>();
var dataObj = new Dictionary<string, object>();
var verDir = DocManagerHelper.VersionDir(histDir, i); // get the path to the given file version
var key = i == currentVersion ? Key : File.ReadAllText(Path.Combine(verDir, "key.txt")); // get document key
obj.Add("key", key);
obj.Add("version", i);
if (i == 1) // check if the version number is equal to 1
{
var infoPath = Path.Combine(histDir, "createdInfo.json"); // get meta data of this file
if (File.Exists(infoPath))
{
var info = jss.Deserialize<Dictionary<string, object>>(File.ReadAllText(infoPath));
obj.Add("created", info["created"]); // write meta information to the object (user information and creation date)
obj.Add("user", new Dictionary<string, object>() {
{ "id", info["id"] },
{ "name", info["name"] },
});
}
}
var ext = Path.GetExtension(FileName).ToLower();
dataObj.Add("fileType", ext.Replace(".", ""));
dataObj.Add("key", key);
// write file url to the data object
string prevFileUrl;
string directPrevFileUrl;
if (Path.IsPathRooted(storagePath) && !string.IsNullOrEmpty(storagePath))
{
prevFileUrl = i == currentVersion ? DocManagerHelper.GetHistoryDownloadUrl(FileName, i.ToString(), "prev" + ext)
: DocManagerHelper.GetDownloadUrl(Directory.GetFiles(verDir, "prev.*")[0].Replace(storagePath + "\\", ""));
directPrevFileUrl = i == currentVersion ? DocManagerHelper.GetHistoryDownloadUrl(FileName, i.ToString(), "prev" + ext, false)
: DocManagerHelper.GetDownloadUrl(Directory.GetFiles(verDir, "prev.*")[0].Replace(storagePath + "\\", ""), false);
}
else {
prevFileUrl = i == currentVersion ? FileUri
: DocManagerHelper.GetHistoryDownloadUrl(FileName, i.ToString(), "prev" + ext);
directPrevFileUrl = i == currentVersion ? DocManagerHelper.GetHistoryDownloadUrl(FileName, i.ToString(), "prev" + ext, false)
: DocManagerHelper.GetDownloadUrl(Directory.GetFiles(verDir, "prev.*")[0].Replace(storagePath + "\\", ""), false);
}
dataObj.Add("url", prevFileUrl);
if (IsEnabledDirectUrl)
{
dataObj.Add("directUrl", directPrevFileUrl);
}
dataObj.Add("version", i);
if (i > 1) // check if the version number is greater than 1 (the file was modified)
{
// get the path to the changes.json file
var changes = jss.Deserialize<Dictionary<string, object>>(File.ReadAllText(Path.Combine(DocManagerHelper.VersionDir(histDir, i - 1), "changes.json")));
var changesArray = (ArrayList)changes["changes"];
var change = changesArray.Count > 0
? (Dictionary<string, object>)changesArray[0]
: new Dictionary<string, object>();
// write information about changes to the object
obj.Add("changes", change.Count > 0 ? changes["changes"] : null);
obj.Add("serverVersion", changes["serverVersion"]);
obj.Add("created", change.Count > 0 ? change["created"] : null);
obj.Add("user", change.Count > 0 ? change["user"] : null);
var prev = (Dictionary<string, object>)histData[(i - 2).ToString()]; // get the history data from the previous file version
dataObj.Add("previous", IsEnabledDirectUrl ? new Dictionary<string, object>() { // write information about previous file version to the data object with direct url
{ "fileType", prev["fileType"] },
{ "key", prev["key"] }, // write key and url information about previous file version
{ "url", prev["url"] },
{ "directUrl", prev["directUrl"] },
} : new Dictionary<string, object>() { // write information about previous file version to the data object without direct url
{ "fileType", prev["fileType"] },
{ "key", prev["key"] }, // write key and url information about previous file version
{ "url", prev["url"] },
});
// write the path to the diff.zip archive with differences in this file version
var changesUrl = DocManagerHelper.GetHistoryDownloadUrl(FileName, (i - 1).ToString(), "diff.zip");
dataObj.Add("changesUrl", changesUrl);
}
if(JwtManager.Enabled)
{
var token = JwtManager.Encode(dataObj);
dataObj.Add("token", token);
}
hist.Add(obj); // add object dictionary to the hist list
histData.Add((i - 1).ToString(), dataObj); // write data object information to the history data
}
// write history information about the current file version to the history object
history = jss.Serialize(new Dictionary<string, object>()
{
{ "currentVersion", currentVersion },
{ "history", hist }
});
historyData = jss.Serialize(histData);
}
}
// get a document which will be compared with the current document
public void GetCompareFileData(out string compareConfig)
{
var jss = new JavaScriptSerializer();
// get the path to the compared file
var compareFileUrl = new UriBuilder(DocManagerHelper.GetServerUrl(true))
{
Path = HttpRuntime.AppDomainAppVirtualPath
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
+ "webeditor.ashx",
Query = "type=assets&fileName=" + HttpUtility.UrlEncode("sample.docx")
};
var directCompareFileUrl = new UriBuilder(DocManagerHelper.GetServerUrl(false))
{
Path = HttpRuntime.AppDomainAppVirtualPath
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
+ "webeditor.ashx",
Query = "type=assets&fileName=" + HttpUtility.UrlEncode("sample.docx")
};
// create an object with the information about the compared file
var dataCompareFile = new Dictionary<string, object>
{
{ "fileType", "docx" },
{ "url", compareFileUrl.ToString() }
};
if (IsEnabledDirectUrl)
{
dataCompareFile.Add("directUrl", directCompareFileUrl.ToString());
}
if (JwtManager.Enabled) // if the secret key to generate token exists
{
var compareFileToken = JwtManager.Encode(dataCompareFile); // encode the dataCompareFile object into the token
dataCompareFile.Add("token", compareFileToken); // and add it to the dataCompareFile object
}
compareConfig = jss.Serialize(dataCompareFile);
}
// get a logo config
public void GetLogoConfig(out string logoUrl)
{
var jss = new JavaScriptSerializer();
// get the path to the logo image
var mailMergeUrl = new UriBuilder(DocManagerHelper.GetServerUrl(true))
{
Path = HttpRuntime.AppDomainAppVirtualPath
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
+ "Content\\images\\logo.png"
};
var directMailMergeUrl = new UriBuilder(DocManagerHelper.GetServerUrl(false))
{
Path = HttpRuntime.AppDomainAppVirtualPath
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
+ "Content\\images\\logo.png"
};
// create a logo config
var logoConfig = new Dictionary<string, object>
{
{ "fileType", "png"},
{ "url", mailMergeUrl.ToString()}
};
if (IsEnabledDirectUrl)
{
logoConfig.Add("directUrl", directMailMergeUrl.ToString());
}
if (JwtManager.Enabled) // if the secret key to generate token exists
{
var token = JwtManager.Encode(logoConfig); // encode logoConfig into the token
logoConfig.Add("token", token); // and add it to the logo config
}
logoUrl = jss.Serialize(logoConfig).Replace("{", "").Replace("}", "");
}
// get a mail merge config
public void GetMailMergeConfig(out string dataMailMergeRecipients)
{
var jss = new JavaScriptSerializer();
// get the path to the recipients data for mail merging
var mailMergeUrl = new UriBuilder(DocManagerHelper.GetServerUrl(true))
{
Path =
HttpRuntime.AppDomainAppVirtualPath
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
+ "webeditor.ashx",
Query = "type=csv"
};
var directMailMergeUrl = new UriBuilder(DocManagerHelper.GetServerUrl(false))
{
Path =
HttpRuntime.AppDomainAppVirtualPath
+ (HttpRuntime.AppDomainAppVirtualPath.EndsWith("/") ? "" : "/")
+ "webeditor.ashx",
Query = "type=csv"
};
// create a mail merge config
var mailMergeConfig = new Dictionary<string, object>
{
{ "fileType", "csv" },
{ "url", mailMergeUrl.ToString()}
};
if (IsEnabledDirectUrl)
{
mailMergeConfig.Add("directUrl", directMailMergeUrl.ToString());
}
if (JwtManager.Enabled) // if the secret key to generate token exists
{
var mailmergeToken = JwtManager.Encode(mailMergeConfig); // encode mailMergeConfig into the token
mailMergeConfig.Add("token", mailmergeToken); // and add it to the mail merge config
}
dataMailMergeRecipients = jss.Serialize(mailMergeConfig);
}
//get a users for mentions
public void GetUsersMentions(HttpRequest request, out string usersForMentions)
{
var jss = new JavaScriptSerializer();
var id = request.Cookies.GetOrDefault("uid", null);
var user = Users.getUser(id);
usersForMentions = !user.id.Equals("uid-0") ? jss.Serialize(Users.getUsersForMentions(user.id)) : null;
}
}
}

View File

@ -0,0 +1,72 @@
/**
*
* (c) Copyright Ascensio System SIA 2023
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System.Collections.Generic;
using System.IO;
namespace OnlineEditorsExampleMVCreact.Models
{
public static class FileUtility
{
public enum FileType
{
Word,
Cell,
Slide
}
// get file type
public static FileType GetFileType(string fileName)
{
var ext = Path.GetExtension(fileName).ToLower();
if (ExtsDocument.Contains(ext)) return FileType.Word; // word type for document extensions
if (ExtsSpreadsheet.Contains(ext)) return FileType.Cell; // cell type for spreadsheet extensions
if (ExtsPresentation.Contains(ext)) return FileType.Slide; // slide type for presentation extensions
return FileType.Word; // the default type is word
}
// document extensions
public static readonly List<string> ExtsDocument = new List<string>
{
".doc", ".docx", ".docm",
".dot", ".dotx", ".dotm",
".odt", ".fodt", ".ott", ".rtf", ".txt",
".html", ".htm", ".mht", ".xml",
".pdf", ".djvu", ".fb2", ".epub", ".xps", ".oxps", ".oform"
};
// spreadsheet extensions
public static readonly List<string> ExtsSpreadsheet = new List<string>
{
".xls", ".xlsx", ".xlsm", ".xlsb",
".xlt", ".xltx", ".xltm",
".ods", ".fods", ".ots", ".csv"
};
// presentation extensions
public static readonly List<string> ExtsPresentation = new List<string>
{
".pps", ".ppsx", ".ppsm",
".ppt", ".pptx", ".pptm",
".pot", ".potx", ".potm",
".odp", ".fodp", ".otp"
};
}
}

View File

@ -0,0 +1,232 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{D2C16047-E658-444A-A45D-23CEE79CB8F3}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineEditorsExampleMVCreact</RootNamespace>
<AssemblyName>OnlineEditorsExampleMVCreact</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
<UseIISExpress>true</UseIISExpress>
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<Use64BitIISExpress />
<UseGlobalApplicationHostFile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="JWT, Version=9.0.0.0, Culture=neutral, PublicKeyToken=6f98bca0f40f2ecf, processorArchitecture=MSIL">
<HintPath>packages\JWT.9.0.3\lib\net46\JWT.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Services" />
<Reference Include="Antlr3.Runtime, Version=3.5.0.2, Culture=neutral, PublicKeyToken=eb42632606e9261f, processorArchitecture=MSIL">
<HintPath>packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll</HintPath>
</Reference>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Formatting, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.AspNet.WebApi.Core.5.2.7\lib\net45\System.Web.Http.dll</HintPath>
</Reference>
<Reference Include="System.Web.Http.WebHost, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.AspNet.WebApi.WebHost.5.2.7\lib\net45\System.Web.Http.WebHost.dll</HintPath>
</Reference>
<Reference Include="System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.AspNet.Mvc.5.2.7\lib\net45\System.Web.Mvc.dll</HintPath>
</Reference>
<Reference Include="System.Web.Optimization, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll</HintPath>
</Reference>
<Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.AspNet.Razor.3.2.7\lib\net45\System.Web.Razor.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
</Reference>
<Reference Include="WebGrease, Version=1.6.5135.21930, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>packages\WebGrease.1.6.0\lib\WebGrease.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="App_Start\BundleConfig.cs" />
<Compile Include="App_Start\FilterConfig.cs" />
<Compile Include="App_Start\RouteConfig.cs" />
<Compile Include="App_Start\WebApiConfig.cs" />
<Compile Include="Controllers\HomeController.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="Helpers\TrackManager.cs" />
<Compile Include="Helpers\DocManagerHelper.cs" />
<Compile Include="Helpers\DocumentConverter.cs" />
<Compile Include="Helpers\JwtManager.cs" />
<Compile Include="Helpers\Users.cs" />
<Compile Include="Helpers\Utils.cs" />
<Compile Include="Models\FileModel.cs" />
<Compile Include="Models\FileUtility.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="WebEditor.ashx.cs">
<DependentUpon>WebEditor.ashx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="Content\editor.css" />
<Content Include="Content\images\block-content.svg" />
<Content Include="Content\images\cell.ico" />
<Content Include="Content\images\close.svg" />
<Content Include="Content\images\comment.svg" />
<Content Include="Content\images\delete.svg" />
<Content Include="Content\images\desktop.svg" />
<Content Include="Content\images\done.svg" />
<Content Include="Content\images\download.svg" />
<Content Include="Content\images\embeded.svg" />
<Content Include="Content\images\error.svg" />
<Content Include="Content\images\file_docx.svg" />
<Content Include="Content\images\file_docxf.svg" />
<Content Include="Content\images\file_pptx.svg" />
<Content Include="Content\images\file_upload.svg" />
<Content Include="Content\images\file_xlsx.svg" />
<Content Include="Content\images\fill-forms.svg" />
<Content Include="Content\images\filter.svg" />
<Content Include="Content\images\icon_docx.svg" />
<Content Include="Content\images\icon_pptx.svg" />
<Content Include="Content\images\icon_xlsx.svg" />
<Content Include="Content\images\info.svg" />
<Content Include="Content\images\loader16.gif" />
<Content Include="Content\images\logo.png" />
<Content Include="Content\images\logo.svg" />
<Content Include="Content\images\mobile-fill-forms.svg" />
<Content Include="Content\images\mobile.svg" />
<Content Include="Content\images\notdone.svg" />
<Content Include="Content\images\review.svg" />
<Content Include="Content\images\slide.ico" />
<Content Include="Content\images\word.ico" />
<Content Include="Content\jquery-ui.css" />
<Content Include="Content\media.css" />
<Content Include="Content\stylesheet.css" />
<Content Include="favicon.ico" />
<Content Include="Global.asax" />
<Content Include="LICENSE" />
<Content Include="Scripts\jquery-1.8.2.js" />
<Content Include="Scripts\jquery-ui.js" />
<Content Include="Scripts\jquery.blockUI.js" />
<Content Include="Scripts\jquery.dropdownToggle.js" />
<Content Include="Scripts\jquery.fileupload.js" />
<Content Include="Scripts\jquery.iframe-transport.js" />
<Content Include="Scripts\jscript.js" />
<Content Include="Scripts\React\src\app.js" />
<Content Include="Scripts\React\src\main.js" />
<Content Include="Scripts\React\webpack.config.js" />
<Content Include="Views\Home\Editor.aspx" />
<Content Include="Views\Home\Index.aspx" />
<Content Include="Web.config">
<SubType>Designer</SubType>
</Content>
<Content Include="Views\Web.config" />
<Content Include="Views\Shared\Error.aspx" />
<Content Include="licenses\EntityFramework.license" />
<Content Include="licenses\Microsoft.Web.Infrastructure.license" />
<Content Include="licenses\Newtonsoft.Json.license" />
<Content Include="licenses\jquery.license" />
<Content Include="licenses\WebGrease.license" />
<Content Include="web.appsettings.config" />
<Content Include="WebEditor.ashx" />
</ItemGroup>
<ItemGroup>
<Content Include="assets\AUTHORS.md" />
<Content Include="assets\LICENSE" />
<Content Include="assets\new\new.docx" />
<Content Include="assets\new\new.docxf" />
<Content Include="assets\new\new.pptx" />
<Content Include="assets\new\new.xlsx" />
<Content Include="assets\sample\csv.csv" />
<Content Include="assets\sample\sample.docx" />
<Content Include="assets\sample\sample.docxf" />
<Content Include="assets\sample\sample.pptx" />
<Content Include="assets\sample\sample.xlsx" />
<None Include="packages.config" />
<Content Include="Scripts\React\package.json" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">16.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="Exists('$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets')" />
<Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
</Target>
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>56212</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:52695/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<PropertyGroup>
<PreBuildEvent>call "$(ProjectDir)Scripts\React\build.bat"</PreBuildEvent>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33213.308
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OnlineEditorsExampleMVCreact", "OnlineEditorsExampleMVCreact.csproj", "{D2C16047-E658-444A-A45D-23CEE79CB8F3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D2C16047-E658-444A-A45D-23CEE79CB8F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D2C16047-E658-444A-A45D-23CEE79CB8F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D2C16047-E658-444A-A45D-23CEE79CB8F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D2C16047-E658-444A-A45D-23CEE79CB8F3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {808AEE5A-E969-411D-8326-9C1F7734DC70}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,19 @@
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("OnlineEditorsExampleMVCreact")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Ascensio System SIA")]
[assembly: AssemblyProduct("OnlineEditorsExampleMVCreact")]
[assembly: AssemblyCopyright("Ascensio System SIA 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("5b0423f6-859c-4514-a5c7-483e25f9bd31")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,81 @@
## Overview
This example will help you integrate ONLYOFFICE Docs into your web application written in .Net (C# MVC).
**Please note**: It is intended for testing purposes and demonstrating functionality of the editors. Do NOT use this integration example on your own server without proper code modifications! In case you enabled the test example, disable it before going for production.
## Step 1. Install ONLYOFFICE Docs
Download and install ONLYOFFICE Docs (packaged as Document Server).
See the detailed guide to learn how to install Document Server [for Windows](https://helpcenter.onlyoffice.com/installation/docs-developer-install-windows.aspx), [for Linux](https://helpcenter.onlyoffice.com/installation/docs-developer-install-ubuntu.aspx), or [for Docker](https://helpcenter.onlyoffice.com/server/developer-edition/docker/docker-installation.aspx).
## Step 2. Download the .Net (C# MVC) code for the editors integration
Download the [.Net (C# MVC) example](https://api.onlyoffice.com/editors/demopreview) from our site.
To connect the editors to your website, specify the path to the editors installation and the path to the storage folder in the *settings.config* file:
```
<add key="storage-path" value=""/>
<add key="files.docservice.url.site" value="https://documentserver/" />
```
where the **documentserver** is the name of the server with the ONLYOFFICE Document Server installed and the **storage-path** is the path where files will be created and stored. You can set an absolute path.
If you want to experiment with the editor configuration, modify the [parameters](https://api.onlyoffice.com/editors/advanced) in the *DocEditor.aspx* file.
## Step 3. Install the prerequisites
Сheck if your system meets the system requirements:
* **Microsoft .NET Framework**: version 4.5 (download it from the [official Microsoft website](https://www.microsoft.com/en-US/download/details.aspx?id=30653));
* **Internet Information Services**: version 7 or later.
Configure the IIS components for the server to work correctly:
1. Open Windows features:
**Start** -> **Control Panel** -> **Programs** -> **Programs and Features** -> **Turn Windows features on or off**
2. In the opened window, find **Internet Information Services** and choose all the necessary features. To do this, open the **World Wide Web Services** list and check the following components:
* **Application Development Features**: .NET Extensibility 4.8, ASP.NET 4.8, ISAPI Extensions, ISAPI Filters,
* **Common HTTP Features**: Default Document,
* **Security**: Request Filtering.
## Step 4. Run your website with the editors
1. Run the Internet Information Service (IIS) Manager:
**Start** -> **Control Panel** -> **System and Security** -> **Administrative Tools** -> **Internet Information Services (IIS) Manager**
2. Add your website in the IIS Manager.
On the **Connections** panel right-click the **Sites** node in the tree, then click **Add Website**.
![add](screenshots/add.png)
3. In the **Add Website** dialog box specify the name of the folder with the .Net (C# MVC) project in the **Site name** box.
Specify the path to the folder with your project in the **Physical Path** box.
Specify the unique value used only for this website in the **Port** box.
![sitename](screenshots/sitename.png)
4. Check for the .NET platform version specified in IIS Manager for you website. Choose **v4.0.** version.
**Application Pools** -> right-click the platform name -> **Set application Pool defaults** -> **.NET CLR version**
![platform](screenshots/platform.png)
5. Browse your website with the IIS Manager:
Right-click the site -> **Manage Website** -> **Browse**
![browse](screenshots/browse.png)
## Step 5. Check accessibility
In case the example and Document Server are installed on different computers, make sure that your server with the example installed has access to the Document Server with the address which you specify instead of **documentserver** in the configuration files.
Make sure that the Document Server has access to the server with the example installed with the address which you specify instead of **example.com** in the configuration files.
## Important security info
Please keep in mind the following security aspects when you are using test examples:
* There is no protection of the storage from unauthorized access since there is no need for authorization.
* There are no checks against parameter substitution in links, since the parameters are generated by the code according to the pre-arranged scripts.
* There are no data checks in requests of saving the file after editing, since each test example is intended for requests only from ONLYOFFICE Document Server.
* There are no prohibitions on using test examples from other sites, since they are intended to interact with ONLYOFFICE Document Server from another domain.

View File

@ -0,0 +1,3 @@
cd ../Scripts/React
call npm install
npm run webpack

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,23 @@
{
"name": "csharp-mvc-react",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"webpack": "webpack"
},
"author": "",
"license": "Apache-2.0",
"dependencies": {
"react-dom": "^18.2.0",
"@onlyoffice/document-editor-react": "^1.2.0"
},
"devDependencies": {
"@babel/preset-env": "^7.20.2",
"@babel/preset-react": "^7.18.6",
"babel-loader": "^9.1.2",
"webpack-cli": "^5.0.1"
}
}

View File

@ -0,0 +1,4 @@
var React = require('react');
var ReactDOM = require('react-dom');
import Main from './main';
ReactDOM.render(< Main />, document.getElementById('root'));

View File

@ -0,0 +1,20 @@
var React = require('react');
import { DocumentEditor } from "@onlyoffice/document-editor-react";
class Main extends React.Component {
render() {
const documentServerUrl = document.getElementById("root").getAttribute("data-docserverurl");
const config = JSON.parse(document.getElementById("root").getAttribute("data-config"));
return (
<DocumentEditor
id="docxEditor1"
documentServerUrl={documentServerUrl}
config={config}
height="100%"
width="100%"
/>)
}
}
export default Main;

View File

@ -0,0 +1,33 @@
module.exports = {
context: __dirname,
entry: "./src/app.js",
output: {
path: __dirname + "/dist",
filename: "bundle.js",
},
watch: true,
module: {
rules: [{
test: /\.js$/,
exclude: /(node_modules)/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-react']
}
}
}]
},
plugins: [
{
apply: (compiler) => {
compiler.hooks.done.tap('DonePlugin', (stats) => {
console.log('Compile is done !')
setTimeout(() => {
process.exit(0)
})
});
}
}
]
}

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More