Compare commits

..

49 Commits

Author SHA1 Message Date
307e5dcc63 users tooltip layout remake, add scroll 2021-09-21 23:36:05 +03:00
18d8d8258d netcore: fix user tooltip size 2021-09-14 12:29:35 +03:00
ec01bf8a3a netcore: add .oxps 2021-09-14 10:19:19 +03:00
f8f9e9cff0 layout fix 2021-09-02 13:49:56 +03:00
0c02148cb8 update layout for ie11 2021-08-26 20:21:25 +03:00
df7b372b1f net-core: set header height 48px 2021-08-23 17:01:51 +03:00
7d04bb5252 netcore: set image url for Blank template "" 2021-07-29 13:37:27 +03:00
25ebaf8844 netcore: add 3rd-Party licenses 2021-07-29 11:59:49 +03:00
b5f8487240 netcore: fix convert data from token 2021-07-29 11:31:39 +03:00
8347133022 netcore: add template submodule 2021-07-28 20:38:03 +03:00
4cb48a2db9 netcore: remove template submodule and replace project files from OnlineEditorsExampleNetCore folder to csharp-core folder 2021-07-28 20:36:20 +03:00
c180cc7d12 netcore: add copyrights 2021-07-28 18:28:12 +03:00
d460a65f38 netcore: set default token secret as "", fix request anonymous name in editor 2021-07-28 18:07:56 +03:00
1bae3ba53a netcore: remove title on span 2021-07-28 10:55:18 +03:00
63e8029d0d netcore: update README.md 2021-07-27 22:49:00 +03:00
f1d1989756 netcore: add template submodule 2021-07-27 21:25:08 +03:00
c6e2a6bcb2 delete assets folder and move LICENSE and AUTHORS from assets to root folder 2021-07-27 21:22:47 +03:00
e338311423 csharp-core: fixed jwt 2021-07-27 11:07:05 +03:00
35f397de20 csharp-core: edited appsettings.json 2021-07-22 13:28:56 +03:00
6dea1c1422 csharp-core: edited launchSettings.json 2021-07-22 13:26:07 +03:00
03f55e661e csharp-core: fixed version history 2021-07-22 11:47:14 +03:00
7a416b107f csharp-core: added new information to readme.md 2021-07-22 10:01:32 +03:00
8135aae7b0 csharp-core: fixed layout 2021-07-21 18:30:03 +03:00
a652a9f1f1 csharp-core: added 3d-party.license 2021-07-21 18:27:08 +03:00
650266133e csharp-core: edited readme 2021-07-21 17:40:23 +03:00
167d8d5059 csharp-core: fixed download 2021-07-21 13:27:29 +03:00
5ba8c4e8f7 csharp-core: fixed convertation 2021-07-20 14:56:58 +03:00
99e41cde5f csharp-core: changed storing a folder assets and files, fixed version history 2021-07-20 11:30:09 +03:00
08072226a5 csharp-core: added new class for serialize responseFromService 2021-07-16 19:31:28 +03:00
858e14a47d csharp-core: added mentions, comment groups, create from templates features, fixed convertion, history, changed icons to svg 2021-07-16 19:28:51 +03:00
621319554b Merge branch 'feature/netcore-project' of https://github.com/ONLYOFFICE/document-server-integration into feature/netcore-project 2021-07-14 12:32:28 +03:00
88eabbf40d netcore: media.css 2021-07-13 17:47:50 +03:00
c1cad2eb6b netcore: adaptive layout 2021-07-13 17:35:51 +03:00
5ae9c11bc5 Merge remote-tracking branch 'remotes/origin/develop' into feature/netcore-project 2021-07-13 15:07:24 +03:00
f84dda21f7 csharp-core: fixed homecontroller 2021-07-13 13:12:23 +03:00
c342740d44 csharp-core: fixed created with sample document and refactored 2021-07-13 11:08:31 +03:00
0cc832652d csharp-core: fixed upload method, styles and added partial views 2021-07-12 23:41:02 +03:00
bdda8a8ed1 csharp-core: upload 2021-07-12 15:55:38 +03:00
263388f1b8 csharp-core: refactor 2021-07-12 15:55:09 +03:00
c0fd4c00d5 csharp-core: refactoring and removed unnecessary packages 2021-07-09 13:37:53 +03:00
63893d2476 csharp-core: fixed track method, download and remove options 2021-07-06 15:32:33 +03:00
fa02a16376 csharp-core: track method refactor 2021-07-05 18:28:16 +03:00
4e7f4f2336 csharp-core: edited homecontroller 2021-07-05 16:11:32 +03:00
3c0384f581 csharp-core: fixed webeditor service and RoutingMiddleware 2021-07-02 16:06:55 +03:00
880fa47e49 csharp-core: added jwt and changed webeditor service to async 2021-07-01 18:51:58 +03:00
272e2f5a15 csharp-core: added webeditor service and fixed bugs 2021-06-28 19:21:57 +03:00
bbdd54712b csharp-core: added rest web api and edited config 2021-06-24 18:58:06 +03:00
2cd2251f2c csharp-core: added editor, index views, config 2021-06-22 18:41:29 +03:00
4595376ee2 netcore: created example of integration on netcore 2021-06-17 12:24:44 +03:00
1349 changed files with 80081 additions and 98733 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

@ -1,31 +0,0 @@
name: Lint Java
on:
workflow_dispatch:
push:
branches: [master]
paths: ['web/documentserver-example/java/**']
pull_request:
branches: [master, develop]
paths: ['web/documentserver-example/java/**']
jobs:
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./web/documentserver-example/java
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Java 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Run linter
run: |
mvn -version
mvn package

View File

@ -1,35 +0,0 @@
name: ESLint
on:
workflow_dispatch:
push:
branches: [master]
paths: ['web/documentserver-example/nodejs/**']
pull_request:
branches: [master, develop]
paths: ['web/documentserver-example/nodejs/**']
env:
NODE_VERSION: 16
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./web/documentserver-example/nodejs
steps:
- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Code Checkout
uses: actions/checkout@v3
- name: Install Dependencies
run: npm ci
- name: Code Linting
run: npm run lint

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

@ -1,29 +0,0 @@
name: PHPCs
on:
workflow_dispatch:
push:
branches: [master]
paths: ['web/documentserver-example/php/**']
pull_request:
branches: [master, develop]
paths: ['web/documentserver-example/php/**']
jobs:
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./web/documentserver-example/php
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: cs2pr, phpcs
- name: Lint
run: phpcs src index.php

View File

@ -1,37 +0,0 @@
name: PyLint
on:
workflow_dispatch:
push:
branches: [master]
paths: ['web/documentserver-example/python/**']
pull_request:
branches: [master, develop]
paths: ['web/documentserver-example/python/**']
jobs:
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./web/documentserver-example/python
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Dependencies
run: |
make dev
- name: Lint Flake8
run: |
make lint
# TODO: Configure mypy
# - name: Types mypy
# run: |
# make types

View File

@ -1,37 +0,0 @@
name: Rubocop
on:
workflow_dispatch:
push:
branches: [master]
paths: ['web/documentserver-example/ruby/**']
pull_request:
branches: [master, develop]
paths: ['web/documentserver-example/ruby/**']
jobs:
lint:
runs-on: ubuntu-latest
defaults:
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

View File

@ -1,31 +0,0 @@
name: Lint Spring
on:
workflow_dispatch:
push:
branches: [master]
paths: ['web/documentserver-example/java-spring/**']
pull_request:
branches: [master, develop]
paths: ['web/documentserver-example/java-spring/**']
jobs:
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./web/documentserver-example/java-spring
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Java 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Run linter
run: |
mvn -version
mvn package

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 }}

8
.gitignore vendored
View File

@ -11,14 +11,6 @@
**/.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/

83
.gitmodules vendored
View File

