Skip to content

Commit 71725df

Browse files
committed
Merge branch 'release/1.1.0'
2 parents 5e087c5 + 2bd8807 commit 71725df

File tree

4 files changed

+1005
-449
lines changed

4 files changed

+1005
-449
lines changed

README.md

Lines changed: 93 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,36 @@
33

44
WebDavLib is a LiveCode library for accessing WebDAV servers. it supports Digest and Basic authentication. WebDavLib does not depend on tsNet and can therefore be used with the Community Edition.
55

6-
##### WebDavLib currently supports the following WebDAV methods:
6+
##### WebDavLib currently supports the following WebDAV methods:
77

8-
- OPTIONS
9-
- PROPFIND
10-
- HEAD
11-
- GET
12-
- PUT
13-
- DELETE
14-
- MKCOL
15-
- PROPPATCH
16-
- LOCK
17-
- UNLOCK
8+
- OPTIONS
9+
- PROPFIND
10+
- HEAD
11+
- GET
12+
- PUT
13+
- DELETE
14+
- MKCOL
15+
- PROPPATCH
16+
- LOCK
17+
- UNLOCK
1818

1919

2020
##### Examples of tasks the library allows to accomplish:
2121

22-
- Generate a list of all WebDAV methods provided by the server
23-
- Get the file size, modification date, content type etc. of a remote file
24-
- Download a file
25-
- Check write permission of a directory
26-
- Upload a file
27-
- Delete a file / folder
28-
- List files / folders
29-
- Create a folder
30-
- Set custom file properties
31-
- Get custom file properties
32-
- Remove custom file properties
33-
- Lock a file (may be not supported on NextCloud servers)
34-
- Check if a file is locked
35-
- Unlock a file (may be not supported on NextCloud servers)
22+
- Generate a list of all WebDAV methods provided by the server
23+
- Get the file size, modification date, content type etc. of a remote file
24+
- Download a file
25+
- Check write permission of a directory
26+
- Upload a file
27+
- Delete a file / folder
28+
- List files / folders
29+
- Create a folder
30+
- Set custom file properties
31+
- Get custom file properties
32+
- Remove custom file properties
33+
- Lock a file (may be not supported on NextCloud servers)
34+
- Check if a file is locked
35+
- Unlock a file (may be not supported on NextCloud servers)
3636

3737
WebDavLib is tested on a commercial NextCloud server, on a private NextCloud server and on a local WebDAV server.
3838

@@ -44,73 +44,90 @@ Check out the enclosed sample stack "webDavTest". Fill out the form and execute
4444

4545
### Usage
4646

47-
Basically the procedure to send a WebDAV request involves:
47+
Basically the procedure to send a WebDAV request involves:
4848

49-
- Setting up the request data using an array
50-
- Storing the request data in WebDavLib which returns a request ID
51-
- Sending the request to the server to receive a response
49+
- Setting up the request data using an array
50+
- Storing the request data in WebDavLib which returns a request ID
51+
- Sending the request to the server to receive a response
5252

53-
Following is an example (returning the WebDAV methods the server supports):
53+
Following is an example (returning the WebDAV methods the server supports):
5454

5555
```
56-
-- SETUP REQUEST DATA
57-
put fld "hostFld" into tRequestDataA["host"]
58-
put fld "portFld" into tRequestDataA["port"]
59-
put fld "userFld" into tRequestDataA["user"]
60-
put fld "passwordFld" into tRequestDataA["password"]
61-
put the label of btn "authBtn" into tRequestDataA["authType"]
62-
put the hilite of btn "secureBtn" into tRequestDataA["sslFlag"]
63-
put the cAgent of this stack && the version && "(" & the platform & ")" into tRequestDataA["agent"]
64-
put fld "davDirFld" into tRequestDataA["uri"]
65-
put "OPTIONS" into tRequestDataA["method"]
66-
67-
-- STORE REQUEST DATA IN LIBRARY, GET REQUEST ID
68-
wdlSetupNewRequest tRequestDataA
69-
put the result into tReqID
70-
71-
-- SEND REQUEST TO SERVER
72-
put wdlExecute(tReqID) into tServerResponse
73-
74-
wdlCleanup tReqID
56+
-- SETUP REQUEST DATA
57+
put fld "hostFld" into tRequestDataA["host"]
58+
put fld "portFld" into tRequestDataA["port"]
59+
put fld "userFld" into tRequestDataA["user"]
60+
put fld "passwordFld" into tRequestDataA["password"]
61+
put the label of btn "authBtn" into tRequestDataA["authType"]
62+
put the hilite of btn "secureBtn" into tRequestDataA["sslFlag"]
63+
put the cAgent of this stack && the version && "(" & the platform & ")" into tRequestDataA["agent"]
64+
put fld "davDirFld" into tRequestDataA["uri"]
65+
66+
-- STORE REQUEST DATA IN LIBRARY, GET REQUEST ID
67+
wdlSetupNewRequest tRequestDataA
68+
put the result into tReqID
69+
70+
-- SEND REQUEST TO SERVER
71+
put wdlGetserverMethods(tReqID) into tServerResponse
72+
73+
wdlCleanup tReqID
7574
```
7675

