java-spring: Integration example
19
web/documentserver-example/java-spring/.gitignore
vendored
Executable file
@ -0,0 +1,19 @@
|
||||
# Eclipse
|
||||
.classpath
|
||||
.project
|
||||
.settings/
|
||||
|
||||
# Intellij
|
||||
.idea/
|
||||
*.iml
|
||||
*.iws
|
||||
|
||||
# Mac
|
||||
.DS_Store
|
||||
|
||||
# Maven
|
||||
log/
|
||||
target/
|
||||
|
||||
#project
|
||||
public/documents
|
||||
17
web/documentserver-example/java-spring/HELP.md
Executable file
@ -0,0 +1,17 @@
|
||||
# Getting Started
|
||||
|
||||
### Reference Documentation
|
||||
For further reference, please consider the following sections:
|
||||
|
||||
* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
|
||||
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.5.1/maven-plugin/reference/html/)
|
||||
* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.5.1/maven-plugin/reference/html/#build-image)
|
||||
* [Spring Web](https://docs.spring.io/spring-boot/docs/2.5.1/reference/htmlsingle/#boot-features-developing-web-applications)
|
||||
|
||||
### Guides
|
||||
The following guides illustrate how to use some features concretely:
|
||||
|
||||
* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/)
|
||||
* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/)
|
||||
* [Building REST services with Spring](https://spring.io/guides/tutorials/bookmarks/)
|
||||
|
||||
310
web/documentserver-example/java-spring/mvnw
vendored
Executable file
@ -0,0 +1,310 @@
|
||||
#!/bin/sh
|
||||
# ----------------------------------------------------------------------------
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you 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
|
||||
#
|
||||
# https://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.
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Maven Start Up Batch script
|
||||
#
|
||||
# Required ENV vars:
|
||||
# ------------------
|
||||
# JAVA_HOME - location of a JDK home dir
|
||||
#
|
||||
# Optional ENV vars
|
||||
# -----------------
|
||||
# M2_HOME - location of maven2's installed home dir
|
||||
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||
# e.g. to debug Maven itself, use
|
||||
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
if [ -z "$MAVEN_SKIP_RC" ] ; then
|
||||
|
||||
if [ -f /etc/mavenrc ] ; then
|
||||
. /etc/mavenrc
|
||||
fi
|
||||
|
||||
if [ -f "$HOME/.mavenrc" ] ; then
|
||||
. "$HOME/.mavenrc"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
# OS specific support. $var _must_ be set to either true or false.
|
||||
cygwin=false;
|
||||
darwin=false;
|
||||
mingw=false
|
||||
case "`uname`" in
|
||||
CYGWIN*) cygwin=true ;;
|
||||
MINGW*) mingw=true;;
|
||||
Darwin*) darwin=true
|
||||
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
|
||||
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
if [ -x "/usr/libexec/java_home" ]; then
|
||||
export JAVA_HOME="`/usr/libexec/java_home`"
|
||||
else
|
||||
export JAVA_HOME="/Library/Java/Home"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$JAVA_HOME" ] ; then
|
||||
if [ -r /etc/gentoo-release ] ; then
|
||||
JAVA_HOME=`java-config --jre-home`
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$M2_HOME" ] ; then
|
||||
## resolve links - $0 may be a link to maven's home
|
||||
PRG="$0"
|
||||
|
||||
# need this for relative symlinks
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG="`dirname "$PRG"`/$link"
|
||||
fi
|
||||
done
|
||||
|
||||
saveddir=`pwd`
|
||||
|
||||
M2_HOME=`dirname "$PRG"`/..
|
||||
|
||||
# make it fully qualified
|
||||
M2_HOME=`cd "$M2_HOME" && pwd`
|
||||
|
||||
cd "$saveddir"
|
||||
# echo Using m2 at $M2_HOME
|
||||
fi
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
||||
if $cygwin ; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME=`cygpath --unix "$M2_HOME"`
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
|
||||
fi
|
||||
|
||||
# For Mingw, ensure paths are in UNIX format before anything is touched
|
||||
if $mingw ; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME="`(cd "$M2_HOME"; pwd)`"
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
|
||||
fi
|
||||
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
javaExecutable="`which javac`"
|
||||
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
|
||||
# readlink(1) is not available as standard on Solaris 10.
|
||||
readLink=`which readlink`
|
||||
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
|
||||
if $darwin ; then
|
||||
javaHome="`dirname \"$javaExecutable\"`"
|
||||
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
|
||||
else
|
||||
javaExecutable="`readlink -f \"$javaExecutable\"`"
|
||||
fi
|
||||
javaHome="`dirname \"$javaExecutable\"`"
|
||||
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
|
||||
JAVA_HOME="$javaHome"
|
||||
export JAVA_HOME
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$JAVACMD" ] ; then
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
else
|
||||
JAVACMD="`which java`"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
echo "Error: JAVA_HOME is not defined correctly." >&2
|
||||
echo " We cannot execute $JAVACMD" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$JAVA_HOME" ] ; then
|
||||
echo "Warning: JAVA_HOME environment variable is not set."
|
||||
fi
|
||||
|
||||
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
|
||||
|
||||
# traverses directory structure from process work directory to filesystem root
|
||||
# first directory with .mvn subdirectory is considered project base directory
|
||||
find_maven_basedir() {
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "Path not specified to find_maven_basedir"
|
||||
return 1
|
||||
fi
|
||||
|
||||
basedir="$1"
|
||||
wdir="$1"
|
||||
while [ "$wdir" != '/' ] ; do
|
||||
if [ -d "$wdir"/.mvn ] ; then
|
||||
basedir=$wdir
|
||||
break
|
||||
fi
|
||||
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
|
||||
if [ -d "${wdir}" ]; then
|
||||
wdir=`cd "$wdir/.."; pwd`
|
||||
fi
|
||||
# end of workaround
|
||||
done
|
||||
echo "${basedir}"
|
||||
}
|
||||
|
||||
# concatenates all lines of a file
|
||||
concat_lines() {
|
||||
if [ -f "$1" ]; then
|
||||
echo "$(tr -s '\n' ' ' < "$1")"
|
||||
fi
|
||||
}
|
||||
|
||||
BASE_DIR=`find_maven_basedir "$(pwd)"`
|
||||
if [ -z "$BASE_DIR" ]; then
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
##########################################################################################
|
||||
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||
# This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||
##########################################################################################
|
||||
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Found .mvn/wrapper/maven-wrapper.jar"
|
||||
fi
|
||||
else
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
|
||||
fi
|
||||
if [ -n "$MVNW_REPOURL" ]; then
|
||||
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||
else
|
||||
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||
fi
|
||||
while IFS="=" read key value; do
|
||||
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
|
||||
esac
|
||||
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Downloading from: $jarUrl"
|
||||
fi
|
||||
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
|
||||
if $cygwin; then
|
||||
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
|
||||
fi
|
||||
|
||||
if command -v wget > /dev/null; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Found wget ... using wget"
|
||||
fi
|
||||
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||
wget "$jarUrl" -O "$wrapperJarPath"
|
||||
else
|
||||
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
|
||||
fi
|
||||
elif command -v curl > /dev/null; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Found curl ... using curl"
|
||||
fi
|
||||
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||
curl -o "$wrapperJarPath" "$jarUrl" -f
|
||||
else
|
||||
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
|
||||
fi
|
||||
|
||||
else
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Falling back to using Java to download"
|
||||
fi
|
||||
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
|
||||
# For Cygwin, switch paths to Windows format before running javac
|
||||
if $cygwin; then
|
||||
javaClass=`cygpath --path --windows "$javaClass"`
|
||||
fi
|
||||
if [ -e "$javaClass" ]; then
|
||||
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo " - Compiling MavenWrapperDownloader.java ..."
|
||||
fi
|
||||
# Compiling the Java class
|
||||
("$JAVA_HOME/bin/javac" "$javaClass")
|
||||
fi
|
||||
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||
# Running the downloader
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo " - Running MavenWrapperDownloader.java ..."
|
||||
fi
|
||||
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
##########################################################################################
|
||||
# End of extension
|
||||
##########################################################################################
|
||||
|
||||
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo $MAVEN_PROJECTBASEDIR
|
||||
fi
|
||||
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME=`cygpath --path --windows "$M2_HOME"`
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
|
||||
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
|
||||
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
|
||||
fi
|
||||
|
||||
# Provide a "standardized" way to retrieve the CLI args that will
|
||||
# work with both Windows and non-Windows executions.
|
||||
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
|
||||
export MAVEN_CMD_LINE_ARGS
|
||||
|
||||
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||
|
||||
exec "$JAVACMD" \
|
||||
$MAVEN_OPTS \
|
||||
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
|
||||
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
||||
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
|
||||
182
web/documentserver-example/java-spring/mvnw.cmd
vendored
Executable file
@ -0,0 +1,182 @@
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Licensed to the Apache Software Foundation (ASF) under one
|
||||
@REM or more contributor license agreements. See the NOTICE file
|
||||
@REM distributed with this work for additional information
|
||||
@REM regarding copyright ownership. The ASF licenses this file
|
||||
@REM to you under the Apache License, Version 2.0 (the
|
||||
@REM "License"); you may not use this file except in compliance
|
||||
@REM with the License. You may obtain a copy of the License at
|
||||
@REM
|
||||
@REM https://www.apache.org/licenses/LICENSE-2.0
|
||||
@REM
|
||||
@REM Unless required by applicable law or agreed to in writing,
|
||||
@REM software distributed under the License is distributed on an
|
||||
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
@REM KIND, either express or implied. See the License for the
|
||||
@REM specific language governing permissions and limitations
|
||||
@REM under the License.
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Maven Start Up Batch script
|
||||
@REM
|
||||
@REM Required ENV vars:
|
||||
@REM JAVA_HOME - location of a JDK home dir
|
||||
@REM
|
||||
@REM Optional ENV vars
|
||||
@REM M2_HOME - location of maven2's installed home dir
|
||||
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
|
||||
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
|
||||
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||
@REM e.g. to debug Maven itself, use
|
||||
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
|
||||
@echo off
|
||||
@REM set title of command window
|
||||
title %0
|
||||
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
|
||||
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
|
||||
|
||||
@REM set %HOME% to equivalent of $HOME
|
||||
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
|
||||
|
||||
@REM Execute a user defined script before this one
|
||||
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
|
||||
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
|
||||
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
|
||||
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
|
||||
:skipRcPre
|
||||
|
||||
@setlocal
|
||||
|
||||
set ERROR_CODE=0
|
||||
|
||||
@REM To isolate internal variables from possible post scripts, we use another setlocal
|
||||
@setlocal
|
||||
|
||||
@REM ==== START VALIDATION ====
|
||||
if not "%JAVA_HOME%" == "" goto OkJHome
|
||||
|
||||
echo.
|
||||
echo Error: JAVA_HOME not found in your environment. >&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||
echo location of your Java installation. >&2
|
||||
echo.
|
||||
goto error
|
||||
|
||||
:OkJHome
|
||||
if exist "%JAVA_HOME%\bin\java.exe" goto init
|
||||
|
||||
echo.
|
||||
echo Error: JAVA_HOME is set to an invalid directory. >&2
|
||||
echo JAVA_HOME = "%JAVA_HOME%" >&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||
echo location of your Java installation. >&2
|
||||
echo.
|
||||
goto error
|
||||
|
||||
@REM ==== END VALIDATION ====
|
||||
|
||||
:init
|
||||
|
||||
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
|
||||
@REM Fallback to current working directory if not found.
|
||||
|
||||
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
|
||||
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
|
||||
|
||||
set EXEC_DIR=%CD%
|
||||
set WDIR=%EXEC_DIR%
|
||||
:findBaseDir
|
||||
IF EXIST "%WDIR%"\.mvn goto baseDirFound
|
||||
cd ..
|
||||
IF "%WDIR%"=="%CD%" goto baseDirNotFound
|
||||
set WDIR=%CD%
|
||||
goto findBaseDir
|
||||
|
||||
:baseDirFound
|
||||
set MAVEN_PROJECTBASEDIR=%WDIR%
|
||||
cd "%EXEC_DIR%"
|
||||
goto endDetectBaseDir
|
||||
|
||||
:baseDirNotFound
|
||||
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
|
||||
cd "%EXEC_DIR%"
|
||||
|
||||
:endDetectBaseDir
|
||||
|
||||
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
|
||||
|
||||
@setlocal EnableExtensions EnableDelayedExpansion
|
||||
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
|
||||
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
|
||||
|
||||
:endReadAdditionalConfig
|
||||
|
||||
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
|
||||
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
|
||||
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||
|
||||
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||
|
||||
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
|
||||
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
|
||||
)
|
||||
|
||||
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||
if exist %WRAPPER_JAR% (
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Found %WRAPPER_JAR%
|
||||
)
|
||||
) else (
|
||||
if not "%MVNW_REPOURL%" == "" (
|
||||
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||
)
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Couldn't find %WRAPPER_JAR%, downloading it ...
|
||||
echo Downloading from: %DOWNLOAD_URL%
|
||||
)
|
||||
|
||||
powershell -Command "&{"^
|
||||
"$webclient = new-object System.Net.WebClient;"^
|
||||
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
|
||||
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
|
||||
"}"^
|
||||
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
|
||||
"}"
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Finished downloading %WRAPPER_JAR%
|
||||
)
|
||||
)
|
||||
@REM End of extension
|
||||
|
||||
@REM Provide a "standardized" way to retrieve the CLI args that will
|
||||
@REM work with both Windows and non-Windows executions.
|
||||
set MAVEN_CMD_LINE_ARGS=%*
|
||||
|
||||
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
|
||||
if ERRORLEVEL 1 goto error
|
||||
goto end
|
||||
|
||||
:error
|
||||
set ERROR_CODE=1
|
||||
|
||||
:end
|
||||
@endlocal & set ERROR_CODE=%ERROR_CODE%
|
||||
|
||||
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
|
||||
@REM check for post script, once with legacy .bat ending and once with .cmd ending
|
||||
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
|
||||
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
|
||||
:skipRcPost
|
||||
|
||||
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
|
||||
if "%MAVEN_BATCH_PAUSE%" == "on" pause
|
||||
|
||||
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
|
||||
|
||||
exit /B %ERROR_CODE%
|
||||
72
web/documentserver-example/java-spring/pom.xml
Executable file
@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.5.1</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>com.onlyoffice</groupId>
|
||||
<artifactId>integration</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>Java Spring Integration Example</name>
|
||||
<description>Onlyoffice Java Spring Integration</description>
|
||||
<properties>
|
||||
<java.version>11</java.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
||||
<version>2.5.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.googlecode.json-simple</groupId>
|
||||
<artifactId>json-simple</artifactId>
|
||||
<version>1.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.8.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.inversoft</groupId>
|
||||
<artifactId>prime-jwt</artifactId>
|
||||
<version>1.3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>2.12.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@ -0,0 +1,12 @@
|
||||
package com.onlyoffice.integration;
|
||||
|
||||
public enum Action {
|
||||
edit,
|
||||
review,
|
||||
view,
|
||||
embedded,
|
||||
filter,
|
||||
comment,
|
||||
fillForms,
|
||||
blockcontent
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
package com.onlyoffice.integration;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class IntegrationApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(IntegrationApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
package com.onlyoffice.integration.controllers;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.onlyoffice.integration.Action;
|
||||
import com.onlyoffice.integration.entities.User;
|
||||
import com.onlyoffice.integration.entities.enums.Language;
|
||||
import com.onlyoffice.integration.entities.enums.Type;
|
||||
import com.onlyoffice.integration.entities.filemodel.File;
|
||||
import com.onlyoffice.integration.services.EditorServices;
|
||||
import com.onlyoffice.integration.services.UserServices;
|
||||
import com.onlyoffice.integration.util.documentManagers.DocumentManager;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.CookieValue;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import java.util.*;
|
||||
|
||||
@Controller
|
||||
public class EditorController {
|
||||
|
||||
@Value("${files.docservice.url.site}")
|
||||
private String docserviceSite;
|
||||
|
||||
@Value("${files.docservice.url.api}")
|
||||
private String docserviceApiUrl;
|
||||
|
||||
@Autowired
|
||||
private DocumentManager documentManager;
|
||||
|
||||
@Autowired
|
||||
private UserServices userService;
|
||||
|
||||
@Autowired
|
||||
private EditorServices editorService;
|
||||
|
||||
@GetMapping("/editor")
|
||||
public String index(@RequestParam("fileName") String fileName,
|
||||
@RequestParam(value = "action", required = false) String actionParam,
|
||||
@RequestParam(value = "type", required = false) String typeParam,
|
||||
@RequestParam(value = "actionLink", required = false) String actionLink,
|
||||
@CookieValue(value = "uid") String uid,
|
||||
@CookieValue(value = "ulang") String lang,
|
||||
Model model){
|
||||
Action action = Action.edit;
|
||||
Type type = Type.desktop;
|
||||
Language language = Language.en;
|
||||
|
||||
if(actionParam != null) action = Action.valueOf(actionParam);
|
||||
if(typeParam != null) type = Type.valueOf(typeParam);
|
||||
if(lang != null) language = Language.valueOf(lang);
|
||||
|
||||
Optional<User> optionalUser = userService.findUserById(Integer.parseInt(uid));
|
||||
|
||||
if(!optionalUser.isPresent()) return "index.html";
|
||||
|
||||
User user = optionalUser.get();
|
||||
|
||||
File file = editorService.createConfiguration(user, fileName, actionLink, action, language, type);
|
||||
|
||||
Map<String, Object> dataInsertImage = new HashMap<>();
|
||||
dataInsertImage.put("fileType", "png");
|
||||
dataInsertImage.put("url", documentManager.getServerUrl(true) + "/css/img/logo.png");
|
||||
|
||||
Map<String, Object> dataCompareFile = new HashMap<>();
|
||||
dataCompareFile.put("fileType", "docx");
|
||||
dataCompareFile.put("url", documentManager.getServerUrl(true) + "/assets?name=sample.docx");
|
||||
|
||||
Map<String, Object> dataMailMergeRecipients = new HashMap<>();
|
||||
dataMailMergeRecipients.put("fileType", "csv");
|
||||
dataMailMergeRecipients.put("url", documentManager.getServerUrl(true) + "/csv");
|
||||
|
||||
//TODO: Implementation
|
||||
List<Map<String, Object>> usersForMentions = new ArrayList<>();
|
||||
|
||||
if(documentManager.tokenEnabled()){
|
||||
file.generateToken();
|
||||
dataInsertImage.put("token", documentManager.createToken(dataInsertImage));
|
||||
dataCompareFile.put("token", documentManager.createToken(dataInsertImage));
|
||||
dataMailMergeRecipients.put("token", documentManager.createToken(dataMailMergeRecipients));
|
||||
}
|
||||
|
||||
//TODO: Get rid of GSON
|
||||
Gson gson = new Gson();
|
||||
|
||||
model.addAttribute("model", file);
|
||||
model.addAttribute("docserviceApiUrl",docserviceSite + docserviceApiUrl);
|
||||
model.addAttribute("dataInsertImage", gson.toJson(dataInsertImage).substring(1, gson.toJson(dataInsertImage).length()-1));
|
||||
model.addAttribute("dataCompareFile", gson.toJson(dataCompareFile));
|
||||
model.addAttribute("dataMailMergeRecipients", gson.toJson(dataMailMergeRecipients));
|
||||
model.addAttribute("usersForMentions", usersForMentions);
|
||||
|
||||
return "editor.html";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,330 @@
|
||||
package com.onlyoffice.integration.controllers;
|
||||
|
||||
import com.onlyoffice.integration.controllers.objects.ConverterBody;
|
||||
import com.onlyoffice.integration.entities.User;
|
||||
import com.onlyoffice.integration.entities.enums.DocumentType;
|
||||
import com.onlyoffice.integration.services.UserServices;
|
||||
import com.onlyoffice.integration.util.fileUtilities.FileUtility;
|
||||
import com.onlyoffice.integration.util.serviceConverter.ServiceConverter;
|
||||
import com.onlyoffice.integration.util.TrackManager;
|
||||
import com.onlyoffice.integration.util.documentManagers.DocumentManager;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.primeframework.jwt.Verifier;
|
||||
import org.primeframework.jwt.domain.JWT;
|
||||
import org.primeframework.jwt.hmac.HMACVerifier;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.*;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
//TODO: Refactor
|
||||
@Controller
|
||||
public class FileController {
|
||||
|
||||
@Autowired
|
||||
private FileUtility fileUtility;
|
||||
|
||||
@Autowired
|
||||
private DocumentManager documentManager;
|
||||
|
||||
@Autowired
|
||||
private TrackManager trackManager;
|
||||
|
||||
@Autowired
|
||||
private UserServices userService;
|
||||
|
||||
@Autowired
|
||||
private ServiceConverter serviceConverter;
|
||||
|
||||
@Value("${files.docservice.header}")
|
||||
private String documentJwtHeader;
|
||||
|
||||
@Value("${files.docservice.secret}")
|
||||
private String tokenSecret;
|
||||
|
||||
private String createUserMetadata(String uid, String fullFileName) throws IOException {
|
||||
Optional<User> optionalUser = userService.findUserById(Integer.parseInt(uid));
|
||||
String fileName = fileUtility.getFileNameWithoutExtension(fullFileName);
|
||||
String documentType = fileUtility.getDocumentType(fullFileName).toString().toLowerCase();
|
||||
if(optionalUser.isPresent()){
|
||||
User user = optionalUser.get();
|
||||
documentManager.createMeta(fileName,
|
||||
String.valueOf(user.getId()), user.getName(), null);
|
||||
}
|
||||
return "{ \"filename\": \"" + fullFileName + "\", \"documentType\": \"" + documentType + "\" }";
|
||||
}
|
||||
|
||||
private ResponseEntity<Resource> downloadFile(String fileName){
|
||||
String fileLocation = documentManager.forcesavePath(fileName, null, false);
|
||||
if (fileLocation.equals("")){
|
||||
fileLocation = documentManager.storagePath(fileName, null);
|
||||
}
|
||||
|
||||
Resource resource = documentManager.loadFileAsResource(fileLocation);
|
||||
|
||||
String contentType = null;
|
||||
if(contentType == null) {
|
||||
contentType = "application/octet-stream";
|
||||
}
|
||||
|
||||
return ResponseEntity.ok()
|
||||
.contentType(MediaType.parseMediaType(contentType))
|
||||
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + resource.getFilename() + "\"")
|
||||
.body(resource);
|
||||
}
|
||||
|
||||
@PostMapping("/upload")
|
||||
@ResponseBody
|
||||
public String upload(@RequestParam("file") MultipartFile file,
|
||||
@CookieValue("uid") String uid){
|
||||
try {
|
||||
String fullFileName = file.getOriginalFilename();
|
||||
String fileExtension = fileUtility.getFileExtension(fullFileName);
|
||||
long fileSize = file.getSize();
|
||||
byte[] bytes = file.getBytes();
|
||||
String directory = documentManager.filesRootPath(null);
|
||||
|
||||
if(documentManager.getMaxFileSize() < fileSize || fileSize <= 0){
|
||||
return "{ \"error\": \"File size is incorrect\"}";
|
||||
}
|
||||
|
||||
if(!documentManager.getFileExts().contains(fileExtension)){
|
||||
return "{ \"error\": \"File type is not supported\"}";
|
||||
}
|
||||
|
||||
Path path = fileUtility.generateFilepath(directory, fullFileName);
|
||||
String fileName = fileUtility.getFileNameWithoutExtension(path.getFileName().toString());
|
||||
|
||||
Files.write(path, bytes);
|
||||
|
||||
return createUserMetadata(uid, fileName+fileExtension);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "{ \"error\": \"Something went wrong when uploading the file.\"}";
|
||||
}
|
||||
|
||||
@PostMapping(path = "${url.converter}")
|
||||
@ResponseBody
|
||||
public String convert(@RequestBody ConverterBody body,
|
||||
@CookieValue("uid") String uid){
|
||||
String fileName = body.getFileName();
|
||||
String fileUri = documentManager.getFileUri(fileName, true);
|
||||
String filePass = body.getFilePass() != null ? body.getFilePass() : null;
|
||||
String fileExt = fileUtility.getFileExtension(fileName);
|
||||
DocumentType type = fileUtility.getDocumentType(fileName);
|
||||
String internalFileExt = fileUtility.getInternalExtension(type);
|
||||
|
||||
try{
|
||||
if(documentManager.getConvertExts().contains(fileExt)){
|
||||
String key = serviceConverter.generateRevisionId(fileUri);
|
||||
String newFileUri = serviceConverter
|
||||
.getConvertedUri(fileUri, fileExt, internalFileExt, key, filePass, true);
|
||||
|
||||
if(newFileUri.isEmpty()){
|
||||
return "{ \"step\" : \"0\", \"filename\" : \"" + fileName + "\"}";
|
||||
}
|
||||
|
||||
String correctedName = documentManager
|
||||
.getCorrectName(fileUtility.getFileNameWithoutExtension(fileName)+internalFileExt, null);
|
||||
|
||||
URL url = new URL(newFileUri);
|
||||
java.net.HttpURLConnection connection = (java.net.HttpURLConnection) url.openConnection();
|
||||
InputStream stream = connection.getInputStream();
|
||||
|
||||
if (stream == null)
|
||||
{
|
||||
throw new Exception("Stream is null");
|
||||
}
|
||||
|
||||
File convertedFile = new File(documentManager.storagePath(correctedName, null));
|
||||
try (FileOutputStream out = new FileOutputStream(convertedFile))
|
||||
{
|
||||
int read;
|
||||
final byte[] bytes = new byte[1024];
|
||||
while ((read = stream.read(bytes)) != -1)
|
||||
{
|
||||
out.write(bytes, 0, read);
|
||||
}
|
||||
|
||||
out.flush();
|
||||
}
|
||||
|
||||
connection.disconnect();
|
||||
|
||||
fileName = correctedName;
|
||||
}
|
||||
return createUserMetadata(uid, fileName+fileExt);
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "{ \"error\": \"" + "The file can't be converted.\"}";
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
@ResponseBody
|
||||
public String delete(@RequestBody ConverterBody body,
|
||||
@CookieValue("uid") String uid){
|
||||
try
|
||||
{
|
||||
String fullFileName = fileUtility.getFileName(body.getFileName());
|
||||
String fileName = fileUtility.getFileNameWithoutExtension(body.getFileName());
|
||||
String fileLocation = documentManager.storagePath(fullFileName, null);
|
||||
String historyLocation = documentManager.historyDir(documentManager
|
||||
.storagePath(fileName, null));
|
||||
String convertedHistoryLocation = documentManager.historyDir(documentManager
|
||||
.storagePath(fullFileName, null));
|
||||
|
||||
documentManager.deleteFilesRecursively(Paths.get(fileLocation));
|
||||
documentManager.deleteFilesRecursively(Paths.get(historyLocation));
|
||||
documentManager.deleteFilesRecursively(Paths.get(convertedHistoryLocation));
|
||||
|
||||
return "{ \"success\": true }";
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return "{ \"error\": \"" + e.getMessage() + "\"}";
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/download")
|
||||
public ResponseEntity<Resource> download(@RequestParam("fileName") String fileName,
|
||||
HttpServletRequest request){
|
||||
try{
|
||||
if(documentManager.tokenEnabled()){
|
||||
String header = request.getHeader(documentJwtHeader == null
|
||||
|| documentJwtHeader.isEmpty() ? "Authorization" : documentJwtHeader);
|
||||
|
||||
if(header != null && !header.isEmpty()){
|
||||
String token = header.startsWith("Bearer ") ? header.substring(7) : header;
|
||||
try {
|
||||
Verifier verifier = HMACVerifier.newVerifier(tokenSecret);
|
||||
JWT.getDecoder().decode(token, verifier);
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return downloadFile(fileName);
|
||||
|
||||
} catch(Exception e){
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/create")
|
||||
public String create(@RequestParam("fileExt") String fileExt,
|
||||
@RequestParam(value = "sample", required = false) Optional<Boolean> isSample,
|
||||
@CookieValue(value = "uid", required = false) String uid){
|
||||
return "notImplemented.html";
|
||||
}
|
||||
|
||||
//TODO: NOT TESTED
|
||||
@GetMapping("/assets")
|
||||
public ResponseEntity<Resource> assets(@RequestParam("name") String name)
|
||||
{
|
||||
String fileName = "assets/sample/" + fileUtility.getFileName(name);
|
||||
return downloadFile(fileName);
|
||||
}
|
||||
|
||||
//TODO: NOT TESTED
|
||||
@GetMapping("/csv")
|
||||
public ResponseEntity<Resource> csv()
|
||||
{
|
||||
String fileName = "assets/sample/csv.csv";
|
||||
return downloadFile(fileName);
|
||||
}
|
||||
|
||||
//TODO: NOT TESTED
|
||||
@GetMapping("/files")
|
||||
@ResponseBody
|
||||
public ArrayList<Map<String, Object>> files(@RequestParam(value = "fileId", required = false) String fileId){
|
||||
ArrayList<Map<String, Object>> files = null;
|
||||
|
||||
if(fileId == null){
|
||||
files = documentManager.getFilesInfo();
|
||||
} else {
|
||||
files = documentManager.getFilesInfo(fileId);
|
||||
}
|
||||
|
||||
return files;
|
||||
}
|
||||
|
||||
//TODO: A separate @RequestBody class
|
||||
//TODO: A separate return class
|
||||
//TODO: Refactor
|
||||
@PostMapping("/track")
|
||||
@ResponseBody
|
||||
public String track(@RequestParam("fileName") String fileName,
|
||||
@RequestParam("userAddress") String userAddress,
|
||||
@CookieValue(value = "uid", required = false) String uid){
|
||||
JSONObject body = null;
|
||||
|
||||
try {
|
||||
body = trackManager.readBody();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return e.getMessage();
|
||||
}
|
||||
|
||||
int status = Math.toIntExact((long) body.get("status"));
|
||||
int saved = 0;
|
||||
|
||||
if (status == 1) { //Editing
|
||||
JSONArray actions = (JSONArray) body.get("actions");
|
||||
JSONArray users = (JSONArray) body.get("users");
|
||||
JSONObject action = (JSONObject) actions.get(0);
|
||||
if (actions != null && action.get("type").toString().equals("0")) { //finished edit
|
||||
String user = (String) action.get("userid");
|
||||
if (users.indexOf(user) == -1) {
|
||||
String key = (String) body.get("key");
|
||||
try {
|
||||
trackManager.commandRequest("forcesave", key);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fileName = fileUtility.getFileName(fileName);
|
||||
|
||||
if (status == 2 || status == 3) { //MustSave, Corrupted
|
||||
try {
|
||||
trackManager.processSave(body, fileName, userAddress);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
saved = 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (status == 6 || status == 7) { //MustForceSave, CorruptedForceSave
|
||||
try {
|
||||
trackManager.processForceSave(body, fileName, userAddress);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
saved = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return"{\"error\":" + saved + "}";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,119 @@
|
||||
package com.onlyoffice.integration.controllers;
|
||||
|
||||
import com.onlyoffice.integration.serializer.FilterState;
|
||||
import com.onlyoffice.integration.entities.*;
|
||||
import com.onlyoffice.integration.services.UserServices;
|
||||
import com.onlyoffice.integration.util.fileUtilities.FileUtility;
|
||||
import com.onlyoffice.integration.util.documentManagers.DocumentManager;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Controller
|
||||
public class IndexController {
|
||||
|
||||
@Autowired
|
||||
private DocumentManager documentManager;
|
||||
|
||||
@Autowired
|
||||
private FileUtility fileUtility;
|
||||
|
||||
@Autowired
|
||||
private UserServices userService;
|
||||
|
||||
@Value("${files.docservice.url.site}")
|
||||
private String docserviceSite;
|
||||
|
||||
@Value("${files.docservice.url.preloader}")
|
||||
private String docservicePreloader;
|
||||
|
||||
@Value("${url.converter}")
|
||||
private String urlConverter;
|
||||
|
||||
@Value("${url.editor}")
|
||||
private String urlEditor;
|
||||
|
||||
@PostConstruct
|
||||
private void init(){
|
||||
List<String> description_user_1 = List.of(
|
||||
"File author by default",
|
||||
"He doesn’t belong to any of the groups",
|
||||
"He can review all the changes",
|
||||
"He can do everything with the comments",
|
||||
"The file favorite state is undefined",
|
||||
"Can create a file from a template with data from the editor"
|
||||
);
|
||||
List<String> description_user_2 = List.of(
|
||||
"He belongs to Group2",
|
||||
"He can review only his own changes or the changes made by the users who don’t belong to any of the groups",
|
||||
"He can view every comment, edit his comments and the comments left by the users who don't belong to any of the groups and remove only his comments",
|
||||
"This file is favorite",
|
||||
"Can create a file from an editor"
|
||||
);
|
||||
List<String> description_user_3 = List.of(
|
||||
"He belongs to Group3",
|
||||
"He can review only the changes made by the users from Group2",
|
||||
"He can view the comments left by the users from Group2 and Group3 and edit the comments left by the users from Group2",
|
||||
"This file isn’t favorite",
|
||||
"He can’t copy data from the file into the clipboard",
|
||||
"He can’t download the file",
|
||||
"He can’t print the file",
|
||||
"Can create a file from an editor"
|
||||
);
|
||||
userService.createUser("John Smith", "smith@mail.ru",
|
||||
description_user_1, null, List.of(FilterState.NULL.toString()),
|
||||
List.of(FilterState.NULL.toString()),
|
||||
List.of(FilterState.NULL.toString()),
|
||||
List.of(FilterState.NULL.toString()));
|
||||
userService.createUser("Mark Pottato", "pottato@mail.ru",
|
||||
description_user_2, "group-2", List.of("","group-2"), List.of(FilterState.NULL.toString()),
|
||||
List.of("group-2", ""), List.of("group-2"));
|
||||
userService.createUser("Hamish Mitchell", "mitchell@mail.ru",
|
||||
description_user_3, "group-3", List.of("group-2"), List.of("group-2", "group-3"),
|
||||
List.of("group-2"), new ArrayList<>());
|
||||
}
|
||||
|
||||
@GetMapping("${url.index}")
|
||||
public String index(Model model){
|
||||
java.io.File[] files = documentManager.getStoredFiles(null);
|
||||
|
||||
List<String> docTypes = Arrays.stream(files).map(
|
||||
file -> fileUtility.getDocumentType(file.getName()).toString().toLowerCase()
|
||||
).collect(Collectors.toList());
|
||||
|
||||
List<Boolean> filesEditable = Arrays.stream(files).map(
|
||||
file -> documentManager.getEditedExts().contains(fileUtility.getFileExtension(file.getName()))
|
||||
).collect(Collectors.toList());
|
||||
|
||||
List<User> users = userService.findAll();
|
||||
String tooltip = users.stream().map(user -> user.getDescriptions()).collect(Collectors.joining());
|
||||
|
||||
model.addAttribute("files", files);
|
||||
model.addAttribute("docTypes", docTypes);
|
||||
model.addAttribute("filesEditable", filesEditable);
|
||||
model.addAttribute("datadocs", docserviceSite+docservicePreloader);
|
||||
model.addAttribute("tooltip", tooltip);
|
||||
model.addAttribute("users", users);
|
||||
|
||||
return "index.html";
|
||||
}
|
||||
|
||||
@PostMapping("/config")
|
||||
@ResponseBody
|
||||
public HashMap<String, String> configParameters(){
|
||||
HashMap<String, String> configuration = new HashMap<>();
|
||||
|
||||
configuration.put("ConverExtList", String.join(",",documentManager.getConvertExts()));
|
||||
configuration.put("EditedExtList", String.join(",",documentManager.getEditedExts()));
|
||||
configuration.put("UrlConverter", urlConverter);
|
||||
configuration.put("UrlEditor", urlEditor);
|
||||
|
||||
return configuration;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package com.onlyoffice.integration.controllers.objects;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class ConverterBody {
|
||||
@JsonProperty("filename")
|
||||
private String fileName;
|
||||
@JsonProperty("filePass")
|
||||
private String filePass;
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
public String getFilePass() {
|
||||
return filePass;
|
||||
}
|
||||
|
||||
public void setFilePass(String filePass) {
|
||||
this.filePass = filePass;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package com.onlyoffice.integration.entities;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Table(name = "`group`")
|
||||
public class Group {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private int id;
|
||||
@Column(unique = true)
|
||||
private String name;
|
||||
@OneToMany(mappedBy = "group")
|
||||
private List<User> users;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public List<User> getUsers() {
|
||||
return users;
|
||||
}
|
||||
|
||||
public void setUsers(List<User> users) {
|
||||
this.users = users;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,137 @@
|
||||
package com.onlyoffice.integration.entities;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Table(name = "`permission`")
|
||||
public class Permission {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private int id;
|
||||
private Boolean comment = true;
|
||||
private Boolean copy = true;
|
||||
private Boolean download = true;
|
||||
private Boolean edit = true;
|
||||
private Boolean print = true;
|
||||
private Boolean fillForms = true;
|
||||
private Boolean modifyFilter = true;
|
||||
private Boolean modifyContentControl = true;
|
||||
private Boolean review = true;
|
||||
@ManyToMany
|
||||
private List<Group> reviewGroups;
|
||||
@ManyToMany
|
||||
private List<Group> commentsViewGroups;
|
||||
@ManyToMany
|
||||
private List<Group> commentsEditGroups;
|
||||
@ManyToMany
|
||||
private List<Group> commentsRemoveGroups;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public Boolean getComment() {
|
||||
return comment;
|
||||
}
|
||||
|
||||
public void setComment(Boolean comment) {
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
public Boolean getCopy() {
|
||||
return copy;
|
||||
}
|
||||
|
||||
public void setCopy(Boolean copy) {
|
||||
this.copy = copy;
|
||||
}
|
||||
|
||||
public Boolean getDownload() {
|
||||
return download;
|
||||
}
|
||||
|
||||
public void setDownload(Boolean download) {
|
||||
this.download = download;
|
||||
}
|
||||
|
||||
public Boolean getEdit() {
|
||||
return edit;
|
||||
}
|
||||
|
||||
public void setEdit(Boolean edit) {
|
||||
this.edit = edit;
|
||||
}
|
||||
|
||||
public Boolean getPrint() {
|
||||
return print;
|
||||
}
|
||||
|
||||
public void setPrint(Boolean print) {
|
||||
this.print = print;
|
||||
}
|
||||
|
||||
public Boolean getFillForms() {
|
||||
return fillForms;
|
||||
}
|
||||
|
||||
public void setFillForms(Boolean fillForms) {
|
||||
this.fillForms = fillForms;
|
||||
}
|
||||
|
||||
public Boolean getModifyFilter() {
|
||||
return modifyFilter;
|
||||
}
|
||||
|
||||
public void setModifyFilter(Boolean modifyFilter) {
|
||||
this.modifyFilter = modifyFilter;
|
||||
}
|
||||
|
||||
public Boolean getModifyContentControl() {
|
||||
return modifyContentControl;
|
||||
}
|
||||
|
||||
public void setModifyContentControl(Boolean modifyContentControl) {
|
||||
this.modifyContentControl = modifyContentControl;
|
||||
}
|
||||
|
||||
public Boolean getReview() {
|
||||
return review;
|
||||
}
|
||||
|
||||
public void setReview(Boolean review) {
|
||||
this.review = review;
|
||||
}
|
||||
|
||||
public List<Group> getReviewGroups() {
|
||||
return reviewGroups;
|
||||
}
|
||||
|
||||
public void setReviewGroups(List<Group> reviewGroups) {
|
||||
this.reviewGroups = reviewGroups;
|
||||
}
|
||||
|
||||
public List<Group> getCommentsViewGroups() {
|
||||
return commentsViewGroups;
|
||||
}
|
||||
|
||||
public void setCommentsViewGroups(List<Group> commentsViewGroups) {
|
||||
this.commentsViewGroups = commentsViewGroups;
|
||||
}
|
||||
|
||||
public List<Group> getCommentsEditGroups() {
|
||||
return commentsEditGroups;
|
||||
}
|
||||
|
||||
public void setCommentsEditGroups(List<Group> commentsEditGroups) {
|
||||
this.commentsEditGroups = commentsEditGroups;
|
||||
}
|
||||
|
||||
public List<Group> getCommentsRemoveGroups() {
|
||||
return commentsRemoveGroups;
|
||||
}
|
||||
|
||||
public void setCommentsRemoveGroups(List<Group> commentsRemoveGroups) {
|
||||
this.commentsRemoveGroups = commentsRemoveGroups;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package com.onlyoffice.integration.entities;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Entity
|
||||
@Table(name = "`user`")
|
||||
public class User {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private int id;
|
||||
private String name;
|
||||
private String email;
|
||||
@ManyToOne
|
||||
private Group group;
|
||||
@OneToOne
|
||||
private Permission permissions;
|
||||
@Column(columnDefinition = "CLOB")
|
||||
private String descriptions;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public Group getGroup() {
|
||||
return group;
|
||||
}
|
||||
|
||||
public void setGroup(Group group) {
|
||||
this.group = group;
|
||||
}
|
||||
|
||||
public Permission getPermissions() {
|
||||
return permissions;
|
||||
}
|
||||
|
||||
public void setPermissions(Permission permissions) {
|
||||
this.permissions = permissions;
|
||||
}
|
||||
|
||||
public String getDescriptions() {
|
||||
return descriptions;
|
||||
}
|
||||
|
||||
public void setDescriptions(String descriptions) {
|
||||
this.descriptions = descriptions;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,149 @@
|
||||
package com.onlyoffice.integration.entities.configurations;
|
||||
|
||||
import com.onlyoffice.integration.util.documentManagers.DocumentManager;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
@Component
|
||||
@Scope("prototype")
|
||||
public class Customization {
|
||||
|
||||
@Autowired
|
||||
private DocumentManager documentManager;
|
||||
|
||||
@Autowired
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
@Value("${url.index}")
|
||||
private String indexUrl;
|
||||
|
||||
private Boolean autosave = true;
|
||||
private Boolean chat = true;
|
||||
private Boolean comments = true;
|
||||
private Boolean compactHeader = false;
|
||||
private Boolean compactToolbar = false;
|
||||
private Boolean compatibleFeatures = false;
|
||||
private Boolean forcesave = false;
|
||||
private Goback goback;
|
||||
private Boolean help = true;
|
||||
private Boolean hideRightMenu = false;
|
||||
private Boolean hideRulers = false;
|
||||
private Logo logo;
|
||||
private Boolean submitForm = false;
|
||||
|
||||
@PostConstruct
|
||||
public void init(){
|
||||
this.goback = applicationContext.getBean(Goback.class);
|
||||
this.logo = applicationContext.getBean(Logo.class);
|
||||
this.goback.setUrl(documentManager.getServerUrl(false)+indexUrl);
|
||||
}
|
||||
|
||||
public Boolean getAutosave() {
|
||||
return autosave;
|
||||
}
|
||||
|
||||
public void setAutosave(Boolean autosave) {
|
||||
this.autosave = autosave;
|
||||
}
|
||||
|
||||
public Boolean getChat() {
|
||||
return chat;
|
||||
}
|
||||
|
||||
public void setChat(Boolean chat) {
|
||||
this.chat = chat;
|
||||
}
|
||||
|
||||
public Boolean getComments() {
|
||||
return comments;
|
||||
}
|
||||
|
||||
public void setComments(Boolean comments) {
|
||||
this.comments = comments;
|
||||
}
|
||||
|
||||
public Boolean getCompactHeader() {
|
||||
return compactHeader;
|
||||
}
|
||||
|
||||
public void setCompactHeader(Boolean compactHeader) {
|
||||
this.compactHeader = compactHeader;
|
||||
}
|
||||
|
||||
public Boolean getCompactToolbar() {
|
||||
return compactToolbar;
|
||||
}
|
||||
|
||||
public void setCompactToolbar(Boolean compactToolbar) {
|
||||
this.compactToolbar = compactToolbar;
|
||||
}
|
||||
|
||||
public Boolean getCompatibleFeatures() {
|
||||
return compatibleFeatures;
|
||||
}
|
||||
|
||||
public void setCompatibleFeatures(Boolean compatibleFeatures) {
|
||||
this.compatibleFeatures = compatibleFeatures;
|
||||
}
|
||||
|
||||
public Boolean getForcesave() {
|
||||
return forcesave;
|
||||
}
|
||||
|
||||
public void setForcesave(Boolean forcesave) {
|
||||
this.forcesave = forcesave;
|
||||
}
|
||||
|
||||
public Goback getGoback() {
|
||||
return goback;
|
||||
}
|
||||
|
||||
public void setGoback(Goback goback) {
|
||||
this.goback = goback;
|
||||
}
|
||||
|
||||
public Boolean getHelp() {
|
||||
return help;
|
||||
}
|
||||
|
||||
public void setHelp(Boolean help) {
|
||||
this.help = help;
|
||||
}
|
||||
|
||||
public Boolean getHideRightMenu() {
|
||||
return hideRightMenu;
|
||||
}
|
||||
|
||||
public void setHideRightMenu(Boolean hideRightMenu) {
|
||||
this.hideRightMenu = hideRightMenu;
|
||||
}
|
||||
|
||||
public Boolean getHideRulers() {
|
||||
return hideRulers;
|
||||
}
|
||||
|
||||
public void setHideRulers(Boolean hideRulers) {
|
||||
this.hideRulers = hideRulers;
|
||||
}
|
||||
|
||||
public Boolean getSubmitForm() {
|
||||
return submitForm;
|
||||
}
|
||||
|
||||
public void setSubmitForm(Boolean submitForm) {
|
||||
this.submitForm = submitForm;
|
||||
}
|
||||
|
||||
public Logo getLogo() {
|
||||
return logo;
|
||||
}
|
||||
|
||||
public void setLogo(Logo logo) {
|
||||
this.logo = logo;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
package com.onlyoffice.integration.entities.configurations;
|
||||
|
||||
import com.onlyoffice.integration.entities.enums.ToolbarDocked;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@Scope("prototype")
|
||||
public class Embedded {
|
||||
private String embedUrl;
|
||||
private String saveUrl;
|
||||
private String shareUrl;
|
||||
private ToolbarDocked toolbarDocked;
|
||||
|
||||
public void configure(String embedUrl, String saveUrl, String shareUrl, ToolbarDocked toolbarDocked){
|
||||
this.embedUrl = embedUrl;
|
||||
this.saveUrl = saveUrl;
|
||||
this.shareUrl = shareUrl;
|
||||
this.toolbarDocked = toolbarDocked;
|
||||
}
|
||||
|
||||
public String getEmbedUrl() {
|
||||
return embedUrl.toString();
|
||||
}
|
||||
|
||||
public void setEmbedUrl(String embedUrl) {
|
||||
this.embedUrl = embedUrl;
|
||||
}
|
||||
|
||||
public String getSaveUrl() {
|
||||
return saveUrl;
|
||||
}
|
||||
|
||||
public void setSaveUrl(String saveUrl) {
|
||||
this.saveUrl = saveUrl;
|
||||
}
|
||||
|
||||
public String getShareUrl() {
|
||||
return shareUrl;
|
||||
}
|
||||
|
||||
public void setShareUrl(String shareUrl) {
|
||||
this.shareUrl = shareUrl;
|
||||
}
|
||||
|
||||
public ToolbarDocked getToolbarDocked() {
|
||||
return toolbarDocked;
|
||||
}
|
||||
|
||||
public void setToolbarDocked(ToolbarDocked toolbarDocked) {
|
||||
this.toolbarDocked = toolbarDocked;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package com.onlyoffice.integration.entities.configurations;
|
||||
|
||||
import com.onlyoffice.integration.util.documentManagers.DocumentManager;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
@Component
|
||||
@Scope("prototype")
|
||||
public class Goback {
|
||||
|
||||
@Autowired
|
||||
private DocumentManager documentManager;
|
||||
|
||||
@Value("${url.index}")
|
||||
private String indexMapping;
|
||||
|
||||
private String url;
|
||||
|
||||
@PostConstruct
|
||||
private void init(){
|
||||
this.url = documentManager.getServerUrl(false)+indexMapping;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.onlyoffice.integration.entities.configurations;
|
||||
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@Scope("prototype")
|
||||
public class Info {
|
||||
private Boolean favorite;
|
||||
|
||||
public Boolean getFavorite() {
|
||||
return favorite;
|
||||
}
|
||||
|
||||
public void setFavorite(Boolean favorite) {
|
||||
this.favorite = favorite;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
package com.onlyoffice.integration.entities.configurations;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
@Component
|
||||
@Scope("prototype")
|
||||
public class Logo {
|
||||
|
||||
@Value("${logo.image}")
|
||||
private String logoImage;
|
||||
|
||||
@Value("${logo.imageEmbedded}")
|
||||
private String logoImageEmbedded;
|
||||
|
||||
@Value("${logo.url}")
|
||||
private String logoUrl;
|
||||
|
||||
private String image;
|
||||
private String imageEmbedded;
|
||||
private String url;
|
||||
|
||||
@PostConstruct
|
||||
private void init(){
|
||||
this.image = logoImage;
|
||||
this.imageEmbedded = logoImageEmbedded;
|
||||
this.url = logoUrl;
|
||||
}
|
||||
|
||||
public String getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public void setImage(String image) {
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
public String getImageEmbedded() {
|
||||
return imageEmbedded;
|
||||
}
|
||||
|
||||
public void setImageEmbedded(String imageEmbedded) {
|
||||
this.imageEmbedded = imageEmbedded;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
package com.onlyoffice.integration.entities.enums;
|
||||
|
||||
public enum DocumentType {
|
||||
word,
|
||||
cell,
|
||||
slide
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package com.onlyoffice.integration.entities.enums;
|
||||
|
||||
public enum Language {
|
||||
en,
|
||||
de,
|
||||
ru,
|
||||
pl,
|
||||
be,
|
||||
bg,
|
||||
ca,
|
||||
zh,
|
||||
cs,
|
||||
da,
|
||||
nl,
|
||||
fi,
|
||||
fr,
|
||||
el,
|
||||
hu,
|
||||
id,
|
||||
it,
|
||||
ja,
|
||||
ko,
|
||||
lv,
|
||||
lo,
|
||||
nb,
|
||||
pt,
|
||||
ro,
|
||||
sk,
|
||||
sl,
|
||||
sv,
|
||||
es,
|
||||
tr,
|
||||
uk,
|
||||
vi
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
package com.onlyoffice.integration.entities.enums;
|
||||
|
||||
public enum Mode {
|
||||
edit,
|
||||
view
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
package com.onlyoffice.integration.entities.enums;
|
||||
|
||||
public enum ToolbarDocked {
|
||||
top,
|
||||
bottom
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
package com.onlyoffice.integration.entities.enums;
|
||||
|
||||
public enum Type {
|
||||
desktop,
|
||||
mobile,
|
||||
embedded
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package com.onlyoffice.integration.entities.filemodel;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.onlyoffice.integration.serializer.SerializerFilter;
|
||||
import com.onlyoffice.integration.entities.Group;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class CommentGroup {
|
||||
@JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = SerializerFilter.class)
|
||||
private List<String> view;
|
||||
@JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = SerializerFilter.class)
|
||||
private List<String> edit;
|
||||
@JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = SerializerFilter.class)
|
||||
private List<String> remove;
|
||||
|
||||
public CommentGroup(List<Group> view, List<Group> edit, List<Group> remove) {
|
||||
this.view = view.stream()
|
||||
.map(group -> group.getName())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
this.edit = edit.stream()
|
||||
.map(group -> group.getName())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
this.remove = remove.stream()
|
||||
.map(group -> group.getName())
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public List<String> getView() {
|
||||
return view;
|
||||
}
|
||||
|
||||
public List<String> getEdit() {
|
||||
return edit;
|
||||
}
|
||||
|
||||
public List<String> getRemove() {
|
||||
return remove;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,107 @@
|
||||
package com.onlyoffice.integration.entities.filemodel;
|
||||
|
||||
import com.onlyoffice.integration.entities.configurations.Info;
|
||||
import com.onlyoffice.integration.util.documentManagers.DocumentManager;
|
||||
import com.onlyoffice.integration.util.fileUtilities.FileUtility;
|
||||
import com.onlyoffice.integration.util.serviceConverter.ServiceConverter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import java.io.File;
|
||||
|
||||
@Component
|
||||
@Scope("prototype")
|
||||
public class Document {
|
||||
|
||||
@Autowired
|
||||
private DocumentManager documentManager;
|
||||
|
||||
@Autowired
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
@Autowired
|
||||
private FileUtility fileUtility;
|
||||
|
||||
@Autowired
|
||||
private ServiceConverter serviceConverter;
|
||||
|
||||
private String fileType;
|
||||
private Info info;
|
||||
private String key;
|
||||
private String urlUser;
|
||||
private String title;
|
||||
private String url;
|
||||
private Permission permissions;
|
||||
|
||||
public void configure(String fileName, Permission permissions){
|
||||
this.title = fileName;
|
||||
this.url = documentManager.getDownloadUrl(fileName);
|
||||
this.urlUser = documentManager.getFileUri(fileName, false);
|
||||
this.fileType = fileUtility.getInternalExtension(fileUtility.getDocumentType(fileName)).replace(".","");
|
||||
this.key = serviceConverter.
|
||||
generateRevisionId(documentManager.curUserHostAddress(null)
|
||||
+ "/" + fileName + "/"
|
||||
+ Long.toString(new File(documentManager.storagePath(fileName, null)).lastModified()));
|
||||
this.info = applicationContext.getBean(Info.class);
|
||||
this.permissions = permissions;
|
||||
//TODO: Add favorite logic
|
||||
this.info.setFavorite(true);
|
||||
}
|
||||
|
||||
public String getFileType() {
|
||||
return fileType;
|
||||
}
|
||||
|
||||
public void setFileType(String fileType) {
|
||||
this.fileType = fileType;
|
||||
}
|
||||
|
||||
public Info getInfo() {
|
||||
return info;
|
||||
}
|
||||
|
||||
public void setInfo(Info info) {
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getUrlUser() {
|
||||
return urlUser;
|
||||
}
|
||||
|
||||
public void setUrlUser(String urlUser) {
|
||||
this.urlUser = urlUser;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public Permission getPermissions() {
|
||||
return permissions;
|
||||
}
|
||||
|
||||
public void setPermissions(Permission permissions) {
|
||||
this.permissions = permissions;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,129 @@
|
||||
package com.onlyoffice.integration.entities.filemodel;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.onlyoffice.integration.Action;
|
||||
import com.onlyoffice.integration.entities.configurations.Customization;
|
||||
import com.onlyoffice.integration.entities.configurations.Embedded;
|
||||
import com.onlyoffice.integration.entities.enums.Language;
|
||||
import com.onlyoffice.integration.entities.enums.Mode;
|
||||
import com.onlyoffice.integration.entities.enums.ToolbarDocked;
|
||||
import com.onlyoffice.integration.entities.enums.Type;
|
||||
import com.onlyoffice.integration.util.fileUtilities.FileUtility;
|
||||
import com.onlyoffice.integration.util.documentManagers.DocumentManager;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@Component
|
||||
@Scope("prototype")
|
||||
public class EditorConfig {
|
||||
|
||||
@Autowired
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
@Autowired
|
||||
private DocumentManager documentManager;
|
||||
|
||||
@Autowired
|
||||
private FileUtility fileUtility;
|
||||
|
||||
private HashMap<String, Object> actionLink = null;
|
||||
private String callbackUrl;
|
||||
private Customization customization;
|
||||
private Embedded embedded;
|
||||
private Language lang;
|
||||
private Mode mode;
|
||||
private User user;
|
||||
|
||||
//TODO: Refactor
|
||||
public void configure(com.onlyoffice.integration.entities.User user,
|
||||
String fileName,
|
||||
String actionData,
|
||||
Action action,
|
||||
Language lang,
|
||||
Type type){
|
||||
if (actionData != null) {
|
||||
Gson gson = new Gson();
|
||||
this.actionLink = gson.fromJson(actionData, new TypeToken<HashMap<String, Object>>() { }.getType());
|
||||
}
|
||||
this.callbackUrl = documentManager.getCallback(fileName);
|
||||
this.lang = lang;
|
||||
Boolean canEdit = documentManager.getEditedExts().contains(fileUtility.getFileExtension(fileName));
|
||||
this.customization = applicationContext.getBean(Customization.class);
|
||||
this.customization.setSubmitForm(canEdit && (action.equals(Action.edit) || action.equals(Action.fillForms)));
|
||||
this.mode = canEdit && !action.equals(Action.view) ? Mode.edit : Mode.view;
|
||||
|
||||
User userModel = applicationContext.getBean(User.class);
|
||||
userModel.configure(user.getId(), user.getName(), user.getGroup() != null ? user.getGroup().getName() : null);
|
||||
|
||||
this.user = userModel;
|
||||
|
||||
if(type.equals(Type.embedded)) this.initDesktop(documentManager.getFileUri(fileName, false));
|
||||
}
|
||||
|
||||
private void initDesktop(String url){
|
||||
Embedded embedded = applicationContext.getBean(Embedded.class);
|
||||
embedded.configure(url,url,url, ToolbarDocked.top);
|
||||
this.embedded = embedded;
|
||||
}
|
||||
|
||||
public HashMap<String, Object> getActionLink() {
|
||||
return actionLink;
|
||||
}
|
||||
|
||||
public void setActionLink(HashMap<String, Object> actionLink) {
|
||||
this.actionLink = actionLink;
|
||||
}
|
||||
|
||||
public String getCallbackUrl() {
|
||||
return callbackUrl;
|
||||
}
|
||||
|
||||
public void setCallbackUrl(String callbackUrl) {
|
||||
this.callbackUrl = callbackUrl;
|
||||
}
|
||||
|
||||
public Customization getCustomization() {
|
||||
return customization;
|
||||
}
|
||||
|
||||
public void setCustomization(Customization customization) {
|
||||
this.customization = customization;
|
||||
}
|
||||
|
||||
public Embedded getEmbedded() {
|
||||
return embedded;
|
||||
}
|
||||
|
||||
public void setEmbedded(Embedded embedded) {
|
||||
this.embedded = embedded;
|
||||
}
|
||||
|
||||
public Language getLang() {
|
||||
return lang;
|
||||
}
|
||||
|
||||
public void setLang(Language lang) {
|
||||
this.lang = lang;
|
||||
}
|
||||
|
||||
public Mode getMode() {
|
||||
return mode;
|
||||
}
|
||||
|
||||
public void setMode(Mode mode) {
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,86 @@
|
||||
package com.onlyoffice.integration.entities.filemodel;
|
||||
|
||||
import com.onlyoffice.integration.entities.enums.DocumentType;
|
||||
import com.onlyoffice.integration.entities.enums.Type;
|
||||
import com.onlyoffice.integration.util.documentManagers.DocumentManager;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
@Scope("prototype")
|
||||
public class File {
|
||||
private Document document;
|
||||
private DocumentType documentType;
|
||||
private EditorConfig editorConfig;
|
||||
private String token;
|
||||
private Type type;
|
||||
|
||||
@Autowired
|
||||
private DocumentManager documentManager;
|
||||
|
||||
public void configure(Document doc, DocumentType documentType, EditorConfig config, Type type){
|
||||
this.document = doc;
|
||||
this.documentType = documentType;
|
||||
this.editorConfig = config;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
//TODO: Implement
|
||||
public String[] GetHistory(){
|
||||
System.out.println("================DON'T FORGET TO IMPLEMENT ME============= \n");
|
||||
return new String[] { "", "" };
|
||||
}
|
||||
|
||||
public void generateToken(){
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("type", type);
|
||||
map.put("documentType", documentType);
|
||||
map.put("document", document);
|
||||
map.put("editorConfig", editorConfig);
|
||||
|
||||
token = documentManager.createToken(map);
|
||||
}
|
||||
|
||||
public Document getDocument() {
|
||||
return document;
|
||||
}
|
||||
|
||||
public void setDocument(Document document) {
|
||||
this.document = document;
|
||||
}
|
||||
|
||||
public DocumentType getDocumentType() {
|
||||
return documentType;
|
||||
}
|
||||
|
||||
public void setDocumentType(DocumentType documentType) {
|
||||
this.documentType = documentType;
|
||||
}
|
||||
|
||||
public EditorConfig getEditorConfig() {
|
||||
return editorConfig;
|
||||
}
|
||||
|
||||
public void setEditorConfig(EditorConfig editorConfig) {
|
||||
this.editorConfig = editorConfig;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public Type getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Type type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,140 @@
|
||||
package com.onlyoffice.integration.entities.filemodel;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.onlyoffice.integration.serializer.SerializerFilter;
|
||||
import com.onlyoffice.integration.entities.Group;
|
||||
import com.onlyoffice.integration.entities.User;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
@Scope("prototype")
|
||||
public class Permission {
|
||||
private Boolean comment = true;
|
||||
private Boolean copy = true;
|
||||
private Boolean download = true;
|
||||
private Boolean edit = true;
|
||||
private Boolean print = true;
|
||||
private Boolean fillForms = true;
|
||||
private Boolean modifyFilter = true;
|
||||
private Boolean modifyContentControl = true;
|
||||
private Boolean review = true;
|
||||
@JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = SerializerFilter.class)
|
||||
private List<String> reviewGroups;
|
||||
private CommentGroup commentGroups;
|
||||
|
||||
public void configure(User user){
|
||||
this.comment = user.getPermissions().getComment();
|
||||
this.copy = user.getPermissions().getCopy();
|
||||
this.download = user.getPermissions().getDownload();
|
||||
this.edit = user.getPermissions().getEdit();
|
||||
this.print = user.getPermissions().getPrint();
|
||||
this.fillForms = user.getPermissions().getFillForms();
|
||||
this.modifyFilter = user.getPermissions().getModifyFilter();
|
||||
this.modifyContentControl = user.getPermissions().getModifyContentControl();
|
||||
this.review = user.getPermissions().getReview();
|
||||
this.reviewGroups = user.getPermissions()
|
||||
.getReviewGroups()
|
||||
.stream()
|
||||
.distinct()
|
||||
.map(group -> group.getName())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<Group> commentViewGroups = user.getPermissions().getCommentsViewGroups();
|
||||
List<Group> commentEditGroups = user.getPermissions().getCommentsEditGroups();
|
||||
List<Group> commentRemoveGroups = user.getPermissions().getCommentsRemoveGroups();
|
||||
|
||||
this.commentGroups = new CommentGroup(commentViewGroups, commentEditGroups, commentRemoveGroups);
|
||||
}
|
||||
|
||||
public Boolean getComment() {
|
||||
return comment;
|
||||
}
|
||||
|
||||
public void setComment(Boolean comment) {
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
public Boolean getCopy() {
|
||||
return copy;
|
||||
}
|
||||
|
||||
public void setCopy(Boolean copy) {
|
||||
this.copy = copy;
|
||||
}
|
||||
|
||||
public Boolean getDownload() {
|
||||
return download;
|
||||
}
|
||||
|
||||
public void setDownload(Boolean download) {
|
||||
this.download = download;
|
||||
}
|
||||
|
||||
public Boolean getEdit() {
|
||||
return edit;
|
||||
}
|
||||
|
||||
public void setEdit(Boolean edit) {
|
||||
this.edit = edit;
|
||||
}
|
||||
|
||||
public Boolean getPrint() {
|
||||
return print;
|
||||
}
|
||||
|
||||
public void setPrint(Boolean print) {
|
||||
this.print = print;
|
||||
}
|
||||
|
||||
public Boolean getFillForms() {
|
||||
return fillForms;
|
||||
}
|
||||
|
||||
public void setFillForms(Boolean fillForms) {
|
||||
this.fillForms = fillForms;
|
||||
}
|
||||
|
||||
public Boolean getModifyFilter() {
|
||||
return modifyFilter;
|
||||
}
|
||||
|
||||
public void setModifyFilter(Boolean modifyFilter) {
|
||||
this.modifyFilter = modifyFilter;
|
||||
}
|
||||
|
||||
public Boolean getModifyContentControl() {
|
||||
return modifyContentControl;
|
||||
}
|
||||
|
||||
public void setModifyContentControl(Boolean modifyContentControl) {
|
||||
this.modifyContentControl = modifyContentControl;
|
||||
}
|
||||
|
||||
public Boolean getReview() {
|
||||
return review;
|
||||
}
|
||||
|
||||
public void setReview(Boolean review) {
|
||||
this.review = review;
|
||||
}
|
||||
|
||||
public List<String> getReviewGroups() {
|
||||
return reviewGroups;
|
||||
}
|
||||
|
||||
public void setReviewGroups(List<String> reviewGroups) {
|
||||
this.reviewGroups = reviewGroups;
|
||||
}
|
||||
|
||||
public CommentGroup getCommentGroups() {
|
||||
return commentGroups;
|
||||
}
|
||||
|
||||
public void setCommentGroups(CommentGroup commentGroups) {
|
||||
this.commentGroups = commentGroups;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package com.onlyoffice.integration.entities.filemodel;
|
||||
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@Scope("prototype")
|
||||
public class User {
|
||||
private String id;
|
||||
private String name;
|
||||
private String group;
|
||||
|
||||
public void configure(int id, String name, String group){
|
||||
this.id = "uid-"+id;
|
||||
this.name = name;
|
||||
this.group = group;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getGroup() {
|
||||
return group;
|
||||
}
|
||||
|
||||
public void setGroup(String group) {
|
||||
this.group = group;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
package com.onlyoffice.integration.repositories;
|
||||
|
||||
import com.onlyoffice.integration.entities.Group;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public interface GroupRepository extends JpaRepository<Group, Integer> {
|
||||
Optional<Group> findGroupByName(String name);
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
package com.onlyoffice.integration.repositories;
|
||||
|
||||
import com.onlyoffice.integration.entities.Permission;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface PermissionRepository extends JpaRepository<Permission, Integer> {
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
package com.onlyoffice.integration.repositories;
|
||||
|
||||
import com.onlyoffice.integration.entities.User;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface UserRepository extends JpaRepository<User, Integer> {
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
package com.onlyoffice.integration.serializer;
|
||||
|
||||
public enum FilterState {
|
||||
NULL
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.onlyoffice.integration.serializer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SerializerFilter {
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof List) {
|
||||
if(((List<?>) obj).size() == 1 && ((List<?>) obj).get(0) == FilterState.NULL.toString()){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
package com.onlyoffice.integration.services;
|
||||
|
||||
import com.onlyoffice.integration.Action;
|
||||
import com.onlyoffice.integration.entities.User;
|
||||
import com.onlyoffice.integration.entities.enums.DocumentType;
|
||||
import com.onlyoffice.integration.entities.enums.Language;
|
||||
import com.onlyoffice.integration.entities.enums.Type;
|
||||
import com.onlyoffice.integration.entities.filemodel.Document;
|
||||
import com.onlyoffice.integration.entities.filemodel.EditorConfig;
|
||||
import com.onlyoffice.integration.entities.filemodel.File;
|
||||
import com.onlyoffice.integration.entities.filemodel.Permission;
|
||||
import com.onlyoffice.integration.util.fileUtilities.FileUtility;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class EditorServices {
|
||||
|
||||
@Autowired
|
||||
private ApplicationContext context;
|
||||
|
||||
@Autowired
|
||||
private FileUtility fileUtility;
|
||||
|
||||
public File createConfiguration(User user, String fileName, String actionData,
|
||||
Action action, Language lang, Type type){
|
||||
DocumentType documentType = fileUtility.getDocumentType(fileName);
|
||||
|
||||
Permission permissions = createPermissions(user);
|
||||
|
||||
Document doc = context.getBean(Document.class);
|
||||
doc.configure(fileName, permissions);
|
||||
|
||||
EditorConfig config = this.createEditorConfig(user, fileName, actionData, action, lang, type);
|
||||
|
||||
File file = context.getBean(File.class);
|
||||
file.configure(doc, documentType, config, type);
|
||||
return file;
|
||||
}
|
||||
|
||||
private Permission createPermissions(User user){
|
||||
Permission permissions = context.getBean(Permission.class);
|
||||
permissions.configure(user);
|
||||
return permissions;
|
||||
}
|
||||
|
||||
private EditorConfig createEditorConfig(User user, String fileName, String actionData, Action action, Language lang, Type type){
|
||||
EditorConfig config = context.getBean(EditorConfig.class);
|
||||
config.configure(user, fileName, actionData, action, lang, type);
|
||||
|
||||
return config;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package com.onlyoffice.integration.services;
|
||||
|
||||
import com.onlyoffice.integration.entities.Group;
|
||||
import com.onlyoffice.integration.repositories.GroupRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class GroupServices {
|
||||
|
||||
@Autowired
|
||||
private GroupRepository groupRepository;
|
||||
|
||||
public Group createGroup(String name){
|
||||
if(name == null) return null;
|
||||
Optional<Group> group = groupRepository.findGroupByName(name);
|
||||
if(group.isPresent()) return group.get();
|
||||
Group newGroup = new Group();
|
||||
newGroup.setName(name);
|
||||
|
||||
groupRepository.save(newGroup);
|
||||
|
||||
return newGroup;
|
||||
}
|
||||
|
||||
public List<Group> createGroups(List<String> reviewGroups){
|
||||
if(reviewGroups == null) return null;
|
||||
return reviewGroups.stream()
|
||||
.map(group -> createGroup(group))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package com.onlyoffice.integration.services;
|
||||
|
||||
import com.onlyoffice.integration.entities.Group;
|
||||
import com.onlyoffice.integration.entities.Permission;
|
||||
import com.onlyoffice.integration.repositories.PermissionRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class PermissionServices {
|
||||
|
||||
@Autowired
|
||||
private PermissionRepository permissionRepository;
|
||||
|
||||
public Permission createPermission(List<Group> reviewGroups,
|
||||
List<Group> commentViewGroups,
|
||||
List<Group> commentEditGroups,
|
||||
List<Group> commentRemoveGroups){
|
||||
|
||||
Permission permission = new Permission();
|
||||
permission.setReviewGroups(reviewGroups);
|
||||
permission.setCommentsViewGroups(commentViewGroups);
|
||||
permission.setCommentsEditGroups(commentEditGroups);
|
||||
permission.setCommentsRemoveGroups(commentRemoveGroups);
|
||||
|
||||
permissionRepository.save(permission);
|
||||
|
||||
return permission;
|
||||
}
|
||||
|
||||
public Permission updatePermission(Permission newPermission){
|
||||
permissionRepository.save(newPermission);
|
||||
|
||||
return newPermission;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
package com.onlyoffice.integration.services;
|
||||
|
||||
import com.onlyoffice.integration.entities.Group;
|
||||
import com.onlyoffice.integration.entities.Permission;
|
||||
import com.onlyoffice.integration.entities.User;
|
||||
import com.onlyoffice.integration.repositories.UserRepository;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class UserServices {
|
||||
@Autowired
|
||||
private UserRepository userRepository;
|
||||
|
||||
@Autowired
|
||||
private GroupServices groupServices;
|
||||
|
||||
@Autowired
|
||||
private PermissionServices permissionService;
|
||||
|
||||
private String convertDescriptions(String username, List<String> description){
|
||||
String result = "<b>"+username+"</b><br/>"+description.
|
||||
stream().map(text -> "<li>"+text+"</li>")
|
||||
.collect(Collectors.joining());
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<User> findAll(){
|
||||
return userRepository.findAll();
|
||||
}
|
||||
|
||||
public Optional<User> findUserById(Integer id){
|
||||
return userRepository.findById(id);
|
||||
}
|
||||
|
||||
public User createUser(String name, String email,
|
||||
List<String> description, String group,
|
||||
List<String> reviewGroups,
|
||||
List<String> viewGroups,
|
||||
List<String> editGroups,
|
||||
List<String> removeGroups){
|
||||
User newUser = new User();
|
||||
newUser.setName(name);
|
||||
newUser.setEmail(email);
|
||||
newUser.setGroup(groupServices.createGroup(group));
|
||||
newUser.setDescriptions(convertDescriptions(name, description));
|
||||
|
||||
List<Group> groupsReview = groupServices.createGroups(reviewGroups);
|
||||
List<Group> commentGroupsView = groupServices.createGroups(viewGroups);
|
||||
List<Group> commentGroupsEdit = groupServices.createGroups(editGroups);
|
||||
List<Group> commentGroupsRemove = groupServices.createGroups(removeGroups);
|
||||
|
||||
Permission permission = permissionService
|
||||
.createPermission(groupsReview, commentGroupsView, commentGroupsEdit, commentGroupsRemove);
|
||||
|
||||
newUser.setPermissions(permission);
|
||||
|
||||
userRepository.save(newUser);
|
||||
|
||||
return newUser;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,324 @@
|
||||
package com.onlyoffice.integration.util;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.onlyoffice.integration.util.documentManagers.DocumentManager;
|
||||
import com.onlyoffice.integration.util.fileUtilities.FileUtility;
|
||||
import com.onlyoffice.integration.util.serviceConverter.ServiceConverter;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
import org.primeframework.jwt.domain.JWT;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.*;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Scanner;
|
||||
|
||||
//TODO: Refactor everything
|
||||
@Component
|
||||
public class TrackManager {
|
||||
|
||||
@Autowired
|
||||
private HttpServletRequest request;
|
||||
|
||||
@Autowired
|
||||
private DocumentManager documentManager;
|
||||
|
||||
@Autowired
|
||||
private FileUtility fileUtility;
|
||||
|
||||
@Autowired
|
||||
private ServiceConverter serviceConverter;
|
||||
|
||||
@Value("${files.docservice.url.site}")
|
||||
private String docserviceUrlSite;
|
||||
|
||||
@Value("${files.docservice.url.command}")
|
||||
private String docserviceUrlCommand;
|
||||
|
||||
@Value("${files.docservice.header}")
|
||||
private String documentJwtHeader;
|
||||
|
||||
//TODO: A separate @RequestBody class
|
||||
public JSONObject readBody() throws Exception {
|
||||
String bodyString = "";
|
||||
|
||||
try {
|
||||
Scanner scanner = new Scanner(request.getInputStream());
|
||||
scanner.useDelimiter("\\A");
|
||||
bodyString = scanner.hasNext() ? scanner.next() : "";
|
||||
scanner.close();
|
||||
}
|
||||
catch (IOException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
if (bodyString.isEmpty()) {
|
||||
throw new Exception("{\"error\":1,\"message\":\"Request payload is empty\"}");
|
||||
}
|
||||
|
||||
JSONParser parser = new JSONParser();
|
||||
JSONObject body;
|
||||
|
||||
try {
|
||||
Object obj = parser.parse(bodyString);
|
||||
body = (JSONObject) obj;
|
||||
} catch (Exception ex) {
|
||||
throw new Exception("{\"error\":1,\"message\":\"JSON Parsing error\"}");
|
||||
}
|
||||
|
||||
if (documentManager.tokenEnabled()) {
|
||||
String token = (String) body.get("token");
|
||||
|
||||
if (token == null) {
|
||||
String header = (String) request.getHeader(documentJwtHeader == null
|
||||
|| documentJwtHeader.isEmpty() ? "Authorization" : documentJwtHeader);
|
||||
if (header != null && !header.isEmpty()) {
|
||||
token = header.startsWith("Bearer ") ? header.substring(7) : header;
|
||||
}
|
||||
}
|
||||
|
||||
if (token == null || token.isEmpty()) {
|
||||
throw new Exception("{\"error\":1,\"message\":\"JWT expected\"}");
|
||||
}
|
||||
|
||||
JWT jwt = documentManager.readToken(token);
|
||||
if (jwt == null) {
|
||||
throw new Exception("{\"error\":1,\"message\":\"JWT validation failed\"}");
|
||||
}
|
||||
|
||||
if (jwt.getObject("payload") != null) {
|
||||
try {
|
||||
@SuppressWarnings("unchecked") LinkedHashMap<String, Object> payload =
|
||||
(LinkedHashMap<String, Object>)jwt.getObject("payload");
|
||||
|
||||
jwt.claims = payload;
|
||||
} catch (Exception ex) {
|
||||
throw new Exception("{\"error\":1,\"message\":\"Wrong payload\"}");
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
Gson gson = new Gson();
|
||||
Object obj = parser.parse(gson.toJson(jwt.claims));
|
||||
body = (JSONObject) obj;
|
||||
} catch (Exception ex) {
|
||||
throw new Exception("{\"error\":1,\"message\":\"Parsing error\"}");
|
||||
}
|
||||
}
|
||||
|
||||
return body;
|
||||
}
|
||||
|
||||
//TODO: A separate @RequestBody class
|
||||
public void processSave(JSONObject body, String fileName, String userAddress) throws Exception{
|
||||
String downloadUri = (String) body.get("url");
|
||||
String changesUri = (String) body.get("changesurl");
|
||||
String key = (String) body.get("key");
|
||||
String newFileName = fileName;
|
||||
|
||||
String curExt = fileUtility.getFileExtension(fileName); // get current file extension
|
||||
String downloadExt = fileUtility.getFileExtension(downloadUri); // get the extension of the downloaded file
|
||||
|
||||
// convert downloaded file to the file with the current extension if these extensions aren't equal
|
||||
if (!curExt.equals(downloadExt)) {
|
||||
try {
|
||||
String newFileUri = serviceConverter.getConvertedUri(downloadUri, downloadExt, curExt, serviceConverter.generateRevisionId(downloadUri), null, false); // convert file and get url to a new file
|
||||
if (newFileUri.isEmpty()) {
|
||||
newFileName = documentManager
|
||||
.getCorrectName(fileUtility.getFileNameWithoutExtension(fileName) + downloadExt, userAddress); // get the correct file name if it already exists
|
||||
} else {
|
||||
downloadUri = newFileUri;
|
||||
}
|
||||
} catch (Exception e){
|
||||
newFileName = documentManager.getCorrectName(fileUtility.getFileNameWithoutExtension(fileName) + downloadExt, userAddress);
|
||||
}
|
||||
}
|
||||
|
||||
String storagePath = documentManager.storagePath(newFileName, userAddress); // get the file path
|
||||
Path histDir = Paths.get(documentManager.historyDir(storagePath)); // get the path to the history direction
|
||||
if (!Files.exists(histDir)) Files.createDirectories(histDir); // if the path doesn't exist, create it
|
||||
|
||||
String versionDir = documentManager.versionDir(histDir.toAbsolutePath().toString(),
|
||||
documentManager.getFileVersion(histDir.toAbsolutePath().toString())); // get the path to the file version
|
||||
|
||||
//TODO: Replace with NIO
|
||||
File ver = new File(versionDir);
|
||||
File lastVersion = new File(documentManager.storagePath(fileName, userAddress));
|
||||
File toSave = new File(storagePath);
|
||||
|
||||
if (!ver.exists()) ver.mkdirs();
|
||||
|
||||
lastVersion.renameTo(new File(versionDir + File.separator + "prev" + curExt)); // get the path to the previous file version and rename the last file version with it
|
||||
|
||||
downloadToFile(downloadUri, toSave); // save file to the storage path
|
||||
downloadToFile(changesUri, new File(versionDir + File.separator + "diff.zip")); // save file changes to the diff.zip archive
|
||||
|
||||
String history = (String) body.get("changeshistory");
|
||||
if (history == null && body.containsKey("history")) {
|
||||
history = ((JSONObject) body.get("history")).toJSONString();
|
||||
}
|
||||
if (history != null && !history.isEmpty()) {
|
||||
FileWriter fw = new FileWriter(new File(versionDir + File.separator + "changes.json")); // write the history changes to the changes.json file
|
||||
fw.write(history);
|
||||
fw.close();
|
||||
}
|
||||
|
||||
FileWriter fw = new FileWriter(new File(versionDir + File.separator + "key.txt")); // write the key value to the key.txt file
|
||||
fw.write(key);
|
||||
fw.close();
|
||||
|
||||
String forcesavePath = documentManager.forcesavePath(newFileName, userAddress, false); // get the path to the forcesaved file version
|
||||
if (!forcesavePath.equals("")) { // if the forcesaved file version exists
|
||||
File forceSaveFile = new File(forcesavePath);
|
||||
forceSaveFile.delete(); // remove it
|
||||
}
|
||||
}
|
||||
private void downloadToFile(String url, File file) throws Exception {
|
||||
if (url == null || url.isEmpty()) throw new Exception("argument url"); // url isn't specified
|
||||
if (file == null) throw new Exception("argument path"); // file isn't specified
|
||||
|
||||
URL uri = new URL(url);
|
||||
java.net.HttpURLConnection connection = (java.net.HttpURLConnection) uri.openConnection();
|
||||
InputStream stream = connection.getInputStream(); // get input stream of the file information from the url
|
||||
|
||||
if (stream == null)
|
||||
{
|
||||
throw new Exception("Stream is null");
|
||||
}
|
||||
|
||||
try (FileOutputStream out = new FileOutputStream(file))
|
||||
{
|
||||
int read;
|
||||
final byte[] bytes = new byte[1024];
|
||||
while ((read = stream.read(bytes)) != -1)
|
||||
{
|
||||
out.write(bytes, 0, read); // write bytes to the output stream
|
||||
}
|
||||
|
||||
// force write data to the output stream that can be cached in the current thread
|
||||
out.flush();
|
||||
}
|
||||
|
||||
connection.disconnect();
|
||||
}
|
||||
|
||||
public void commandRequest(String method, String key) throws Exception {
|
||||
String DocumentCommandUrl = docserviceUrlSite + docserviceUrlCommand;
|
||||
|
||||
URL url = new URL(DocumentCommandUrl);
|
||||
java.net.HttpURLConnection connection = (java.net.HttpURLConnection) url.openConnection();
|
||||
|
||||
HashMap<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("c", method);
|
||||
params.put("key", key);
|
||||
|
||||
String headerToken = "";
|
||||
if (documentManager.tokenEnabled()) // check if a secret key to generate token exists or not
|
||||
{
|
||||
Map<String, Object> payloadMap = new HashMap<String, Object>();
|
||||
payloadMap.put("payload", params);
|
||||
headerToken = documentManager.createToken(payloadMap); // encode a payload object into a header token
|
||||
|
||||
// add a header Authorization with a header token and Authorization prefix in it
|
||||
connection.setRequestProperty(documentJwtHeader.equals("") ? "Authorization" : documentJwtHeader, "Bearer " + headerToken);
|
||||
|
||||
String token = documentManager.createToken(params); // encode a payload object into a body token
|
||||
params.put("token", token);
|
||||
}
|
||||
|
||||
Gson gson = new Gson();
|
||||
String bodyString = gson.toJson(params);
|
||||
|
||||
byte[] bodyByte = bodyString.getBytes(StandardCharsets.UTF_8);
|
||||
|
||||
connection.setRequestMethod("POST"); // set the request method
|
||||
connection.setRequestProperty("Content-Type", "application/json; charset=UTF-8"); // set the Content-Type header
|
||||
connection.setDoOutput(true); // set the doOutput field to true
|
||||
|
||||
connection.connect();
|
||||
try (OutputStream os = connection.getOutputStream()) {
|
||||
os.write(bodyByte); // write bytes to the output stream
|
||||
}
|
||||
InputStream stream = connection.getInputStream();; // get input stream
|
||||
|
||||
if (stream == null)
|
||||
throw new Exception("Could not get an answer");
|
||||
|
||||
String jsonString = serviceConverter.convertStreamToString(stream); // convert stream to json string
|
||||
connection.disconnect();
|
||||
|
||||
JSONObject response = serviceConverter.convertStringToJSON(jsonString); // convert json string to json object
|
||||
if (!response.get("error").toString().equals("0")){
|
||||
throw new Exception(response.toJSONString());
|
||||
}
|
||||
}
|
||||
|
||||
public void processForceSave(JSONObject body, String fileName, String userAddress) throws Exception {
|
||||
|
||||
String downloadUri = (String) body.get("url");
|
||||
|
||||
String curExt = fileUtility.getFileExtension(fileName); // get current file extension
|
||||
String downloadExt = fileUtility.getFileExtension(downloadUri); // 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 {
|
||||
String newFileUri = serviceConverter.getConvertedUri(downloadUri, downloadExt,
|
||||
curExt, serviceConverter.generateRevisionId(downloadUri), null, false); // convert file and get url to a new file
|
||||
if (newFileUri.isEmpty()) {
|
||||
newFileName = true;
|
||||
} else {
|
||||
downloadUri = newFileUri;
|
||||
}
|
||||
} catch (Exception e){
|
||||
newFileName = true;
|
||||
}
|
||||
}
|
||||
|
||||
String forcesavePath = "";
|
||||
boolean isSubmitForm = body.get("forcesavetype").toString().equals("3"); // SubmitForm
|
||||
|
||||
if (isSubmitForm) { // if the form is submitted
|
||||
// new file
|
||||
if (newFileName){
|
||||
fileName = documentManager
|
||||
.getCorrectName(fileUtility.getFileNameWithoutExtension(fileName) + "-form" + downloadExt, userAddress); // get the correct file name if it already exists
|
||||
} else {
|
||||
fileName = documentManager.getCorrectName(fileUtility.getFileNameWithoutExtension(fileName) + "-form" + curExt, userAddress);
|
||||
}
|
||||
forcesavePath = documentManager.storagePath(fileName, userAddress);
|
||||
} else {
|
||||
if (newFileName){
|
||||
fileName = documentManager.getCorrectName(fileUtility.getFileNameWithoutExtension(fileName) + downloadExt, userAddress);
|
||||
}
|
||||
|
||||
// create forcesave path if it doesn't exist
|
||||
forcesavePath = documentManager.forcesavePath(fileName, userAddress, false);
|
||||
if (forcesavePath == "") {
|
||||
forcesavePath = documentManager.forcesavePath(fileName, userAddress, true);
|
||||
}
|
||||
}
|
||||
|
||||
File toSave = new File(forcesavePath);
|
||||
downloadToFile(downloadUri, toSave);
|
||||
|
||||
if (isSubmitForm) {
|
||||
JSONArray actions = (JSONArray) body.get("actions");
|
||||
JSONObject action = (JSONObject) actions.get(0);
|
||||
String user = (String) action.get("userid"); // get the user id
|
||||
documentManager.createMeta(fileName, user, "Filling Form", userAddress); // create meta data for forcesaved file
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package com.onlyoffice.integration.util.documentManagers;
|
||||
|
||||
import org.primeframework.jwt.domain.JWT;
|
||||
import org.springframework.core.io.Resource;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
//TODO: Segregate the interface
|
||||
public interface DocumentManager {
|
||||
public long getMaxFileSize();
|
||||
public List<String> getFileExts();
|
||||
public List<String> getViewedExts();
|
||||
public List<String> getEditedExts();
|
||||
public List<String> getConvertExts();
|
||||
public String curUserHostAddress(String userAddress);
|
||||
public String filesRootPath(String userAddress);
|
||||
public String storagePath(String fileName, String userAddress);
|
||||
public String forcesavePath(String fileName, String userAddress, Boolean create);
|
||||
public String historyDir(String storagePath);
|
||||
public String versionDir(String histPath, Integer version);
|
||||
public String versionDir(String fileName, String userAddress, Integer version);
|
||||
public int getFileVersion(String historyPath);
|
||||
public int getFileVersion(String fileName, String userAddress);
|
||||
public String getCorrectName(String fileName, String userAddress);
|
||||
public void createMeta(String fileName, String uid, String uname, String userAddress) throws IOException;
|
||||
public File[] getStoredFiles(String userAddress);
|
||||
public String getServerUrl(Boolean s);
|
||||
public String getFileUri(String fileName, Boolean forDocumentServer);
|
||||
public boolean tokenEnabled();
|
||||
public String createToken(Map<String, Object> payloadClaims);
|
||||
public String getCallback(String fileName);
|
||||
public JWT readToken(String token);
|
||||
public String getDownloadUrl(String fileName);
|
||||
public void deleteFilesRecursively(Path path);
|
||||
public Resource loadFileAsResource(String fileLocation);
|
||||
public ArrayList<Map<String, Object>> getFilesInfo();
|
||||
public ArrayList<Map<String, Object>> getFilesInfo(String fileId);
|
||||
}
|
||||
@ -0,0 +1,415 @@
|
||||
package com.onlyoffice.integration.util.documentManagers;
|
||||
|
||||
import com.onlyoffice.integration.util.fileUtilities.FileUtility;
|
||||
import com.onlyoffice.integration.util.serviceConverter.ServiceConverter;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.primeframework.jwt.Signer;
|
||||
import org.primeframework.jwt.Verifier;
|
||||
import org.primeframework.jwt.domain.JWT;
|
||||
import org.primeframework.jwt.hmac.HMACSigner;
|
||||
import org.primeframework.jwt.hmac.HMACVerifier;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.core.io.UrlResource;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.FileSystemUtils;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.*;
|
||||
import java.io.File;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.net.InetAddress;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URLEncoder;
|
||||
import java.net.UnknownHostException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Component
|
||||
public class DocumentManagerImpl implements DocumentManager {
|
||||
|
||||
@Autowired
|
||||
private HttpServletRequest request;
|
||||
|
||||
@Autowired
|
||||
private FileUtility fileUtility;
|
||||
|
||||
@Autowired
|
||||
private ServiceConverter serviceConverter;
|
||||
|
||||
@Value("${storage-folder}")
|
||||
private String storageFolder;
|
||||
|
||||
@Value("${files.docservice.secret}")
|
||||
private String tokenSecret;
|
||||
|
||||
@Value("${files.docservice.url.example}")
|
||||
private String docserviceUrlExample;
|
||||
|
||||
@Value("${filesize-max}")
|
||||
private String filesizeMax;
|
||||
|
||||
@Value("${files.docservice.viewed-docs}")
|
||||
private String docserviceViewedDocs;
|
||||
|
||||
@Value("${files.docservice.edited-docs}")
|
||||
private String docserviceEditedDocs;
|
||||
|
||||
@Value("${files.docservice.convert-docs}")
|
||||
private String docserviceConvertDocs;
|
||||
|
||||
@Value("${files.docservice.history.postfix}")
|
||||
private String historyPostfix;
|
||||
|
||||
@Value("${url.track}")
|
||||
private String trackUrl;
|
||||
|
||||
@Value("${url.download}")
|
||||
private String downloadUrl;
|
||||
|
||||
public long getMaxFileSize(){
|
||||
long size = Long.parseLong(filesizeMax);
|
||||
return size > 0 ? size : 5 * 1024 * 1024;
|
||||
}
|
||||
|
||||
public List<String> getFileExts()
|
||||
{
|
||||
List<String> res = new ArrayList<>();
|
||||
|
||||
res.addAll(getViewedExts());
|
||||
res.addAll(getEditedExts());
|
||||
res.addAll(getConvertExts());
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
public List<String> getViewedExts()
|
||||
{
|
||||
return Arrays.asList(docserviceViewedDocs.split("\\|"));
|
||||
}
|
||||
|
||||
public List<String> getEditedExts()
|
||||
{
|
||||
return Arrays.asList(docserviceEditedDocs.split("\\|"));
|
||||
}
|
||||
|
||||
public List<String> getConvertExts()
|
||||
{
|
||||
return Arrays.asList(docserviceConvertDocs.split("\\|"));
|
||||
}
|
||||
|
||||
public String curUserHostAddress(String userAddress){
|
||||
if(userAddress == null){
|
||||
try{
|
||||
userAddress = InetAddress.getLocalHost().getHostAddress();
|
||||
} catch (UnknownHostException e){
|
||||
userAddress = "";
|
||||
}
|
||||
}
|
||||
return userAddress.replaceAll("[^0-9a-zA-Z.=]", "_");
|
||||
}
|
||||
|
||||
public void createDirectory(Path path){
|
||||
if (!Files.exists(path))
|
||||
{
|
||||
try {
|
||||
Files.createDirectory(path);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteFilesRecursively(Path path) {
|
||||
FileSystemUtils.deleteRecursively(path.toFile());
|
||||
}
|
||||
|
||||
public Resource loadFileAsResource(String fileLocation){
|
||||
try {
|
||||
Path filePath = Paths.get(fileLocation);
|
||||
Resource resource = new UrlResource(filePath.toUri());
|
||||
if(resource.exists()) return resource;
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String filesRootPath(String userAddress)
|
||||
{
|
||||
String directory = buildDirectoryLocation(userAddress);
|
||||
createDirectory(Paths.get(directory));
|
||||
|
||||
return directory;
|
||||
}
|
||||
|
||||
public String storagePath(String fileName, String userAddress)
|
||||
{
|
||||
String directory = filesRootPath(userAddress);
|
||||
|
||||
return directory + fileUtility.getFileName(fileName);
|
||||
}
|
||||
|
||||
public String forcesavePath(String fileName, String userAddress, Boolean create)
|
||||
{
|
||||
String directory = buildDirectoryLocation(userAddress);
|
||||
|
||||
Path path = Paths.get(directory);
|
||||
if (!Files.exists(path)) return "";
|
||||
|
||||
directory = directory + fileName + historyPostfix + File.separator;
|
||||
|
||||
path = Paths.get(directory);
|
||||
if (!create && !Files.exists(path)) return "";
|
||||
|
||||
try {
|
||||
Files.createDirectories(path);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
directory = directory + fileName;
|
||||
path = Paths.get(directory);
|
||||
if (!create && !Files.exists(path)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
return directory;
|
||||
}
|
||||
|
||||
public String historyDir(String storagePath)
|
||||
{
|
||||
return storagePath += historyPostfix;
|
||||
}
|
||||
|
||||
public String versionDir(String histPath, Integer version)
|
||||
{
|
||||
return histPath + File.separator + Integer.toString(version);
|
||||
}
|
||||
|
||||
public String versionDir(String fileName, String userAddress, Integer version)
|
||||
{
|
||||
return versionDir(historyDir(storagePath(fileName, userAddress)), version);
|
||||
}
|
||||
|
||||
//TODO: NOT TESTED
|
||||
public int getFileVersion(String historyPath)
|
||||
{
|
||||
Path path = Paths.get(historyPath);
|
||||
if (!Files.exists(path)) return 0;
|
||||
|
||||
try (Stream<Path> stream = Files.walk(path, 1)) {
|
||||
return stream
|
||||
.filter(file -> !Files.isDirectory(file))
|
||||
.map(Path::getFileName)
|
||||
.map(Path::toString)
|
||||
.collect(Collectors.toSet()).size();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public 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 String getCorrectName(String fileName, String userAddress)
|
||||
{
|
||||
String baseName = fileUtility.getFileNameWithoutExtension(fileName);
|
||||
String ext = fileUtility.getFileExtension(fileName);
|
||||
String name = baseName + ext;
|
||||
|
||||
Path path = Paths.get(storagePath(name, userAddress));
|
||||
|
||||
for (int i = 1; Files.exists(path); i++)
|
||||
{
|
||||
name = baseName + " (" + i + ")" + ext;
|
||||
path = Paths.get(storagePath(name, userAddress));
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
public void createMeta(String fileName, String uid, String uname, String userAddress) throws IOException {
|
||||
String histDir = historyDir(storagePath(fileName, userAddress));
|
||||
|
||||
Path path = Paths.get(histDir);
|
||||
try {
|
||||
Files.createDirectory(path);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("created", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
||||
json.put("id", uid);
|
||||
json.put("name", uname);
|
||||
|
||||
File meta = Files.createFile(Paths.get(histDir + File.separator + "createdInfo.json")).toFile();
|
||||
try (FileWriter writer = new FileWriter(meta)) {
|
||||
json.writeJSONString(writer);
|
||||
} catch (IOException ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public File[] getStoredFiles(String userAddress)
|
||||
{
|
||||
String directory = filesRootPath(userAddress);
|
||||
|
||||
File file = new File(directory);
|
||||
return file.listFiles(pathname -> pathname.isFile());
|
||||
}
|
||||
|
||||
public String getServerUrl(Boolean forDocumentServer) {
|
||||
if (forDocumentServer && !docserviceUrlExample.equals("")) {
|
||||
return docserviceUrlExample;
|
||||
} else {
|
||||
return request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath();
|
||||
}
|
||||
}
|
||||
|
||||
public String getFileUri(String fileName, Boolean forDocumentServer)
|
||||
{
|
||||
try
|
||||
{
|
||||
String serverPath = getServerUrl(forDocumentServer);
|
||||
String hostAddress = curUserHostAddress(null);
|
||||
|
||||
String filePath = serverPath + "/" + storageFolder
|
||||
+ "/" + hostAddress + "/"
|
||||
+ URLEncoder.encode(fileName, java.nio.charset.StandardCharsets.UTF_8.toString()).replace("+", "%20");
|
||||
|
||||
return filePath;
|
||||
}
|
||||
catch (UnsupportedEncodingException e)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public String createToken(Map<String, Object> payloadClaims)
|
||||
{
|
||||
try
|
||||
{
|
||||
Signer signer = HMACSigner.newSHA256Signer(tokenSecret);
|
||||
JWT jwt = new JWT();
|
||||
for (String key : payloadClaims.keySet())
|
||||
{
|
||||
jwt.addClaim(key, payloadClaims.get(key));
|
||||
}
|
||||
return JWT.getEncoder().encode(jwt, signer);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public boolean tokenEnabled()
|
||||
{
|
||||
return tokenSecret != null && !tokenSecret.isEmpty();
|
||||
}
|
||||
|
||||
public String getCallback(String fileName)
|
||||
{
|
||||
String serverPath = getServerUrl(true);
|
||||
String hostAddress = curUserHostAddress(null);
|
||||
try
|
||||
{
|
||||
String query = trackUrl+"?fileName="+
|
||||
URLEncoder.encode(fileName, java.nio.charset.StandardCharsets.UTF_8.toString())
|
||||
+ "&userAddress=" + URLEncoder.encode(hostAddress, java.nio.charset.StandardCharsets.UTF_8.toString());
|
||||
return serverPath + query;
|
||||
}
|
||||
catch (UnsupportedEncodingException e)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public JWT readToken(String token)
|
||||
{
|
||||
try
|
||||
{
|
||||
Verifier verifier = HMACVerifier.newVerifier(tokenSecret);
|
||||
return JWT.getDecoder().decode(token, verifier);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public String getDownloadUrl(String fileName) {
|
||||
String serverPath = getServerUrl(true);
|
||||
String hostAddress = curUserHostAddress(null);
|
||||
try
|
||||
{
|
||||
String query = downloadUrl+"?fileName="
|
||||
+ URLEncoder.encode(fileName, java.nio.charset.StandardCharsets.UTF_8.toString())
|
||||
+ "&userAddress="
|
||||
+ URLEncoder.encode(hostAddress, java.nio.charset.StandardCharsets.UTF_8.toString());
|
||||
|
||||
return serverPath + query;
|
||||
}
|
||||
catch (UnsupportedEncodingException e)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList<Map<String, Object>> getFilesInfo(){
|
||||
ArrayList<Map<String, Object>> files = new ArrayList<>();
|
||||
|
||||
for(File file : getStoredFiles(null)){
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("version", getFileVersion(file.getName(), null));
|
||||
map.put("id", serviceConverter
|
||||
.generateRevisionId(curUserHostAddress(null) +
|
||||
"/" + file.getName() + "/"
|
||||
+ Long.toString(Paths.get(storagePath(file.getName(), null))
|
||||
.toFile()
|
||||
.lastModified())));
|
||||
map.put("contentLength", new BigDecimal(String.valueOf((file.length()/1024.0)))
|
||||
.setScale(2, RoundingMode.HALF_UP) + " KB");
|
||||
map.put("pureContentLength", file.length());
|
||||
map.put("title", file.getName());
|
||||
map.put("updated", String.valueOf(new Date(file.lastModified())));
|
||||
files.add(map);
|
||||
}
|
||||
|
||||
return files;
|
||||
}
|
||||
|
||||
public ArrayList<Map<String, Object>> getFilesInfo(String fileId){
|
||||
ArrayList<Map<String, Object>> file = new ArrayList<>();
|
||||
|
||||
for (Map<String, Object> map : getFilesInfo()){
|
||||
if (map.get("id").equals(fileId)){
|
||||
file.add(map);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return file;
|
||||
}
|
||||
|
||||
private String buildDirectoryLocation(String userAddress){
|
||||
String hostAddress = curUserHostAddress(userAddress);
|
||||
String serverPath = request.getSession().getServletContext().getRealPath("");
|
||||
String directory = serverPath + storageFolder + File.separator + hostAddress + File.separator;
|
||||
|
||||
return directory;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.onlyoffice.integration.util.fileUtilities;
|
||||
|
||||
import com.onlyoffice.integration.entities.enums.DocumentType;
|
||||
|
||||
import java.nio.file.Path;
|
||||
|
||||
public interface FileUtility {
|
||||
public DocumentType getDocumentType(String fileName);
|
||||
public String getFileName(String url);
|
||||
public String getFileNameWithoutExtension(String url);
|
||||
public String getFileExtension(String url);
|
||||
public String getInternalExtension(DocumentType type);
|
||||
public Path generateFilepath(String directory, String fullFileName);
|
||||
}
|
||||
@ -0,0 +1,103 @@
|
||||
package com.onlyoffice.integration.util.fileUtilities;
|
||||
|
||||
import com.onlyoffice.integration.entities.enums.DocumentType;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class FileUtilityImpl implements FileUtility {
|
||||
private List<String> ExtsDocument = Arrays.asList(
|
||||
".doc", ".docx", ".docm",
|
||||
".dot", ".dotx", ".dotm",
|
||||
".odt", ".fodt", ".ott", ".rtf", ".txt",
|
||||
".html", ".htm", ".mht", ".xml",
|
||||
".pdf", ".djvu", ".fb2", ".epub", ".xps");
|
||||
|
||||
private List<String> ExtsSpreadsheet = Arrays.asList(
|
||||
".xls", ".xlsx", ".xlsm",
|
||||
".xlt", ".xltx", ".xltm",
|
||||
".ods", ".fods", ".ots", ".csv");
|
||||
|
||||
private List<String> ExtsPresentation = Arrays.asList(
|
||||
".pps", ".ppsx", ".ppsm",
|
||||
".ppt", ".pptx", ".pptm",
|
||||
".pot", ".potx", ".potm",
|
||||
".odp", ".fodp", ".otp");
|
||||
|
||||
public DocumentType getDocumentType(String fileName)
|
||||
{
|
||||
String ext = getFileExtension(fileName).toLowerCase();
|
||||
if (ExtsDocument.contains(ext))
|
||||
return DocumentType.word;
|
||||
|
||||
if (ExtsSpreadsheet.contains(ext))
|
||||
return DocumentType.cell;
|
||||
|
||||
if (ExtsPresentation.contains(ext))
|
||||
return DocumentType.slide;
|
||||
|
||||
return DocumentType.word;
|
||||
}
|
||||
|
||||
public String getFileName(String url)
|
||||
{
|
||||
if (url == null) return "";
|
||||
|
||||
String fileName = url.substring(url.lastIndexOf('/') + 1, url.length());
|
||||
fileName = fileName.split("\\?")[0];
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public String getFileNameWithoutExtension(String url)
|
||||
{
|
||||
String fileName = getFileName(url);
|
||||
if (fileName == null) return null;
|
||||
String fileNameWithoutExt = fileName.substring(0, fileName.lastIndexOf('.'));
|
||||
return fileNameWithoutExt;
|
||||
}
|
||||
|
||||
public String getFileExtension(String url)
|
||||
{
|
||||
String fileName = getFileName(url);
|
||||
if (fileName == null) return null;
|
||||
String fileExt = fileName.substring(fileName.lastIndexOf("."));
|
||||
return fileExt.toLowerCase();
|
||||
}
|
||||
|
||||
public String getInternalExtension(DocumentType type)
|
||||
{
|
||||
// .docx for word file type
|
||||
if (type.equals(DocumentType.word))
|
||||
return ".docx";
|
||||
|
||||
// .xlsx for cell file type
|
||||
if (type.equals(DocumentType.cell))
|
||||
return ".xlsx";
|
||||
|
||||
// .pptx for slide file type
|
||||
if (type.equals(DocumentType.slide))
|
||||
return ".pptx";
|
||||
|
||||
// the default file type is .docx
|
||||
return ".docx";
|
||||
}
|
||||
|
||||
public Path generateFilepath(String directory, String fullFileName){
|
||||
String fileName = getFileNameWithoutExtension(fullFileName);
|
||||
String fileExtension = getFileExtension(fullFileName);
|
||||
Path path = Paths.get(directory+fullFileName);
|
||||
|
||||
for(int i = 1; Files.exists(path); i++){
|
||||
fileName = getFileNameWithoutExtension(fullFileName) + "("+i+")";
|
||||
path = Paths.get(directory+fileName+fileExtension);
|
||||
}
|
||||
|
||||
path = Paths.get(directory+fileName+fileExtension);
|
||||
return path;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
package com.onlyoffice.integration.util.objects;
|
||||
|
||||
public class ConvertBody {
|
||||
private String url;
|
||||
private String outputtype;
|
||||
private String filetype;
|
||||
private String title;
|
||||
private String key;
|
||||
private String filePass;
|
||||
private Boolean async;
|
||||
private String token;
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getOutputtype() {
|
||||
return outputtype;
|
||||
}
|
||||
|
||||
public void setOutputtype(String outputtype) {
|
||||
this.outputtype = outputtype;
|
||||
}
|
||||
|
||||
public String getFiletype() {
|
||||
return filetype;
|
||||
}
|
||||
|
||||
public void setFiletype(String filetype) {
|
||||
this.filetype = filetype;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public Boolean getAsync() {
|
||||
return async;
|
||||
}
|
||||
|
||||
public void setAsync(Boolean async) {
|
||||
this.async = async;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public String getFilePass() {
|
||||
return filePass;
|
||||
}
|
||||
|
||||
public void setFilePass(String filePass) {
|
||||
this.filePass = filePass;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.onlyoffice.integration.util.serviceConverter;
|
||||
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.ParseException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
public interface ServiceConverter {
|
||||
public String getConvertedUri(String documentUri, String fromExtension,
|
||||
String toExtension, String documentRevisionId,
|
||||
String filePass, Boolean isAsync) throws Exception;
|
||||
public String generateRevisionId(String expectedKey);
|
||||
public String convertStreamToString(InputStream stream) throws IOException;
|
||||
public JSONObject convertStringToJSON(String jsonString) throws ParseException;
|
||||
}
|
||||
@ -0,0 +1,253 @@
|
||||
package com.onlyoffice.integration.util.serviceConverter;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.onlyoffice.integration.util.documentManagers.DocumentManager;
|
||||
import com.onlyoffice.integration.util.fileUtilities.FileUtility;
|
||||
import com.onlyoffice.integration.util.objects.ConvertBody;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
import org.json.simple.parser.ParseException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.io.*;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
@Component
|
||||
public class ServiceConverterImpl implements ServiceConverter
|
||||
{
|
||||
|
||||
@Autowired
|
||||
private DocumentManager documentManager;
|
||||
|
||||
@Autowired
|
||||
private FileUtility fileUtility;
|
||||
|
||||
private int convertTimeout = 120000;
|
||||
|
||||
@Value("${files.docservice.header}")
|
||||
private String documentJwtHeader;
|
||||
|
||||
@Value("${files.docservice.url.site}")
|
||||
private String docServiceUrl;
|
||||
|
||||
@Value("${files.docservice.url.converter}")
|
||||
private String docServiceUrlConverter;
|
||||
|
||||
@Value("${files.docservice.timeout}")
|
||||
private String docserviceTimeout;
|
||||
|
||||
|
||||
@PostConstruct
|
||||
public void init(){
|
||||
int timeout = Integer.parseInt(docserviceTimeout);
|
||||
if(timeout > 0) convertTimeout = timeout;
|
||||
}
|
||||
|
||||
private String postToServer(ConvertBody body, String headerToken){
|
||||
Gson gson = new Gson();
|
||||
String bodyString = gson.toJson(body);
|
||||
URL url = null;
|
||||
java.net.HttpURLConnection connection = null;
|
||||
InputStream response = null;
|
||||
String jsonString = null;
|
||||
|
||||
byte[] bodyByte = bodyString.getBytes(StandardCharsets.UTF_8);
|
||||
try{
|
||||
url = new URL(docServiceUrl+docServiceUrlConverter);
|
||||
connection = (java.net.HttpURLConnection) url.openConnection();
|
||||
connection.setRequestMethod("POST");
|
||||
connection.setDoOutput(true);
|
||||
connection.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
|
||||
connection.setFixedLengthStreamingMode(bodyByte.length);
|
||||
connection.setRequestProperty("Accept", "application/json");
|
||||
connection.setConnectTimeout(convertTimeout);
|
||||
|
||||
if (documentManager.tokenEnabled())
|
||||
{
|
||||
connection.setRequestProperty(documentJwtHeader.equals("") ?
|
||||
"Authorization" : documentJwtHeader, "Bearer " + headerToken);
|
||||
}
|
||||
|
||||
connection.connect();
|
||||
try (OutputStream os = connection.getOutputStream()) {
|
||||
os.write(bodyByte);
|
||||
os.flush(); //
|
||||
}
|
||||
|
||||
response = connection.getInputStream();
|
||||
jsonString = convertStreamToString(response);
|
||||
} catch (java.io.IOException e){
|
||||
System.out.println(e);
|
||||
} finally {
|
||||
connection.disconnect();
|
||||
return jsonString;
|
||||
}
|
||||
}
|
||||
|
||||
public String getConvertedUri(String documentUri, String fromExtension,
|
||||
String toExtension, String documentRevisionId,
|
||||
String filePass, Boolean isAsync) throws Exception
|
||||
{
|
||||
fromExtension = fromExtension == null || fromExtension.isEmpty() ?
|
||||
fileUtility.getFileExtension(documentUri) : fromExtension;
|
||||
|
||||
// check if the file name parameter is defined; if not, get random uuid for this file
|
||||
String title = fileUtility.getFileName(documentUri);
|
||||
title = title == null || title.isEmpty() ? UUID.randomUUID().toString() : title;
|
||||
|
||||
documentRevisionId = documentRevisionId == null || documentRevisionId.isEmpty() ? documentUri : documentRevisionId;
|
||||
|
||||
documentRevisionId = generateRevisionId(documentRevisionId); // create document token
|
||||
|
||||
// write all the necessary parameters to the body object
|
||||
ConvertBody body = new ConvertBody();
|
||||
body.setUrl(documentUri);
|
||||
body.setOutputtype(toExtension.replace(".", ""));
|
||||
body.setFiletype(fromExtension.replace(".", ""));
|
||||
body.setTitle(title);
|
||||
body.setKey(documentRevisionId);
|
||||
body.setFilePass(filePass);
|
||||
if (isAsync)
|
||||
body.setAsync(true);
|
||||
|
||||
String headerToken = "";
|
||||
if (documentManager.tokenEnabled())
|
||||
{
|
||||
HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("url", body.getUrl());
|
||||
map.put("outputtype", body.getOutputtype());
|
||||
map.put("filetype", body.getFiletype());
|
||||
map.put("title", body.getTitle());
|
||||
map.put("key", body.getKey());
|
||||
map.put("password", body.getFilePass());
|
||||
if (isAsync)
|
||||
map.put("async", body.getAsync());
|
||||
|
||||
// add token to the body if it is enabled
|
||||
String token = documentManager.createToken(map);
|
||||
body.setToken(token);
|
||||
|
||||
Map<String, Object> payloadMap = new HashMap<String, Object>();
|
||||
payloadMap.put("payload", map); // create payload object
|
||||
headerToken = documentManager.createToken(payloadMap); // create header token
|
||||
}
|
||||
|
||||
String jsonString = postToServer(body, headerToken);
|
||||
|
||||
return getResponseUri(jsonString);
|
||||
}
|
||||
|
||||
public String generateRevisionId(String expectedKey)
|
||||
{
|
||||
if (expectedKey.length() > 20)
|
||||
expectedKey = Integer.toString(expectedKey.hashCode());
|
||||
|
||||
String key = expectedKey.replace("[^0-9-.a-zA-Z_=]", "_");
|
||||
|
||||
return key.substring(0, Math.min(key.length(), 20));
|
||||
}
|
||||
|
||||
private void processConvertServiceResponceError(int errorCode) throws Exception
|
||||
{
|
||||
String errorMessage = "";
|
||||
String errorMessageTemplate = "Error occurred in the ConvertService: ";
|
||||
|
||||
switch (errorCode)
|
||||
{
|
||||
case -8:
|
||||
errorMessage = errorMessageTemplate + "Error document VKey";
|
||||
break;
|
||||
case -7:
|
||||
errorMessage = errorMessageTemplate + "Error document request";
|
||||
break;
|
||||
case -6:
|
||||
errorMessage = errorMessageTemplate + "Error database";
|
||||
break;
|
||||
case -5:
|
||||
errorMessage = errorMessageTemplate + "Error unexpected guid";
|
||||
break;
|
||||
case -4:
|
||||
errorMessage = errorMessageTemplate + "Error download error";
|
||||
break;
|
||||
case -3:
|
||||
errorMessage = errorMessageTemplate + "Error convertation error";
|
||||
break;
|
||||
case -2:
|
||||
errorMessage = errorMessageTemplate + "Error convertation timeout";
|
||||
break;
|
||||
case -1:
|
||||
errorMessage = errorMessageTemplate + "Error convertation unknown";
|
||||
break;
|
||||
case 0:
|
||||
break;
|
||||
default:
|
||||
errorMessage = "ErrorCode = " + errorCode;
|
||||
break;
|
||||
}
|
||||
|
||||
throw new Exception(errorMessage);
|
||||
}
|
||||
|
||||
private String getResponseUri(String jsonString) throws Exception
|
||||
{
|
||||
JSONObject jsonObj = convertStringToJSON(jsonString);
|
||||
|
||||
Object error = jsonObj.get("error");
|
||||
if (error != null)
|
||||
processConvertServiceResponceError(Math.toIntExact((long)error));
|
||||
|
||||
Boolean isEndConvert = (Boolean) jsonObj.get("endConvert");
|
||||
|
||||
Long resultPercent = 0l;
|
||||
String responseUri = null;
|
||||
|
||||
if (isEndConvert)
|
||||
{
|
||||
resultPercent = 100l;
|
||||
responseUri = (String) jsonObj.get("fileUrl");
|
||||
}
|
||||
else
|
||||
{
|
||||
resultPercent = (Long) jsonObj.get("percent");
|
||||
resultPercent = resultPercent >= 100l ? 99l : resultPercent;
|
||||
}
|
||||
|
||||
return resultPercent >= 100l ? responseUri : "";
|
||||
}
|
||||
|
||||
public String convertStreamToString(InputStream stream) throws IOException
|
||||
{
|
||||
if (stream == null)
|
||||
throw new IOException("The stream is empty");
|
||||
InputStreamReader inputStreamReader = new InputStreamReader(stream);
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
|
||||
String line = bufferedReader.readLine();
|
||||
|
||||
while (line != null)
|
||||
{
|
||||
stringBuilder.append(line);
|
||||
line = bufferedReader.readLine();
|
||||
}
|
||||
|
||||
String result = stringBuilder.toString();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public JSONObject convertStringToJSON(String jsonString) throws ParseException
|
||||
{
|
||||
JSONParser parser = new JSONParser();
|
||||
Object obj = parser.parse(jsonString);
|
||||
JSONObject jsonObj = (JSONObject) obj;
|
||||
|
||||
return jsonObj;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
server.address=172.17.0.1
|
||||
server.port=4000
|
||||
|
||||
filesize-max=5242880
|
||||
storage-folder=documents
|
||||
|
||||
files.docservice.viewed-docs=.pdf|.djvu|.xps
|
||||
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.history.postfix=-hist
|
||||
|
||||
files.docservice.url.site=http://172.17.0.1:80/
|
||||
files.docservice.url.converter=ConvertService.ashx
|
||||
files.docservice.url.command=coauthoring/CommandService.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.example=
|
||||
|
||||
files.docservice.secret=
|
||||
files.docservice.header=Authorization
|
||||
|
||||
spring.datasource.url=jdbc:h2:mem:usersdb
|
||||
spring.datasource.driverClassName=org.h2.Driver
|
||||
spring.datasource.username=sa
|
||||
spring.datasource.password=password
|
||||
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
|
||||
hibernate.ddl-auto
|
||||
spring.h2.console.enabled=true
|
||||
spring.h2.console.path=/h2
|
||||
|
||||
url.index=/
|
||||
url.converter=/converter
|
||||
url.editor=/editor
|
||||
url.track=/track
|
||||
url.download=/download
|
||||
|
||||
logo.image=
|
||||
logo.imageEmbedded=
|
||||
logo.url=https://www.onlyoffice.com
|
||||
@ -0,0 +1,44 @@
|
||||
/**
|
||||
*
|
||||
* (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.
|
||||
*
|
||||
*/
|
||||
|
||||
html {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
background: #fff;
|
||||
color: #333;
|
||||
font-family: Arial, Tahoma,sans-serif;
|
||||
font-size: 12px;
|
||||
font-weight: normal;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
overflow-y: hidden;
|
||||
padding: 0;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.form {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
div {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
@ -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="3" y="11" width="4" height="1" fill="#444444"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M2 13V10H10V8H1C0.447715 8 0 8.44772 0 9V14C0 14.5523 0.447715 15 1 15H10V13H2Z" fill="#444444"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M23.5243 10.5534L22.2366 10.3386C22.143 9.95592 22.0065 9.59014 21.8288 9.24897L22.6532 8.22679C22.8285 8.01077 22.8205 7.69994 22.6357 7.49145L22.1235 6.91502C21.9379 6.70675 21.63 6.6627 21.3952 6.81106L20.2939 7.50337C19.8095 7.16494 19.2608 6.91502 18.6689 6.77L18.4535 5.4753C18.4083 5.20115 18.171 5 17.8926 5H17.1207C16.8428 5 16.6048 5.20115 16.5606 5.4753L16.344 6.77041C15.8546 6.89023 15.3958 7.08363 14.9771 7.33835L13.9297 6.59088C13.704 6.42961 13.394 6.45483 13.197 6.65139L12.6517 7.19707C12.4552 7.39406 12.4299 7.7041 12.5916 7.92983L13.3408 8.97921C13.0885 9.39477 12.8971 9.85099 12.7773 10.336L11.4753 10.5534C11.2015 10.5986 11 10.8359 11 11.1144V11.8856C11 12.1641 11.2015 12.4014 11.4753 12.4466L12.7773 12.664C12.8757 13.0631 13.0185 13.4444 13.2083 13.7978L12.3877 14.8142C12.213 15.0301 12.2203 15.3411 12.4051 15.5494L12.9169 16.1258C13.1026 16.3345 13.4106 16.3778 13.6455 16.2298L14.7626 15.528C15.2353 15.8513 15.7701 16.0889 16.344 16.2298L16.5606 17.5247C16.6048 17.7988 16.8428 18 17.1207 18H17.8926C18.171 18 18.4083 17.7989 18.4535 17.5247L18.6693 16.2298C19.1525 16.1116 19.6055 15.9215 20.0205 15.6712L21.1115 16.4504C21.3368 16.6122 21.6471 16.5868 21.8439 16.3897L22.3894 15.8442C22.5857 15.6478 22.6123 15.3379 22.4492 15.1118L21.6725 14.0227C21.9255 13.6058 22.118 13.1487 22.237 12.6616L23.5248 12.4465C23.7993 12.4013 24 12.1641 24 11.8856V11.1143C23.9996 10.8359 23.7989 10.5986 23.5243 10.5534ZM17.5204 13.9375C16.1745 13.9375 15.0829 12.8457 15.0829 11.5C15.0829 10.1541 16.1745 9.0625 17.5204 9.0625C18.866 9.0625 19.9578 10.1541 19.9578 11.5C19.9578 12.8457 18.866 13.9375 17.5204 13.9375Z" fill="#444444"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 8.2 KiB |
@ -0,0 +1,3 @@
|
||||
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.294404 0.294466C-0.0961199 0.68499 -0.0998005 1.32183 0.290724 1.71236L5.57837 7L5.57841 7.00005L0.29081 12.2877C-0.0997145 12.6782 -0.0960336 13.315 0.294491 13.7055C0.685015 14.0961 1.32186 14.0997 1.71238 13.7092L6.99999 8.42162L12.2876 13.7092C12.6781 14.0997 13.315 14.0961 13.7055 13.7055C14.096 13.315 14.0997 12.6782 13.7092 12.2877L8.42156 7.00005L8.42161 7L13.7093 1.71236C14.0998 1.32183 14.0961 0.68499 13.7056 0.294466C13.315 -0.0960591 12.6782 -0.0997395 12.2877 0.290785L7.00003 5.57843L6.99999 5.57847L6.99994 5.57843L1.7123 0.290785C1.32177 -0.0997395 0.684928 -0.0960591 0.294404 0.294466Z" fill="#AAAAAA"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 781 B |
@ -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="M5 6C4.44772 6 4 6.44772 4 7V16.4074C4 16.9597 4.44772 17.4074 5 17.4074H6.72783C7.02679 17.4074 7.31006 17.5412 7.50002 17.772L8.56115 19.0616C8.96117 19.5477 9.7055 19.5477 10.1055 19.0616L11.1667 17.772C11.3566 17.5412 11.6399 17.4074 11.9388 17.4074H19C19.5523 17.4074 20 16.9597 20 16.4074V7C20 6.44772 19.5523 6 19 6H5ZM17 9H7V10H17V9ZM17 11H7V12H17V11ZM7 13H15V14H7V13Z" fill="#444444"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 547 B |
@ -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="M18 18.0001L17.9952 16.401L13.5964 12.0025L17.9998 7.59937L17.9998 6L16.4004 6.00008L11.997 10.4032L7.59925 6.00568L5.99999 6.00013L5.99988 7.60497L10.3977 12.0025L6.00447 16.3954L6.00001 18.0001L7.60384 17.9947L11.997 13.6018L16.3958 18.0003L18 18.0001Z" fill="#444444"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 425 B |
@ -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 |
@ -0,0 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M10.3765 15.128C9.98789 15.5187 9.35642 15.5214 8.96449 15.134L6.14517 12.3473C5.75561 11.9622 5.12876 11.9622 4.7392 12.3473L4.72038 12.3659C4.32403 12.7576 4.32441 13.3978 4.72124 13.7891L8.96526 17.974C9.35702 18.3603 9.98726 18.3576 10.3757 17.9679L20.2877 8.02323C20.6801 7.6296 20.67 6.9855 20.2729 6.59668C19.8804 6.21243 19.2454 6.21063 18.8581 6.60005L10.3765 15.128Z" fill="#8BB825"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 507 B |
@ -0,0 +1,4 @@
|
||||
<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="M6 16V13H7.2V11H5C4.44772 11 4 11.4477 4 12V17C4 17.5523 4.44772 18 5 18H19C19.5523 18 20 17.5523 20 17V12C20 11.4477 19.5523 11 19 11H16.8V13H18V16H6Z" fill="#444444"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.9996 8.5L15.2025 8.5C15.7911 8.5 16 8.49063 16 8.75503C16 8.94763 15.8986 9.29489 15.6987 9.4874L12.6667 12.6478C12.179 13.1174 11.821 13.1174 11.3333 12.6478L8.30133 9.4874C8.10142 9.29489 8 8.94763 8 8.75503C8 8.49056 8.20889 8.5 8.79749 8.5C8.79749 8.5 9.4909 8.5 9.99708 8.5C9.99708 8.28638 9.99708 5 9.99708 5L13.9996 5C13.9996 5 13.9996 8.29916 13.9996 8.5Z" fill="#444444"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 757 B |
@ -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 |
@ -0,0 +1,3 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.99857 1.6C4.46508 1.6 1.6 4.46548 1.6 8.00029C1.6 9.70508 2.26458 11.2515 3.35202 12.3999C4.52033 13.6337 6.16874 14.4 7.99857 14.4C11.5348 14.4 14.4 11.5335 14.4 8.00029C14.4 4.46592 11.5348 1.6 7.99857 1.6ZM0 8.00029C0 3.58219 3.58105 0 7.99857 0C12.4184 0 16 3.58219 16 8.00029C16 12.4172 12.4184 16 7.99857 16C5.71117 16 3.64805 15.0395 2.19023 13.5C0.83265 12.0663 0 10.1304 0 8.00029ZM7 4H9V9H7V4ZM9 10H7V12H9V10Z" fill="#CB0000"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 593 B |
@ -0,0 +1,8 @@
|
||||
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 3C0 1.34315 1.34315 0 3 0H21.674C22.4697 0 23.2327 0.316071 23.7953 0.87868L29.1213 6.20465C29.6839 6.76726 30 7.53032 30 8.32597V37C30 38.6569 28.6569 40 27 40H3C1.34315 40 0 38.6569 0 37V3Z" fill="#3779A6"/>
|
||||
<path d="M22.9167 0L30.0001 7.08333H25.9167C24.2599 7.08333 22.9167 5.74019 22.9167 4.08333V0Z" fill="#1D5880"/>
|
||||
<path d="M6.17627 14.7059H23.8233V15.8823H6.17627V14.7059Z" fill="white"/>
|
||||
<path d="M6.17627 18.5294H23.8233V19.7059H6.17627V18.5294Z" fill="white"/>
|
||||
<path d="M6.17627 22.3529H23.8233V23.5294H6.17627V22.3529Z" fill="white"/>
|
||||
<path d="M6.17627 26.1765H23.8233V27.3529H6.17627V26.1765Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 738 B |
@ -0,0 +1,8 @@
|
||||
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 3C0 1.34315 1.34315 0 3 0H22.9167L30 7.08333V37C30 38.6569 28.6569 40 27 40H3C1.34315 40 0 38.6569 0 37V3Z" fill="#F36700"/>
|
||||
<path d="M22.9167 0L30.0001 7.08333H25.9168C24.2599 7.08333 22.9167 5.74019 22.9167 4.08333V0Z" fill="#AB531F"/>
|
||||
<path d="M6.17627 16.1275H23.8233V17.3039H6.17627V16.1275Z" fill="white"/>
|
||||
<path d="M6.17627 28.7745L6.17627 16.1275L7.35274 16.1275L7.35274 28.7745H6.17627Z" fill="white"/>
|
||||
<path d="M23.8233 16.1275V28.7745H22.6469V16.1275L23.8233 16.1275Z" fill="white"/>
|
||||
<path d="M6.17627 27.598H23.8233V28.7745H6.17627L6.17627 27.598Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 691 B |
@ -0,0 +1,6 @@
|
||||
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M30 7.44186L22 0H3C1.22739 0 0 0.822551 0 2.32558V37.2093C0 38.7123 1.22739 40 3 40H27C28.7726 40 30 38.7123 30 37.2093V7.44186Z" fill="#D0D5DA"/>
|
||||
<path d="M24.1042 7.27273H29.9631L22 0V5.32334C22 6.4105 22.949 7.27273 24.1042 7.27273Z" fill="#646464"/>
|
||||
<path d="M16.9562 22.3485H12.9746V17.803H10.9839L14.9654 14.1667L18.947 17.803H16.9562V22.3485Z" fill="#646464"/>
|
||||
<path d="M20.9378 23.7121C20.9378 24.1666 20.4401 24.6212 19.9424 24.6212H9.98848C9.49078 24.6212 8.99309 24.1666 8.99309 23.7121V22.3485C8.99309 21.8939 9.49078 21.4394 9.98848 21.4394H10.9839V20.0757H9.49078C8.49539 20.0757 7.5 20.9848 7.5 21.8939V24.1666C7.5 25.0757 8.61982 25.9848 9.49078 25.9848H20.4401C21.3111 25.9848 22.4309 25.0757 22.4309 24.1666V21.8939C22.4309 20.9848 21.4355 20.0757 20.4401 20.0757H18.947V21.4394H19.9424C20.4401 21.4394 20.9378 21.8939 20.9378 22.3485V23.7121Z" fill="#646464"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 992 B |
@ -0,0 +1,12 @@
|
||||
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 3C0 1.34315 1.34315 0 3 0H22.9167L30 7.08333V37C30 38.6569 28.6569 40 27 40H3C1.34315 40 0 38.6569 0 37V3Z" fill="#78A73B"/>
|
||||
<path d="M22.9167 0L30.0001 7.08333H25.9168C24.2599 7.08333 22.9167 5.74019 22.9167 4.08333V0Z" fill="#5A7D2B"/>
|
||||
<path d="M6.17644 15.2941H23.8235V16.4706H6.17644V15.2941Z" fill="white"/>
|
||||
<path d="M6.17644 19.1177H23.8235V20.2941H6.17644V19.1177Z" fill="white"/>
|
||||
<path d="M6.17644 22.9412H23.8235V24.1177H6.17644V22.9412Z" fill="white"/>
|
||||
<path d="M6.17644 26.7647H23.8235V27.9412H6.17644V26.7647Z" fill="white"/>
|
||||
<path d="M5.88232 27.9412L5.88232 15.2941L7.0588 15.2941L7.0588 27.9412H5.88232Z" fill="white"/>
|
||||
<path d="M11.4706 27.9412L11.4706 15.2941L12.647 15.2941V27.9412H11.4706Z" fill="white"/>
|
||||
<path d="M17.0588 27.9412L17.0588 15.2941L18.2353 15.2941V27.9412H17.0588Z" fill="white"/>
|
||||
<path d="M22.647 27.9412V15.2941H23.8235V27.9412H22.647Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1004 B |
@ -0,0 +1,4 @@
|
||||
<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="M6 16V13H7V11H5C4.44772 11 4 11.4477 4 12V17C4 17.5523 4.44772 18 5 18H19C19.5523 18 20 17.5523 20 17V12C20 11.4477 19.5523 11 19 11H17V13H18V16H6Z" fill="#444444"/>
|
||||
<path d="M11 15H9V13L16 6H17V7H18V8L11 15Z" fill="#444444"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 379 B |
@ -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="M10.4 10.4L4 4H20L13.6 10.4V17.8667V21.0667L10.4 17.8667V10.4Z" fill="#444444"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 233 B |
@ -0,0 +1,12 @@
|
||||
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M2.84616 1H10.8462L14.8462 5V15H2.84616V1Z" fill="white"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.8462 5L10.8462 1H2.84616V15H14.8462V5ZM10.8462 0L15.8462 5V16H1.84616V0H10.8462Z" fill="#BFBFBF"/>
|
||||
<rect x="3.84616" y="10" width="10" height="4" fill="#3779A6"/>
|
||||
<path d="M3.84616 4H4.84616V5H3.84616V4Z" fill="#BFBFBF"/>
|
||||
<path d="M3.84616 6H4.84616V7H3.84616V6Z" fill="#BFBFBF"/>
|
||||
<path d="M4.84616 8H3.84616V9H4.84616V8Z" fill="#BFBFBF"/>
|
||||
<path d="M12.8462 8H5.84616V9H12.8462V8Z" fill="#BFBFBF"/>
|
||||
<path d="M7.84616 6H5.84616V7H7.84616V6Z" fill="#BFBFBF"/>
|
||||
<path d="M12.8462 4H5.84616V5H12.8462V4Z" fill="#BFBFBF"/>
|
||||
<path opacity="0.3" d="M9.84616 1H10.8462V4H14.8462L15.8462 5H9.84616V1Z" fill="#333333"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 832 B |
@ -0,0 +1,12 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M2 1H10L14 5V15H2V1Z" fill="white"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M14 5L10 1H2V15H14V5ZM10 0L15 5V16H1V0H10Z" fill="#BFBFBF"/>
|
||||
<rect x="3" y="10" width="10" height="4" fill="#F36700"/>
|
||||
<path d="M3 4H4V5H3V4Z" fill="#BFBFBF"/>
|
||||
<path d="M3 6H4V7H3V6Z" fill="#BFBFBF"/>
|
||||
<path d="M4 8H3V9H4V8Z" fill="#BFBFBF"/>
|
||||
<path d="M12 8H5V9H12V8Z" fill="#BFBFBF"/>
|
||||
<path d="M7 6H5V7H7V6Z" fill="#BFBFBF"/>
|
||||
<path d="M12 4H5V5H12V4Z" fill="#BFBFBF"/>
|
||||
<path opacity="0.3" d="M9 1H10V4H14L15 5H9V1Z" fill="#333333"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 631 B |
@ -0,0 +1,12 @@
|
||||
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M2.84592 1H10.8459L14.8459 5V15H2.84592V1Z" fill="white"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.8459 5L10.8459 1H2.84592V15H14.8459V5ZM10.8459 0L15.8459 5V16H1.84592V0H10.8459Z" fill="#BFBFBF"/>
|
||||
<rect x="3.84592" y="10" width="10" height="4" fill="#78A73B"/>
|
||||
<path d="M3.84592 4H4.84592V5H3.84592V4Z" fill="#BFBFBF"/>
|
||||
<path d="M3.84592 6H4.84592V7H3.84592V6Z" fill="#BFBFBF"/>
|
||||
<path d="M4.84592 8H3.84592V9H4.84592V8Z" fill="#BFBFBF"/>
|
||||
<path d="M12.8459 8H5.84592V9H12.8459V8Z" fill="#BFBFBF"/>
|
||||
<path d="M7.84592 6H5.84592V7H7.84592V6Z" fill="#BFBFBF"/>
|
||||
<path d="M12.8459 4H5.84592V5H12.8459V4Z" fill="#BFBFBF"/>
|
||||
<path opacity="0.3" d="M9.84592 1H10.8459V4H14.8459L15.8459 5H9.84592V1Z" fill="#333333"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 832 B |
@ -0,0 +1,3 @@
|
||||
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M6 12C9.31371 12 12 9.31371 12 6C12 2.68629 9.31371 0 6 0C2.68629 0 0 2.68629 0 6C0 9.31371 2.68629 12 6 12ZM5 6C5 5.44772 5.44772 5 6 5C6.55228 5 7 5.44772 7 6V9C7 9.55229 6.55228 10 6 10C5.44772 10 5 9.55229 5 9V6ZM6 2C5.44772 2 5 2.44772 5 3C5 3.55228 5.44772 4 6 4C6.55228 4 7 3.55228 7 3C7 2.44772 6.55228 2 6 2Z" fill="#D0D5DA"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 488 B |
|
After Width: | Height: | Size: 673 B |
|
After Width: | Height: | Size: 2.0 KiB |
@ -0,0 +1,15 @@
|
||||
<svg width="153" height="28" viewBox="0 0 153 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.3403 27.6567L0.801116 21.8897C-0.267039 21.3862 -0.267039 20.6081 0.801116 20.1504L5.16662 18.1365L13.2939 21.8897C14.362 22.3932 16.0804 22.3932 17.1021 21.8897L25.2294 18.1365L29.5949 20.1504C30.663 20.6539 30.663 21.432 29.5949 21.8897L17.0556 27.6567C16.0804 28.1144 14.362 28.1144 13.3403 27.6567Z" fill="#FF6F3D"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.3403 20.5623L0.801116 14.7953C-0.267039 14.2918 -0.267039 13.5137 0.801116 13.056L5.07373 11.0879L13.3403 14.8868C14.4085 15.3903 16.1268 15.3903 17.1485 14.8868L25.4151 11.0879L29.6877 13.056C30.7559 13.5595 30.7559 14.3376 29.6877 14.7953L17.1485 20.5623C16.0804 21.0658 14.362 21.0658 13.3403 20.5623Z" fill="#95C038"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.3403 13.651L0.801116 7.88393C-0.267039 7.38045 -0.267039 6.60236 0.801116 6.14466L13.3403 0.377605C14.4085 -0.125868 16.1268 -0.125868 17.1485 0.377605L29.6877 6.14466C30.7559 6.64813 30.7559 7.42622 29.6877 7.88393L17.1485 13.651C16.0804 14.1087 14.362 14.1087 13.3403 13.651Z" fill="#5DC0E8"/>
|
||||
<path d="M38.1528 13.9433C38.1528 11.5581 38.8442 9.75803 40.2731 8.58797C41.6559 7.3729 43.3152 6.78787 45.2051 6.78787C47.0949 6.78787 48.7081 7.3729 50.0909 8.58797C51.4737 9.80304 52.1651 11.5581 52.1651 13.9883C52.1651 16.3734 51.4737 18.1735 50.0909 19.3436C48.7081 20.5586 47.0488 21.1437 45.2051 21.1437C43.3152 21.1437 41.702 20.5586 40.2731 19.3436C38.8442 18.1285 38.1528 16.3284 38.1528 13.9433ZM41.195 13.9433C41.195 15.6084 41.5176 16.7784 42.1168 17.5435C42.7621 18.3085 43.4535 18.8035 44.191 18.9835C44.3754 19.0285 44.5137 19.0735 44.698 19.0735C44.8363 19.0735 45.0207 19.1185 45.159 19.1185C45.3433 19.1185 45.4816 19.1185 45.666 19.0735C45.8504 19.0735 45.9886 19.0285 46.173 18.9835C46.9105 18.8035 47.6019 18.3085 48.2011 17.5435C48.8003 16.7784 49.123 15.5633 49.123 13.9883C49.123 12.3682 48.8003 11.1981 48.2011 10.4331C47.6019 9.66803 46.9105 9.173 46.173 8.99299C45.9886 8.94799 45.8043 8.90299 45.666 8.90299C45.4816 8.90299 45.3433 8.85798 45.159 8.85798C44.9746 8.85798 44.8363 8.85798 44.698 8.90299C44.5598 8.90299 44.3754 8.94799 44.191 8.99299C43.4535 9.173 42.7621 9.66803 42.1168 10.4331C41.5176 11.1081 41.195 12.3232 41.195 13.9433Z" fill="white"/>
|
||||
<path d="M53.6863 6.92288H57.4659L62.444 15.7434L63.1814 17.6785H63.2275L63.1814 15.1583V6.92288H66.0853V20.9636H62.3057L57.3276 11.7831L56.5901 10.2081H56.544L56.5901 12.6832V20.9636H53.6863V6.92288Z" fill="white"/>
|
||||
<path d="M69.0813 6.92288H71.9852V18.5785H77.7007V20.9636H69.0813V6.92288Z" fill="white"/>
|
||||
<path d="M75.9031 6.92288H79.2679L82.2178 11.8281L82.6787 12.8182H82.7709L83.2319 11.8281L86.2279 6.92288H89.3161L84.1076 15.2483V20.9636H81.2038V15.2033L75.9031 6.92288Z" fill="white"/>
|
||||
<path d="M88.9473 13.9433C88.9473 11.5581 89.6387 9.75803 91.0675 8.58797C92.4503 7.3729 94.1097 6.78787 95.9995 6.78787C97.8893 6.78787 99.5026 7.3729 100.885 8.58797C102.268 9.80304 102.96 11.5581 102.96 13.9883C102.96 16.3734 102.268 18.1735 100.885 19.3436C99.5026 20.5586 97.8432 21.1437 95.9995 21.1437C94.1097 21.1437 92.4964 20.5586 91.0675 19.3436C89.6848 18.1285 88.9473 16.3284 88.9473 13.9433ZM91.9894 13.9433C91.9894 15.6084 92.3121 16.7784 92.9113 17.5435C93.5566 18.3085 94.2019 18.8035 94.9855 18.9835C95.1698 19.0285 95.3081 19.0735 95.4925 19.0735C95.6308 19.0735 95.8151 19.1185 95.9534 19.1185C96.1378 19.1185 96.2761 19.1185 96.4604 19.0735C96.6448 19.0735 96.7831 19.0285 96.9675 18.9835C97.7049 18.8035 98.3963 18.3085 98.9955 17.5435C99.5948 16.7784 99.9174 15.5633 99.9174 13.9883C99.9174 12.3682 99.5948 11.1981 98.9955 10.4331C98.3963 9.66803 97.7049 9.173 96.9675 8.99299C96.7831 8.94799 96.5987 8.90299 96.4604 8.90299C96.2761 8.90299 96.1378 8.85798 95.9534 8.85798C95.769 8.85798 95.6308 8.85798 95.4925 8.90299C95.3542 8.90299 95.1698 8.94799 94.9855 8.99299C94.248 9.173 93.5566 9.66803 92.9113 10.4331C92.3121 11.1081 91.9894 12.3232 91.9894 13.9433Z" fill="white"/>
|
||||
<path d="M104.988 6.92288H113.008V9.26301H107.891V12.6832H112.777V15.0683H107.891V20.9636H104.988V6.92288Z" fill="white"/>
|
||||
<path d="M115.174 6.92288H123.195V9.26301H118.078V12.6832H122.964V15.0683H118.078V20.9636H115.174V6.92288Z" fill="white"/>
|
||||
<path d="M124.9 20.9636V6.92288H127.804V20.9636H124.9Z" fill="white"/>
|
||||
<path d="M140.599 7.2378V9.66793C140.092 9.48792 139.585 9.35291 139.032 9.26291C138.478 9.1729 137.833 9.1279 137.188 9.1279C135.667 9.1279 134.515 9.57792 133.685 10.523C132.855 11.423 132.44 12.5931 132.44 13.9882C132.44 15.3382 132.809 16.4633 133.593 17.3633C134.376 18.2634 135.482 18.7584 136.911 18.7584C137.418 18.7584 137.925 18.7134 138.525 18.6684C139.124 18.5784 139.723 18.4434 140.368 18.1734L140.553 20.5585C140.46 20.6035 140.322 20.6485 140.184 20.6935C140 20.7385 139.815 20.7835 139.585 20.8285C139.216 20.9185 138.755 20.9635 138.202 21.0535C137.649 21.0985 137.096 21.1436 136.497 21.1436C136.404 21.1436 136.312 21.1436 136.266 21.1436C136.174 21.1436 136.082 21.1436 136.036 21.1436C134.376 21.0535 132.855 20.4235 131.472 19.3435C130.09 18.2184 129.398 16.4633 129.398 14.1232C129.398 11.828 130.09 10.0279 131.426 8.76788C132.763 7.50781 134.607 6.87778 136.865 6.87778C137.464 6.87778 138.018 6.87778 138.478 6.92278C138.986 6.96778 139.446 7.05779 139.953 7.14779C140.046 7.19279 140.184 7.19279 140.276 7.2378C140.368 7.19279 140.46 7.2378 140.599 7.2378Z" fill="white"/>
|
||||
<path d="M142.903 6.92294H151.523V9.12806H145.853V12.6383H150.97V14.7984H145.853V18.7586H151.523V20.9637H142.903V6.92294Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.5 KiB |
@ -0,0 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M8 3C6.89543 3 6 3.89543 6 5V19C6 20.1046 6.89543 21 8 21H16C17.1046 21 18 20.1046 18 19V5C18 3.89543 17.1046 3 16 3H8ZM16.8462 6H7.15385V18H16.8462V6ZM10.3846 4H13.6154V5H10.3846V4ZM12 20C12.2974 20 12.5385 19.7761 12.5385 19.5C12.5385 19.2239 12.2974 19 12 19C11.7026 19 11.4615 19.2239 11.4615 19.5C11.4615 19.7761 11.7026 20 12 20Z" fill="#444444"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 506 B |
@ -0,0 +1,5 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g opacity="0.3">
|
||||
<path d="M10.3826 15.3872C9.9926 15.7862 9.35162 15.7889 8.95828 15.3933L6.15133 12.5701C5.76034 12.1768 5.12403 12.1768 4.73304 12.5701L4.70185 12.6015C4.31371 12.9918 4.31409 13.6225 4.7027 14.0124L8.95904 18.2831C9.35223 18.6776 9.99196 18.6749 10.3817 18.277L20.3062 8.14519C20.6903 7.75301 20.6865 7.12447 20.2976 6.73701L20.273 6.71257C19.8791 6.32014 19.2408 6.32437 18.8521 6.722L10.3826 15.3872Z" fill="#444444"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 549 B |
@ -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="M6 5C5.44772 5 5 5.44772 5 6V18C5 18.5523 5.44772 19 6 19H17C17.5523 19 18 18.5523 18 18V13.4142L14.4142 17H11V15H8V14H11V13.5858L11.5858 13H8V12H12.5858L13.5858 11H8V10H14.5858L18 6.58579V6C18 5.44772 17.5523 5 17 5H6ZM8 8H15V9H8V8ZM12 16H14L21 9V8H20V7H19L12 14V16Z" fill="#444444"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 438 B |
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 8.2 KiB |
464
web/documentserver-example/java-spring/src/main/resources/static/css/jquery-ui.css
vendored
Executable file
@ -0,0 +1,464 @@
|
||||
/*! jQuery UI - v1.9.2 - 2012-11-23
|
||||
* http://jqueryui.com
|
||||
* Includes: jquery.ui.core.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css, jquery.ui.theme.css
|
||||
* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
|
||||
|
||||
/* Layout helpers
|
||||
----------------------------------*/
|
||||
.ui-helper-hidden { display: none; }
|
||||
.ui-helper-hidden-accessible { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
|
||||
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
|
||||
.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
|
||||
.ui-helper-clearfix:after { clear: both; }
|
||||
.ui-helper-clearfix { zoom: 1; }
|
||||
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
|
||||
|
||||
|
||||
/* Interaction Cues
|
||||
----------------------------------*/
|
||||
.ui-state-disabled { cursor: default !important; }
|
||||
|
||||
|
||||
/* Icons
|
||||
----------------------------------*/
|
||||
|
||||
/* states and images */
|
||||
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
|
||||
|
||||
|
||||
/* Misc visuals
|
||||
----------------------------------*/
|
||||
|
||||
/* Overlays */
|
||||
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
|
||||
|
||||
.ui-accordion .ui-accordion-header { display: block; cursor: pointer; position: relative; margin-top: 2px; padding: .5em .5em .5em .7em; zoom: 1; }
|
||||
.ui-accordion .ui-accordion-icons { padding-left: 2.2em; }
|
||||
.ui-accordion .ui-accordion-noicons { padding-left: .7em; }
|
||||
.ui-accordion .ui-accordion-icons .ui-accordion-icons { padding-left: 2.2em; }
|
||||
.ui-accordion .ui-accordion-header .ui-accordion-header-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
|
||||
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; overflow: auto; zoom: 1; }
|
||||
|
||||
.ui-autocomplete {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* workarounds */
|
||||
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
|
||||
|
||||
.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
|
||||
.ui-button, .ui-button:link, .ui-button:visited, .ui-button:hover, .ui-button:active { text-decoration: none; }
|
||||
.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
|
||||
button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
|
||||
.ui-button-icons-only { width: 3.4em; }
|
||||
button.ui-button-icons-only { width: 3.7em; }
|
||||
|
||||
/*button text element */
|
||||
.ui-button .ui-button-text { display: block; line-height: 1.4; }
|
||||
.ui-button-text-only .ui-button-text { padding: .4em 1em; }
|
||||
.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
|
||||
.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
|
||||
.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
|
||||
.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
|
||||
/* no icon support for input elements, provide padding by default */
|
||||
input.ui-button { padding: .4em 1em; }
|
||||
|
||||
/*button icon element(s) */
|
||||
.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
|
||||
.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
|
||||
.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
|
||||
.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
|
||||
.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
|
||||
|
||||
/*button sets*/
|
||||
.ui-buttonset { margin-right: 7px; }
|
||||
.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
|
||||
|
||||
/* workarounds */
|
||||
button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
|
||||
|
||||
.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
|
||||
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
|
||||
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
|
||||
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
|
||||
.ui-datepicker .ui-datepicker-prev { left:2px; }
|
||||
.ui-datepicker .ui-datepicker-next { right:2px; }
|
||||
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
|
||||
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
|
||||
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
|
||||
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
|
||||
.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
|
||||
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
|
||||
.ui-datepicker select.ui-datepicker-month,
|
||||
.ui-datepicker select.ui-datepicker-year { width: 49%;}
|
||||
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
|
||||
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
|
||||
.ui-datepicker td { border: 0; padding: 1px; }
|
||||
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
|
||||
|
||||
/* with multiple calendars */
|
||||
.ui-datepicker.ui-datepicker-multi { width:auto; }
|
||||
.ui-datepicker-multi .ui-datepicker-group { float:left; }
|
||||
.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
|
||||
.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
|
||||
.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
|
||||
.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
|
||||
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
|
||||
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
|
||||
.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
|
||||
.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
|
||||
|
||||
/* RTL support */
|
||||
.ui-datepicker-rtl { direction: rtl; }
|
||||
.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
|
||||
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
||||
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
||||
|
||||
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
|
||||
.ui-datepicker-cover {
|
||||
position: absolute; /*must have*/
|
||||
z-index: -1; /*must have*/
|
||||
filter: mask(); /*must have*/
|
||||
top: -4px; /*must have*/
|
||||
left: -4px; /*must have*/
|
||||
width: 200px; /*must have*/
|
||||
height: 200px; /*must have*/
|
||||
}
|
||||
.ui-dialog { position: absolute; top: 0; left: 0; padding: .2em; width: 650px; overflow: hidden; }
|
||||
.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
|
||||
.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
|
||||
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
|
||||
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
|
||||
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
|
||||
.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
|
||||
.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
|
||||
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
|
||||
.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
|
||||
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
|
||||
.ui-draggable .ui-dialog-titlebar { cursor: move; }
|
||||
|
||||
.ui-menu { list-style:none; padding: 2px; margin: 0; display:block; outline: none; }
|
||||
.ui-menu .ui-menu { margin-top: -3px; position: absolute; }
|
||||
.ui-menu .ui-menu-item { margin: 0; padding: 0; zoom: 1; width: 100%; }
|
||||
.ui-menu .ui-menu-divider { margin: 5px -2px 5px -2px; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; }
|
||||
.ui-menu .ui-menu-item a { text-decoration: none; display: block; padding: 2px .4em; line-height: 1.5; zoom: 1; font-weight: normal; }
|
||||
.ui-menu .ui-menu-item a.ui-state-focus,
|
||||
.ui-menu .ui-menu-item a.ui-state-active { font-weight: normal; margin: -1px; }
|
||||
|
||||
.ui-menu .ui-state-disabled { font-weight: normal; margin: .4em 0 .2em; line-height: 1.5; }
|
||||
.ui-menu .ui-state-disabled a { cursor: default; }
|
||||
|
||||
/* icon support */
|
||||
.ui-menu-icons { position: relative; }
|
||||
.ui-menu-icons .ui-menu-item a { position: relative; padding-left: 2em; }
|
||||
|
||||
/* left-aligned */
|
||||
.ui-menu .ui-icon { position: absolute; top: .2em; left: .2em; }
|
||||
|
||||
/* right-aligned */
|
||||
.ui-menu .ui-menu-icon { position: static; float: right; }
|
||||
|
||||
.ui-progressbar { height:2em; text-align: left; overflow: hidden; }
|
||||
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
|
||||
.ui-resizable { position: relative;}
|
||||
.ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; }
|
||||
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
|
||||
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
|
||||
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
|
||||
.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
|
||||
.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
|
||||
.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
|
||||
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
|
||||
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
|
||||
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}
|
||||
.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
|
||||
|
||||
.ui-slider { position: relative; text-align: left; }
|
||||
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
|
||||
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
|
||||
|
||||
.ui-slider-horizontal { height: .8em; }
|
||||
.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
|
||||
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
|
||||
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
|
||||
.ui-slider-horizontal .ui-slider-range-max { right: 0; }
|
||||
|
||||
.ui-slider-vertical { width: .8em; height: 100px; }
|
||||
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
|
||||
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
|
||||
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
|
||||
.ui-slider-vertical .ui-slider-range-max { top: 0; }
|
||||
.ui-spinner { position:relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; }
|
||||
.ui-spinner-input { border: none; background: none; padding: 0; margin: .2em 0; vertical-align: middle; margin-left: .4em; margin-right: 22px; }
|
||||
.ui-spinner-button { width: 16px; height: 50%; font-size: .5em; padding: 0; margin: 0; text-align: center; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; }
|
||||
.ui-spinner a.ui-spinner-button { border-top: none; border-bottom: none; border-right: none; } /* more specificity required here to overide default borders */
|
||||
.ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; } /* vertical centre icon */
|
||||
.ui-spinner-up { top: 0; }
|
||||
.ui-spinner-down { bottom: 0; }
|
||||
|
||||
/* TR overrides */
|
||||
.ui-spinner .ui-icon-triangle-1-s {
|
||||
/* need to fix icons sprite */
|
||||
background-position:-65px -16px;
|
||||
}
|
||||
|
||||
.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
|
||||
.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
|
||||
.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 0; margin: 1px .2em 0 0; border-bottom: 0; padding: 0; white-space: nowrap; }
|
||||
.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: -1px; padding-bottom: 1px; }
|
||||
.ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a { cursor: text; }
|
||||
.ui-tabs .ui-tabs-nav li a, .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
|
||||
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
|
||||
|
||||
.ui-tooltip {
|
||||
padding: 8px;
|
||||
position: absolute;
|
||||
z-index: 9999;
|
||||
max-width: 300px;
|
||||
-webkit-box-shadow: 0 0 5px #aaa;
|
||||
box-shadow: 0 0 5px #aaa;
|
||||
}
|
||||
/* Fades and background-images don't work well together in IE6, drop the image */
|
||||
* html .ui-tooltip {
|
||||
background-image: none;
|
||||
}
|
||||
body .ui-tooltip { border-width: 2px; }
|
||||
|
||||
/* Component containers
|
||||
----------------------------------*/
|
||||
.ui-widget { font-family: 'Open Sans',sans-serif; font-size: 1.1em; }
|
||||
.ui-widget .ui-widget { font-size: 1em; }
|
||||
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: 'Open Sans',sans-serif; font-size: 1em; }
|
||||
.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff 50% 50% repeat-x; color: #222222; }
|
||||
.ui-widget-content a { color: #222222; }
|
||||
.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc 50% 50% repeat-x; color: #222222; font-weight: bold; }
|
||||
.ui-widget-header a { color: #222222; }
|
||||
|
||||
/* Interaction states
|
||||
----------------------------------*/
|
||||
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 50% 50% repeat-x; font-weight: normal; color: #555555; }
|
||||
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; }
|
||||
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada 50% 50% repeat-x; font-weight: normal; color: #212121; }
|
||||
.ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, .ui-state-hover a:visited { color: #212121; text-decoration: none; }
|
||||
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff 50% 50% repeat-x; font-weight: normal; color: #212121; }
|
||||
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; }
|
||||
|
||||
/* Interaction Cues
|
||||
----------------------------------*/
|
||||
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee 50% 50% repeat-x; color: #363636; }
|
||||
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
|
||||
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec 50% 50% repeat-x; color: #cd0a0a; }
|
||||
.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
|
||||
.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
|
||||
.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
|
||||
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
|
||||
.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
|
||||
.ui-state-disabled .ui-icon { filter:Alpha(Opacity=35); } /* For IE8 - See #6059 */
|
||||
|
||||
/* Icons
|
||||
----------------------------------*/
|
||||
|
||||
/* positioning */
|
||||
.ui-icon-carat-1-n { background-position: 0 0; }
|
||||
.ui-icon-carat-1-ne { background-position: -16px 0; }
|
||||
.ui-icon-carat-1-e { background-position: -32px 0; }
|
||||
.ui-icon-carat-1-se { background-position: -48px 0; }
|
||||
.ui-icon-carat-1-s { background-position: -64px 0; }
|
||||
.ui-icon-carat-1-sw { background-position: -80px 0; }
|
||||
.ui-icon-carat-1-w { background-position: -96px 0; }
|
||||
.ui-icon-carat-1-nw { background-position: -112px 0; }
|
||||
.ui-icon-carat-2-n-s { background-position: -128px 0; }
|
||||
.ui-icon-carat-2-e-w { background-position: -144px 0; }
|
||||
.ui-icon-triangle-1-n { background-position: 0 -16px; }
|
||||
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
|
||||
.ui-icon-triangle-1-e { background-position: -32px -16px; }
|
||||
.ui-icon-triangle-1-se { background-position: -48px -16px; }
|
||||
.ui-icon-triangle-1-s { background-position: -64px -16px; }
|
||||
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
|
||||
.ui-icon-triangle-1-w { background-position: -96px -16px; }
|
||||
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
|
||||
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
|
||||
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
|
||||
.ui-icon-arrow-1-n { background-position: 0 -32px; }
|
||||
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
|
||||
.ui-icon-arrow-1-e { background-position: -32px -32px; }
|
||||
.ui-icon-arrow-1-se { background-position: -48px -32px; }
|
||||
.ui-icon-arrow-1-s { background-position: -64px -32px; }
|
||||
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
|
||||
.ui-icon-arrow-1-w { background-position: -96px -32px; }
|
||||
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
|
||||
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
|
||||
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
|
||||
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
|
||||
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
|
||||
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
|
||||
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
|
||||
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
|
||||
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
|
||||
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
|
||||
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
|
||||
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
|
||||
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
|
||||
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
|
||||
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
|
||||
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
|
||||
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
|
||||
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
|
||||
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
|
||||
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
|
||||
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
|
||||
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
|
||||
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
|
||||
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
|
||||
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
|
||||
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
|
||||
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
|
||||
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
|
||||
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
|
||||
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
|
||||
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
|
||||
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
|
||||
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
|
||||
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
|
||||
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
|
||||
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
|
||||
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
|
||||
.ui-icon-arrow-4 { background-position: 0 -80px; }
|
||||
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
|
||||
.ui-icon-extlink { background-position: -32px -80px; }
|
||||
.ui-icon-newwin { background-position: -48px -80px; }
|
||||
.ui-icon-refresh { background-position: -64px -80px; }
|
||||
.ui-icon-shuffle { background-position: -80px -80px; }
|
||||
.ui-icon-transfer-e-w { background-position: -96px -80px; }
|
||||
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
|
||||
.ui-icon-folder-collapsed { background-position: 0 -96px; }
|
||||
.ui-icon-folder-open { background-position: -16px -96px; }
|
||||
.ui-icon-document { background-position: -32px -96px; }
|
||||
.ui-icon-document-b { background-position: -48px -96px; }
|
||||
.ui-icon-note { background-position: -64px -96px; }
|
||||
.ui-icon-mail-closed { background-position: -80px -96px; }
|
||||
.ui-icon-mail-open { background-position: -96px -96px; }
|
||||
.ui-icon-suitcase { background-position: -112px -96px; }
|
||||
.ui-icon-comment { background-position: -128px -96px; }
|
||||
.ui-icon-person { background-position: -144px -96px; }
|
||||
.ui-icon-print { background-position: -160px -96px; }
|
||||
.ui-icon-trash { background-position: -176px -96px; }
|
||||
.ui-icon-locked { background-position: -192px -96px; }
|
||||
.ui-icon-unlocked { background-position: -208px -96px; }
|
||||
.ui-icon-bookmark { background-position: -224px -96px; }
|
||||
.ui-icon-tag { background-position: -240px -96px; }
|
||||
.ui-icon-home { background-position: 0 -112px; }
|
||||
.ui-icon-flag { background-position: -16px -112px; }
|
||||
.ui-icon-calendar { background-position: -32px -112px; }
|
||||
.ui-icon-cart { background-position: -48px -112px; }
|
||||
.ui-icon-pencil { background-position: -64px -112px; }
|
||||
.ui-icon-clock { background-position: -80px -112px; }
|
||||
.ui-icon-disk { background-position: -96px -112px; }
|
||||
.ui-icon-calculator { background-position: -112px -112px; }
|
||||
.ui-icon-zoomin { background-position: -128px -112px; }
|
||||
.ui-icon-zoomout { background-position: -144px -112px; }
|
||||
.ui-icon-search { background-position: -160px -112px; }
|
||||
.ui-icon-wrench { background-position: -176px -112px; }
|
||||
.ui-icon-gear { background-position: -192px -112px; }
|
||||
.ui-icon-heart { background-position: -208px -112px; }
|
||||
.ui-icon-star { background-position: -224px -112px; }
|
||||
.ui-icon-link { background-position: -240px -112px; }
|
||||
.ui-icon-cancel { background-position: 0 -128px; }
|
||||
.ui-icon-plus { background-position: -16px -128px; }
|
||||
.ui-icon-plusthick { background-position: -32px -128px; }
|
||||
.ui-icon-minus { background-position: -48px -128px; }
|
||||
.ui-icon-minusthick { background-position: -64px -128px; }
|
||||
.ui-icon-close { background-position: -80px -128px; }
|
||||
.ui-icon-closethick { background-position: -96px -128px; }
|
||||
.ui-icon-key { background-position: -112px -128px; }
|
||||
.ui-icon-lightbulb { background-position: -128px -128px; }
|
||||
.ui-icon-scissors { background-position: -144px -128px; }
|
||||
.ui-icon-clipboard { background-position: -160px -128px; }
|
||||
.ui-icon-copy { background-position: -176px -128px; }
|
||||
.ui-icon-contact { background-position: -192px -128px; }
|
||||
.ui-icon-image { background-position: -208px -128px; }
|
||||
.ui-icon-video { background-position: -224px -128px; }
|
||||
.ui-icon-script { background-position: -240px -128px; }
|
||||
.ui-icon-alert { background-position: 0 -144px; }
|
||||
.ui-icon-info { background-position: -16px -144px; }
|
||||
.ui-icon-notice { background-position: -32px -144px; }
|
||||
.ui-icon-help { background-position: -48px -144px; }
|
||||
.ui-icon-check { background-position: -64px -144px; }
|
||||
.ui-icon-bullet { background-position: -80px -144px; }
|
||||
.ui-icon-radio-on { background-position: -96px -144px; }
|
||||
.ui-icon-radio-off { background-position: -112px -144px; }
|
||||
.ui-icon-pin-w { background-position: -128px -144px; }
|
||||
.ui-icon-pin-s { background-position: -144px -144px; }
|
||||
.ui-icon-play { background-position: 0 -160px; }
|
||||
.ui-icon-pause { background-position: -16px -160px; }
|
||||
.ui-icon-seek-next { background-position: -32px -160px; }
|
||||
.ui-icon-seek-prev { background-position: -48px -160px; }
|
||||
.ui-icon-seek-end { background-position: -64px -160px; }
|
||||
.ui-icon-seek-start { background-position: -80px -160px; }
|
||||
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
|
||||
.ui-icon-seek-first { background-position: -80px -160px; }
|
||||
.ui-icon-stop { background-position: -96px -160px; }
|
||||
.ui-icon-eject { background-position: -112px -160px; }
|
||||
.ui-icon-volume-off { background-position: -128px -160px; }
|
||||
.ui-icon-volume-on { background-position: -144px -160px; }
|
||||
.ui-icon-power { background-position: 0 -176px; }
|
||||
.ui-icon-signal-diag { background-position: -16px -176px; }
|
||||
.ui-icon-signal { background-position: -32px -176px; }
|
||||
.ui-icon-battery-0 { background-position: -48px -176px; }
|
||||
.ui-icon-battery-1 { background-position: -64px -176px; }
|
||||
.ui-icon-battery-2 { background-position: -80px -176px; }
|
||||
.ui-icon-battery-3 { background-position: -96px -176px; }
|
||||
.ui-icon-circle-plus { background-position: 0 -192px; }
|
||||
.ui-icon-circle-minus { background-position: -16px -192px; }
|
||||
.ui-icon-circle-close { background-position: -32px -192px; }
|
||||
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
|
||||
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
|
||||
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
|
||||
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
|
||||
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
|
||||
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
|
||||
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
|
||||
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
|
||||
.ui-icon-circle-zoomin { background-position: -176px -192px; }
|
||||
.ui-icon-circle-zoomout { background-position: -192px -192px; }
|
||||
.ui-icon-circle-check { background-position: -208px -192px; }
|
||||
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
|
||||
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
|
||||
.ui-icon-circlesmall-close { background-position: -32px -208px; }
|
||||
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
|
||||
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
|
||||
.ui-icon-squaresmall-close { background-position: -80px -208px; }
|
||||
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
|
||||
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
|
||||
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
|
||||
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
|
||||
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
|
||||
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
|
||||
|
||||
|
||||
/* Misc visuals
|
||||
----------------------------------*/
|
||||
|
||||
/* Corner radius */
|
||||
.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
|
||||
.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
|
||||
.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
|
||||
.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
|
||||
|
||||
/* Overlays */
|
||||
.ui-widget-overlay { background: #aaaaaa 50% 50% repeat-x; opacity: .3;filter:Alpha(Opacity=30); }
|
||||
.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa 50% 50% repeat-x; opacity: .3;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }
|
||||
@ -0,0 +1,684 @@
|
||||
/**
|
||||
*
|
||||
* (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.
|
||||
*
|
||||
*/
|
||||
|
||||
html {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
background: #FFFFFF;
|
||||
color: #333333;
|
||||
font-family: Open Sans;
|
||||
font-size: 12px;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
overflow-y: overlay;
|
||||
padding: 0;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
form {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
div {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
a,
|
||||
a:hover,
|
||||
a:visited {
|
||||
color: #333333;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
header {
|
||||
background: #333333;
|
||||
height: 72px;
|
||||
margin: 0 auto;
|
||||
min-width: 1152px;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
header img {
|
||||
margin: 22px 0 22px 32px;
|
||||
}
|
||||
|
||||
.center {
|
||||
margin: 0 auto 0;
|
||||
width: 1152px;
|
||||
}
|
||||
|
||||
.main{
|
||||
height: calc(100% - 136px);
|
||||
min-height: 536px;
|
||||
}
|
||||
|
||||
.table-main {
|
||||
border-spacing: 0;
|
||||
height: 100%;
|
||||
min-height: 536px;
|
||||
}
|
||||
|
||||
.section{
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.main-panel {
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
height: 100%;
|
||||
list-style: none;
|
||||
padding: 48px 32px 24px;
|
||||
position: relative;
|
||||
width: 896px;
|
||||
}
|
||||
|
||||
.portal-name {
|
||||
color: #FF6F3D;
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
line-height: 133%;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
.portal-descr {
|
||||
display: inline-block;
|
||||
font-size: 16px;
|
||||
line-height: 160%;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.header-list {
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
line-height: 133%;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
label .checkbox {
|
||||
margin: 0 5px 3px 0;
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.try-editor-list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.try-editor-list li {
|
||||
margin-bottom: 12px
|
||||
}
|
||||
|
||||
.try-editor {
|
||||
background-color: transparent;
|
||||
background-repeat: no-repeat;
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
line-height: 40px;
|
||||
padding-left: 42px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.try-editor.word {
|
||||
background-image: url("img/file_docx.svg");
|
||||
}
|
||||
|
||||
.try-editor.cell {
|
||||
background-image: url("img/file_xlsx.svg");
|
||||
}
|
||||
|
||||
.try-editor.slide {
|
||||
background-image: url("img/file_pptx.svg");
|
||||
}
|
||||
|
||||
.create-sample {
|
||||
color: #666666;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
.button,
|
||||
.button:visited,
|
||||
.button:hover,
|
||||
.button:active {
|
||||
align-items: center;
|
||||
border-radius: 3px;
|
||||
box-sizing: border-box;
|
||||
cursor:pointer;
|
||||
display: inline-block;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.08em;
|
||||
line-height: 133%;
|
||||
padding: 8px 20px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
text-transform: uppercase;
|
||||
vertical-align: middle;
|
||||
user-select: none;
|
||||
-o-touch-callout: none;
|
||||
-moz-touch-callout: none;
|
||||
-webkit-touch-callout: none;
|
||||
-o-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
}
|
||||
|
||||
.button.orange {
|
||||
background: #FF6F3D;
|
||||
border: 1px solid #FF6F3D;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.button.orange.disable {
|
||||
background: #EDC2B3;
|
||||
border: 1px solid #EDC2B3;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.button.orange:not(.disable):hover{
|
||||
background: #ff7a4b;
|
||||
}
|
||||
|
||||
.button.gray {
|
||||
border: 1px solid #AAAAAA;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.button.gray.disable {
|
||||
border: 1px solid #E5E5E5;
|
||||
color: #B5B5B5;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.button.gray:not(.disable):hover {
|
||||
border: 1px solid #FF6F3D;
|
||||
color: #FF6F3D;
|
||||
}
|
||||
|
||||
.upload-panel {
|
||||
float: left;
|
||||
padding: 24px 0;
|
||||
}
|
||||
|
||||
.file-upload {
|
||||
background: url(img/file_upload.svg) no-repeat 0 transparent;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
line-height: 40px;
|
||||
overflow: hidden;
|
||||
padding-left: 42px;
|
||||
position: relative;
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.file-upload input {
|
||||
cursor: pointer;
|
||||
height: 40px;
|
||||
margin: 0;
|
||||
opacity: 0;
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
transform: translate(0px, -21px) scale(2);
|
||||
width: 192px;
|
||||
}
|
||||
|
||||
.create-panel {
|
||||
float: left;
|
||||
padding: 16px 0;
|
||||
}
|
||||
|
||||
.upload-panel,
|
||||
.create-panel {
|
||||
width: 100%;
|
||||
border-bottom: 1px solid #D0D5DA;
|
||||
}
|
||||
|
||||
#mainProgress {
|
||||
color: #333333;
|
||||
display: none;
|
||||
font-size: 12px;
|
||||
margin: 30px 40px
|
||||
}
|
||||
|
||||
#mainProgress .uploadFileName{
|
||||
background-position: left center;
|
||||
background-repeat: no-repeat;
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
line-height: 160%;
|
||||
overflow: hidden;
|
||||
padding-left: 28px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#mainProgress .describeUpload {
|
||||
line-height: 150%;
|
||||
letter-spacing: -0.02em;
|
||||
padding: 16px 0;
|
||||
}
|
||||
|
||||
#mainProgress #embeddedView {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#mainProgress.embedded #embeddedView {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#mainProgress.embedded #uploadSteps {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.error-message {
|
||||
background: url(img/error.svg) no-repeat scroll 4px 10px;
|
||||
color: #CB0000;
|
||||
display: none;
|
||||
line-height: 160%;
|
||||
letter-spacing: -0.02em;
|
||||
margin: 5px 0;
|
||||
padding: 10px 10px 10px 30px;
|
||||
vertical-align: middle;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.step {
|
||||
background-repeat: no-repeat;
|
||||
background-position: left center;
|
||||
background-color: transparent;
|
||||
font-weight: bold;
|
||||
line-height: 167%;
|
||||
padding-left: 35px;
|
||||
}
|
||||
|
||||
.current {
|
||||
background-image: url("img/loader16.gif");
|
||||
}
|
||||
|
||||
.done {
|
||||
background-image: url("img/done.svg");
|
||||
}
|
||||
|
||||
.error {
|
||||
background-image: url("img/notdone.svg");
|
||||
}
|
||||
|
||||
.step-descr {
|
||||
display: block;
|
||||
margin-left: 35px;
|
||||
font-size: 11px;
|
||||
line-height: 188%;
|
||||
}
|
||||
|
||||
.progress-descr {
|
||||
letter-spacing: -0.02em;
|
||||
line-height: 150%;
|
||||
}
|
||||
|
||||
#loadScripts {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#iframeScripts {
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
footer {
|
||||
background: #333333;
|
||||
color: #AAAAAA;
|
||||
height: 64px;
|
||||
min-width: 1152px;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
footer table {
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
footer table tr {
|
||||
height: 64px;
|
||||
}
|
||||
|
||||
footer table td {
|
||||
padding-left: 32px;
|
||||
}
|
||||
|
||||
footer a,
|
||||
footer a:hover,
|
||||
footer a:visited {
|
||||
color: #FF6F3D;
|
||||
font-size: 14px;
|
||||
line-height: 120%;
|
||||
}
|
||||
|
||||
footer a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.copy {
|
||||
padding-left: 510px;
|
||||
}
|
||||
|
||||
.help-block {
|
||||
margin: 48px 32px 24px;
|
||||
}
|
||||
|
||||
.help-block span {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
line-height: 19px;
|
||||
}
|
||||
|
||||
.stored-list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.stored-edit {
|
||||
background-color: transparent;
|
||||
background-position: left center;
|
||||
background-repeat: no-repeat;
|
||||
display: inline-block;
|
||||
height: 16px;
|
||||
max-width: 250px;
|
||||
overflow: hidden;
|
||||
padding: 8px 0 1px 26px;
|
||||
text-decoration: none;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.stored-edit.word,
|
||||
.uploadFileName.word {
|
||||
background-image: url("img/icon_docx.svg");
|
||||
}
|
||||
|
||||
.stored-edit.cell,
|
||||
.uploadFileName.cell {
|
||||
background-image: url("img/icon_xlsx.svg");
|
||||
}
|
||||
|
||||
.stored-edit.slide,
|
||||
.uploadFileName.slide {
|
||||
background-image: url("img/icon_pptx.svg");
|
||||
}
|
||||
|
||||
.stored-edit span {
|
||||
font-size: 12px;
|
||||
line-height: 12px;
|
||||
}
|
||||
|
||||
.stored-edit:hover span {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.blockTitle {
|
||||
background-color: #333333 !important;
|
||||
border: none !important;
|
||||
border-radius: 0 !important;
|
||||
-moz-border-radius: 0 !important;
|
||||
-webkit-border-radius: 0 !important;
|
||||
color: #F5F5F5 !important;
|
||||
font-size: 16px !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;
|
||||
cursor: pointer;
|
||||
float: right;
|
||||
font-size: 1px;
|
||||
height: 14px;
|
||||
line-height: 1px;
|
||||
margin-top: 4px;
|
||||
width: 14px;
|
||||
}
|
||||
|
||||
.blockPage {
|
||||
border: none !important;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
|
||||
-moz-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
|
||||
-webkit-box-shadow:0 2px 4px rgba(0, 0, 0, 0.5);
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.clearFix:after {
|
||||
content: ".";
|
||||
display: block;
|
||||
height: 0;
|
||||
clear: both;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.tableRow {
|
||||
background: transparent;
|
||||
-moz-transition: all 0.2s ease-in-out;
|
||||
-webkit-transition: all 0.2s ease-in-out;
|
||||
-o-transition: all 0.2s ease-in-out;
|
||||
-ms-transition: all 0.2s ease-in-out;
|
||||
transition: all 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.tableRow:hover {
|
||||
background-color: #ECECEC;
|
||||
}
|
||||
|
||||
.tableHeader {
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.tableHeader tr{
|
||||
background: transparent;
|
||||
cursor: default;
|
||||
height: 40px;
|
||||
-khtml-user-select: none;
|
||||
user-select: none;
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
}
|
||||
|
||||
.tableHeaderCell {
|
||||
border-bottom: 1px solid #EFEFEF;
|
||||
padding: 2px 4px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.tableHeaderCellFileName {
|
||||
text-align: left;
|
||||
width: 37%;
|
||||
}
|
||||
|
||||
.tableHeaderCellEditors{
|
||||
width: 29%;
|
||||
}
|
||||
|
||||
.tableHeaderCellViewers{
|
||||
width: 11%;
|
||||
}
|
||||
|
||||
.tableHeaderCellDownload{
|
||||
width: 13%;
|
||||
text-align: right;
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.tableHeaderCellRemove{
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.contentCells {
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
font-size: 16px;
|
||||
padding: 4px;
|
||||
white-space: nowrap;
|
||||
-khtml-user-select: none;
|
||||
user-select: none;
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
}
|
||||
|
||||
.contentCells-shift {
|
||||
padding-right: 44px;
|
||||
}
|
||||
|
||||
.contentCells-icon {
|
||||
width: 4%;
|
||||
}
|
||||
|
||||
.select-user {
|
||||
color: #444444;
|
||||
font-family: Open Sans;
|
||||
font-size: 12px!important;
|
||||
font-weight: normal!important;
|
||||
line-height: 16px!important;
|
||||
}
|
||||
|
||||
.info{
|
||||
cursor: pointer;
|
||||
padding: 3px 5px;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.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;
|
||||
position: absolute;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
.user-block-table {
|
||||
height: 100%;
|
||||
padding-top: 14px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.user-block-table td {
|
||||
background-color: #F4F4F4;
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.user-block-table td select {
|
||||
border: 1px solid #D0D5DA;
|
||||
box-sizing: border-box;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
margin-top: 5px;
|
||||
padding: 2px 5px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.icon-delete {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.left-panel {
|
||||
width: 256px;
|
||||
background: #F5F5F5;
|
||||
}
|
||||
|
||||
.scroll-table-body {
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
margin-top: 0px;
|
||||
overflow-x: auto;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 71px;
|
||||
scrollbar-color: #D0D5DA transparent;
|
||||
scrollbar-width: thin;
|
||||
}
|
||||
|
||||
.scroll-table-body::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
|
||||
.scroll-table-body::-webkit-scrollbar-thumb {
|
||||
background: #D0D5DA;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.descrFilePass {
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
line-height: 167%;
|
||||
}
|
||||
|
||||
#filePass {
|
||||
border: 1px solid #D0D5DA;
|
||||
border-radius: 3px;
|
||||
box-sizing: border-box;
|
||||
display: inline-block;
|
||||
height: 33px;
|
||||
letter-spacing: -0.02em;
|
||||
line-height: 150%;
|
||||
margin-right: 8px;
|
||||
outline: none;
|
||||
padding: 7px 8px;
|
||||
vertical-align: bottom;
|
||||
user-select: none;
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
.errorInput {
|
||||
border-color: #CB0000!important;
|
||||
}
|
||||
|
||||
.errorPass {
|
||||
color: #CB0000;
|
||||
display: block;
|
||||
line-height: 160%;
|
||||
letter-spacing: -0.02em;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
BIN
web/documentserver-example/java-spring/src/main/resources/static/favicon.ico
Executable file
|
After Width: | Height: | Size: 144 KiB |
@ -0,0 +1,14 @@
|
||||
var ConverExtList;
|
||||
var EditedExtList;
|
||||
var UrlConverter;
|
||||
var UrlEditor;
|
||||
|
||||
if (typeof jQuery !== "undefined") {
|
||||
jQuery.post('/config',
|
||||
function(data) {
|
||||
ConverExtList = data.ConverExtList;
|
||||
EditedExtList = data.ConverExtList;
|
||||
UrlConverter = data.UrlConverter;
|
||||
UrlEditor = data.UrlEditor;
|
||||
});
|
||||
}
|
||||
9440
web/documentserver-example/java-spring/src/main/resources/static/scripts/jquery-1.8.2.js
vendored
Executable file
5
web/documentserver-example/java-spring/src/main/resources/static/scripts/jquery-ui.js
vendored
Executable file
@ -0,0 +1,576 @@
|
||||
/*!
|
||||
* jQuery blockUI plugin
|
||||
* Version 2.55 (18-JAN-2013)
|
||||
* @requires jQuery v1.7 or later
|
||||
*
|
||||
* Examples at: http://malsup.com/jquery/block/
|
||||
* Copyright (c) 2007-2013 M. Alsup
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*
|
||||
* Thanks to Amir-Hossein Sobhi for some excellent contributions!
|
||||
*/
|
||||
|
||||
;(function() {
|
||||
"use strict";
|
||||
|
||||
function setup($) {
|
||||
$.fn._fadeIn = $.fn.fadeIn;
|
||||
|
||||
var noOp = $.noop || function() {};
|
||||
|
||||
// this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle
|
||||
// retarded userAgent strings on Vista)
|
||||
var msie = /MSIE/.test(navigator.userAgent);
|
||||
var ie6 = /MSIE 6.0/.test(navigator.userAgent);
|
||||
var mode = document.documentMode || 0;
|
||||
// var setExpr = msie && (($.browser.version < 8 && !mode) || mode < 8);
|
||||
var setExpr = $.isFunction( document.createElement('div').style.setExpression );
|
||||
|
||||
// global $ methods for blocking/unblocking the entire page
|
||||
$.blockUI = function(opts) { install(window, opts); };
|
||||
$.unblockUI = function(opts) { remove(window, opts); };
|
||||
|
||||
// convenience method for quick growl-like notifications (http://www.google.com/search?q=growl)
|
||||
$.growlUI = function(title, message, timeout, onClose) {
|
||||
var $m = $('<div class="growlUI"></div>');
|
||||
if (title) $m.append('<h1>'+title+'</h1>');
|
||||
if (message) $m.append('<h2>'+message+'</h2>');
|
||||
if (timeout === undefined) timeout = 3000;
|
||||
$.blockUI({
|
||||
message: $m, fadeIn: 700, fadeOut: 1000, centerY: false,
|
||||
timeout: timeout, showOverlay: false,
|
||||
onUnblock: onClose,
|
||||
css: $.blockUI.defaults.growlCSS
|
||||
});
|
||||
};
|
||||
|
||||
// plugin method for blocking element content
|
||||
$.fn.block = function(opts) {
|
||||
var fullOpts = $.extend({}, $.blockUI.defaults, opts || {});
|
||||
this.each(function() {
|
||||
var $el = $(this);
|
||||
if (fullOpts.ignoreIfBlocked && $el.data('blockUI.isBlocked'))
|
||||
return;
|
||||
$el.unblock({ fadeOut: 0 });
|
||||
});
|
||||
|
||||
return this.each(function() {
|
||||
if ($.css(this,'position') == 'static') {
|
||||
this.style.position = 'relative';
|
||||
$(this).data('blockUI.static', true);
|
||||
}
|
||||
this.style.zoom = 1; // force 'hasLayout' in ie
|
||||
install(this, opts);
|
||||
});
|
||||
};
|
||||
|
||||
// plugin method for unblocking element content
|
||||
$.fn.unblock = function(opts) {
|
||||
return this.each(function() {
|
||||
remove(this, opts);
|
||||
});
|
||||
};
|
||||
|
||||
$.blockUI.version = 2.55; // 2nd generation blocking at no extra cost!
|
||||
|
||||
// override these in your code to change the default behavior and style
|
||||
$.blockUI.defaults = {
|
||||
// message displayed when blocking (use null for no message)
|
||||
message: '<h1>Please wait...</h1>',
|
||||
|
||||
title: null, // title string; only used when theme == true
|
||||
draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded)
|
||||
|
||||
theme: false, // set to true to use with jQuery UI themes
|
||||
|
||||
// styles for the message when blocking; if you wish to disable
|
||||
// these and use an external stylesheet then do this in your code:
|
||||
// $.blockUI.defaults.css = {};
|
||||
css: {
|
||||
padding: 0,
|
||||
margin: 0,
|
||||
width: '30%',
|
||||
top: '40%',
|
||||
left: '35%',
|
||||
textAlign: 'center',
|
||||
color: '#000',
|
||||
border: '3px solid #aaa',
|
||||
backgroundColor:'#fff',
|
||||
cursor: 'wait'
|
||||
},
|
||||
|
||||
// minimal style set used when themes are used
|
||||
themedCSS: {
|
||||
//width: '30%',
|
||||
top: '20%',
|
||||
left: '50%',
|
||||
marginLeft: "-325px"
|
||||
},
|
||||
|
||||
// styles for the overlay
|
||||
overlayCSS: {
|
||||
backgroundColor: '#000',
|
||||
opacity: 0.6,
|
||||
cursor: 'wait'
|
||||
},
|
||||
|
||||
// style to replace wait cursor before unblocking to correct issue
|
||||
// of lingering wait cursor
|
||||
cursorReset: 'default',
|
||||
|
||||
// styles applied when using $.growlUI
|
||||
growlCSS: {
|
||||
width: '350px',
|
||||
top: '10px',
|
||||
left: '',
|
||||
right: '10px',
|
||||
border: 'none',
|
||||
padding: '5px',
|
||||
opacity: 0.6,
|
||||
cursor: 'default',
|
||||
color: '#fff',
|
||||
backgroundColor: '#000',
|
||||
'-webkit-border-radius':'10px',
|
||||
'-moz-border-radius': '10px',
|
||||
'border-radius': '10px'
|
||||
},
|
||||
|
||||
// IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w
|
||||
// (hat tip to Jorge H. N. de Vasconcelos)
|
||||
/*jshint scripturl:true */
|
||||
iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',
|
||||
|
||||
// force usage of iframe in non-IE browsers (handy for blocking applets)
|
||||
forceIframe: false,
|
||||
|
||||
// z-index for the blocking overlay
|
||||
baseZ: 1000,
|
||||
|
||||
// set these to true to have the message automatically centered
|
||||
centerX: true, // <-- only effects element blocking (page block controlled via css above)
|
||||
centerY: true,
|
||||
|
||||
// allow body element to be stetched in ie6; this makes blocking look better
|
||||
// on "short" pages. disable if you wish to prevent changes to the body height
|
||||
allowBodyStretch: true,
|
||||
|
||||
// enable if you want key and mouse events to be disabled for content that is blocked
|
||||
bindEvents: true,
|
||||
|
||||
// be default blockUI will supress tab navigation from leaving blocking content
|
||||
// (if bindEvents is true)
|
||||
constrainTabKey: true,
|
||||
|
||||
// fadeIn time in millis; set to 0 to disable fadeIn on block
|
||||
fadeIn: 200,
|
||||
|
||||
// fadeOut time in millis; set to 0 to disable fadeOut on unblock
|
||||
fadeOut: 400,
|
||||
|
||||
// time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock
|
||||
timeout: 0,
|
||||
|
||||
// disable if you don't want to show the overlay
|
||||
showOverlay: true,
|
||||
|
||||
// if true, focus will be placed in the first available input field when
|
||||
// page blocking
|
||||
focusInput: true,
|
||||
|
||||
// suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)
|
||||
// no longer needed in 2012
|
||||
// applyPlatformOpacityRules: true,
|
||||
|
||||
// callback method invoked when fadeIn has completed and blocking message is visible
|
||||
onBlock: null,
|
||||
|
||||
// callback method invoked when unblocking has completed; the callback is
|
||||
// passed the element that has been unblocked (which is the window object for page
|
||||
// blocks) and the options that were passed to the unblock call:
|
||||
// onUnblock(element, options)
|
||||
onUnblock: null,
|
||||
|
||||
// callback method invoked when the overlay area is clicked.
|
||||
// setting this will turn the cursor to a pointer, otherwise cursor defined in overlayCss will be used.
|
||||
onOverlayClick: null,
|
||||
|
||||
// don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493
|
||||
quirksmodeOffsetHack: 4,
|
||||
|
||||
// class name of the message block
|
||||
blockMsgClass: 'blockMsg',
|
||||
|
||||
// if it is already blocked, then ignore it (don't unblock and reblock)
|
||||
ignoreIfBlocked: false
|
||||
};
|
||||
|
||||
// private data and functions follow...
|
||||
|
||||
var pageBlock = null;
|
||||
var pageBlockEls = [];
|
||||
|
||||
function install(el, opts) {
|
||||
var css, themedCSS;
|
||||
var full = (el == window);
|
||||
var msg = (opts && opts.message !== undefined ? opts.message : undefined);
|
||||
opts = $.extend({}, $.blockUI.defaults, opts || {});
|
||||
|
||||
if (opts.ignoreIfBlocked && $(el).data('blockUI.isBlocked'))
|
||||
return;
|
||||
|
||||
opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
|
||||
css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
|
||||
if (opts.onOverlayClick)
|
||||
opts.overlayCSS.cursor = 'pointer';
|
||||
|
||||
themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});
|
||||
msg = msg === undefined ? opts.message : msg;
|
||||
|
||||
// remove the current block (if there is one)
|
||||
if (full && pageBlock)
|
||||
remove(window, {fadeOut:0});
|
||||
|
||||
// if an existing element is being used as the blocking content then we capture
|
||||
// its current place in the DOM (and current display style) so we can restore
|
||||
// it when we unblock
|
||||
if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {
|
||||
var node = msg.jquery ? msg[0] : msg;
|
||||
var data = {};
|
||||
$(el).data('blockUI.history', data);
|
||||
data.el = node;
|
||||
data.parent = node.parentNode;
|
||||
data.display = node.style.display;
|
||||
data.position = node.style.position;
|
||||
if (data.parent)
|
||||
data.parent.removeChild(node);
|
||||
}
|
||||
|
||||
$(el).data('blockUI.onUnblock', opts.onUnblock);
|
||||
var z = opts.baseZ;
|
||||
|
||||
// blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;
|
||||
// layer1 is the iframe layer which is used to supress bleed through of underlying content
|
||||
// layer2 is the overlay layer which has opacity and a wait cursor (by default)
|
||||
// layer3 is the message content that is displayed while blocking
|
||||
var lyr1, lyr2, lyr3, s;
|
||||
if (msie || opts.forceIframe)
|
||||
lyr1 = $('<iframe class="blockUI" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>');
|
||||
else
|
||||
lyr1 = $('<div class="blockUI" style="display:none"></div>');
|
||||
|
||||
if (opts.theme)
|
||||
lyr2 = $('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+ (z++) +';display:none"></div>');
|
||||
else
|
||||
lyr2 = $('<div class="blockUI blockOverlay" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
|
||||
|
||||
if (opts.theme && full) {
|
||||
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:fixed">';
|
||||
if ( opts.title ) {
|
||||
s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || ' ')+'</div>';
|
||||
}
|
||||
s += '<div class="ui-widget-content ui-dialog-content"></div>';
|
||||
s += '</div>';
|
||||
}
|
||||
else if (opts.theme) {
|
||||
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:absolute">';
|
||||
if ( opts.title ) {
|
||||
s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || ' ')+'</div>';
|
||||
}
|
||||
s += '<div class="ui-widget-content ui-dialog-content"></div>';
|
||||
s += '</div>';
|
||||
}
|
||||
else if (full) {
|
||||
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage" style="z-index:'+(z+10)+';display:none;position:fixed"></div>';
|
||||
}
|
||||
else {
|
||||
s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement" style="z-index:'+(z+10)+';display:none;position:absolute"></div>';
|
||||
}
|
||||
lyr3 = $(s);
|
||||
|
||||
// if we have a message, style it
|
||||
if (msg) {
|
||||
if (opts.theme) {
|
||||
lyr3.css(themedCSS);
|
||||
lyr3.addClass('ui-widget-content');
|
||||
}
|
||||
else
|
||||
lyr3.css(css);
|
||||
}
|
||||
|
||||
// style the overlay
|
||||
if (!opts.theme /*&& (!opts.applyPlatformOpacityRules)*/)
|
||||
lyr2.css(opts.overlayCSS);
|
||||
lyr2.css('position', full ? 'fixed' : 'absolute');
|
||||
|
||||
// make iframe layer transparent in IE
|
||||
if (msie || opts.forceIframe)
|
||||
lyr1.css('opacity',0.0);
|
||||
|
||||
//$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);
|
||||
var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el);
|
||||
$.each(layers, function() {
|
||||
this.appendTo($par);
|
||||
});
|
||||
|
||||
if (opts.theme && opts.draggable && $.fn.draggable) {
|
||||
lyr3.draggable({
|
||||
handle: '.ui-dialog-titlebar',
|
||||
cancel: 'li'
|
||||
});
|
||||
}
|
||||
|
||||
// ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)
|
||||
var expr = setExpr && (!$.support.boxModel || $('object,embed', full ? null : el).length > 0);
|
||||
if (ie6 || expr) {
|
||||
// give body 100% height
|
||||
if (full && opts.allowBodyStretch && $.support.boxModel)
|
||||
$('html,body').css('height','100%');
|
||||
|
||||
// fix ie6 issue when blocked element has a border width
|
||||
if ((ie6 || !$.support.boxModel) && !full) {
|
||||
var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth');
|
||||
var fixT = t ? '(0 - '+t+')' : 0;
|
||||
var fixL = l ? '(0 - '+l+')' : 0;
|
||||
}
|
||||
|
||||
// simulate fixed position
|
||||
$.each(layers, function(i,o) {
|
||||
var s = o[0].style;
|
||||
s.position = 'absolute';
|
||||
if (i < 2) {
|
||||
if (full)
|
||||
s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"');
|
||||
else
|
||||
s.setExpression('height','this.parentNode.offsetHeight + "px"');
|
||||
if (full)
|
||||
s.setExpression('width','jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"');
|
||||
else
|
||||
s.setExpression('width','this.parentNode.offsetWidth + "px"');
|
||||
if (fixL) s.setExpression('left', fixL);
|
||||
if (fixT) s.setExpression('top', fixT);
|
||||
}
|
||||
else if (opts.centerY) {
|
||||
if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
|
||||
s.marginTop = 0;
|
||||
}
|
||||
else if (!opts.centerY && full) {
|
||||
var top = (opts.css && opts.css.top) ? parseInt(opts.css.top, 10) : 0;
|
||||
var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';
|
||||
s.setExpression('top',expression);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// show the message
|
||||
if (msg) {
|
||||
if (opts.theme)
|
||||
lyr3.find('.ui-widget-content').append(msg);
|
||||
else
|
||||
lyr3.append(msg);
|
||||
if (msg.jquery || msg.nodeType)
|
||||
$(msg).show();
|
||||
}
|
||||
|
||||
if ((msie || opts.forceIframe) && opts.showOverlay)
|
||||
lyr1.show(); // opacity is zero
|
||||
if (opts.fadeIn) {
|
||||
var cb = opts.onBlock ? opts.onBlock : noOp;
|
||||
var cb1 = (opts.showOverlay && !msg) ? cb : noOp;
|
||||
var cb2 = msg ? cb : noOp;
|
||||
if (opts.showOverlay)
|
||||
lyr2._fadeIn(opts.fadeIn, cb1);
|
||||
if (msg)
|
||||
lyr3._fadeIn(opts.fadeIn, cb2);
|
||||
}
|
||||
else {
|
||||
if (opts.showOverlay)
|
||||
lyr2.show();
|
||||
if (msg)
|
||||
lyr3.show();
|
||||
if (opts.onBlock)
|
||||
opts.onBlock();
|
||||
}
|
||||
|
||||
// bind key and mouse events
|
||||
bind(1, el, opts);
|
||||
|
||||
if (full) {
|
||||
pageBlock = lyr3[0];
|
||||
pageBlockEls = $(':input:enabled:visible',pageBlock);
|
||||
if (opts.focusInput)
|
||||
setTimeout(focus, 20);
|
||||
}
|
||||
else
|
||||
center(lyr3[0], opts.centerX, opts.centerY);
|
||||
|
||||
if (opts.timeout) {
|
||||
// auto-unblock
|
||||
var to = setTimeout(function() {
|
||||
if (full)
|
||||
$.unblockUI(opts);
|
||||
else
|
||||
$(el).unblock(opts);
|
||||
}, opts.timeout);
|
||||
$(el).data('blockUI.timeout', to);
|
||||
}
|
||||
}
|
||||
|
||||
// remove the block
|
||||
function remove(el, opts) {
|
||||
var full = (el == window);
|
||||
var $el = $(el);
|
||||
var data = $el.data('blockUI.history');
|
||||
var to = $el.data('blockUI.timeout');
|
||||
if (to) {
|
||||
clearTimeout(to);
|
||||
$el.removeData('blockUI.timeout');
|
||||
}
|
||||
opts = $.extend({}, $.blockUI.defaults, opts || {});
|
||||
bind(0, el, opts); // unbind events
|
||||
|
||||
if (opts.onUnblock === null) {
|
||||
opts.onUnblock = $el.data('blockUI.onUnblock');
|
||||
$el.removeData('blockUI.onUnblock');
|
||||
}
|
||||
|
||||
var els;
|
||||
if (full) // crazy selector to handle odd field errors in ie6/7
|
||||
els = $('body').children().filter('.blockUI').add('body > .blockUI');
|
||||
else
|
||||
els = $el.find('>.blockUI');
|
||||
|
||||
// fix cursor issue
|
||||
if ( opts.cursorReset ) {
|
||||
if ( els.length > 1 )
|
||||
els[1].style.cursor = opts.cursorReset;
|
||||
if ( els.length > 2 )
|
||||
els[2].style.cursor = opts.cursorReset;
|
||||
}
|
||||
|
||||
if (full)
|
||||
pageBlock = pageBlockEls = null;
|
||||
|
||||
if (opts.fadeOut) {
|
||||
els.fadeOut(opts.fadeOut);
|
||||
setTimeout(function() { reset(els,data,opts,el); }, opts.fadeOut);
|
||||
}
|
||||
else
|
||||
reset(els, data, opts, el);
|
||||
}
|
||||
|
||||
// move blocking element back into the DOM where it started
|
||||
function reset(els,data,opts,el) {
|
||||
var $el = $(el);
|
||||
els.each(function(i,o) {
|
||||
// remove via DOM calls so we don't lose event handlers
|
||||
if (this.parentNode)
|
||||
this.parentNode.removeChild(this);
|
||||
});
|
||||
|
||||
if (data && data.el) {
|
||||
data.el.style.display = data.display;
|
||||
data.el.style.position = data.position;
|
||||
if (data.parent)
|
||||
data.parent.appendChild(data.el);
|
||||
$el.removeData('blockUI.history');
|
||||
}
|
||||
|
||||
if ($el.data('blockUI.static')) {
|
||||
$el.css('position', 'static'); // #22
|
||||
}
|
||||
|
||||
if (typeof opts.onUnblock == 'function')
|
||||
opts.onUnblock(el,opts);
|
||||
|
||||
// fix issue in Safari 6 where block artifacts remain until reflow
|
||||
var body = $(document.body), w = body.width(), cssW = body[0].style.width;
|
||||
body.width(w-1).width(w);
|
||||
body[0].style.width = cssW;
|
||||
}
|
||||
|
||||
// bind/unbind the handler
|
||||
function bind(b, el, opts) {
|
||||
var full = el == window, $el = $(el);
|
||||
|
||||
// don't bother unbinding if there is nothing to unbind
|
||||
if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked')))
|
||||
return;
|
||||
|
||||
$el.data('blockUI.isBlocked', b);
|
||||
|
||||
// don't bind events when overlay is not in use or if bindEvents is false
|
||||
if (!opts.bindEvents || (b && !opts.showOverlay))
|
||||
return;
|
||||
|
||||
// bind anchors and inputs for mouse and key events
|
||||
var events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove';
|
||||
if (b)
|
||||
$(document).bind(events, opts, handler);
|
||||
else
|
||||
$(document).unbind(events, handler);
|
||||
|
||||
// former impl...
|
||||
// var $e = $('a,:input');
|
||||
// b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);
|
||||
}
|
||||
|
||||
// event handler to suppress keyboard/mouse events when blocking
|
||||
function handler(e) {
|
||||
// allow tab navigation (conditionally)
|
||||
if (e.keyCode && e.keyCode == 9) {
|
||||
if (pageBlock && e.data.constrainTabKey) {
|
||||
var els = pageBlockEls;
|
||||
var fwd = !e.shiftKey && e.target === els[els.length-1];
|
||||
var back = e.shiftKey && e.target === els[0];
|
||||
if (fwd || back) {
|
||||
setTimeout(function(){focus(back);},10);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
var opts = e.data;
|
||||
var target = $(e.target);
|
||||
if (target.hasClass('blockOverlay') && opts.onOverlayClick)
|
||||
opts.onOverlayClick();
|
||||
|
||||
// allow events within the message content
|
||||
if (target.parents('div.' + opts.blockMsgClass).length > 0)
|
||||
return true;
|
||||
|
||||
// allow events for content that is not being blocked
|
||||
return target.parents().children().filter('div.blockUI').length === 0;
|
||||
}
|
||||
|
||||
function focus(back) {
|
||||
if (!pageBlockEls)
|
||||
return;
|
||||
var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0];
|
||||
if (e)
|
||||
e.focus();
|
||||
}
|
||||
|
||||
function center(el, x, y) {
|
||||
var p = el.parentNode, s = el.style;
|
||||
var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth');
|
||||
var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth');
|
||||
if (x) s.left = l > 0 ? (l+'px') : '0';
|
||||
if (y) s.top = t > 0 ? (t+'px') : '0';
|
||||
}
|
||||
|
||||
function sz(el, p) {
|
||||
return parseInt($.css(el,p),10)||0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*global define:true */
|
||||
if (typeof define === 'function' && define.amd && define.amd.jQuery) {
|
||||
define(['jquery'], setup);
|
||||
} else {
|
||||
setup(jQuery);
|
||||
}
|
||||
|
||||
})();
|
||||
@ -0,0 +1,142 @@
|
||||
/**
|
||||
*
|
||||
* (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.
|
||||
*
|
||||
*/
|
||||
|
||||
;(function() {
|
||||
var
|
||||
dropdownToggleHash = {};
|
||||
jQuery.extend({
|
||||
dropdownToggle: function(options) {
|
||||
// default options
|
||||
options = jQuery.extend({
|
||||
//switcherSelector: "#id" or ".class", - button
|
||||
//dropdownID: "id", - drop panel
|
||||
//anchorSelector: "#id" or ".class", - near field
|
||||
//noActiveSwitcherSelector: "#id" or ".class", - dont hide
|
||||
addTop: 0,
|
||||
addLeft: 0,
|
||||
position: "absolute",
|
||||
fixWinSize: true,
|
||||
enableAutoHide: true,
|
||||
showFunction: null,
|
||||
afterShowFunction: null,
|
||||
hideFunction: null,
|
||||
alwaysUp: false,
|
||||
simpleToggle: false,
|
||||
rightPos: false
|
||||
}, options);
|
||||
|
||||
var _toggle = function(switcherObj, dropdownID, addTop, addLeft, fixWinSize, position, anchorSelector, showFunction, alwaysUp, simpleToggle, afterShowFunction) {
|
||||
var dropdownItem = jq("#" + dropdownID);
|
||||
|
||||
if (typeof (simpleToggle) === "undefined" || simpleToggle === false) {
|
||||
fixWinSize = fixWinSize === true;
|
||||
addTop = addTop || 0;
|
||||
addLeft = addLeft || 0;
|
||||
position = position || "absolute";
|
||||
|
||||
var targetPos = jq(anchorSelector || switcherObj).offset();
|
||||
|
||||
if (!targetPos) return;
|
||||
|
||||
var elemPosLeft = targetPos.left;
|
||||
var elemPosTop = targetPos.top + jq(anchorSelector || switcherObj).outerHeight();
|
||||
if (options.rightPos) {
|
||||
elemPosLeft = Math.max(0,targetPos.left - dropdownItem.outerWidth() + jq(anchorSelector || switcherObj).outerWidth());
|
||||
}
|
||||
|
||||
var w = jq(window);
|
||||
var topPadding = w.scrollTop();
|
||||
var leftPadding = w.scrollLeft();
|
||||
|
||||
if (position === "fixed") {
|
||||
addTop -= topPadding;
|
||||
addLeft -= leftPadding;
|
||||
}
|
||||
|
||||
var scrWidth = w.width();
|
||||
var scrHeight = w.height();
|
||||
|
||||
if (fixWinSize && (!options.rightPos)
|
||||
&& (targetPos.left + addLeft + dropdownItem.outerWidth()) > (leftPadding + scrWidth)) {
|
||||
elemPosLeft = Math.max(0, leftPadding + scrWidth - dropdownItem.outerWidth()) - addLeft;
|
||||
}
|
||||
|
||||
if (fixWinSize
|
||||
&& (elemPosTop + dropdownItem.outerHeight()) > (topPadding + scrHeight)
|
||||
&& (targetPos.top - dropdownItem.outerHeight()) > topPadding
|
||||
|| alwaysUp) {
|
||||
elemPosTop = targetPos.top - dropdownItem.outerHeight();
|
||||
}
|
||||
|
||||
dropdownItem.css(
|
||||
{
|
||||
"position": position,
|
||||
"top": elemPosTop + addTop,
|
||||
"left": elemPosLeft + addLeft
|
||||
});
|
||||
}
|
||||
if (typeof showFunction === "function") {
|
||||
showFunction(switcherObj, dropdownItem);
|
||||
}
|
||||
|
||||
dropdownItem.toggle();
|
||||
|
||||
if (typeof afterShowFunction === "function") {
|
||||
afterShowFunction(switcherObj, dropdownItem);
|
||||
}
|
||||
};
|
||||
|
||||
var _registerAutoHide = function(event, switcherSelector, dropdownSelector, hideFunction) {
|
||||
if (jq(dropdownSelector).is(":visible")) {
|
||||
var $targetElement = jq((event.target) ? event.target : event.srcElement);
|
||||
if (!$targetElement.parents().andSelf().is(switcherSelector + ", " + dropdownSelector)) {
|
||||
if (typeof hideFunction === "function")
|
||||
hideFunction($targetElement);
|
||||
jq(dropdownSelector).hide();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (options.switcherSelector && options.dropdownID) {
|
||||
var toggleFunc = function(e) {
|
||||
_toggle(jq(this), options.dropdownID, options.addTop, options.addLeft, options.fixWinSize, options.position, options.anchorSelector, options.showFunction, options.alwaysUp, options.simpleToggle, options.afterShowFunction);
|
||||
};
|
||||
if (!dropdownToggleHash.hasOwnProperty(options.switcherSelector + options.dropdownID)) {
|
||||
jq(document).on("click", options.switcherSelector, toggleFunc);
|
||||
dropdownToggleHash[options.switcherSelector + options.dropdownID] = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (options.enableAutoHide && options.dropdownID) {
|
||||
var hideFunc = function(e) {
|
||||
var allSwitcherSelectors = options.noActiveSwitcherSelector ?
|
||||
options.switcherSelector + ", " + options.noActiveSwitcherSelector : options.switcherSelector;
|
||||
_registerAutoHide(e, allSwitcherSelectors, "#" + options.dropdownID, options.hideFunction);
|
||||
|
||||
};
|
||||
jq(document).unbind("click", hideFunc);
|
||||
jq(document).bind("click", hideFunc);
|
||||
}
|
||||
|
||||
return {
|
||||
toggle: _toggle,
|
||||
registerAutoHide: _registerAutoHide
|
||||
};
|
||||
}
|
||||
});
|
||||
})();
|
||||
1149
web/documentserver-example/java-spring/src/main/resources/static/scripts/jquery.fileupload.js
vendored
Executable file
@ -0,0 +1,142 @@
|
||||
/*
|
||||
* jQuery Iframe Transport Plugin 1.2
|
||||
* https://github.com/blueimp/jQuery-File-Upload
|
||||
*
|
||||
* Copyright 2011, Sebastian Tschan
|
||||
* https://blueimp.net
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* http://creativecommons.org/licenses/MIT/
|
||||
*/
|
||||
|
||||
/*jslint unparam: true */
|
||||
/*global jQuery */
|
||||
|
||||
(function ($) {
|
||||
'use strict';
|
||||
|
||||
// Helper variable to create unique names for the transport iframes:
|
||||
var counter = 0;
|
||||
|
||||
// The iframe transport accepts three additional options:
|
||||
// options.fileInput: a jQuery collection of file input fields
|
||||
// options.paramName: the parameter name for the file form data,
|
||||
// overrides the name property of the file input field(s)
|
||||
// options.formData: an array of objects with name and value properties,
|
||||
// equivalent to the return data of .serializeArray(), e.g.:
|
||||
// [{name: a, value: 1}, {name: b, value: 2}]
|
||||
$.ajaxTransport('iframe', function (options, originalOptions, jqXHR) {
|
||||
if (options.type === 'POST' || options.type === 'GET') {
|
||||
var form,
|
||||
iframe;
|
||||
return {
|
||||
send: function (headers, completeCallback) {
|
||||
form = $('<form style="display:none;"></form>');
|
||||
// javascript:false as initial iframe src
|
||||
// prevents warning popups on HTTPS in IE6.
|
||||
// IE versions below IE8 cannot set the name property of
|
||||
// elements that have already been added to the DOM,
|
||||
// so we set the name along with the iframe HTML markup:
|
||||
iframe = $(
|
||||
'<iframe src="javascript:false;" name="iframe-transport-' +
|
||||
(counter += 1) + '"></iframe>'
|
||||
).bind('load', function () {
|
||||
var fileInputClones;
|
||||
iframe
|
||||
.unbind('load')
|
||||
.bind('load', function () {
|
||||
// The complete callback returns the
|
||||
// iframe content document as response object:
|
||||
completeCallback(
|
||||
200,
|
||||
'success',
|
||||
{'iframe': iframe.contents()}
|
||||
);
|
||||
// Fix for IE endless progress bar activity bug
|
||||
// (happens on form submits to iframe targets):
|
||||
$('<iframe src="javascript:false;"></iframe>')
|
||||
.appendTo(form);
|
||||
form.remove();
|
||||
});
|
||||
form
|
||||
.prop('target', iframe.prop('name'))
|
||||
.prop('action', options.url)
|
||||
.prop('method', options.type);
|
||||
if (options.formData) {
|
||||
$.each(options.formData, function (index, field) {
|
||||
$('<input type="hidden"/>')
|
||||
.prop('name', field.name)
|
||||
.val(field.value)
|
||||
.appendTo(form);
|
||||
});
|
||||
}
|
||||
if (options.fileInput && options.fileInput.length &&
|
||||
options.type === 'POST') {
|
||||
fileInputClones = options.fileInput.clone();
|
||||
// Insert a clone for each file input field:
|
||||
options.fileInput.after(function (index) {
|
||||
return fileInputClones[index];
|
||||
});
|
||||
if (options.paramName) {
|
||||
options.fileInput.each(function () {
|
||||
$(this).prop('name', options.paramName);
|
||||
});
|
||||
}
|
||||
// Appending the file input fields to the hidden form
|
||||
// removes them from their original location:
|
||||
form
|
||||
.append(options.fileInput)
|
||||
.prop('enctype', 'multipart/form-data')
|
||||
// enctype must be set as encoding for IE:
|
||||
.prop('encoding', 'multipart/form-data');
|
||||
}
|
||||
form.submit();
|
||||
// Insert the file input fields at their original location
|
||||
// by replacing the clones with the originals:
|
||||
if (fileInputClones && fileInputClones.length) {
|
||||
options.fileInput.each(function (index, input) {
|
||||
var clone = $(fileInputClones[index]);
|
||||
$(input).prop('name', clone.prop('name'));
|
||||
clone.replaceWith(input);
|
||||
});
|
||||
}
|
||||
});
|
||||
form.append(iframe).appendTo('body');
|
||||
},
|
||||
abort: function () {
|
||||
if (iframe) {
|
||||
// javascript:false as iframe src aborts the request
|
||||
// and prevents warning popups on HTTPS in IE6.
|
||||
// concat is used to avoid the "Script URL" JSLint error:
|
||||
iframe
|
||||
.unbind('load')
|
||||
.prop('src', 'javascript'.concat(':false;'));
|
||||
}
|
||||
if (form) {
|
||||
form.remove();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// The iframe transport returns the iframe content document as response.
|
||||
// The following adds converters from iframe to text, json, html, and script:
|
||||
$.ajaxSetup({
|
||||
converters: {
|
||||
'iframe text': function (iframe) {
|
||||
return iframe.text();
|
||||
},
|
||||
'iframe json': function (iframe) {
|
||||
return $.parseJSON(iframe.text());
|
||||
},
|
||||
'iframe html': function (iframe) {
|
||||
return iframe.find('body').html();
|
||||
},
|
||||
'iframe script': function (iframe) {
|
||||
return $.globalEval(iframe.text());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}(jQuery));
|
||||
@ -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.
|
||||
*
|
||||
*/
|
||||
|
||||
if (typeof jQuery !== "undefined") {
|
||||
jq = jQuery.noConflict();
|
||||
|
||||
mustReload = false;
|
||||
|
||||
jq(function () {
|
||||
jq("#fileupload").fileupload({
|
||||
dataType: "json",
|
||||
add: function (e, data) {
|
||||
jq(".error").removeClass("error");
|
||||
jq(".done").removeClass("done");
|
||||
jq(".current").removeClass("current");
|
||||
jq("#step1").addClass("current");
|
||||
jq("#mainProgress .error-message").hide().find("span").text("");
|
||||
jq("#blockPassword").hide();
|
||||
jq("#mainProgress").removeClass("embedded");
|
||||
jq("#uploadFileName").text("");
|
||||
|
||||
jq.blockUI({
|
||||
theme: true,
|
||||
title: "File upload" + "<div class=\"dialog-close\"></div>",
|
||||
message: jq("#mainProgress"),
|
||||
overlayCSS: { "background-color": "#aaa" },
|
||||
themedCSS: { width: "539px", top: "20%", left: "50%", marginLeft: "-269px" }
|
||||
});
|
||||
jq("#beginEdit, #beginView, #beginEmbedded").addClass("disable");
|
||||
|
||||
data.submit();
|
||||
},
|
||||
always: function (e, data) {
|
||||
if (!jq("#mainProgress").is(":visible")) {
|
||||
return;
|
||||
}
|
||||
var response = data.result;
|
||||
if (response.error) {
|
||||
jq(".current").removeClass("current");
|
||||
jq(".step:not(.done)").addClass("error");
|
||||
jq("#mainProgress .error-message").show().find("span").text(response.error);
|
||||
jq('#hiddenFileName').val("");
|
||||
return;
|
||||
}
|
||||
|
||||
jq("#hiddenFileName").val(response.filename);
|
||||
jq("#uploadFileName").text(response.filename);
|
||||
jq("#uploadFileName").addClass(response.documentType);
|
||||
|
||||
mustReload = true;
|
||||
|
||||
jq("#step1").addClass("done").removeClass("current");
|
||||
|
||||
checkConvert();
|
||||
}
|
||||
});
|
||||
|
||||
initSelectors();
|
||||
});
|
||||
|
||||
var timer = null;
|
||||
var checkConvert = function (filePass = null) {
|
||||
if (timer !== null) {
|
||||
clearTimeout(timer);
|
||||
}
|
||||
|
||||
if (!jq("#mainProgress").is(":visible")) {
|
||||
return;
|
||||
}
|
||||
jq("#step2").addClass("current");
|
||||
jq("#filePass").val("");
|
||||
|
||||
var fileName = jq("#hiddenFileName").val();
|
||||
var posExt = fileName.lastIndexOf(".");
|
||||
posExt = 0 <= posExt ? fileName.substring(posExt).trim().toLowerCase() : "";
|
||||
|
||||
if (ConverExtList.indexOf(posExt) === -1) {
|
||||
jq("#step2").addClass("done").removeClass("current");
|
||||
loadScripts();
|
||||
return;
|
||||
}
|
||||
|
||||
timer = setTimeout(function () {
|
||||
jq.ajax({
|
||||
async: true,
|
||||
contentType: "application/json",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: JSON.stringify({filename: fileName, filePass: filePass}),
|
||||
url: UrlConverter,
|
||||
complete: function (data) {
|
||||
var responseText = data.responseText;
|
||||
var response = jq.parseJSON(responseText);
|
||||
if (response.error) {
|
||||
if (response.error.includes("Incorrect password")) {
|
||||
jq(".current").removeClass("current");
|
||||
jq("#step2").addClass("error");
|
||||
jq("#blockPassword").show();
|
||||
if (filePass) {
|
||||
jq("#filePass").addClass("errorInput");
|
||||
jq(".errorPass").text("The password is incorrect, please try again.");
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
jq(".current").removeClass("current");
|
||||
jq(".step:not(.done)").addClass("error");
|
||||
jq("#mainProgress .error-message").show().find("span").text(response.error);
|
||||
jq('#hiddenFileName').val("");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
jq("#hiddenFileName").val(response.filename);
|
||||
|
||||
if (response.step && response.step < 100) {
|
||||
checkConvert(filePass);
|
||||
} else {
|
||||
jq("#step2").addClass("done").removeClass("current");
|
||||
loadScripts();
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
var loadScripts = function () {
|
||||
if (!jq("#mainProgress").is(":visible")) {
|
||||
return;
|
||||
}
|
||||
jq("#step3").addClass("current");
|
||||
|
||||
if (jq("#loadScripts").is(":empty")) {
|
||||
var urlScripts = jq("#loadScripts").attr("data-docs");
|
||||
var frame = "<iframe id=\"iframeScripts\" width=1 height=1 style=\"position: absolute; visibility: hidden;\" ></iframe>";
|
||||
jq("#loadScripts").html(frame);
|
||||
document.getElementById("iframeScripts").onload = onloadScripts;
|
||||
jq("#loadScripts iframe").attr("src", urlScripts);
|
||||
} else {
|
||||
onloadScripts();
|
||||
}
|
||||
};
|
||||
|
||||
var onloadScripts = function () {
|
||||
if (!jq("#mainProgress").is(":visible")) {
|
||||
return;
|
||||
}
|
||||
jq("#step3").addClass("done").removeClass("current");
|
||||
jq("#beginView, #beginEmbedded").removeClass("disable");
|
||||
|
||||
var fileName = jq("#hiddenFileName").val();
|
||||
var posExt = fileName.lastIndexOf(".");
|
||||
posExt = 0 <= posExt ? fileName.substring(posExt).trim().toLowerCase() : "";
|
||||
|
||||
if (EditedExtList.indexOf(posExt) !== -1) {
|
||||
jq("#beginEdit").removeClass("disable");
|
||||
}
|
||||
};
|
||||
|
||||
var initSelectors = function () {
|
||||
var userSel = jq("#user");
|
||||
var langSel = jq("#language");
|
||||
|
||||
function getCookie(name) {
|
||||
let matches = document.cookie.match(new RegExp(
|
||||
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
|
||||
));
|
||||
return matches ? decodeURIComponent(matches[1]) : null;
|
||||
}
|
||||
function setCookie(name, value) {
|
||||
document.cookie = name + "=" + value + "; expires=" + new Date(Date.now() + 1000 * 60 * 60 * 24 * 7).toUTCString(); //week
|
||||
}
|
||||
|
||||
var userId = getCookie("uid");
|
||||
if (userId) userSel.val(userId);
|
||||
var langId = getCookie("ulang");
|
||||
if (langId) langSel.val(langId);
|
||||
|
||||
userSel.on("change", function () {
|
||||
setCookie("uid", userSel.val());
|
||||
});
|
||||
langSel.on("change", function () {
|
||||
setCookie("ulang", langSel.val());
|
||||
});
|
||||
};
|
||||
|
||||
jq(document).on("click", "#enterPass", function () {
|
||||
var pass = jq("#filePass").val();
|
||||
if (pass) {
|
||||
jq("#step2").removeClass("error");
|
||||
jq("#blockPassword").hide();
|
||||
checkConvert(pass);
|
||||
} else {
|
||||
jq("#filePass").addClass("errorInput");
|
||||
jq(".errorPass").text("Password can't be blank.");
|
||||
}
|
||||
});
|
||||
|
||||
jq(document).on("click", "#skipPass", function () {
|
||||
jq("#blockPassword").hide();
|
||||
loadScripts();
|
||||
});
|
||||
|
||||
jq(document).on("click", "#beginEdit:not(.disable)", function () {
|
||||
var fileId = encodeURIComponent(jq("#hiddenFileName").val());
|
||||
var url = UrlEditor + "?action=edit&fileName=" + fileId;
|
||||
window.open(url, "_blank");
|
||||
jq("#hiddenFileName").val("");
|
||||
jq.unblockUI();
|
||||
});
|
||||
|
||||
jq(document).on("click", "#beginView:not(.disable)", function () {
|
||||
var fileId = encodeURIComponent(jq("#hiddenFileName").val());
|
||||
var url = UrlEditor + "?action=view&fileName=" + fileId;
|
||||
window.open(url, "_blank");
|
||||
jq("#hiddenFileName").val("");
|
||||
jq.unblockUI();
|
||||
});
|
||||
|
||||
jq(document).on("click", "#beginEmbedded:not(.disable)", function () {
|
||||
var fileId = encodeURIComponent(jq("#hiddenFileName").val());
|
||||
var url = UrlEditor + "?type=embedded&action=embedded&fileName=" + fileId;
|
||||
|
||||
jq("#mainProgress").addClass("embedded");
|
||||
jq("#beginEmbedded").addClass("disable");
|
||||
|
||||
jq("#embeddedView").attr("src", url);
|
||||
});
|
||||
|
||||
jq(document).on("click", "#cancelEdit, .dialog-close", function () {
|
||||
jq('#hiddenFileName').val("");
|
||||
jq("#embeddedView").attr("src", "");
|
||||
jq.unblockUI();
|
||||
if (mustReload) {
|
||||
document.location.reload();
|
||||
}
|
||||
});
|
||||
|
||||
jq(document).on("click", ".try-editor", function (e) {
|
||||
var url = "/create?fileExt=" + e.target.attributes["data-type"].value;
|
||||
if (jq("#createSample").is(":checked")) {
|
||||
url += "&sample=true";
|
||||
}
|
||||
var w = window.open(url, "_blank");
|
||||
w.onload = function () {
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
|
||||
jq(document).on("click", ".delete-file", function () {
|
||||
var fileName = encodeURIComponent(jq(this).attr("data-filename"));
|
||||
|
||||
var requestAddress = "/delete";
|
||||
|
||||
jq.ajax({
|
||||
async: true,
|
||||
contentType: "application/json",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: JSON.stringify({filename: fileName, filePass: null}),
|
||||
url: requestAddress,
|
||||
complete: function (data) {
|
||||
document.location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
jq(".info").mouseover(function (event) {
|
||||
var target = event.target;
|
||||
var id = target.dataset.id ? target.dataset.id : target.id;
|
||||
var tooltip = target.dataset.tooltip;
|
||||
|
||||
jq("<div class='tooltip'>" + tooltip + "</div><div class='arrow'></div>").appendTo("body");
|
||||
|
||||
var left = jq("#" + id).offset().left + jq("#" + id).outerWidth();
|
||||
|
||||
var topElement = jq("#" + id).offset().top;
|
||||
var halfHeightElement = jq("#" + id).outerHeight() / 2;
|
||||
|
||||
var heightToFooter = jq("footer").offset().top - (topElement + halfHeightElement);
|
||||
var halfHeightTooltip = jq("div.tooltip").outerHeight() / 2;
|
||||
if (heightToFooter > (halfHeightTooltip + 10)) {
|
||||
var top = topElement + halfHeightElement - halfHeightTooltip;
|
||||
} else {
|
||||
var top = jq("footer").offset().top - jq("div.tooltip").outerHeight() - 10;
|
||||
}
|
||||
|
||||
jq("div.tooltip").css({"top": top, "left": left + 10});
|
||||
jq("div.arrow").css({"top": topElement + halfHeightElement, "left": left + 6});
|
||||
}).mouseout(function () {
|
||||
jq("div.tooltip").remove();
|
||||
jq("div.arrow").remove();
|
||||
});
|
||||
}
|
||||
172
web/documentserver-example/java-spring/src/main/resources/templates/editor.html
Executable file
@ -0,0 +1,172 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<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" />
|
||||
<!--
|
||||
*
|
||||
* (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.
|
||||
*
|
||||
-->
|
||||
<title>ONLYOFFICE</title>
|
||||
<link rel="icon" th:href="@{/css/img/{icon}.ico(icon=${model.getDocumentType()})}" type="image/x-icon"/>
|
||||
<link rel="stylesheet" type="text/css" href="css/editor.css" />
|
||||
|
||||
<script type="text/javascript" th:src="@{${docserviceApiUrl}}"></script>
|
||||
|
||||
<script th:inline="javascript">
|
||||
var docEditor;
|
||||
|
||||
var innerAlert = function (message) {
|
||||
if (console && console.log)
|
||||
console.log(message);
|
||||
};
|
||||
|
||||
var onAppReady = function () {
|
||||
innerAlert("Document editor ready");
|
||||
};
|
||||
|
||||
var onDocumentStateChange = function (event) {
|
||||
var title = document.title.replace(/\*$/g, "");
|
||||
document.title = title + (event.data ? "*" : "");
|
||||
};
|
||||
|
||||
var onRequestEditRights = function () {
|
||||
location.href = location.href.replace(RegExp("mode=view\&?", "i"), "");
|
||||
};
|
||||
|
||||
var onError = function (event) {
|
||||
if (event) innerAlert(event.data);
|
||||
};
|
||||
|
||||
var onOutdatedVersion = function (event) {
|
||||
location.reload(true);
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
var onMakeActionLink = function (event) {
|
||||
var actionData = event.data;
|
||||
var linkParam = JSON.stringify(actionData);
|
||||
docEditor.setActionLink(replaceActionLink(location.href, linkParam));
|
||||
};
|
||||
|
||||
var onMetaChange = function (event) {
|
||||
var favorite = !!event.data.favorite;
|
||||
var title = document.title.replace(/^\☆/g, "");
|
||||
document.title = (favorite ? "☆" : "") + title;
|
||||
docEditor.setFavorite(favorite);
|
||||
};
|
||||
|
||||
|
||||
var dataInsertImage = [[${dataInsertImage}]];
|
||||
|
||||
var onRequestInsertImage = function(event) {
|
||||
const temp = Object.assign({}, {"c": event.data.c}, dataInsertImage);
|
||||
docEditor.insertImage(temp);
|
||||
};
|
||||
|
||||
var onRequestCompareFile = function() {
|
||||
docEditor.setRevisedFile([[${dataCompareFile}]]);
|
||||
};
|
||||
|
||||
var onRequestMailMergeRecipients = function (event) {
|
||||
docEditor.setMailMergeRecipients([[${dataMailMergeRecipients}]]);
|
||||
};
|
||||
|
||||
var config = [[${model}]];
|
||||
|
||||
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,
|
||||
};
|
||||
|
||||
var histArray = [[${model.GetHistory()}]];
|
||||
var history = histArray[0];
|
||||
var historyData = histArray[1];
|
||||
<!-- String usersForMentions = [[${usersForMentions}]];-->
|
||||
|
||||
if (history && historyData) {
|
||||
config.events['onRequestHistory'] = function () {
|
||||
docEditor.refreshHistory(history);
|
||||
};
|
||||
config.events['onRequestHistoryData'] = function (event) {
|
||||
var ver = event.data;
|
||||
var histData = historyData;
|
||||
docEditor.setHistoryData(histData[ver - 1]);
|
||||
};
|
||||
config.events['onRequestHistoryClose'] = function () {
|
||||
document.location.reload();
|
||||
};
|
||||
}
|
||||
|
||||
<!-- if(usersForMentions){-->
|
||||
<!-- config.events['onRequestUsers'] = function () {-->
|
||||
<!-- docEditor.setUsers({-->
|
||||
<!-- "users": 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>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="form">
|
||||
<div id="iframeEditor"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
319
web/documentserver-example/java-spring/src/main/resources/templates/index.html
Executable file
@ -0,0 +1,319 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns:th="http://www.thymeleaf.org">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<!--
|
||||
*
|
||||
* (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.
|
||||
*
|
||||
-->
|
||||
<title>ONLYOFFICE</title>
|
||||
<link rel="icon" type="image/ico" href="/favicon.ico"/>
|
||||
<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" />
|
||||
<link rel="stylesheet" type="text/css" href="css/stylesheet.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/jquery-ui.css" />
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="center">
|
||||
<a href="">
|
||||
<img src ="css/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 clearFix">
|
||||
<ul class="try-editor-list clearFix">
|
||||
<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>
|
||||
|
||||
<form method="POST" action="/upload" enctype="multipart/form-data" class="upload-panel clearFix">
|
||||
<a class="file-upload">Upload file
|
||||
<input type="file" id="fileupload" name="file" />
|
||||
</a>
|
||||
</form>
|
||||
|
||||
<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" src="css/img/info.svg"
|
||||
th:attr="data-tooltip=${tooltip}"/>
|
||||
<select class="select-user" id="user">
|
||||
<option disabled="disabled" selected="selected">...</option>
|
||||
<option th:each="user : ${users}"
|
||||
th:value="${user.id}"
|
||||
th:text="${user.name}"/>
|
||||
</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="css/img/info.svg" />
|
||||
<select class="select-user" id="language">
|
||||
<option disabled="disabled" selected="selected">...</option>
|
||||
<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>
|
||||
</div>
|
||||
</td>
|
||||
<td class="section">
|
||||
<div class="main-panel">
|
||||
<th:block th:if="${#lists.isEmpty(files)}">
|
||||
<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>
|
||||
</th:block>
|
||||
<th:block th:if="${not #lists.isEmpty(files)}">
|
||||
<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>
|
||||
<tr th:each="file,iState : ${files}" class="tableRow" th:title="${files[iState.index].getName()}">
|
||||
<td class="contentCells">
|
||||
<a class="stored-edit" th:classappend="${docTypes[iState.index]}"
|
||||
th:href="@{/editor(fileName=${files[iState.index].getName()})}" target="_blank">
|
||||
<span th:title="${files[iState.index].getName()}" th:text="${files[iState.index].getName()}"></span>
|
||||
</a>
|
||||
</td>
|
||||
<th:block th:if="${filesEditable[iState.index]}">
|
||||
<td class="contentCells contentCells-icon">
|
||||
<a th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='edit')}" target="_blank">
|
||||
<img src="css/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 th:href="@{/editor(fileName=${files[iState.index].getName()},type='mobile',action='edit')}" target="_blank">
|
||||
<img src="css/img/mobile.svg" alt="Open in editor for mobile devices" title="Open in editor for mobile devices"/>
|
||||
</a>
|
||||
</td>
|
||||
<td class="contentCells contentCells-icon">
|
||||
<div th:if="${docTypes[iState.index]} eq 'word'">
|
||||
<a th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='review')}" target="_blank">
|
||||
<img src="css/img/review.svg" alt="Open in editor for review" title="Open in editor for review"/>
|
||||
</a>
|
||||
</div>
|
||||
<div th:if="${docTypes[iState.index]} eq 'cell'">
|
||||
<a th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='filter')}" target="_blank">
|
||||
<img src="css/img/filter.svg" alt="Open in editor without access to change the filter" title="Open in editor without access to change the filter" />
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
<td class="contentCells contentCells-icon">
|
||||
<a th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='comment')}" target="_blank">
|
||||
<img src="css/img/comment.svg" alt="Open in editor for comment" title="Open in editor for comment"/>
|
||||
</a>
|
||||
</td>
|
||||
<td class="contentCells contentCells-icon">
|
||||
<div th:if="${docTypes[iState.index]} eq 'word'">
|
||||
<a th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='fillForms')}" target="_blank">
|
||||
<img src="css/img/fill-forms.svg" alt="Open in editor for filling in forms" title="Open in editor for filling in forms"/>
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
<td class="contentCells contentCells-shift contentCells-icon">
|
||||
<div th:if="${docTypes[iState.index]} eq 'word'">
|
||||
<a th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='blockcontent')}" target="_blank">
|
||||
<img src="css/img/block-content.svg" alt="Open in editor without content control modification" title="Open in editor without content control modification"/>
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</th:block>
|
||||
<th:block th:if="${not filesEditable[iState.index]}">
|
||||
<td class="contentCells contentCells-shift contentCells-icon" colspan="6"></td>
|
||||
</th:block>
|
||||
<td class="contentCells contentCells-icon">
|
||||
<a th:href="@{/editor(fileName=${files[iState.index].getName()},type='desktop',action='view')}" target="_blank">
|
||||
<img src="css/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 th:href="@{/editor(fileName=${files[iState.index].getName()},type='mobile',action='view')}" target="_blank">
|
||||
<img src="css/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 th:href="@{/editor(fileName=${files[iState.index].getName()},type='embedded',action='embedded')}" target="_blank">
|
||||
<img src="css/img/embeded.svg" alt="Open in embedded mode" title="Open in embedded mode"/>
|
||||
</a>
|
||||
</td>
|
||||
<td class="contentCells contentCells-icon contentCells-shift">
|
||||
<a th:href="@{/download(fileName=${files[iState.index].getName()})}" target="_blank">
|
||||
<img class="icon-download" src="css/img/download.svg" alt="Download" title="Download" />
|
||||
</a>
|
||||
</td>
|
||||
<td class="contentCells contentCells-icon contentCells-shift">
|
||||
<a class="delete-file" th:attr="data-filename=${files[iState.index].getName()}">
|
||||
<img class="icon-delete" src="css/img/delete.svg" alt="Delete" title="Delete" />
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
</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></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" th:attr="data-docs=${datadocs}"></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">
|
||||
© Ascensio Systems SIA 2020. All rights reserved.
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script type="text/javascript" src="scripts/jquery-1.8.2.js"></script>
|
||||
<script type="text/javascript" src="scripts/jquery-ui.js"></script>
|
||||
<script type="text/javascript" src="scripts/jquery.blockUI.js"></script>
|
||||
<script type="text/javascript" src="scripts/jquery.iframe-transport.js"></script>
|
||||
<script type="text/javascript" src="scripts/jquery.fileupload.js"></script>
|
||||
<script type="text/javascript" src="scripts/jquery.dropdownToggle.js"></script>
|
||||
<script type="text/javascript" src="scripts/jscript.js"></script>
|
||||
<script type="text/javascript" src="scripts/converter.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Not implemented</title>
|
||||
</head>
|
||||
<body>
|
||||
<b>
|
||||
<big>
|
||||
<p style="text-align: center">This feature is not implemented yet</p>
|
||||
</big>
|
||||
</b>
|
||||
</body>
|
||||
</html>
|
||||