Skip to content

Commit

Permalink
add README-EN.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ethendev committed Oct 28, 2019
1 parent 2ec3802 commit c34806b
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 22 deletions.
40 changes: 40 additions & 0 deletions README-EN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
### Introduction
WopiHost supports previewing and editing documents such as word, excel, and ppt (preview only) through Office Web Apps.

### Environment
First you need to install Office online 2016 and java 1.8.

### Usage
word preview

http://[owas.domain]/wv/wordviewerframe.aspx?WOPISrc=http://[WopiHost.domain]:8080/wopi/files/test.docx&access_token=123
![Alt text](http://img.blog.csdn.net/20170418172425910?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQveXVmZWl5YW5saXU=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)

word editor

http://[owas.domain]/we/wordeditorframe.aspx?WOPISrc=http://[WopiHost.domain]:8080/wopi/files/test.docx&access_token=123
![Alt text](http://img.blog.csdn.net/20170418172534332?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQveXVmZWl5YW5saXU=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)

excel preview

http://[owas.domain]/x/_layouts/xlviewerinternal.aspx?ui=zh-CN&rs=zh-CN&WOPISrc=http://[WopiHost.domain]:8080/wopi/files/test.xlsx&access_token=123

excel editor

http://[owas.domain]/x/_layouts/xlviewerinternal.aspx?edit=1&WOPISrc=http://[WopiHost.domain]:8080/wopi/files/test.xlsx&access_token=123

ppt preview

http://[owas.domain]/p/PowerPointFrame.aspx?PowerPointView=ReadingView&WOPISrc=http://[WopiHost.domain]:8080/wopi/files/test.pptx&access_token=123

ppt editor

http://[owas.domain]/p/PowerPointFrame.aspx?PowerPointView=EditView&WOPISrc=http://[WopiHost.domain]:8080/wopi/files/test.pptx&access_token=123

Note:[owas.domain] is the IP address of Office online 2016,[WopiHost.domain] is the address of wopihost。

### Frequently Asked Questions
* Doc files cannot be previewed and edited, but docx is ok.
* PPT files cannot be previewed and edited.
* If the document cannot be edited or previewed, make sure that the wopi server can access the office server.
* I didn't check the access_token parameter. if you need it, implement it yourself.
31 changes: 11 additions & 20 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,15 @@
<packaging>jar</packaging>

<name>wopihost</name>
<description>Demo project for Spring Boot</description>
<description>office online preview and editor</description>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
<version>2.0.0.RELEASE</version>
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>

Expand All @@ -35,13 +32,6 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

<!-- 打包时加入此项, 告诉spring-boot tomcat相关jar包用外部的,不要打进去 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<!--<scope>provided</scope>-->
</dependency>
</dependencies>

<build>
Expand All @@ -51,14 +41,15 @@
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>

<!--<plugin>-->
<!--<groupId>org.apache.maven.plugins</groupId>-->
<!--<artifactId>maven-compiler-plugin</artifactId>-->
<!--<configuration>-->
<!--<source>1.7</source>-->
<!--<target>1.7</target>-->
<!--</configuration>-->
<!--</plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/wopihost/WopiHostContrller.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public void postFile(@PathVariable(name = "name") String name, @RequestBody byte
* @throws UnsupportedEncodingException
*/
@GetMapping("/files/{name}")
public void getFileInfo(@PathVariable(name = "name") String name, HttpServletRequest request, HttpServletResponse response) {
public void getFileInfo(HttpServletRequest request, HttpServletResponse response) {
String uri = request.getRequestURI();
FileInfo info = new FileInfo();
try {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# officeÎĵµÂ·¾¶
# office file path
file.path=E:\\

0 comments on commit c34806b

Please sign in to comment.