77-
These are the request data array keys used depending on the particular request method:
78-
79-
- host (the host address like: myname.ocloud.de)
80-
- uri (the path to the WebDAV directory like: /remote.php/webdav/)
81-
- port (as a general rule this is 80 or 443 for secure connections)
82-
- user
83-
- password (user password or app password)
84-
- authType (Basic or Digest)
85-
- sslFlag (a boolean, TRUE for a secure connection)
86-
- method (see the WebDav methods above)
87-
- agent (User-agent)
88-
- propertiesXML (the properties XML data inserted into a XML request body)
89-
- contentType (Content-type like application/xml; charset="utf-8")
90-
- contentLength
91-
- dataToUpload (the binary file data to upload)
92-
- nameSpace (WebDAV XML namespace like http://www.w3.com/standards/z39.50/)
93-
- lockScope (exclusive or shared)
94-
- lockType (write)
95-
- lockOwner (any name)
96-
- lockToken (the cCurrentLockToken of stack "WebDavLib")
97-
- callBack (the name of a callback handler used by methods GET and PUT)
98-
- callbackTarget (the long ID of the object containing the callback handler)
76+
These are the request data array keys used depending on the particular request method:
77+
78+
- host (the host address like: myname.ocloud.de)
79+
- uri (the path to the WebDAV directory like: /remote.php/webdav/)
80+
- port (as a general rule this is 80 or 443 for secure connections)
81+
- user
82+
- password (user password or app password)
83+
- authType (Basic or Digest)
84+
- sslFlag (a boolean, TRUE for a secure connection)
85+
- method (see the WebDav methods above)
86+
- agent (User-agent)
87+
- propertiesXML (the properties XML data inserted into a XML request body)
88+
- contentType (Content-type like application/xml; charset="utf-8")
89+
- contentLength
90+
- dataToUpload (the binary file data to upload)
91+
- nameSpace (WebDAV XML namespace like "http://www.w3.com/standards/z39.50/")
92+
- lockScope (exclusive or shared)
93+
- lockType (write)
94+
- lockOwner (any name)
95+
- lockToken (the cCurrentLockToken of stack "WebDavLib")
96+
- callBack (the name of a callback handler used by methods GET and PUT)
97+
- callbackTarget (the long ID of the object containing the callback handler)
98+
99+
100+
Following are the available public handlers:
101+
102+
- wdlSetupNewRequest tRequestDataA
103+
- wdlGetserverMethods(tReqID)
104+
- wdlGetFile(tReqID)
105+
- wdlWritePermission(tReqID)
106+
- wdlDeleteFileFolder(tReqID)
107+
- wdlPutFile(tReqID)
108+
- wdlGetFileList(tReqID)
109+
- wdlCreateFolder(tReqID)
110+
- wdlSetFileProps(tReqID, tSetPropsA, tRemovePropsA)
111+
- wdlGetFileProps(tReqID, tProps)
112+
- wdlGetCustomProps(tReqID, tProps)
113+
- wdlLock(tReqID)
114+
- wdlUnlock(tReqID)
115+
- wdlGetFileHeaders(tReqID)
116+
- wdlCleanup tReqID
99117

100118

101119
**NOTE:** Be aware that if you use the LC Indy Edition or the LC Business Edition WebDavLib does not work if the tsNet external is loaded. So, to use the WebDavLib library you need to unload tsNetLibURL like:
102120

103121
```
104-
if the environment is "development" and there is a stack "tsNetLibURL" then
105-
dispatch "revUnloadLibrary" to stack "tsNetLibURL"
106-
end if
122+
if the environment is "development" and there is a stack "tsNetLibURL" then
123+
dispatch "revUnloadLibrary" to stack "tsNetLibURL"
124+
end if
107125
```
108126

109127
See button "requestBtn" in the enclosed sample stack.
110128

111129

112130
### Meta
113131

114-
- Version: 1.0.0
132+
- Version: 1.1.0
115133
- Author: [Ralf Bitter](mailto:rabit@revigniter.com)
116-

0 commit comments

Comments
 (0)