O2OA服务器支持使用webdav协议来存储二进制文件.

Tomcat默认是支持WebDAV的,且默认为禁用状态.

可以开启Tomcat的webdav作为文件存储服务器.

开启步骤如下:

1.在tomcat的webapp是目录下创建一个webdav目录作为项目.

2.在webdav目录下创建WEB-INF/web.xml

web.xml内容如下:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="http://java.sun.com/xml/ns/javaee"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
	id="WebApp_ID" version="3.0">
	<display-name>webdav</display-name>
	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
		<welcome-file>index.htm</welcome-file>
		<welcome-file>index.jsp</welcome-file>
		<welcome-file>default.html</welcome-file>
		<welcome-file>default.htm</welcome-file>
		<welcome-file>default.jsp</welcome-file>
	</welcome-file-list>
	<servlet>
		<servlet-name>webdav</servlet-name>
		<servlet-class>org.apache.catalina.servlets.WebdavServlet</servlet-class>
		<init-param>
			<param-name>debug</param-name>
			<param-value>0</param-value>
		</init-param>
		<init-param>
			<param-name>listings</param-name>
			<param-value>true</param-value>
		</init-param>
		<!-- Read-Write Access Settings -->
		<init-param>
			<param-name>readonly</param-name>
			<param-value>false</param-value>
		</init-param>
	</servlet>
	<!-- URL Mapping -->
	<servlet-mapping>
		<servlet-name>webdav</servlet-name>
		<url-pattern>/*</url-pattern>
	</servlet-mapping>
	<security-constraint>
		<web-resource-collection>
			<web-resource-name>webdav</web-resource-name>
			<!-- Detect WebDAV Methods in URL For Whole Application -->
			<url-pattern>/*</url-pattern>
			<http-method>PROPFIND</http-method>
			<http-method>PROPPATCH</http-method>
			<http-method>COPY</http-method>
			<http-method>MOVE</http-method>
			<http-method>LOCK</http-method>
			<http-method>UNLOCK</http-method>
		</web-resource-collection>
		<!-- Restrict access by role -->
		<auth-constraint>
			<role-name>*</role-name>
		</auth-constraint>
	</security-constraint>
	<login-config>
		<auth-method>BASIC</auth-method>
		<realm-name>webdav</realm-name>
	</login-config>
	<security-role>
		<description>WebDAV User</description>
		<role-name>webdav</role-name>
	</security-role>
</web-app>

3.在tomcat/conf目录下的tomcat-users.xml文件中添加webdav访问用户

4.启动Tomcat

<?xml version="1.0" encoding="UTF-8"?>
<tomcat-users xmlns="http://tomcat.apache.org/xml"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
              version="1.0">
  <role rolename="webdav"/>
  <user username="admin" password="admin" roles="webdav"/>
</tomcat-users>

5.在o2server/configSample目录下拷贝externalStorageSources.json到o2server/config目录

修改配置指向webdav

{
  "file": [
    {
      "protocol": "webdav",
      "username": "admin",
      "password": "admin",
      "host": "127.0.0.1",
      "port": 8080.0,
      "prefix": "webdav/file/",
      "enable": true,
      "weight": 100.0,
      "name": "251",
      "deepPath": false,
      "###protocol": "协议,可选值ftp,webdav###",
      "###username": "登录用户名.###",
      "###password": "登录密码.###",
      "###host": "主机地址.###",
      "###port": "端口.###",
      "###prefix": "前缀路径.###",
      "###enable": "是否启用###",
      "###weight": "设置权重.###",
      "###name": "存储节点名,对应存储名称,谨慎修改.###",
      "###deepPath": "是否使用更深的路径.###"
    }
  ],
  "processPlatform": [
    {
      "protocol": "webdav",
      "username": "admin",
      "password": "admin",
      "host": "127.0.0.1",
      "port": 8080.0,
      "prefix": "webdav/processPlatform/",
      "enable": true,
      "weight": 100.0,
      "name": "251",
      "deepPath": false,
      "###protocol": "协议,可选值ftp,webdav###",
      "###username": "登录用户名.###",
      "###password": "登录密码.###",
      "###host": "主机地址.###",
      "###port": "端口.###",
      "###prefix": "前缀路径.###",
      "###enable": "是否启用###",
      "###weight": "设置权重.###",
      "###name": "存储节点名,对应存储名称,谨慎修改.###",
      "###deepPath": "是否使用更深的路径.###"
    }
  ],
  "mind": [
    {
      "protocol": "webdav",
      "username": "admin",
      "password": "admin",
      "host": "127.0.0.1",
      "port": 8080.0,
      "prefix": "webdav/mind/",
      "enable": true,
      "weight": 100.0,
      "name": "251",
      "deepPath": false,
      "###protocol": "协议,可选值ftp,webdav###",
      "###username": "登录用户名.###",
      "###password": "登录密码.###",
      "###host": "主机地址.###",
      "###port": "端口.###",
      "###prefix": "前缀路径.###",
      "###enable": "是否启用###",
      "###weight": "设置权重.###",
      "###name": "存储节点名,对应存储名称,谨慎修改.###",
      "###deepPath": "是否使用更深的路径.###"
    }
  ],
  "meeting": [
    {
      "protocol": "webdav",
      "username": "admin",
      "password": "admin",
      "host": "127.0.0.1",
      "port": 8080.0,
      "prefix": "webdav/meeting/",
      "enable": true,
      "weight": 100.0,
      "name": "251",
      "deepPath": false,
      "###protocol": "协议,可选值ftp,webdav###",
      "###username": "登录用户名.###",
      "###password": "登录密码.###",
      "###host": "主机地址.###",
      "###port": "端口.###",
      "###prefix": "前缀路径.###",
      "###enable": "是否启用###",
      "###weight": "设置权重.###",
      "###name": "存储节点名,对应存储名称,谨慎修改.###",
      "###deepPath": "是否使用更深的路径.###"
    }
  ],
  "calendar": [
    {
      "protocol": "webdav",
      "username": "admin",
      "password": "admin",
      "host": "127.0.0.1",
      "port": 8080.0,
      "prefix": "webdav/calendar/",
      "enable": true,
      "weight": 100.0,
      "name": "251",
      "deepPath": false,
      "###protocol": "协议,可选值ftp,webdav###",
      "###username": "登录用户名.###",
      "###password": "登录密码.###",
      "###host": "主机地址.###",
      "###port": "端口.###",
      "###prefix": "前缀路径.###",
      "###enable": "是否启用###",
      "###weight": "设置权重.###",
      "###name": "存储节点名,对应存储名称,谨慎修改.###",
      "###deepPath": "是否使用更深的路径.###"
    }
  ],
  "okr": [
    {
      "protocol": "webdav",
      "username": "admin",
      "password": "admin",
      "host": "127.0.0.1",
      "port": 8080.0,
      "prefix": "webdav/okr/",
      "enable": true,
      "weight": 100.0,
      "name": "251",
      "deepPath": false,
      "###protocol": "协议,可选值ftp,webdav###",
      "###username": "登录用户名.###",
      "###password": "登录密码.###",
      "###host": "主机地址.###",
      "###port": "端口.###",
      "###prefix": "前缀路径.###",
      "###enable": "是否启用###",
      "###weight": "设置权重.###",
      "###name": "存储节点名,对应存储名称,谨慎修改.###",
      "###deepPath": "是否使用更深的路径.###"
    }
  ],
  "cms": [
    {
      "protocol": "webdav",
      "username": "admin",
      "password": "admin",
      "host": "127.0.0.1",
      "port": 8080.0,
      "prefix": "webdav/cms/",
      "enable": true,
      "weight": 100.0,
      "name": "251",
      "deepPath": false,
      "###protocol": "协议,可选值ftp,webdav###",
      "###username": "登录用户名.###",
      "###password": "登录密码.###",
      "###host": "主机地址.###",
      "###port": "端口.###",
      "###prefix": "前缀路径.###",
      "###enable": "是否启用###",
      "###weight": "设置权重.###",
      "###name": "存储节点名,对应存储名称,谨慎修改.###",
      "###deepPath": "是否使用更深的路径.###"
    }
  ],
  "bbs": [
    {
      "protocol": "webdav",
      "username": "admin",
      "password": "admin",
      "host": "127.0.0.1",
      "port": 8080.0,
      "prefix": "webdav/bbs/",
      "enable": true,
      "weight": 100.0,
      "name": "251",
      "deepPath": false,
      "###protocol": "协议,可选值ftp,webdav###",
      "###username": "登录用户名.###",
      "###password": "登录密码.###",
      "###host": "主机地址.###",
      "###port": "端口.###",
      "###prefix": "前缀路径.###",
      "###enable": "是否启用###",
      "###weight": "设置权重.###",
      "###name": "存储节点名,对应存储名称,谨慎修改.###",
      "###deepPath": "是否使用更深的路径.###"
    }
  ],
  "report": [
    {
      "protocol": "webdav",
      "username": "admin",
      "password": "admin",
      "host": "127.0.0.1",
      "port": 8080.0,
      "prefix": "webdav/report/",
      "enable": true,
      "weight": 100.0,
      "name": "251",
      "deepPath": false,
      "###protocol": "协议,可选值ftp,webdav###",
      "###username": "登录用户名.###",
      "###password": "登录密码.###",
      "###host": "主机地址.###",
      "###port": "端口.###",
      "###prefix": "前缀路径.###",
      "###enable": "是否启用###",
      "###weight": "设置权重.###",
      "###name": "存储节点名,对应存储名称,谨慎修改.###",
      "###deepPath": "是否使用更深的路径.###"
    }
  ],
  "strategyDeploy": [
    {
      "protocol": "webdav",
      "username": "admin",
      "password": "admin",
      "host": "127.0.0.1",
      "port": 8080.0,
      "prefix": "webdav/strategyDeploy/",
      "enable": true,
      "weight": 100.0,
      "name": "251",
      "deepPath": false,
      "###protocol": "协议,可选值ftp,webdav###",
      "###username": "登录用户名.###",
      "###password": "登录密码.###",
      "###host": "主机地址.###",
      "###port": "端口.###",
      "###prefix": "前缀路径.###",
      "###enable": "是否启用###",
      "###weight": "设置权重.###",
      "###name": "存储节点名,对应存储名称,谨慎修改.###",
      "###deepPath": "是否使用更深的路径.###"
    }
  ],
  "teamwork": [
    {
      "protocol": "webdav",
      "username": "admin",
      "password": "admin",
      "host": "127.0.0.1",
      "port": 8080.0,
      "prefix": "webdav/teamwork/",
      "enable": true,
      "weight": 100.0,
      "name": "251",
      "deepPath": false,
      "###protocol": "协议,可选值ftp,webdav###",
      "###username": "登录用户名.###",
      "###password": "登录密码.###",
      "###host": "主机地址.###",
      "###port": "端口.###",
      "###prefix": "前缀路径.###",
      "###enable": "是否启用###",
      "###weight": "设置权重.###",
      "###name": "存储节点名,对应存储名称,谨慎修改.###",
      "###deepPath": "是否使用更深的路径.###"
    }
  ],
  "structure": [
    {
      "protocol": "webdav",
      "username": "admin",
      "password": "admin",
      "host": "127.0.0.1",
      "port": 8080.0,
      "prefix": "webdav/structure/",
      "enable": true,
      "weight": 100.0,
      "name": "251",
      "deepPath": false,
      "###protocol": "协议,可选值ftp,webdav###",
      "###username": "登录用户名.###",
      "###password": "登录密码.###",
      "###host": "主机地址.###",
      "###port": "端口.###",
      "###prefix": "前缀路径.###",
      "###enable": "是否启用###",
      "###weight": "设置权重.###",
      "###name": "存储节点名,对应存储名称,谨慎修改.###",
      "###deepPath": "是否使用更深的路径.###"
    }
  ],
  "general": [
    {
      "protocol": "webdav",
      "username": "admin",
      "password": "admin",
      "host": "127.0.0.1",
      "port": 8080.0,
      "prefix": "webdav/general/",
      "enable": true,
      "weight": 100.0,
      "name": "251",
      "deepPath": false,
      "###protocol": "协议,可选值ftp,webdav###",
      "###username": "登录用户名.###",
      "###password": "登录密码.###",
      "###host": "主机地址.###",
      "###port": "端口.###",
      "###prefix": "前缀路径.###",
      "###enable": "是否启用###",
      "###weight": "设置权重.###",
      "###name": "存储节点名,对应存储名称,谨慎修改.###",
      "###deepPath": "是否使用更深的路径.###"
    }
  ]
}

6.在o2server/config目录下将node_xxx.xxx.xxx.xxx.json中的storage服务器设置为禁用.

  "storage": {
    "enable": false,
    "port": 20040.0,
    "sslEnable": false,
    "name": "251",
    "accounts": [],
    "prefix": "",
    "deepPath": false,
    "###enable": "是否启用,对于二进制流文件,比如附件,图片等存储在单独的文件服务器中,可以支持多种文件服务器,默认情况下使用ftp服务器作为文件服务器,每个节点可以启动一个文件服务器以提供高性能.###",
    "###port": "ftp服务器端口,此端口可以不对外开放,仅有ApplicationServer进行访问,并不直接对用户提供服务.###",
    "###sslEnable": "是否启用ssl传输加密,如果启用将使用config/keystore文件作为密钥文件.使用config/token.json文件中的sslKeyStorePassword字段为密钥密码,sslKeyManagerPassword为管理密码.###",
    "###name": "名称,多个节点中不能重名,默认为251.###",
    "###accounts": "二进制流文件是分多个账号分段存储的,可以单独设置每个分类的存储配置,一般不需要设置.###",
    "###passivePorts": "ftp传输有主动和被动之分,如果使用了被动传输,设置被动端口范围,默认为29000-30000.###",
    "###prefix": "路径前缀.###",
    "###deepPath": "使用更深的路径###"
  }

7.启动服务器o2server服务已经将存储转向tomcat服务器所提供的webdav服务.

📎tomcat-users.xml

📎webdav.zip

推荐文章:

流程设计-流程设计与应用权限设置
2021-02-26
本文主要介绍如何在O2OA中进行审批流程或者工作流设计,O2OA主要采用拖拽可视化开发的方式完成流程的设计和配置,不需要过多的代码编写,业务人员可以直接进行修改
开发知识-O2OA平台启用Eruda进行移动端调试
2021-02-07
//reload--是否重新加载页面。true表示重新加载页面;默认falseo2.debug(reload);
藕粉社区问答系列1
2021-09-16
@开发问题@知识问答@藕粉社区@开发经验@O2OA[流程开发]请问在未能找到处理人的情况下如何指定一个处理人?问题内容:比如在办理阶段没有指定办理人,系统现在默
数据中心-自定义数据表
2021-03-01
O2OA提供的数据管理中心,可以让用户通过配置的形式完成对数据的汇总,统计和数据分组展现,查询和搜索数据形成列表数据展现。也支持用户配置独立的数据表来适应特殊的
linux环境libreoffice安装及使用
2021-08-27
进入官网或者下载源下载适配操作系统的版本,linux下载rpm版本,截止本文档最新的版本是7.2,可以下载次新稳定版本7.1.5,下载完成后执行下面命令解压安装
系统集成-SSO与单点认证
2021-02-26
O2OA平台提供灵活的系统集成方案,让企业信息平台与各类第三方系统进行集成。本篇主要介绍如何在O2OA中与其他系统实现单点登入。
开发知识-单个端口模式的Nginx和系统配置
2021-02-07
配置目的部分企事业单位外网地址不能开通太多的端口,我们使用单个端口,上下文根的方式配置访问地址。Nginx服务器域名:harbor.o2oa.net(172.1
CRM客户管理使用手册
2021-02-19
O2OA包含一个简单的开源CRM客户信息管理系统,提供客户信息管理,客户线索管理,公海管理,联系人管理以及跟进信息和数据统计功能。O2OA是一款以流程管理为核心
表单-手写板组件配置
2021-10-22
简介V6.4版本中,O2OA平台的表单中新增了组件-手写板。该组件基于浏览器Canvas实现了手写和涂鸦基本功能、更改笔触大小颜色、插入背景图、橡皮檫、历史记录
系统安全-用户登录IP限制
2021-02-25
为增加系统和用户的安全性增加用户登录IP限制功能,此功能仅对PC端,移动端不限制(移动端需要满足外网登录需求),此功业务场景适用于内网系统。本篇主要介绍如何将在

results matching ""

    No results matching ""