@ -1,67 +1,32 @@
[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/nodejs/public/assets/plugin-aiautofill"]
path = web/documentserver-example/nodejs/public/assets/plugin-aiautofill
url = https://github.com/ONLYOFFICE/plugin-aiautofill.git
[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/csharp-core/wwwroot/assets"]
path = web/documentserver-example/csharp-core/wwwroot/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
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

271
3rd-Party.license Normal file
View File

@ -0,0 +1,271 @@
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/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
sync-request - Make synchronous web requests with cross-platform support. (https://github.com/ForbesLindesay/sync-request/blob/master/LICENSE)
License: MIT
License File: sync-request.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,216 +0,0 @@
# 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
- nodejs: added AI Auto Fill Plugin
- php-laravel: fix custom jwt header
- formats for ds v9.3
- 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
## 1.5.0
- nodejs: added wopi putRelativeFile action
- nodejs: wopi editnew action for exisiting file
- nodejs: fix wopi actions after restart
- setting an unavailable language
- description in the tooltip on the main page
- nodejs: referenceData
- option to send directUrl
## 1.4.0
- nodejs: option to send directUrl
- opening file on client by directUrl
- offline viewer for anonymous
- added hy, eu, zh-TW, ms, pt-PT
## 1.3.1
- charp: fix references
- ruby: update rails
## 1.3.0
- update empty files
- anonymous without chat
- changed jwt implementation in csharp, csharp-mvc, php, ruby
## 1.2.0
- ruby v3.0
- set filetype in setHistoryData
- read filetype from input request
- creating file on WOPI
- upload on WOPI page
- fix xss
- set userInfoGroups
- check JWT on downloading history
- upload dialog on mobile
- anonymous without id
- renaming from editor
- new skin languages
- ignore certificate
## 1.1.0
- creating docxf
- opening docxf, oform
## 1.0.0
- added java spring

View File

@ -1,34 +1,66 @@
## Integration examples
## Document Server integration example
These 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.
These examples show the way to integrate [ONLYOFFICE Document Server][2] into your own website or application using one of the programming languages. 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`
* .Net (C# MVC) - `web/documentserver-example/csharp-mvc/web.appsettings.config`
* .Net (C#) - `web/documentserver-example/csharp/settings.config`
* Java - `web/documentserver-example/java/src/main/resources/settings.properties`
* Node.js - `web/documentserver-example/nodejs/config/default.json`
* PHP - `web/documentserver-example/php/config.php`
* 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")
## Important security info
## API methods for test examples
Please keep in mind the following security aspects when you are using test examples:
The methods described below are available for all of the 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.
### 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}` |
## Project Information
@ -40,9 +72,9 @@ ONLYOFFICE for developers: [https://www.onlyoffice.com/developer-edition.aspx](h
## User Feedback and Support
If you have any problems with or questions about [ONLYOFFICE Document Server][2], please visit our official forum to find answers to your questions: [forum.onlyoffice.com][1] or you can ask and answer ONLYOFFICE development questions on [Stack Overflow][3].
If you have any problems with or questions about [ONLYOFFICE Document Server][2], please visit our official forum to find answers to your questions: [dev.onlyoffice.org][1] or you can ask and answer ONLYOFFICE development questions on [Stack Overflow][3].
[1]: https://forum.onlyoffice.com
[1]: http://dev.onlyoffice.org
[2]: https://github.com/ONLYOFFICE/DocumentServer
[3]: http://stackoverflow.com/questions/tagged/onlyoffice

View File

@ -4,14 +4,12 @@
<PropertyGroup>
<To Condition=" '$(To)' == '' ">..\deploy\</To>
<RootDir Condition="$(RootDir)==''">..\..\</RootDir>
<NameCSharp>$(To)DotNet (Csharp) Example</NameCSharp>
<NameCSharp>$(To).Net (C#) Example</NameCSharp>
<DirCSharp>$(RootDir)web\documentserver-example\csharp\</DirCSharp>
<NameMvc>$(To)DotNet (Csharp MVC) Example</NameMvc>
<NameMvc>$(To).Net (C# MVC) Example</NameMvc>
<DirMvc>$(RootDir)web\documentserver-example\csharp-mvc\</DirMvc>
<NameJava>$(To)Java Example</NameJava>
<DirJava>$(RootDir)web\documentserver-example\java\</DirJava>
<NameSpring>$(To)Java Spring Example</NameSpring>
<DirSpring>$(RootDir)web\documentserver-example\java-spring\</DirSpring>
<NameNodeJS>$(To)Node.js Example</NameNodeJS>
<DirNodeJS>$(RootDir)web\documentserver-example\nodejs\</DirNodeJS>
<NamePHP>$(To)PHP Example</NamePHP>
@ -26,49 +24,43 @@
<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\**" />
</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\**" />
</ItemGroup>
<Copy SourceFiles="@(ZipFilesMVC)" DestinationFiles="@(ZipFilesMVC->'$(NameMvc)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Zip Files="$(NameMvc)" WorkingDirectory="$(To)" ZipFileName="$(NameMvc).zip" />
<ItemGroup>
<ZipFilesJava Include="$(DirJava)**" Exclude="$(DirJava)**\.git" />
<ZipFilesJava Include="$(DirJava)**" />
</ItemGroup>
<Copy SourceFiles="@(ZipFilesJava)" DestinationFiles="@(ZipFilesJava->'$(NameJava)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Zip Files="$(NameJava)" WorkingDirectory="$(To)" ZipFileName="$(NameJava).zip" />
<ItemGroup>
<ZipFilesSpring Include="$(DirSpring)**" Exclude="$(DirSpring)**\.git" />
</ItemGroup>
<Copy SourceFiles="@(ZipFilesSpring)" DestinationFiles="@(ZipFilesSpring->'$(NameSpring)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Zip Files="$(NameSpring)" WorkingDirectory="$(To)" ZipFileName="$(NameSpring).zip" />
<ItemGroup>
<ZipFilesNodeJS Include="$(DirNodeJS)**" Exclude="$(DirNodeJS)node_modules\**;$(DirNodeJS)**\.git" />
<ZipFilesNodeJS Include="$(DirNodeJS)**" Exclude="$(DirNodeJS)node_modules\**" />
</ItemGroup>
<Copy SourceFiles="@(ZipFilesNodeJS)" DestinationFiles="@(ZipFilesNodeJS->'$(NameNodeJS)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Zip Files="$(NameNodeJS)" WorkingDirectory="$(To)" ZipFileName="$(NameNodeJS).zip" />
<ItemGroup>
<ZipFilesPHP Include="$(DirPHP)**" Exclude="$(DirPHP)**\.git" />
<ZipFilesPHP Include="$(DirPHP)**" />
</ItemGroup>
<Copy SourceFiles="@(ZipFilesPHP)" DestinationFiles="@(ZipFilesPHP->'$(NamePHP)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Zip Files="$(NamePHP)" WorkingDirectory="$(To)" ZipFileName="$(NamePHP).zip" />
<ItemGroup>
<ZipFilesRuby Include="$(DirRuby)**" Exclude="$(DirRuby)**\.git" />
<ZipFilesRuby Include="$(DirRuby)**" />
</ItemGroup>
<Copy SourceFiles="@(ZipFilesRuby)" DestinationFiles="@(ZipFilesRuby->'$(NameRuby)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Zip Files="$(NameRuby)" WorkingDirectory="$(To)" ZipFileName="$(NameRuby).zip" />
<ItemGroup>
<ZipFilesPython Include="$(DirPython)**" Exclude="$(DirPython)**\.git" />
<ZipFilesPython Include="$(DirPython)**" />
</ItemGroup>
<Copy SourceFiles="@(ZipFilesPython)" DestinationFiles="@(ZipFilesPython->'$(NamePython)\%(RecursiveDir)%(Filename)%(Extension)')" />
<Zip Files="$(NamePython)" WorkingDirectory="$(To)" ZipFileName="$(NamePython).zip" />

View File

@ -0,0 +1,17 @@
# Integration examples
## To start integrating document editors into your own website you need to do the following:
1. Download [Document Server installation](https://www.onlyoffice.com/developer-edition-request.aspx?from=api.onlyoffice.com) and set it up on your local server.
2. Select the programming language and clone the source code for the sample of online editors integration into your web site.
3. [Edit the configuration files](https://api.onlyoffice.com/editors/advanced) in the sample changing the default path for the one to the editors installed at step 1 and other advanced parameters available for editor configuration.
4. 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. And you must also make sure that the Document Server in its turn has access to the server with the example installed with the address which you specify instead of **example.com** in the configuration files.
Please note that the integration examples are used to demonstrate document editors functions and the ways to connect **Document Server** to your own application. **DO NOT USE** these examples on your own server without **PROPER CODE MODIFICATIONS**!
The result should look like the [demo preview](https://api.onlyoffice.com/editors/demopreview#DemoPreview) on our web site.
If you have any further questions, please contact us at [integration@onlyoffice.com](mailto:integration@onlyoffice.com).

View File

@ -0,0 +1,29 @@
ONLYOFFICE Applications example uses code from the following 3rd party projects:
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
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
Microsoft.AspNetCore.Cors - CORS middleware and policy for ASP.NET Core to enable cross-origin resource sharing (https://raw.githubusercontent.com/aspnet/AspNetCore/2.0.0/LICENSE.txt)
License: MIT
License File: Microsoft.AspNetCore.Cors.license

View File

@ -0,0 +1,4 @@
# Authors
* Ascensio System SIA: <integration@onlyoffice.com>

View File

@ -0,0 +1,372 @@
/**
*
* (c) Copyright Ascensio System SIA 2021
*
* 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 Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using OnlineEditorsExampleNetCore.Helpers;
using OnlineEditorsExampleNetCore.Models;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
namespace OnlineEditorsExampleNetCore.Controllers
{
public class HomeController : Controller
{
private readonly IWebHostEnvironment _environment;
private readonly IHttpContextAccessor _httpContextAccessor;
public HomeController(IWebHostEnvironment environment, IHttpContextAccessor httpContextAccessor)
{
_environment = environment;
_httpContextAccessor = httpContextAccessor;
}
public IActionResult Index()
{
DocManagerHelper.ContentPath = _environment.WebRootPath;
DocManagerHelper.Context = HttpContext;
return View();
}
public IActionResult Editor(string fileName, string editorsMode, string editorsType)
{
var file = new FileModel
{
Mode = editorsMode, // editor mode: edit or view
Type = editorsType, // editor type: desktop, mobile, embedded
FileName = Path.GetFileName(fileName), // file name
};
return View("Editor", file);
}
public IActionResult Sample(string fileExt, bool? sample)
{
if (ModelState.IsValid)
{
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
return Redirect(Url.Action("Editor", "Home", new { fileName = fileName }));
}
return new EmptyResult();
}
[Route("/upload")]
public IActionResult Upload(IFormCollection form)
{
HttpContext.Response.ContentType = "text/plain";
try
{
var httpPostedFile = form.Files[0];
var fileName = httpPostedFile.FileName;
if (HttpContext.Request.Headers["User-Agent"] == "IE")
{
var files = httpPostedFile.FileName.Split(new char[] { '\\' });
fileName = files[files.Length - 1];
}
var curSize = httpPostedFile.Length;
if (DocManagerHelper.MaxFileSize < curSize || curSize <= 0)
{
throw new Exception("File size is incorrect");
}
var curExt = (Path.GetExtension(fileName) ?? "").ToLower();
if (!DocManagerHelper.FileExts.Contains(curExt))
{
throw new Exception("File type is not supported");
}
fileName = DocManagerHelper.GetCorrectName(fileName);
fileName = DocManagerHelper.GetCorrectName(fileName); // get the correct file name if such a name already exists
var documentType = FileUtility.GetFileType(fileName).ToString().ToLower();
var savedFileName = DocManagerHelper.StoragePath(fileName); // get the storage path to the uploading file
using (var fs = System.IO.File.Open(savedFileName, FileMode.Create, FileAccess.ReadWrite))
{
httpPostedFile.CopyTo(fs); // and save it
}
// get file meta information or create the default one
var id = HttpContext.Request.Cookies.GetOrDefault("uid", null);
var user = Users.getUser(id);
DocManagerHelper.CreateMeta(fileName, user.id, user.name);
return Json(new Dictionary<string, object>() {
{ "filename", fileName },
{ "documentType", documentType }
});
}
catch (Exception e)
{
return Json(new Dictionary<string, object>() { { "error", e.Message } });
}
}
[Route("/convert")]
public IActionResult Convert()
{
HttpContext.Response.ContentType = "text/plain";
try
{
string fileData;
using (var receiveStream = HttpContext.Request.Body)
using (var readStream = new StreamReader(receiveStream))
{
fileData = readStream.ReadToEnd();
if (string.IsNullOrEmpty(fileData)) return Json(new Dictionary<string, object>() { { "error", "1" }, { "message", "Request stream is empty" } });
}
var body = JsonConvert.DeserializeObject<Dictionary<string, object>>(fileData);
var fileName = Path.GetFileName(body["filename"].ToString());
var filePass = body["filePass"] != null ? body["filePass"].ToString() : null;
var fileUri = DocManagerHelper.GetDownloadUrl(fileName);
var extension = (Path.GetExtension(fileName).ToLower() ?? "").Trim('.');
var internalExtension = DocManagerHelper.GetInternalExtension(FileUtility.GetFileType(fileName)).Trim('.');
// check if the file with such an extension can be converted
if (DocManagerHelper.ConvertExts.Contains("." + extension)
&& !string.IsNullOrEmpty(internalExtension))
{
// generate document key
var key = ServiceConverter.GenerateRevisionId(fileUri);
// get the url to the converted file
string newFileUri;
var result = ServiceConverter.GetConvertedUri(fileUri.ToString(), extension, internalExtension, key, true, out newFileUri, filePass);
if (result != 100)
{
return Json(new Dictionary<string, object>() { { "step", result }, { "filename", fileName } });
}
// get a file name of an internal file extension with an index if the file with such a name already exists
var correctName = DocManagerHelper.GetCorrectName(Path.GetFileNameWithoutExtension(fileName) + "." + internalExtension);
var req = (HttpWebRequest)WebRequest.Create(newFileUri);
using (var stream = req.GetResponse().GetResponseStream()) // get response stream of the converting file
{
if (stream == null) throw new Exception("Stream is null");
const int bufferSize = 4096;
using (var fs = System.IO.File.Open(DocManagerHelper.StoragePath(correctName), FileMode.Create))
{
var buffer = new byte[bufferSize];
int readed;
while ((readed = stream.Read(buffer, 0, bufferSize)) != 0)
{
fs.Write(buffer, 0, readed); // write bytes to the output stream
}
}
}
Remove(fileName); // remove the original file and its history if it exists
fileName = correctName; // create meta information about the converted file with user id and name specified
var id = HttpContext.Request.Cookies.GetOrDefault("uid", null);
var user = Users.getUser(id);
DocManagerHelper.CreateMeta(fileName, user.id, user.name);
}
var documentType = FileUtility.GetFileType(fileName).ToString().ToLower();
return Json(new Dictionary<string, object>() { { "filename", fileName }, { "documentType", documentType } });
}
catch (Exception e)
{
return Json(new Dictionary<string, object>() { { "error", e.Message } });
}
}
// track file changes
[Route("/track")]
public IActionResult Track([FromQuery] string userAddress, [FromQuery] string fileName)
{
// read request body
var fileData = TrackManager.readBody(HttpContext);
var status = (WebEditorExtenstions.TrackerStatus)(Int64)fileData["status"]; // get status from the request body
var saved = 1; // editing
switch (status)
{
case WebEditorExtenstions.TrackerStatus.Editing:
try
{
var actions = JsonConvert.DeserializeObject<List<object>>(JsonConvert.SerializeObject(fileData["actions"]));
var action = JsonConvert.DeserializeObject<Dictionary<string, object>>(JsonConvert.SerializeObject(actions[0]));
if (action != null && action["type"].ToString().Equals("0")) // finished edit
{
var user = action["userid"].ToString(); // the user who finished editing
var users = JsonConvert.DeserializeObject<List<object>>(JsonConvert.SerializeObject(fileData["users"]));
if (!users.Contains(user))
{
TrackManager.commandRequest("forcesave", fileData["key"].ToString()); // create a command request with the forcesave method
}
}
}
catch (Exception e)
{
Debug.Print(e.StackTrace);
}
break;
// MustSave, Corrupted
case WebEditorExtenstions.TrackerStatus.MustSave:
case WebEditorExtenstions.TrackerStatus.Corrupted:
try
{
// saving a document
saved = TrackManager.processSave(fileData, fileName, userAddress);
}
catch (Exception)
{
saved = 1;
}
return Json(new Dictionary<string, object>() { { "error", saved } });
// MustForceSave, CorruptedForceSave
case WebEditorExtenstions.TrackerStatus.MustForceSave:
case WebEditorExtenstions.TrackerStatus.CorruptedForceSave:
try
{
// force saving a document
saved = TrackManager.processForceSave(fileData, fileName, userAddress);
}
catch (Exception)
{
saved = 1;
}
return Json(new Dictionary<string, object>() { { "error", saved } });
}
return Json(new Dictionary<string, object>() { { "error", 0 } });
}
// remove a file
[Route("/remove")]
public IActionResult Remove([FromQuery] string fileName)
{
HttpContext.Response.ContentType = "text/plain";
try
{
WebEditorExtenstions.Remove(fileName);
}
catch (Exception e)
{
return Json(new Dictionary<string, object>() { { "error", e.Message } });
}
return Redirect(Url.Action("Index", "Home"));
}
// get files information
[Route("/files")]
public IActionResult Files([FromQuery] string fileId)
{
List<Dictionary<string, object>> files = null;
try
{
HttpContext.Response.ContentType = "application/json";
if (fileId.ToString() == null)
{
files = DocManagerHelper.GetFilesInfo(); // get the information about the files from the storage path
return Json(JsonConvert.SerializeObject(files));
}
else
{
files = DocManagerHelper.GetFilesInfo(fileId);
if (files.Count == 0)
{
return Json("File not found");
}
else
{
return Json(JsonConvert.SerializeObject(files));
}
}
}
catch (Exception e)
{
return Json(new Dictionary<string, object>() { { "error", e.Message } });
}
}
// get sample files from the assests
[Route("/assets")]
public async Task<IActionResult> Assets([FromQuery] string fileName)
{
var filePath = "assets/sample/" + fileName;
await WebEditorExtenstions.DownloadAsync(filePath, HttpContext);
return new EmptyResult();
}
// download a csv file
[Route("/csv")]
public async Task<IActionResult> GetCsv()
{
var fileName = "csv.csv";
var filePath = "assets/sample/" + fileName;
await WebEditorExtenstions.DownloadAsync(filePath, HttpContext);
return new EmptyResult();
}
// download a file
[Route("/download")]
public async Task<IActionResult> Download([FromQuery] string fileName, [FromQuery] string userAddress)
{
try
{
if (JwtManager.Enabled)
{
string JWTheader = Startup.AppSettings["files.docservice.header"].Equals("") ? "Authorization" : Startup.AppSettings["files.docservice.header"];
if (HttpContext.Request.Headers.Keys.Contains(JWTheader, StringComparer.InvariantCultureIgnoreCase))
{
var headerToken = HttpContext.Request.Headers[JWTheader].ToString().Substring("Bearer ".Length);
string token = JwtManager.Decode(headerToken);
if (token == null || token.Equals(""))
{
HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden;
return Json("JWT validation failed");
}
}
}
var filePath = DocManagerHelper.ForcesavePath(fileName, userAddress, false); // get the path to the force saved document version
if (filePath.Equals(""))
{
filePath = DocManagerHelper.StoragePath(fileName, userAddress); // or to the original document
}
await WebEditorExtenstions.DownloadAsync(filePath, HttpContext);
}
catch (Exception)
{
return Json(new Dictionary<string, object>() { { "error", "File not found!" } });
}
return new EmptyResult();
}
}
}

View File

@ -0,0 +1,362 @@
/**
*
* (c) Copyright Ascensio System SIA 2021
*
* 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 Microsoft.AspNetCore.Http;
using System.Web;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System;
using OnlineEditorsExampleNetCore.Models;
using Newtonsoft.Json;
namespace OnlineEditorsExampleNetCore.Helpers
{
public class DocManagerHelper
{
public static string ContentPath{ get; set; }
public static HttpContext Context {
set
{
Host = value.Request.Host.Host;
RequestHost = value.Request.Headers["Host"];
Port = value.Request.Host.Port.ToString();
}
}
private static string Host { get; set; }
private static string RequestHost { get; set; }
private static string Port { get; set; }
// get max file size
public static long MaxFileSize
{
get
{
long size;
long.TryParse(Startup.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).ToList(); }
}
// get file extensions that can be viewed
public static List<string> ViewedExts
{
get { return (Startup.AppSettings["files.docservice.viewed-docs"] ?? "").Split(new char[] { '|', ',' }, StringSplitOptions.RemoveEmptyEntries).ToList(); }
}
// get file extensions that can be edited
public static List<string> EditedExts
{
get { return (Startup.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 (Startup.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 ?? Host, "[^0-9a-zA-Z.=]", "_");
}
// get the storage path of the file
public static string StoragePath(string fileName, string userAddress = null)
{
var directory = ContentPath + "\\" + CurUserHostAddress(userAddress) + "\\";
if (!Directory.Exists(directory))
{
Directory.CreateDirectory(directory);
}
return directory + 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 = ContentPath + 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 "";
}
}
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 0; // if the history path doesn't exist, then the file version is 0
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 = ContentPath + "\\" + 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(ContentPath + "\\" + 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"), JsonConvert.SerializeObject(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 = "/" + fileName,
Query = ""
};
return uri.ToString();
}
// get the path url
public static string GetPathUri(string path)
{
var uri = new UriBuilder(GetServerUrl(true))
{
Path = "/" + path,
Query = ""
};
return uri.ToString();
}
// get the server url
public static string GetServerUrl(Boolean forDocumentServer)
{
if (forDocumentServer && !Startup.AppSettings["files.docservice.url.example"].Equals(""))
{
return Startup.AppSettings["files.docservice.url.example"];
}
else
{
var uri = new UriBuilder(Host) { Query = "" };
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 = "/track",
Query = "fileName=" + HttpUtility.UrlEncode(fileName)
+ "&userAddress=" + HttpUtility.UrlEncode(Host)
};
return callbackUrl.ToString();
}
public static string GetCreateUrl(FileUtility.FileType fileType)
{
var createUrl = new UriBuilder(GetServerUrl(false))
{
Path = "Home/Sample",
Query = "fileExt=" + GetInternalExtension(fileType).Trim('.')
};
return createUrl.ToString();
}
public static string GetDownloadUrl(string fileName)
{
var downloadUrl = new UriBuilder(GetServerUrl(true))
{
Path = "/download",
Query = "fileName=" + HttpUtility.UrlEncode(fileName)
+ "&userAddress=" + HttpUtility.UrlEncode(Host)
};
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 = "\\img\\"
};
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;
}
}
}

View File

@ -0,0 +1,267 @@
/**
*
* (c) Copyright Ascensio System SIA 2021
*
* 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 Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using OnlineEditorsExampleNetCore.Services;
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
namespace OnlineEditorsExampleNetCore.Helpers
{
/// <summary>
/// Class service api conversion
/// </summary>
public static class ServiceConverter
{
// /// <summary>
// /// Static constructor
// /// </summary>
static ServiceConverter()
{
DocumentConverterUrl = (Startup.AppSettings["files.docservice.url.site"] ?? "") + (Startup.AppSettings["files.docservice.url.converter"] ?? "");
Int32.TryParse(Startup.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)
{
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 }
};
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 = Startup.AppSettings["files.docservice.header"].Equals("") ? "Authorization" : Startup.AppSettings["files.docservice.header"];
request.Headers.Add(JWTheader, "Bearer " + payloadToken);
body.Add("token", bodyToken);
}
var bytes = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(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
}
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 = JsonConvert.DeserializeObject<ResponseFromConvert>(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,111 @@
/**
*
* (c) Copyright Ascensio System SIA 2021
*
* 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 Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace OnlineEditorsExampleNetCore.Helpers
{
public static class JwtManager
{
private static readonly string Secret;
public static readonly bool Enabled;
static JwtManager()
{
Secret = Startup.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)
{
// define the hashing algorithm and the token type
var header = new Dictionary<string, object>
{
{ "alg", "HS256" },
{ "typ", "JWT" }
};
// three parts of token
var encHeader = Base64UrlEncode(JsonConvert.SerializeObject(header)); // header
var encPayload = Base64UrlEncode(JsonConvert.SerializeObject(payload)); // payload
var hashSum = Base64UrlEncode(CalculateHash(encHeader, encPayload)); // signature
return string.Format("{0}.{1}.{2}", encHeader, encPayload, hashSum);
}
// decode a token into a payload object using a secret key
public static string Decode(string token)
{
if (!Enabled || string.IsNullOrEmpty(token)) return "";
var split = token.Split('.');
if (split.Length != 3) return "";
var hashSum = Base64UrlEncode(CalculateHash(split[0], split[1])); // get signature
if (hashSum != split[2]) return ""; // and check if it is equal to the signature from the token
return Base64UrlDecode(split[1]); // decode payload
}
// generate a hash code based on a key using the HMAC method
private static byte[] CalculateHash(string encHeader, string encPayload)
{
using (var hasher = new HMACSHA256(Encoding.UTF8.GetBytes(Secret)))
{
var bytes = Encoding.UTF8.GetBytes(string.Format("{0}.{1}", encHeader, encPayload));
return hasher.ComputeHash(bytes);
}
}
// encode a string into the base64 value
private static string Base64UrlEncode(string str)
{
return Base64UrlEncode(Encoding.UTF8.GetBytes(str));
}
// encode bytes into the base64 value
private static string Base64UrlEncode(byte[] bytes)
{
return Convert.ToBase64String(bytes)
.TrimEnd('=').Replace('+', '-').Replace('/', '_');
}
// decode a base64 value into the string
private static string Base64UrlDecode(string payload)
{
var b64 = payload.Replace('_', '/').Replace('-', '+');
switch (b64.Length % 4)
{
case 2:
b64 += "==";
break;
case 3:
b64 += "=";
break;
}
var bytes = Convert.FromBase64String(b64);
return Encoding.UTF8.GetString(bytes);
}
}
}

View File

@ -0,0 +1,308 @@
/**
*
* (c) Copyright Ascensio System SIA 2021
*
* 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.Linq;
using System.Text;
using Microsoft.AspNetCore.Http;
using Newtonsoft.Json;
namespace OnlineEditorsExampleNetCore.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.Body)
using (var readStream = new StreamReader(receiveStream))
{
body = readStream.ReadToEnd();
if (string.IsNullOrEmpty(body)) context.Response.WriteAsync("{\"error\":1,\"message\":\"Request stream is empty\"}");
}
}
catch (Exception e)
{
throw new Exception(HttpStatusCode.BadRequest.ToString(), e);
}
var fileData = JsonConvert.DeserializeObject<Dictionary<string, object>>(body);
// check if the document token is enabled
if (JwtManager.Enabled)
{
string JWTheader = Startup.AppSettings["files.docservice.header"].Equals("") ? "Authorization" : Startup.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.Keys.Contains(JWTheader, StringComparer.InvariantCultureIgnoreCase)) // if the Authorization header exists
{
var headerToken = context.Request.Headers[JWTheader].ToString().Substring("Bearer ".Length);
token = JwtManager.Decode(headerToken); // decode its part after Authorization prefix
}
else // otherwise, an error occurs
{
context.Response.WriteAsync("{\"error\":1,\"message\":\"JWT expected\"}");
}
if (token != null && !token.Equals("")) // invalid signature error
{
fileData = (Dictionary<string, object>)JsonConvert.DeserializeObject<Dictionary<string, object>>(token);
}
else
{
context.Response.WriteAsync("{\"error\":1,\"message\":\"JWT validation failed\"}");
}
}
return fileData;
}
// file saving process
public static int processSave(Dictionary<string, object> fileData, string fileName, string userAddress)
{
var downloadUri = (string)fileData["url"];
string curExt = Path.GetExtension(fileName).ToLower(); // get current file extension
string downloadExt = Path.GetExtension(downloadUri).ToLower() ?? ""; // 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);
}
}
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));
DownloadToFile(downloadUri, storagePath); // save file to the storage directory
DownloadToFile((string)fileData["changesurl"], 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"))
{
hist = JsonConvert.SerializeObject(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
}
return 0;
}
// file force saving process
public static int processForceSave(Dictionary<string, object> fileData, string fileName, string userAddress)
{
var downloadUri = (string)fileData["url"];
string curExt = Path.GetExtension(fileName).ToLower(); // get current file extension
string downloadExt = Path.GetExtension(downloadUri).ToLower(); // 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;
}
}
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 (forcesavePath.Equals("")) // create forcesave path if it doesn't exist
{
forcesavePath = DocManagerHelper.ForcesavePath(fileName, userAddress, true);
}
}
DownloadToFile(downloadUri, forcesavePath);
if (isSubmitForm)
{
var actions = JsonConvert.DeserializeObject<List<object>>(JsonConvert.SerializeObject(fileData["actions"]));
var action = JsonConvert.DeserializeObject<Dictionary<string, object>>(JsonConvert.SerializeObject(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
}
return 0;
}
// create a command request
public static void commandRequest(string method, string key)
{
string documentCommandUrl = Startup.AppSettings["files.docservice.url.site"] + Startup.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 }
};
// 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 = Startup.AppSettings["files.docservice.header"].Equals("") ? "Authorization" : Startup.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(JsonConvert.SerializeObject(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 responseObj = JsonConvert.DeserializeObject<Dictionary<string, object>>(dataResponse);
if (!responseObj["error"].ToString().Equals("0"))
{
throw new Exception(dataResponse);
}
}
// save file information from the url to the file specified
public static void DownloadToFile(string url, string path)
{
if (string.IsNullOrEmpty(url)) throw new ArgumentException("url"); // url isn't specified
if (string.IsNullOrEmpty(path)) throw new ArgumentException("path"); // file isn't specified
var req = (HttpWebRequest)WebRequest.Create(url);
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");
const int bufferSize = 4096;
using (var fs = File.Open(path, FileMode.Create))
{
var buffer = new byte[bufferSize];
int readed;
while ((readed = stream.Read(buffer, 0, bufferSize)) != 0)
{
fs.Write(buffer, 0, readed); // write bytes to the output stream
}
}
}
}
}
}

View File

@ -0,0 +1,191 @@
/**
*
* (c) Copyright Ascensio System SIA 2021
*
* 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.Linq;
using System.Threading.Tasks;
namespace OnlineEditorsExampleNetCore.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"
};
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"
};
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"
};
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"
};
private static List<User> users = new List<User>() {
new User(
"uid-1",
"John Smith",
"smith@mail.ru",
null,
null,
new Dictionary<string, object>(),
null,
new List<string>(),
descr_user_1,
true
),
new User(
"uid-2",
"Mark Pottato",
"pottato@mail.ru",
"group-2",
new List<string>() { "group-2", "" },
new Dictionary<string, object>()
{
{ "view", "" },
{ "edit", new List<string>() { "group-2", "" } },
{ "remove", new List<string>() { "group-2" } }
},
true,
new List<string>(),
descr_user_2,
false
),
new User(
"uid-3",
"Hamish Mitchell",
"mitchell@mail.ru",
"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>() { } }
},
false,
new List<string>() { "copy", "download", "print" },
descr_user_3,
false
),
new User(
"uid-0",
null,
null,
null,
null,
new Dictionary<string,object>(),
null,
new List<string>(),
descr_user_0,
false
)
};
public static User getUser(string id)
{
foreach (User user in users)
{
if (user.id.Equals(id)) return user;
}
return users[0];
}
public static List<User> getAllUsers()
{
return users;
}
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 User(string id, string name, string email, string group, List<string> reviewGroups, Dictionary<string, object> commentGroups, 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;
}
}
}

View File

@ -0,0 +1,45 @@
/**
*
* (c) Copyright Ascensio System SIA 2021
*
* 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 Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace OnlineEditorsExampleNetCore.Helpers
{
public static class Utils
{
// get the request header or return the default one
public static string GetOrDefault(this HttpContext context, string header, string def)
{
var value = context.Request.Headers[header];
if (value != String.Empty) return value.ToString();
return def;
}
// get a cookie from the cookie collection or return the default one
public static string GetOrDefault(this IRequestCookieCollection cookies, string cookie, string def)
{
var cook = cookies[cookie];
if (cook != null && !string.IsNullOrEmpty(cook)) return cook;
return def;
}
}
}

View File

@ -0,0 +1,380 @@
/**
*
* (c) Copyright Ascensio System SIA 2021
*
* 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 Microsoft.AspNetCore.Http;
using OnlineEditorsExampleNetCore.Helpers;
using System;
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json;
using Microsoft.AspNetCore.Mvc;
using System.Web;
using Newtonsoft.Json.Linq;
namespace OnlineEditorsExampleNetCore.Models
{
// create file model
public class FileModel
{
public string Mode { get; set; } // editor mode
public string Type { get; set; } // editor type
// 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 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 Ext { get; set; }
public string DownloadUrl
{
get { return DocManagerHelper.GetDownloadUrl(FileName); }
}
// get the document config
public string GetDocConfig(HttpContext context, IUrlHelper url)
{
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 mode = canEdit && editorsMode != "view" ? "edit" : "view"; // set the mode parameter: change it to view if the document can't be edited
var submitForm = canEdit && (editorsMode.Equals("edit") || editorsMode.Equals("fillForms")); // check if the Submit form button is displayed or not
var id = context.Request.Cookies["uid"];
var user = Users.getUser(id); // get the user
// favorite icon state
bool? favorite = user.favorite;
var actionLink = context.GetOrDefault("actionLink", null); // get the action link (comment or bookmark) if it exists
var actionData = string.IsNullOrEmpty(actionLink) ? null : JsonConvert.SerializeObject(actionLink); // get action data for the action link
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 },
{ "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") },
{ "reviewGroups", user.reviewGroups },
{ "commentGroups", user.commentGroups }
}
}
}
},
{
"editorConfig", new Dictionary<string, object>
{
{ "actionLink", actionData },
{ "mode", mode },
{ "lang", context.Request.Cookies.GetOrDefault("ulang", "en") },
{ "callbackUrl", CallbackUrl }, // absolute URL to the document storage service
{ "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 },
{ "name", user.id.Equals("uid-0") ? "" : user.name },
{ "group", user.group }
}
},
{
// the parameters for the embedded document type
"embedded", new Dictionary<string, object>
{
{ "saveUrl", FileUriUser }, // the absolute URL that will allow the document to be saved onto the user personal computer
{ "embedUrl", FileUriUser }, // the absolute URL to the document serving as a source file for the document embedded into the web page
{ "shareUrl", FileUriUser }, // 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
{ "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", url.Action("Index", "Home") } // 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 JsonConvert.SerializeObject(config);
}
// get the document history
public void GetHistory(out string history, out string historyData)
{
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 = JsonConvert.DeserializeObject<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"] },
});
}
}
dataObj.Add("key", key);
// write file url to the data object
dataObj.Add("url", i == currentVersion ? FileUri : DocManagerHelper.GetPathUri(Directory.GetFiles(verDir, "prev.*")[0].Substring(DocManagerHelper.ContentPath.Length)));
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 = JsonConvert.DeserializeObject<Dictionary<string, object>>(File.ReadAllText(Path.Combine(DocManagerHelper.VersionDir(histDir, i - 1), "changes.json")));
var changesArray = (JArray)changes["changes"];
var change = changesArray.Count > 0
? changesArray[0].ToObject<Dictionary<string, object>>()
: 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", new Dictionary<string, object>() { // write information about previous file version to the data object
{ "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
dataObj.Add("changesUrl", DocManagerHelper.GetPathUri(Path.Combine(DocManagerHelper.VersionDir(histDir, i - 1), "diff.zip").Substring(DocManagerHelper.ContentPath.Length)));
}
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 = JsonConvert.SerializeObject(new Dictionary<string, object>()
{
{ "currentVersion", currentVersion },
{ "history", hist }
});
historyData = JsonConvert.SerializeObject(histData);
}
}
// get a document which will be compared with the current document
public void GetCompareFileData(out string compareConfig)
{
// get the path to the compared file
var compareFileUrl = new UriBuilder(DocManagerHelper.GetServerUrl(true))
{
Path = "/assets",
Query = "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 (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 = JsonConvert.SerializeObject(dataCompareFile);
}
// get a logo config
public void GetLogoConfig(out string logoUrl)
{
// get the path to the logo image
var mailMergeUrl = new UriBuilder(DocManagerHelper.GetServerUrl(true))
{
Path = "\\img\\logo.png"
};
// create a logo config
var logoConfig = new Dictionary<string, object>
{
{ "fileType", "png"},
{ "url", mailMergeUrl.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 = JsonConvert.SerializeObject(logoConfig).Replace("{", "").Replace("}", "");
}
// get a mail merge config
public void GetMailMergeConfig(out string dataMailMergeRecipients)
{
// get the path to the recipients data for mail merging
var mailMergeUrl = new UriBuilder(DocManagerHelper.GetServerUrl(true))
{
Path = "/csv"
};
// create a mail merge config
var mailMergeConfig = new Dictionary<string, object>
{
{ "fileType", "csv" },
{ "url", mailMergeUrl.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 = JsonConvert.SerializeObject(mailMergeConfig);
}
//get a users for mentions
public void GetUsersMentions(HttpRequest request, out string usersForMentions)
{
var id = request.Cookies.GetOrDefault("uid", null);
var user = Users.getUser(id);
usersForMentions = !user.id.Equals("uid-0") ? JsonConvert.SerializeObject(Users.getUsersForMentions(user.id)) : JsonConvert.SerializeObject(null);
}
}
}

View File

@ -0,0 +1,72 @@
/**
*
* (c) Copyright Ascensio System SIA 2021
*
* 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 OnlineEditorsExampleNetCore.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"
};
// spreadsheet extensions
public static readonly List<string> ExtsSpreadsheet = new List<string>
{
".xls", ".xlsx", ".xlsm",
".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,30 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Content Include="192.168.1.2\new.docx" />
</ItemGroup>
<ItemGroup>
<None Include="wwwroot\assets\AUTHORS.md" />
<None Include="wwwroot\assets\LICENSE" />
<None Include="wwwroot\assets\new\new.docx" />
<None Include="wwwroot\assets\new\new.pptx" />
<None Include="wwwroot\assets\new\new.xlsx" />
<None Include="wwwroot\assets\sample\csv.csv" />
<None Include="wwwroot\assets\sample\sample.docx" />
<None Include="wwwroot\assets\sample\sample.pptx" />
<None Include="wwwroot\assets\sample\sample.xlsx" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Cors" Version="2.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JsonSchema="" /></VisualStudio></ProjectExtensions>
</Project>

View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31205.134
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OnlineEditorsExampleNetCore", "OnlineEditorsExampleNetCore.csproj", "{99F3DBD2-90F0-4F99-A450-A9D8E21C6132}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{99F3DBD2-90F0-4F99-A450-A9D8E21C6132}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{99F3DBD2-90F0-4F99-A450-A9D8E21C6132}.Debug|Any CPU.Build.0 = Debug|Any CPU
{99F3DBD2-90F0-4F99-A450-A9D8E21C6132}.Release|Any CPU.ActiveCfg = Release|Any CPU
{99F3DBD2-90F0-4F99-A450-A9D8E21C6132}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C16F5484-E16F-462F-9481-64F2A61E0A91}
EndGlobalSection
EndGlobal

View File

@ -1,7 +1,6 @@
<?php
/**
* (c) Copyright Ascensio System SIA 2026
*
* (c) Copyright Ascensio System SIA 2021
*
* 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,26 @@
* 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 Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
use UnexpectedValueException;
class DownloadFileRequest
namespace OnlineEditorsExampleNetCore
{
public function __construct(public string $url)
public class Program
{
if (! filter_var($url, FILTER_VALIDATE_URL)) {
throw new UnexpectedValueException("$url is not a valid URL");
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
}

View File

@ -0,0 +1,12 @@
{
"profiles": {
"OnlineEditorsExampleNetCore": {
"commandName": "Project",
"launchBrowser": true,
"applicationUrl": "http://localhost:8000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

View File

@ -0,0 +1,62 @@
## Overview
This example will help you integrate ONLYOFFICE Docs into your web application written in .Net Core.
It is aimed at testing the editors. Please, do not use it for production without proper modifications.
## 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 Core code for the editors integration and change base configuration
Download the [.Net Core example](https://api.onlyoffice.com/editors/demopreview) from our site. Or you can clone git repository using **git** command:
```
git clone https://github.com/ONLYOFFICE/document-server-integration.git
```
You need to connect the editors to your web site. Go to the project directory and specify path to the editors installation in the *appsettings.json* file:
```
"files.docservice.url.site": "https://documentserver/"
```
where the **documentserver** is the address of the server with the ONLYOFFICE Document Server installed.
If you want to experiment with the editor configuration, modify the [parameters](https://api.onlyoffice.com/editors/advanced) it the *FileModel.cs* file.
## Step 3. Install the prerequisites
Сheck if your system meets the system requirements:
* Microsoft .NET Core: version 3.1 (download it from the [official Microsoft website](https://dotnet.microsoft.com/download/dotnet/3.1));
You can install the prerequisites using scripts:
### For Windows
(https://docs.microsoft.com/en-us/dotnet/core/install/windows?tabs=net50#install-with-powershell-automation)
### For Linux
(https://docs.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install)
Or you can install .NET Core for your OS following this instruction:
([instruction](https://docs.microsoft.com/en-us/dotnet/core/install/linux))
## Step 4. Run your website with the editors
1. The example listening on http://localhost:8000, but if you want change this value, you need go to folder **Properties** and edit path in the *launchSettings.json* file:
```
"applicationUrl": "http://localhost:8000",
```
where the **http://localhost:8000** is the name of you listening address and you can change 8000 port to any available port.
2. From the current folder where the example is located in your command prompt, run the following command:
```
dotnet run
```
The **dotnet run** command will build and start the app. You can stop the app at any time by selecting **Ctrl+C**.
If you rebuild and restart the app whenever you make code changes, run the following command:
```
dotnet watch run
```
You can stop the app at any time by selecting **Ctrl+C**.
## 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.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2026
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -16,15 +16,26 @@
*
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace OnlineEditorsExampleMVC.Models
namespace OnlineEditorsExampleNetCore.Services
{
// create file model
public class ForgottenFilesModel
public class ResponseFromConvert
{
public List<Dictionary<string, string>> files { get; set; }
[JsonPropertyName("error")]
public string Error { get; set; }
public ForgottenFilesModel(List<Dictionary<string, string>> files) { this.files = files; }
[JsonPropertyName("endConvert")]
public bool EndConvert { get; set; }
[JsonPropertyName("fileUrl")]
public string FileUrl { get; set; }
[JsonPropertyName("percent")]
public int Percent { get; set; }
}
}
}

View File

@ -0,0 +1,89 @@
/**
*
* (c) Copyright Ascensio System SIA 2021
*
* 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 Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.StaticFiles;
using OnlineEditorsExampleNetCore.Helpers;
using System;
using System.IO;
using System.Net;
using System.Threading.Tasks;
using System.Web;
namespace OnlineEditorsExampleNetCore
{
public class WebEditorExtenstions
{
// define tracker status
public enum TrackerStatus
{
NotFound = 0,
Editing = 1,
MustSave = 2,
Corrupted = 3,
Closed = 4,
MustForceSave = 6,
CorruptedForceSave = 7
}
public static void Remove(string fileName)
{
var path = DocManagerHelper.StoragePath(fileName, null);
var histDir = DocManagerHelper.HistoryDir(path);
if (File.Exists(path)) File.Delete(path);
if (Directory.Exists(histDir)) Directory.Delete(histDir, true);
}
public static void DownloadToFile(string url, string path)
{
if (string.IsNullOrEmpty(url)) throw new ArgumentException("url");
if (string.IsNullOrEmpty(path)) throw new ArgumentException("path");
var req = (HttpWebRequest)WebRequest.Create(url);
using (var stream = req.GetResponse().GetResponseStream())
{
if (stream == null) throw new Exception("stream is null");
const int bufferSize = 4096;
using (var fs = File.Open(path, FileMode.Create))
{
var buffer = new byte[bufferSize];
int readed;
while ((readed = stream.Read(buffer, 0, bufferSize)) != 0)
{
fs.Write(buffer, 0, readed);
}
}
}
}
// download data from the url to the file
public static async Task DownloadAsync(string filePath, HttpContext context)
{
var fileinf = new FileInfo(filePath);
context.Response.Headers.Add("Content-Length", fileinf.Length.ToString()); // set headers to the response
new FileExtensionContentTypeProvider().TryGetContentType(filePath, out string contentType);
context.Response.Headers.Add("Content-Type", contentType);
var tmp = HttpUtility.UrlEncode(Path.GetFileName(filePath));
tmp = tmp.Replace("+", "%20");
context.Response.Headers.Add("Content-Disposition", "attachment; filename*=UTF-8\'\'" + tmp);
await context.Response.SendFileAsync(filePath);
}
}
}

View File

@ -0,0 +1,114 @@
/**
*
* (c) Copyright Ascensio System SIA 2021
*
* 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 Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Server.Kestrel.Core;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Hosting;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace OnlineEditorsExampleNetCore
{
public class Startup
{
public IConfiguration Configuration { get; set; }
public IWebHostEnvironment HostEnvironment { get; set; }
public static Dictionary<string, string> AppSettings { get; set; }
public Startup(IConfiguration configuration, IWebHostEnvironment env)
{
Configuration = configuration;
HostEnvironment = env;
}
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
AppSettings = Configuration.GetSection("AppSettings").GetChildren()
.ToDictionary(x => x.Key, x => x.Value);
services.AddSingleton(HostEnvironment);
services.AddHttpContextAccessor();
services.AddDistributedMemoryCache();
services.AddSession();
services.AddCors();
services.AddSingleton<IFileProvider>(
new PhysicalFileProvider(
Path.Combine(Directory.GetCurrentDirectory(), "wwwroot")));
services.AddControllersWithViews();
// If using Kestrel:
services.Configure<KestrelServerOptions>(options =>
{
options.AllowSynchronousIO = true;
});
// If using IIS:
services.Configure<IISServerOptions>(options =>
{
options.AllowSynchronousIO = true;
});
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Home/Error");
}
app.UseCors(builder =>
{
builder
.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader();
});
app.UseSession();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
});
}
}
}

View File

@ -0,0 +1,201 @@
@{
Layout = null;
}
@model FileModel
<!DOCTYPE html>
<html>
<head runat="server">
<!--
*
* (c) Copyright Ascensio System SIA 2020
*
* 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.
*
-->
@await Html.PartialAsync("EditorMetatagsPartial")
<link rel="icon" href="@Url.Content("~/img/" + @Model.DocumentType + ".ico")" type="image/x-icon" />
<title>@Model.FileName - ONLYOFFICE</title>
@await Html.PartialAsync("EditorCssPartial")
</head>
<body>
<div class="form">
<div id="iframeEditor">
</div>
</div>
<script src="@Startup.AppSettings["files.docservice.url.site"]@Startup.AppSettings["files.docservice.url.api"]"></script>
<script type="text/javascript" language="javascript">
var docEditor;
var innerAlert = function (message) {
if (console && console.log)
console.log(message);
};
// the application is loaded into the browser
var onAppReady = function () {
innerAlert("Document editor ready");
};
// the document is modified
var onDocumentStateChange = function (event) {
var title = document.title.replace(/\*$/g, "");
document.title = title + (event.data ? "*" : "");
};
// the user is trying to switch the document from the viewing into the editing mode
var onRequestEditRights = function () {
location.href = location.href.replace(RegExp("editorsMode=view\&?", "i"), "");
};
// an error or some other specific event occurs
var onError = function (event) {
if (event)
innerAlert(event.data);
};
// the document is opened for editing with the old document.key value
var onOutdatedVersion = function (event) {
location.reload(true);
};
// replace the link to the document which contains a bookmark
var replaceActionLink = function(href, linkParam) {
var link;
var actionIndex = href.indexOf("&actionLink=");
if (actionIndex != -1) {
var endIndex = href.indexOf("&", actionIndex + "&actionLink=".length);
if (endIndex != -1) {
link = href.substring(0, actionIndex) + href.substring(endIndex) + "&actionLink=" + encodeURIComponent(linkParam);
} else {
link = href.substring(0, actionIndex) + "&actionLink=" + encodeURIComponent(linkParam);
}
} else {
link = href + "&actionLink=" + encodeURIComponent(linkParam);
}
return link;
}
// the user is trying to get link for opening the document which contains a bookmark, scrolling to the bookmark position
var onMakeActionLink = function (event) {
var actionData = event.data;
var linkParam = JSON.stringify(actionData);
docEditor.setActionLink(replaceActionLink(location.href, linkParam)); // set the link to the document which contains a bookmark
};
// the meta information of the document is changed via the meta command
var onMetaChange = function (event) {
var favorite = !!event.data.favorite;
var title = document.title.replace(/^\☆/g, "");
document.title = (favorite ? "☆" : "") + title;
docEditor.setFavorite(favorite); // change the Favorite icon state
};
// the user is trying to insert an image by clicking the Image from Storage button
var onRequestInsertImage = function (event) {
@{string logoUrl;
Model.GetLogoConfig(out logoUrl);}
docEditor.insertImage({ // insert an image into the file
"c": event.data.c,
@Html.Raw(logoUrl)
})
};
// the user is trying to select document for comparing by clicking the Document from Storage button
var onRequestCompareFile = function () {
@{string compareFileData;
Model.GetCompareFileData(out compareFileData);}
docEditor.setRevisedFile(@Html.Raw(compareFileData)); // select a document for comparing
};
// the user is trying to select recipients data by clicking the Mail merge button
var onRequestMailMergeRecipients = function (event) {
@{ string dataMailMergeRecipients;
Model.GetMailMergeConfig(out dataMailMergeRecipients); }
docEditor.setMailMergeRecipients(@Html.Raw(dataMailMergeRecipients)); // insert recipient data for mail merge into the file
};
var config = @Html.Raw(Model.GetDocConfig(Context, Url));
config.width = "100%";
config.height = "100%";
config.events = {
'onAppReady': onAppReady,
'onDocumentStateChange': onDocumentStateChange,
'onRequestEditRights': onRequestEditRights,
'onError': onError,
'onOutdatedVersion': onOutdatedVersion,
"onMakeActionLink": onMakeActionLink,
"onMetaChange": onMetaChange,
"onRequestInsertImage": onRequestInsertImage,
"onRequestCompareFile": onRequestCompareFile,
"onRequestMailMergeRecipients": onRequestMailMergeRecipients,
};
@{ string hist, histData; }
@{ Model.GetHistory(out hist, out histData); }
@{ if (!string.IsNullOrEmpty(hist) && !string.IsNullOrEmpty(histData)) }
{
// the user is trying to show the document version history
config.events['onRequestHistory'] = function () {
docEditor.refreshHistory(@Html.Raw(hist)); // show the document version history
};
// the user is trying to click the specific document version in the document version history
config.events['onRequestHistoryData'] = function (event) {
var ver = event.data;
var histData = @Html.Raw(histData);
docEditor.setHistoryData(histData[ver - 1]); // send the link to the document for viewing the version history
};
// the user is trying to go back to the document from viewing the document version history
config.events['onRequestHistoryClose '] = function () {
document.location.reload();
};
}
@{ string usersForMentions; }
@{ Model.GetUsersMentions(Context.Request, out usersForMentions); }
@{ if (!string.IsNullOrEmpty(usersForMentions)) }
{
// add mentions for not anonymous users
config.events['onRequestUsers'] = function () {
docEditor.setUsers({
"users": @Html.Raw(usersForMentions)
});
};
config.events['onRequestSendNotify'] = function (event) {
var actionLink = JSON.stringify(event.data.actionLink);
console.log("onRequestSendNotify:");
console.log(event.data);
console.log("Link to comment: " + replaceActionLink(location.href, actionLink));
};
}
var сonnectEditor = function () {
docEditor = new DocsAPI.DocEditor("iframeEditor", config);
};
if (window.addEventListener) {
window.addEventListener("load", сonnectEditor);
} else if (window.attachEvent) {
window.attachEvent("load", сonnectEditor);
}
</script>
</body>
</html>

View File

@ -0,0 +1,34 @@
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<!--
*
* (c) Copyright Ascensio System SIA 2020
*
* 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.
*
-->
<meta name="viewport" content="width=device-width" />
<title>Error</title>
</head>
<body>
<hgroup>
<h1>Error.</h1>
<h2>An error occurred while processing your request.</h2>
</hgroup>
</body>
</html>

View File

@ -0,0 +1,384 @@
@{
Layout = null;
}
@model FileModel
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head runat="server">
<!--
*
* (c) Copyright Ascensio System SIA 2020
*
* 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.
*
-->
@await Html.PartialAsync("IndexMetatagsPartial")
<title>ONLYOFFICE</title>
<link href="@Url.Content("~/favicon.ico")" rel="shortcut icon" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans:900,800,700,600,500,400,300&subset=latin,cyrillic-ext,cyrillic,latin-ext" />
@await Html.PartialAsync("IndexCssPartial")
</head>
<body>
<header>
<div class="center">
<div class="menu">
<span></span>
<span></span>
<span></span>
</div>
<a href="">
<img src="~/img/logo.svg" alt="ONLYOFFICE" />
</a>
</div>
</header>
<div class="center main">
<table class="table-main">
<tbody>
<tr>
<td class="left-panel section">
<div class="help-block">
<span>Create new</span>
<div class="clearFix">
<div class="create-panel">
<ul class="try-editor-list clearFix" data-link="@Url.Action("Sample", "Home")">
<li>
<a class="try-editor word" data-type="docx">Document</a>
</li>
<li>
<a class="try-editor cell" data-type="xlsx">Spreadsheet</a>
</li>
<li>
<a class="try-editor slide" data-type="pptx">Presentation</a>
</li>
</ul>
<label class="create-sample">
<input id="createSample" class="checkbox" type="checkbox" />With sample content
</label>
</div>
<div class="upload-panel clearFix">
<a class="file-upload">
Upload file
<input type="file" id="fileupload" name="files[]" data-url="@Url.Content("~/upload")" />
</a>
</div>
</div>
<table class="user-block-table" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="middle">
<span class="select-user">Username</span>
<img class="info" data-id="user" data-tooltip="You can open the same document using different users in different Web browser sessions, so you can check out multi-user editing functions.
</br>
@foreach (User user in Users.getAllUsers())
{
<b>
@if (@user.name == null)
{
user.name = "Anonymous";
}
else @user.name
</b>
<ul>
@foreach (string description in user.descriptions)
{
<li>@description</li>
}
</ul>
}"
src="~/img/info.svg" />
<select class="select-user" id="user">
@foreach (User user in Users.getAllUsers())
{
<option value="@user.id">
@if (@user.name == null)
{
user.name = "Anonymous";
}
else @user.name
</option>
}
</select>
</td>
</tr>
<tr>
<td valign="middle">
<span class="select-user">Language</span>
<img class="info" data-id="language" data-tooltip="Choose the language for ONLYOFFICE editors interface" src="~/img/info.svg" />
<select class="select-user" id="language">
<option value="en">English</option>
<option value="be">Belarusian</option>
<option value="bg">Bulgarian</option>
<option value="ca">Catalan</option>
<option value="zh">Chinese</option>
<option value="cs">Czech</option>
<option value="da">Danish</option>
<option value="nl">Dutch</option>
<option value="fi">Finnish</option>
<option value="fr">French</option>
<option value="de">German</option>
<option value="el">Greek</option>
<option value="hu">Hungarian</option>
<option value="id">Indonesian</option>
<option value="it">Italian</option>
<option value="ja">Japanese</option>
<option value="ko">Korean</option>
<option value="lv">Latvian</option>
<option value="lo">Lao</option>
<option value="nb">Norwegian</option>
<option value="pl">Polish</option>
<option value="pt">Portuguese</option>
<option value="ro">Romanian</option>
<option value="ru">Russian</option>
<option value="sk">Slovak</option>
<option value="sl">Slovenian</option>
<option value="sv">Swedish</option>
<option value="es">Spanish</option>
<option value="tr">Turkish</option>
<option value="uk">Ukrainian</option>
<option value="vi">Vietnamese</option>
</select>
</td>
</tr>
</tbody>
</table>
</div>
</td>
<td class="section">
<div class="main-panel">
@{ var storedFiles = DocManagerHelper.GetStoredFiles(); }
@if (!storedFiles.Any())
{
<span class="portal-name">ONLYOFFICE Document Editors Welcome!</span>
<span class="portal-descr">
Get started with a demo-sample of ONLYOFFICE Document Editors, the first html5-based editors.
<br /> You may upload your own documents for testing using the "<b>Upload file</b>" button and <b>selecting</b> the necessary files on your PC.
</span>
}
else
{
<div class="stored-list">
<span class="header-list">Your documents</span>
<table class="tableHeader" cellspacing="0" cellpadding="0" width="100%">
<thead>
<tr>
<td class="tableHeaderCell tableHeaderCellFileName">Filename</td>
<td class="tableHeaderCell tableHeaderCellEditors contentCells-shift">Editors</td>
<td class="tableHeaderCell tableHeaderCellViewers">Viewers</td>
<td class="tableHeaderCell tableHeaderCellDownload">Download</td>
<td class="tableHeaderCell tableHeaderCellRemove">Remove</td>
</tr>
</thead>
</table>
<div class="scroll-table-body">
<table cellspacing="0" cellpadding="0" width="100%">
<tbody>
@foreach (var storedFile in storedFiles)
{
var editUrl = "Editor?fileID=" + HttpUtility.UrlEncode(storedFile.Name);
var docType = FileUtility.GetFileType(storedFile.Name).ToString().ToLower();
var canEdir = DocManagerHelper.EditedExts.Contains(System.IO.Path.GetExtension(storedFile.Name).ToLower());
var version = DocManagerHelper.GetFileVersion(storedFile.Name, DocManagerHelper.CurUserHostAddress(null));
<tr class="tableRow" title="@storedFile.Name [@version]">
<td class="contentCells">
<a class="stored-edit @docType" href="@Url.Action("Editor", "Home", new { fileName = storedFile.Name })" target="_blank">
<span>@storedFile.Name</span>
</a>
</td>
@if (canEdir)
{
<td class="contentCells contentCells-icon">
<a href="@Url.Action("Editor", "Home", new { fileName = storedFile.Name, editorsType = "desktop", editorsMode = "edit" })" target="_blank">
<img src="~/img/desktop.svg" alt="Open in editor for full size screens" title="Open in editor for full size screens" />
</a>
</td>
<td class="contentCells contentCells-icon">
<a href="@Url.Action("Editor", "Home", new { fileName = storedFile.Name, editorsType = "mobile", editorsMode = "edit" })" target="_blank">
<img src="~/img/mobile.svg" alt="Open in editor for mobile devices" title="Open in editor for mobile devices" />
</a>
</td>
<td class="contentCells contentCells-icon">
<a href="@Url.Action("Editor", "Home", new { fileName = storedFile.Name, editorsType = "desktop", editorsMode = "comment" })" target="_blank">
<img src="~/img/comment.svg" alt="Open in editor for comment" title="Open in editor for comment" />
</a>
</td>
@if (docType == "word")
{
<td class="contentCells contentCells-icon">
<a href="@Url.Action("Editor", "Home", new { fileName = storedFile.Name, editorsType = "desktop", editorsMode = "review" })" target="_blank">
<img src="~/img/review.svg" alt="Open in editor for review" title="Open in editor for review" />
</a>
</td>
}
else if (docType == "cell")
{
<td class="contentCells contentCells-icon">
<a href="@Url.Action("Editor", "Home", new { fileName = storedFile.Name, editorsType = "desktop", editorsMode = "filter" })" target="_blank">
<img src="~/img/filter.svg" alt="Open in editor without access to change the filter" title="Open in editor without access to change the filter" />
</a>
</td>
}
@if (docType == "slide")
{
<td class="contentCells contentCells-icon contentCellsEmpty"></td>
}
@if (docType == "word")
{
<td class="contentCells contentCells-icon">
<a href="@Url.Action("Editor", "Home", new { fileName = storedFile.Name, editorsType = "desktop", editorsMode = "fillForms" })" target="_blank">
<img src="~/img/fill-forms.svg" alt="Open in editor for filling in forms" title="Open in editor for filling in forms" />
</a>
</td>
}
else
{
<td class="contentCells contentCells-icon "></td>
}
@if (docType == "word")
{
<td class="contentCells contentCells-shift contentCells-icon firstContentCellShift">
<a href="@Url.Action("Editor", "Home", new { fileName = storedFile.Name, editorsType = "desktop", editorsMode = "blockcontent" })" target="_blank">
<img src="~/img/block-content.svg" alt="Open in editor without content control modification" title="Open in editor without content control modification" />
</a>
</td>
}
else
{
<td class="contentCells contentCells-shift contentCells-icon firstContentCellShift "></td>
}
@if (docType == "slide")
{
<td class="contentCells contentCells-icon "></td>
}
}
else
{
<td class="contentCells contentCells-shift contentCells-icon contentCellsEmpty" colspan="6"></td>
}
<td class="contentCells contentCells-icon firstContentCellViewers">
<a href="@Url.Action("Editor", "Home", new { fileName = storedFile.Name, editorsType = "desktop", editorsMode = "view" })" target="_blank">
<img src="~/img/desktop.svg" alt="Open in viewer for full size screens" title="Open in viewer for full size screens" />
</a>
</td>
<td class="contentCells contentCells-icon">
<a href="@Url.Action("Editor", "Home", new { fileName = storedFile.Name, editorsType = "mobile", editorsMode = "view" })" target="_blank">
<img src="~/img/mobile.svg" alt="Open in viewer for mobile devices" title="Open in viewer for mobile devices" />
</a>
</td>
<td class="contentCells contentCells-icon contentCells-shift">
<a href="@Url.Action("Editor", "Home", new { fileName = storedFile.Name, editorsType = "embedded", editorsMode = "embedded" })" target="_blank">
<img src="~/img/embeded.svg" alt="Open in embedded mode" title="Open in embedded mode" />
</a>
</td>
<td class="contentCells contentCells-icon contentCells-shift downloadContentCellShift">
<a href="@DocManagerHelper.GetDownloadUrl(storedFile.Name)">
<img class="icon-download" src="~/img/download.svg" alt="Download" title="Download" />
</a>
</td>
<td class="contentCells contentCells-icon contentCells-shift">
<a href="@Url.Action("Remove", "Home", new { fileName = storedFile.Name })">
<img class="icon-delete" src="~/img/delete.svg" alt="Delete" title="Delete" />
</a>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
}
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div id="mainProgress">
<div id="uploadSteps">
<span id="uploadFileName" class="uploadFileName"></span>
<div class="describeUpload">After these steps are completed, you can work with your document.</div>
<span id="step1" class="step">1. Loading the file.</span>
<span class="step-descr">The loading speed depends on file size and additional elements it contains.</span>
<br />
<span id="step2" class="step">2. Conversion.</span>
<span class="step-descr">The file is converted to OOXML so that you can edit it.</span>
<br />
<div id="blockPassword">
<span class="descrFilePass">The file is password protected.</span>
<br />
<div>
<input id="filePass" type="password" />
<div id="enterPass" class="button orange">Enter</div>
<div id="skipPass" class="button gray">Skip</div>
</div>
<span class="errorPass"></span>
<br />
</div>
<span id="step3" class="step">3. Loading editor scripts.</span>
<span class="step-descr">They are loaded only once, they will be cached on your computer.</span>
<input type="hidden" name="hiddenFileName" id="hiddenFileName" />
<br />
<br />
<span class="progress-descr">Note the speed of all operations depends on your connection quality and server location.</span>
<br />
<br />
<div class="error-message">
<b>Upload error: </b><span></span>
<br />
Please select another file and try again.
</div>
</div>
<iframe id="embeddedView" src="" height="345px" width="432px" frameborder="0" scrolling="no" allowtransparency=allowtransparency></iframe>
<br />
<div id="beginEdit" class="button orange disable">Edit</div>
<div id="beginView" class="button gray disable">View</div>
<div id="beginEmbedded" class="button gray disable">Embedded view</div>
<div id="cancelEdit" class="button gray">Cancel</div>
</div>
<span id="loadScripts" data-docs="@Startup.AppSettings["files.docservice.url.site"]@Startup.AppSettings["files.docservice.url.preloader"]"></span>
<footer>
<div class="center">
<table>
<tbody>
<tr>
<td>
<a href="http://api.onlyoffice.com/editors/howitworks" target="_blank">API Documentation</a>
</td>
<td>
<a href="mailto:sales@onlyoffice.com">Submit your request</a>
</td>
<td class="copy">
&copy; Ascensio System SIA @DateTime.Now.Year.ToString(). All rights reserved.
</td>
@ViewBag.NewFileUrl
</tr>
</tbody>
</table>
</div>
</footer>
@await Html.PartialAsync("IndexScriptsPartial")
<script language="javascript" type="text/javascript">
var ConverExtList = '@string.Join(",", DocManagerHelper.ConvertExts.ToArray())';
var EditedExtList = '@string.Join(",", DocManagerHelper.EditedExts.ToArray())';
var UrlConverter = '@Url.Content("~/convert")';
var UrlEditor = '@Url.Action("editor", "Home")';
</script>
</body>
</html>

View File

@ -0,0 +1 @@
<link href="~/css/editor.css" type="text/css" rel="stylesheet" />

View File

@ -0,0 +1,5 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />

View File

@ -0,0 +1,3 @@
<link href="~/css/jquery-ui.css" type="text/css" rel="stylesheet" />
<link href="~/css/stylesheet.css" type="text/css" rel="stylesheet" />
<link href="~/css/media.css" type="text/css" rel="stylesheet" />

View File

@ -0,0 +1,3 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width" />

View File

@ -0,0 +1 @@
<script asp-src-include="~/js/*.js"></script>

View File

@ -0,0 +1 @@


View File

@ -0,0 +1,25 @@
<!--
*
* (c) Copyright Ascensio System SIA 2020
*
* 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 OnlineEditorsExampleNetCore
@using OnlineEditorsExampleNetCore.Models
@using OnlineEditorsExampleNetCore.Helpers
@using System.IO
@using Microsoft.AspNetCore.Http
@using System.Web
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

View File

@ -0,0 +1,21 @@
<!--
*
* (c) Copyright Ascensio System SIA 2020
*
* 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.
*
-->
@{
Layout = "_Layout";
}

View File

@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
}
}

View File

@ -0,0 +1,27 @@
{
"AppSettings": {
"webpages:Version": "2.0.0.0",
"webpages:Enabled": "false",
"PreserveLoginUrl": "true",
"ClientValidationEnabled": "true",
"UnobtrusiveJavaScriptEnabled": "true",
"filesize-max": "5242880",
"files.docservice.viewed-docs": ".pdf|.djvu|.xps|.oxps",
"files.docservice.edited-docs": ".docx|.xlsx|.csv|.pptx|.txt",
"files.docservice.convert-docs": ".docm|.dotx|.dotm|.dot|.doc|.odt|.fodt|.ott|.xlsm|.xltx|.xltm|.xlt|.xls|.ods|.fods|.ots|.pptm|.ppt|.ppsx|.ppsm|.pps|.potx|.potm|.pot|.odp|.fodp|.otp|.rtf|.mht|.html|.htm|.xml|.epub|.fb2",
"files.docservice.timeout": "120000",
"files.docservice.secret": "",
"files.docservice.header": "Authorization",
"files.docservice.url.site": "https://documentserver/",
"files.docservice.url.converter": "ConvertService.ashx",
"files.docservice.url.api": "web-apps/apps/api/documents/api.js",
"files.docservice.url.preloader": "web-apps/apps/api/documents/cache-scripts.html",
"files.docservice.url.command": "coauthoring/CommandService.ashx",
"files.docservice.url.example": ""
}
}

View File

@ -0,0 +1,29 @@
ONLYOFFICE Applications example uses code from the following 3rd party projects:
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
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
Microsoft.AspNetCore.Cors - CORS middleware and policy for ASP.NET Core to enable cross-origin resource sharing (https://raw.githubusercontent.com/aspnet/AspNetCore/2.0.0/LICENSE.txt)
License: MIT
License File: Microsoft.AspNetCore.Cors.license

View File

@ -0,0 +1,14 @@
Copyright (c) .NET Foundation and Contributors
All rights reserved.
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.

View File

@ -0,0 +1,14 @@
The MIT License (MIT)
Copyright (c) 2007 James Newton-King
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.

View File

@ -0,0 +1,9 @@
Copyright <20> 2007-2013 M. Alsup.
The BlockUI plugin is dual licensed under the MIT and GPL licenses.
You may use either license. The MIT license is recommended for most projects because it is simple and easy to understand and it places almost no restrictions on what you can do with the plugin.
If the GPL suits your project better you are also free to use the plugin under that license.
You do not have to do anything special to choose one license or the other and you don't have to notify anyone which license you are using. You are free to use the BlockUI plugin in commercial projects as long as the copyright header is left intact.

View File

@ -0,0 +1,20 @@
MIT License
Copyright <20> 2010 Sebastian Tschan, https://blueimp.net
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -0,0 +1,43 @@
Copyright jQuery Foundation and other contributors, https://jquery.org/
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/jquery/jquery-ui
The following license applies to all parts of this software except as
documented below:
====
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
====
Copyright and related rights for sample code are waived via CC0. Sample
code is defined as all source code contained within the demos directory.
CC0: http://creativecommons.org/publicdomain/zero/1.0/
====
All files located in the node_modules and external directories are
externally maintained libraries used by this software which have their
own licenses; we recommend you read them, as their terms may differ from
the terms above.

View File

@ -0,0 +1,20 @@
MIT License
Copyright <20> 2010 Sebastian Tschan, https://blueimp.net
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -0,0 +1,20 @@
Copyright (c) 2009 John Resig, http://jquery.com/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2026
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -0,0 +1,596 @@
/**
*
* (c) Copyright Ascensio System SIA 2021
*
* 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.
*
*/
@media (min-width: 1280px) and (max-width: 1380px) {
.copy {
margin-right: 6.5%;
}
footer table tr td:first-child {
margin-left: 6.5%;
}
}
@media (max-width: 1280px) and (min-width: 1080px) {
.tableRow td:first-child {
flex-grow: 1;
width: 25%;
}
.tableHeaderCellFileName {
width: 25%;
}
.tableHeaderCellEditors {
width: 13%;
}
.tableHeaderCellViewers {
width: 29%;
text-align: right;
}
.tableHeaderCellDownload {
width: 21%;
padding-right: 18px;
}
.tableHeaderCellRemove {
padding-left: 13px;
}
footer table tr td:first-child {
margin-left: 5%;
}
.copy {
margin-right: 5%;
padding-right: 32px;
}
.left-panel {
margin-left: 48px;
width: 95%;
}
}
@media (max-width: 1080px) {
.copy {
margin-right: 32px;
}
footer table tr td:first-child {
margin-left: 0;
}
.tableRow {
width: 90%;
}
.tableHeaderCellFileName {
width: 16%;
}
.tableHeaderCellEditors {
width: 13%;
}
.tableHeaderCellViewers {
width: 38%;
}
.tableHeaderCellDownload {
width: 23%;
}
.tableHeaderCellRemove {
padding-left: 0px;
}
}
@media (max-width: 1008px) {
.left-panel {
margin-left: 0;
width: 94%;
}
.main-panel {
left: -1%;
padding: 48px 26px 24px;
}
}
@media (max-width: 769px) and (min-width: 593px) {
.contentCells-icon{
width: 5%;
}
.tableRow {
width: 55%;
}
.tableRow td:first-child {
border: none;
flex-grow: 1;
width: 100%;
max-width: 100%;
}
.tableHeader {
display: none;
}
.scroll-table-body {
top: 31px;
}
footer {
height: 80px;
}
.left-panel {
width: 90%;
}
.main-panel {
left: 0;
padding: 48px 18px 24px;
}
footer table td {
margin-left: 0;
margin-right: 0;
padding-right: 4px;
padding-left: 4px;
}
.copy {
margin:auto;
padding-right: 3%;
}
footer table tr td:first-child {
margin-left: auto;
padding-left: 1%;
margin-right: 1.5%;
}
.contentCells-shift {
padding-right: 22px;
}
}
@media (max-width: 715px) {
.tableRow {
width: 45%;
}
}
@media (max-width: 670px) and (min-width: 620px){
/*.main-panel{*/
/* width: 90%;*/
/*}*/
}
@media (max-width: 681px) and (min-width: 593px) {
.left-panel {
width: 69%;
}
.main-panel {
left: -6%;
padding: 48px 0 24px;
}
.help-block {
margin: 48px 20px 24px;
}
.file-upload{
width: 100%;
}
#fileupload{
width: 100%;
}
}
@media (max-width: 1080px) and (min-width: 970px) {
.tableHeader {
width: 90%;
}
.tableRow td:first-child {
flex-grow: 0;
width: 15%;
}
.tableHeaderCellFileName {
width: 16%;
}
.tableHeaderCellEditors {
width: 13%;
}
.tableHeaderCellViewers {
text-align: right;
width: 37%;
}
.tableHeaderCellDownload {
width: 22%;
}
}
@media (max-width: 986px) and (min-width: 890px) {
.tableHeader {
width: 75%;
}
.tableHeaderCellEditors {
width: 26%;
text-align: left;
}
.tableHeaderCellFileName {
width: 17%;
}
.tableHeaderCellViewers {
width: 27%;
text-align: right;
}
.tableHeaderCellDownload {
padding-right: 18px;
width: 20%;
}
.tableHeaderCellRemove {
padding-left: 0;
}
.tableRow {
width: 75%;
}
.tableRow td:last-child {
padding-right: 38px;
}
.tableRow td:first-child {
flex-grow: 0;
width: 15%;
}
.contentCells-icon {
width: 3%;
}
}
@media (max-width: 890px) and (min-width: 769px ) {
.left-panel{
width: 100%;
}
.contentCells-shift {
padding-right: 28px;
}
.main-panel {
width: 580px;
}
.tableRow {
width: 95%;
}
.tableHeader {
width: 95%;
}
.tableHeaderCellViewers {
width: 22%;
text-align: right;
}
.tableHeaderCellDownload {
padding-right: 4px;
width: 20%;
text-align: right;
}
.tableHeaderCellFileName {
width: 20%;
}
.tableHeaderCellEditors {
text-align: left;
width: 31%;
}
.tableHeaderCellViewers {
width: 18%;
}
}
@media (max-width: 890px) {
.tableRow td:first-child {
max-width: 17%;
}
}
.downloadContentCellShift:after {
bottom:0 ;
left: 0;
content: "";
background: #e5e5e5;
height: 1px;
position: absolute;
width: 100%;
}
@media (max-width: 769px) {
.tableRow td:first-child {
max-width: 100%;
}
}
@media (max-width: 593px ) {
.file-upload{
width: 100%;
}
#fileupload{
width: 100%;
}
.tableHeader {
display: none;
}
.scroll-table-body {
top: 31px;
}
.menu {
display: flex;
}
header .center > a {
position: absolute;
left: 30px;
}
footer table tr {
justify-content: center;
}
footer table td {
padding-top: 16px;
padding-right: 32px;
padding-left: 32px;
}
footer {
height: 80px;
}
.copy {
width: 100%;
text-align: center;
margin: 0;
}
.left-panel {
width: 61%;
}
.help-block {
margin: 16px 10px 6px;
}
.main-panel {
left: -8%;
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%;
}
}
@media (max-width: 560px) and (min-width: 510px) {
.contentCells-icon {
width: 13%;
}
.downloadContentCellShift {
padding-right: 45px;
max-width: 4%;
}
}
@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;
padding-left: 5px;
}
.copy {
padding-right: 5px;
margin: 0;
}
.firstContentCellViewers{
padding-right: 2px;
width: 11%;
}
}
@media (max-width: 1160px) {
.left-panel {
margin-left: 0;
}
}
@media (min-width: 593px) {
.contentCellsEmpty {
display: none;
}
}
@media (max-width: 769px) and (min-width: 715px){
.tableRow{
width: 50%;
}
}
@media(max-width: 1080px) and (min-width: 986px){
.tableHeaderCellRemove{
padding-left: 6px;
}
}

View File

@ -1,6 +1,6 @@
/**
*
* (c) Copyright Ascensio System SIA 2026
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -16,13 +16,12 @@
*
*/
html {
html {
height: 100%;
width: 100%;
}
body {
display: block;
background: #FFFFFF;
color: #333333;
font-family: Open Sans;
@ -65,22 +64,13 @@ header img {
margin: 10px 0 22px 32px;
}
.responsive-nav {
display: none;
}
.mobile-close-btn {
display: none;
}
.center {
position: relative;
margin: 0 auto 0;
width: 1152px;
}
.main{
display: table;
.main {
height: calc(100% - 112px);
min-height: 536px;
}
@ -91,7 +81,7 @@ header img {
min-height: 536px;
}
.section{
.section {
height: 100%;
padding: 0;
vertical-align: top;
@ -107,10 +97,6 @@ header img {
width: 896px;
}
#portal-info {
max-width: 65vw;
}
.portal-name {
color: #FF6F3D;
font-size: 24px;
@ -160,22 +146,18 @@ label .checkbox {
}
.try-editor.word {
background-image: url("img/file_docx.svg");
background-image: url("/img/file_docx.svg");
}
.try-editor.cell {
background-image: url("img/file_xlsx.svg");
background-image: url("/img/file_xlsx.svg");
}
.try-editor.slide {
background-image: url("img/file_pptx.svg");
background-image: url("/img/file_pptx.svg");
}
.try-editor.form {
background-image: url("img/file_pdf.svg");
}
.side-option {
.create-sample {
color: #666666;
line-height: 24px;
}
@ -187,7 +169,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;
@ -218,7 +200,7 @@ label .checkbox {
cursor: default;
}
.button.orange:not(.disable):hover{
.button.orange:not(.disable):hover {
background: #ff7a4b;
}
@ -238,86 +220,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(img/file_upload.svg) no-repeat 0 transparent;
background: url("/img/file_upload.svg") no-repeat 0 transparent;
cursor: pointer;
display: block;
font-size: 14px;
@ -352,51 +261,14 @@ 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;
font-size: 12px;
margin: 30px 40px
margin: 30px 40px;
}
#mainProgress .uploadFileName{
#mainProgress .uploadFileName {
background-position: left center;
background-repeat: no-repeat;
display: block;
@ -426,34 +298,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(img/error.svg) no-repeat scroll 4px 10px;
background: url("../img/error.svg") no-repeat scroll 4px 10px;
color: #CB0000;
display: none;
line-height: 160%;
@ -473,26 +319,16 @@ label .checkbox {
padding-left: 35px;
}
.waiting {
opacity: 30%;
}
.current {
background-image: url("img/loader16.gif");
background-image: url("../img/loader16.gif");
}
.done {
background-image: url("img/done.svg");
background-image: url("../img/done.svg");
}
.error {
background-image: url("img/notdone.svg");
}
.convertPercent {
color: #FF6F3D;
font-weight: 700;
display: inline;
background-image: url("../img/notdone.svg");
}
.step-descr {
@ -502,15 +338,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;
@ -567,7 +403,6 @@ footer a:hover {
footer table tr td:first-child {
margin-left: 14%;
}
.copy {
width: max-content;
position: relative;
@ -606,28 +441,19 @@ footer table tr td:first-child {
white-space: nowrap;
}
.convertFileName.word,
.stored-edit.word,
.uploadFileName.word {
background-image: url("img/icon_docx.svg");
background-image: url("../img/icon_docx.svg");
}
.convertFileName.cell,
.stored-edit.cell,
.uploadFileName.cell {
background-image: url("img/icon_xlsx.svg");
background-image: url("../img/icon_xlsx.svg");
}
.convertFileName.slide,
.stored-edit.slide,
.uploadFileName.slide {
background-image: url("img/icon_pptx.svg");
}
.convertFileName.pdf,
.stored-edit.pdf,
.uploadFileName.pdf {
background-image: url("img/icon_pdf.svg");
background-image: url("../img/icon_pptx.svg");
}
.stored-edit span {
@ -647,14 +473,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("img/close.svg") no-repeat scroll left top;
background: url("../img/close.svg") no-repeat scroll left top;
cursor: pointer;
float: right;
font-size: 1px;
@ -681,11 +507,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;
@ -703,7 +524,7 @@ footer table tr td:first-child {
padding-top: 10px;
}
.tableHeader tr{
.tableHeader tr {
background: transparent;
cursor: default;
height: 40px;
@ -714,7 +535,7 @@ footer table tr td:first-child {
}
.tableHeaderCell {
border-bottom: 1px solid #EFEFEF;
border-bottom: 1px solid #CCCCCC;
padding: 2px 4px;
text-align: center;
}
@ -724,32 +545,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;
@ -761,51 +577,56 @@ 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;
}
.tooltip {
background: #FFFFFF;
border-radius: 5px;
box-shadow: 0px 7px 25px rgba(85, 85, 85, 0.15);
color: #666666;
line-height: 160%;
max-width: 60vw;
padding: 14px;
position: absolute;
}
#user-tooltip {
overflow-y: overlay;
height: 86vh;
top: 30px;
}
.tooltip ul {
margin: 0;
}
.arrow {
border-top: 8px solid transparent;
border-bottom: 8px solid transparent;
border-right: 8px solid #FFFFFF;
position: absolute;
transform: translate(-50%, -50%);
}
.user-block-table {
height: 100%;
padding-top: 14px;
width: 100%;
}
@ -825,7 +646,7 @@ footer table tr td:first-child {
width: 100%;
}
.icon-action {
.icon-delete {
cursor: pointer;
}
@ -846,7 +667,6 @@ footer table tr td:first-child {
position: absolute;
right: 0;
top: 71px;
height: calc(100% - 130px);
scrollbar-color: #D0D5DA transparent;
scrollbar-width: thin;
}
@ -885,7 +705,7 @@ footer table tr td:first-child {
}
.errorInput {
border-color: #CB0000!important;
border-color: #CB0000 !important;
}
.errorPass {
@ -895,6 +715,26 @@ footer table tr td:first-child {
letter-spacing: -0.02em;
word-wrap: break-word;
}
.menu {
cursor: pointer;
display: none;
flex-wrap: nowrap;
flex-direction: column;
justify-content: space-between;
top: 10px;
left: 12px;
position: absolute;
content: "";
height: 26px;
width: 30px;
}
.menu span {
content: "";
width: 26px;
height: 3px;
background: rgb(194, 194, 194);
}
html {
overflow-x: hidden;
@ -908,26 +748,18 @@ html {
position: relative;
}
.typeButtonsRow {
width: 100%;
display: flex;
flex-wrap: wrap;
flex-direction: row;
position: relative;
}
.tableRow td:first-child {
display: flex;
flex-grow: 1;
max-width: 29%;
max-width: 25%;
}
.tableHeaderCellFileName {
width: 24%;
width: 30%;
}
.tableHeaderCellEditors {
width: 17%;
width: 28%;
}
.tableHeaderCellViewers {
@ -943,151 +775,4 @@ html {
}
.tableHeaderCellRemove{
padding-left: 10px;
}
.user-descr {
display: inline-table;
width: 30vw;
min-width: 200px;
max-width: 400px;
margin-top: 20px;
}
.user-descr > b {
margin-left: 25px;
}
.buttonsMobile.indent{
padding-left: 35px;
margin-top: 10px;
margin-bottom: 10px;
}
.invisible {
display: none;
}
.tooltip {
background: #FFFFFF;
border-radius: 5px;
box-shadow: 0px 7px 25px rgba(85, 85, 85, 0.15);
color: #666666;
line-height: 160%;
max-width: 455px;
padding: 14px;
position: absolute;
}
.tooltip ul {
margin: 0;
}
.arrow {
border-top: 8px solid transparent;
border-bottom: 8px solid transparent;
border-right: 8px solid #FFFFFF;
left: -4px;
position: absolute;
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

Before

Width:  |  Height:  |  Size: 144 KiB

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

View File

Before

Width:  |  Height:  |  Size: 547 B

After

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 425 B

After

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 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="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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 757 B

After

Width:  |  Height:  |  Size: 757 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

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

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