Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
slm-fileview
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jenkins
slm-fileview
Commits
0db6b23b
Commit
0db6b23b
authored
Apr 16, 2019
by
陈精华
Committed by
kl
Apr 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Linux下集成OpenOffice
parent
6dc10e8d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
69 additions
and
51 deletions
+69
-51
OfficeUtils.java
...ava/org/artofsolving/jodconverter/office/OfficeUtils.java
+1
-0
startup.sh
jodconverter-web/src/main/bin/startup.sh
+24
-3
ConfigRefreshComponent.java
...rc/main/java/cn/keking/config/ConfigRefreshComponent.java
+2
-3
HomePathUtils.java
...rter-web/src/main/java/cn/keking/utils/HomePathUtils.java
+0
-26
assembly.xml
jodconverter-web/src/main/resources/assembly.xml
+5
-0
logback.xml
jodconverter-web/src/main/resources/logback.xml
+0
-19
install.sh
jodconverter-web/src/main/script/install.sh
+37
-0
No files found.
jodconverter-core/src/main/java/org/artofsolving/jodconverter/office/OfficeUtils.java
View file @
0db6b23b
...
...
@@ -86,6 +86,7 @@ public class OfficeUtils {
return
findOfficeHome
(
"/opt/openoffice.org3"
,
"/opt/libreoffice"
,
"/opt/openoffice4"
,
"/usr/lib/openoffice"
,
"/usr/lib/libreoffice"
);
...
...
jodconverter-web/src/main/bin/startup.sh
View file @
0db6b23b
#!/bin/bash
KKFILEVIEW_BIN_FOLDER
=
$(
cd
"
$(
dirname
"
$0
"
)
"
;
pwd
)
DIR_HOME
=(
"/opt/openoffice.org3"
"/opt/libreoffice"
"/opt/openoffice4"
"/usr/lib/openoffice"
"/usr/lib/libreoffice"
)
FLAG
=
OFFICE_HOME
=
KKFILEVIEW_BIN_FOLDER
=
$(
cd
"
$(
dirname
"
$0
"
)
"
;
pwd
)
vim
export
KKFILEVIEW_BIN_FOLDER
=
$KKFILEVIEW_BIN_FOLDER
cd
$KKFILEVIEW_BIN_FOLDER
echo
"Using KKFILEVIEW_BIN_FOLDER
$KKFILEVIEW_BIN_FOLDER
"
grep
'office\.home'
../conf/application.properties |
grep
'!^#'
if
[
$?
-eq
0
]
;
then
echo
"Using customized office.home"
else
for
i
in
${
DIR_HOME
[@]
}
do
if
[
-f
$i
"/program/soffice.bin"
]
;
then
FLAG
=
true
OFFICE_HOME
=
${
i
}
break
fi
done
if
[
!
-n
"
${
FLAG
}
"
]
;
then
echo
"Installing OpenOffice"
sh ../script/install.sh
else
echo
"Detected office component has been installed in
$OFFICE_HOME
"
fi
fi
echo
"Starting kkFileView..."
echo
"Please check log file for more information"
nohup
java
-Dspring
.config.location
=
../conf/application.properties
-jar
kkFileView-0.1.jar ../log/kkFileView.log 2>&1 &
\ No newline at end of file
nohup
java
-Dspring
.config.location
=
../conf/application.properties
-jar
kkFileView-0.1.jar
>
../log/kkFileView.log 2>&1 &
jodconverter-web/src/main/java/cn/keking/config/ConfigRefreshComponent.java
View file @
0db6b23b
package
cn
.
keking
.
config
;
import
cn.keking.utils.HomePath
Utils
;
import
org.artofsolving.jodconverter.office.Office
Utils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.PostConstruct
;
import
java.io.BufferedReader
;
import
java.io.File
;
import
java.io.FileReader
;
import
java.io.IOException
;
import
java.util.Properties
;
...
...
@@ -38,7 +37,7 @@ public class ConfigRefreshComponent {
String
convertedFileCharset
;
String
[]
textArray
;
String
[]
mediaArray
;
String
homePath
=
HomePath
Utils
.
getHomePath
();
String
homePath
=
Office
Utils
.
getHomePath
();
String
separator
=
java
.
io
.
File
.
separator
;
String
configFilePath
=
homePath
+
separator
+
"conf"
+
separator
+
"application.properties"
;
while
(
true
)
{
...
...
jodconverter-web/src/main/java/cn/keking/utils/HomePathUtils.java
deleted
100644 → 0
View file @
6dc10e8d
package
cn
.
keking
.
utils
;
import
java.io.File
;
/**
* @auther: chenjh
* @time: 2019/4/15 9:11
* @description
*/
public
class
HomePathUtils
{
public
static
String
getHomePath
()
{
String
userDir
=
System
.
getenv
(
"KKFILEVIEW_BIN_FOLDER"
);
if
(
userDir
==
null
)
{
userDir
=
System
.
getProperty
(
"user.dir"
);
}
if
(
userDir
.
endsWith
(
"bin"
))
{
userDir
=
userDir
.
substring
(
0
,
userDir
.
length
()
-
4
);
}
else
{
String
separator
=
File
.
separator
;
userDir
=
userDir
+
separator
+
"jodconverter-web"
+
separator
+
"src"
+
separator
+
"main"
;
}
return
userDir
;
}
}
jodconverter-web/src/main/resources/assembly.xml
View file @
0db6b23b
...
...
@@ -20,6 +20,11 @@
<outputDirectory>
${file.separator}bin
</outputDirectory>
<fileMode>
755
</fileMode>
</fileSet>
<fileSet>
<directory>
src/main/script
</directory>
<outputDirectory>
${file.separator}script
</outputDirectory>
<fileMode>
755
</fileMode>
</fileSet>
<fileSet>
<directory>
src/main/log
</directory>
<outputDirectory>
${file.separator}log
</outputDirectory>
...
...
jodconverter-web/src/main/resources/logback.xml
deleted
100644 → 0
View file @
6dc10e8d
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property
name=
"LOG_FILE"
value=
"@logging.path@/app.log"
></property>
<include
resource=
"org/springframework/boot/logging/logback/base.xml"
/>
<jmxConfigurator/>
<logger
name=
"org.springframework.web"
level=
"info"
/>
<appender
name=
"stash"
class=
"net.logstash.logback.appender.LogstashSocketAppender"
>
<port>
10800
</port>
<host>
192.168.1.109
</host>
<includeCallerData>
true
</includeCallerData>
<customFields>
{"app_name":"@appName@"}
</customFields>
</appender>
<root
level=
"INFO"
>
<!--<appender-ref ref="dailyRollingFile"/>
<appender-ref ref="consoleRolling"/>-->
<appender-ref
ref=
"stash"
/>
</root>
</configuration>
\ No newline at end of file
jodconverter-web/src/main/script/install.sh
0 → 100644
View file @
0db6b23b
#!/bin/bash
cd
/tmp
install_redhat
()
{
wget https://iweb.dl.sourceforge.net/project/openofficeorg.mirror/4.1.6/binaries/zh-CN/Apache_OpenOffice_4.1.6_Linux_x86-64_install-rpm_zh-CN.tar.gz
-cO
openoffice_rpm.tar.gz
&&
tar
zxf /tmp/openoffice_rpm.tar.gz
&&
cd
/tmp/zh-CN/RPMS
if
[
$?
-eq
0
]
;
then
rpm
-Uvih
*
.rpm
echo
'install desktop service ...'
rpm
-Uvih
desktop-integration/openoffice4.1.6-redhat-menus-4.1.6-9790.noarch.rpm
echo
'install finshed...'
else
echo
'download package error...'
fi
}
install_ubuntu
()
{
wget https://iweb.dl.sourceforge.net/project/openofficeorg.mirror/4.1.6/binaries/zh-CN/Apache_OpenOffice_4.1.6_Linux_x86-64_install-deb_zh-CN.tar.gz
-cO
openoffice_deb.tar.gz
&&
tar
zxf /tmp/openoffice_deb.tar.gz
&&
cd
/tmp/zh-CN/DEBS
echo
$?
if
[
$?
-eq
0
]
;
then
dpkg
-i
*
.deb
echo
'install desktop service ...'
dpkg
-i
desktop-integration/openoffice4.1-debian-menus_4.1.6-9790_all.deb
echo
'install finshed...'
else
echo
'download package error...'
fi
}
if
[
-f
"/etc/redhat-release"
]
;
then
yum
install
wget
install_redhat
else
apt-get
install
wget
install_ubuntu
fi
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment