| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
The sample provides Class 2 WebDAV server implementation that can be hosted in Apache Tomcat, GlassFish, JBoss, WebLogic, WebSphere or other compliant application server. All data including file content, documents structure and custom attributes is stored in Oracle database. The IT Hit WebDAV Ajax Library is used to display and browse server content on a default web page as well as to open documents for editing from a web page and save back directly to server.
You will also need the IT Hit WebDAV Ajax Library to display JavaScript UI on a default web page. You can install it from NPM using NPM command line tool, see below. Node.js is ONLY required to download the JavaScript files used in the project. Node.js is NOT required to run the server.
It is also recommended to increase the datafile. After creating the database run the following command:
alter database datafile ' C:\oraclexe\oradata\XE\SYSTEM.DBF' resize 4g;
This is especially required if you would like to test WebDAV server running Oracle XE with IT Hit AJAX File Browser.
<init-param> <param-name>license</param-name> <param-value>C:\License.lic</param-value> </init-param>The IT Hit Java WebDAV Server Library is fully functional and does not have any limitations. However, the trial period is limited to 1 month. After the trial period expires the Java WebDAV Server will stop working.
npm install webdav.clientThis will download IT Hit WebDAV Ajax Library files into your project. Note that Node.js itself is NOT required to run the server, it is used ONLY to install the required JavaScript files.
<Context path="" debug="0" docBase="oraclestorage"> <Resource name="jdbc/Oracle" auth="Container" type="javax.sql.DataSource" username="system" password="pwd" driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@localhost:1521:XE" maxActive="8" maxIdle="4" factory="org.apache.commons.dbcp.BasicDataSourceFactory"/> </Context>
Specify Oracle database login credentials in Context tag. Check you service instance Id in server url.
Finally, restart the Tomcat for configuration changes to take effect.
To see if your server is running type the root URL of your WebDAV site in a browser and you will see the list of folders. Now connect to the server with any WebDAV client.
If you experience any problems examine the log created by tomcat: <Your Tomcat location>\Tomcat x.x\logs\localhost.xxxx-xx-xx.log.
Copy \oraclestorage\WEB-INF\lib\oracle-driver-ojdbc6-x.x.x.x.jar to <GLASSFISH_HOME>/domains/domain1/lib/ext folder. Note that "domain1" is a default Glassfish domain. The domain may be different for specific deployments.
Restart GlassFish.
Open administrative console of the Glassfish server.
From the main tree (Common Tasks) expand Resources and go to JDBC > Connection Pools. Create a Connection pool:
- JNDI name = Oracle
- resource_type = javax.sql.ConnectionPoolDataSource
- Database Vendor = Oracle
Click Next.
Specify following additional properties (replace following values with your specific):
- url = jdbc:oracle:thin:@localhost:1521:XE
- user = system
- password = password
- xa-driver-does-not-support-non-tx-operations = true
Test connection with Ping button.
From the main tree (Common Tasks) expand Resources and go to JDBC > JDBC Resources.
Press New and provide the following information:
- JNDI Name: JDBC/Oracle (must be called exactly like this).
- Pool Name: The pool name created in the previous section.
Press OK, JDBC-resource will be created.
From the main tree (Common Tasks) goto Applications.
Press Deploy and specify following properties:
- Local Packaged File or Directory That Is Accessible from the Enterprise Server = <path to oracle storage directory>
- Type = Web Application
- Context Root = /
Note: sample can be deployed to a non-root context, but some clients work only with servers deployed to root the context.
- Application Name = oraclestorage
From the main tree (Common Tasks) go to Applications.
Press Launch on oraclestorage application.
If everything was set up properly you should see a sample page with a list of sample files and folders. Now connect to the server with any WebDAV client.
If anything goes wrong please consult log usually located at <GLASSFISH_INSTANCE_ROOT>/logs/server.log.
On the diagram below you can see the classes in WebDAV OracleStorage project.
To adapt the sample to your needs, you will modify these classes to read and write data from and into your storage. You can find more about this in Creating a Class 1 WebDAV Server and Creating Class 2 WebDAV Server article as well as in the class reference documentation.
The database consists of 3 entities as depicted in the figure below.
All the information about files and folders along with their content is stored here. Following is the list of columns with a brief description of each field.
The Lock table stores lock applied to items. You can find more about locking in the Creating Class 2 WebDAV Server article.
All the information about the properties pertaining to each item is stored in Properties table.
WebDAV Server Example with File System Back-end, Java and Kotlin
| Back | FazBrowse Home | New Git URL |