|
1 |
| -This is a reference implementation for Workfront's webhooks plugin framework. |
2 |
| -All APIs are based on Workfront's webhooks document API spec. |
| 1 | +# webhooks-app |
| 2 | + |
| 3 | +A Reference implementation for Workfront's webhooks plugin framework. All APIs are based on Workfront's webhooks document API spec. |
3 | 4 | In order to mimic a real document management system, we implements a simple file exchange system to
|
4 | 5 | achieve the goal. A maven tomcat7 plugin is embedded in the project to serve the application.
|
5 | 6 |
|
| 7 | +## Usage |
6 | 8 |
|
7 | 9 | The steps to run the application are as follows:
|
8 | 10 |
|
9 |
| -1) mvn clean package -Pwebhooks-app |
| 11 | +#### 1) mvn clean package -Pwebhooks-app |
10 | 12 |
|
11 | 13 | This will create webhooks-app-1.0-SNAPSHOT-war-exec.jar, war-exec.manifest and war-exec.properties files under target directory.
|
12 | 14 |
|
13 |
| -2) java -jar <webhooks-app-1.0-SNAPSHOT--war-exec>.jar [options] |
| 15 | +####2) java -jar <webhooks-app-1.0-SNAPSHOT--war-exec>.jar [options] |
14 | 16 |
|
15 | 17 | options:
|
16 | 18 |
|
17 |
| - -ajpPort <ajpPort> ajp port to use |
18 |
| - -clientAuth enable client authentication for |
19 |
| - https |
20 |
| - -D <arg> key=value |
21 |
| - -extractDirectory <extractDirectory> path to extract war content, |
22 |
| - default value: .extract |
23 |
| - -h,--help help |
24 |
| - -httpPort <httpPort> http port to use |
25 |
| - -httpProtocol <httpProtocol> http protocol to use: HTTP/1.1 or |
26 |
| - org.apache.coyote.http11.Http11Nio |
27 |
| - Protocol |
28 |
| - -httpsPort <httpsPort> https port to use |
29 |
| - -keyAlias <keyAlias> alias from keystore for ssl |
30 |
| - -loggerName <loggerName> logger to use: slf4j to use slf4j |
31 |
| - bridge on top of jul |
32 |
| - -obfuscate <password> obfuscate the password and exit |
33 |
| - -resetExtract clean previous extract directory |
34 |
| - -serverXmlPath <serverXmlPath> server.xml to use, optional |
35 |
| - -X,--debug debug |
36 |
| - |
37 |
| -3) You can either test it with AtTask or with Postman. |
38 |
| - |
39 |
| -Here are some samples by Postman. |
40 |
| - |
41 |
| -// register a user |
42 |
| - |
43 |
| -method: post |
44 |
| -url: http://localhost:9966/webhooks-app/rest/accounts |
| 19 | +Option | Description |
| 20 | +------- | ----------- |
| 21 | + -ajpPort \<ajpPort> | ajp port to use |
| 22 | + -clientAuth | enable client authentication for https |
| 23 | + -D <arg> | key=value |
| 24 | + -extractDirectory \<extractDirectory> | path to extract war content, default value: .extract |
| 25 | + -h,--help | help |
| 26 | + -httpPort \<httpPort> | http port to use |
| 27 | + -httpProtocol \<httpProtocol> | http protocol to use: HTTP/1.1 or org.apache.coyote.http11.Http11Nio Protocol |
| 28 | + -httpsPort \<httpsPort> | https port to use |
| 29 | + -keyAlias \<keyAlias> | alias from keystore for ssl |
| 30 | + -loggerName \<loggerName> | logger to use: slf4j to use slf4j bridge on top of jul |
| 31 | + -obfuscate \<password> | obfuscate the password and exit |
| 32 | + -resetExtract | clean previous extract directory |
| 33 | + -serverXmlPath \<serverXmlPath> | server.xml to use, optional |
| 34 | + -X,--debug | debug |
| 35 | + |
| 36 | +##Test |
| 37 | +To verify the app works, AtTask or Postman can be used to test the build. |
| 38 | + |
| 39 | +####Some examples for using Postman |
| 40 | + |
| 41 | +#####register a user |
| 42 | + |
| 43 | +method: post |
| 44 | +url: http://localhost:9966/webhooks-app/rest/accounts |
45 | 45 | message body: {"Id":"1", "name":" [email protected]", "password":"test"}
|
46 | 46 |
|
47 | 47 | This should give back the json response
|
48 | 48 |
|
49 |
| -{ |
50 |
| - |
51 |
| -"links": [ |
52 |
| - { |
53 |
| - "rel": "self", |
54 |
| - "href": "http://localhost:9966/webhooks-app/rest/accounts/1" |
55 |
| - } |
56 |
| - ] |
57 |
| -} |
| 49 | +{ |
| 50 | + "name": " [email protected]", |
| 51 | + "links": [ |
| 52 | + { |
| 53 | + "rel": "self", |
| 54 | + "href": "http://localhost:9966/webhooks-app/rest/accounts/1" |
| 55 | + } |
| 56 | + ] |
| 57 | +} |
58 | 58 |
|
59 | 59 |
|
60 |
| -// get a list of folders/documents under those published directories |
| 60 | +#####get a list of folders/documents under those published directories |
61 | 61 |
|
62 |
| -method: get |
63 |
| -url: http://localhost:9966/webhooks-app/rest/api/files |
64 |
| -header: Content-Type application/json |
65 |
| - Accept application/json |
66 |
| - |
67 |
| - apiKey 123456 |
| 62 | +method: get |
| 63 | +url: http://localhost:9966/webhooks-app/rest/api/files |
| 64 | +header: |
| 65 | +Content-Type application/json |
| 66 | +Accept application/json |
| 67 | + |
| 68 | +apiKey 123456 |
68 | 69 |
|
69 | 70 | This will return a list of metadata for files/folders.
|
70 | 71 |
|
71 |
| - |
| 72 | +## Configuration File |
72 | 73 |
|
73 | 74 | The webhooks-config.xml configuration file under WEB-INF directory can be used to configure the ApiKeys and published directories for document access. The apply-authentication tag can be used to turn on/off the authentication which is based on a registered user and ApiKey. More info is under Workfront web site.
|
74 | 75 |
|
| 76 | + |
| 77 | +## License |
| 78 | + |
| 79 | +Copyright (c) 2015 Workfront |
| 80 | + |
| 81 | +Licensed under the Apache License, Version 2.0. |
| 82 | +See the top-level file `LICENSE` and |
| 83 | +(http://www.apache.org/licenses/LICENSE-2.0). |
| 84 | + |
| 85 | + |
| 86 | +[license-image]: http://img.shields.io/badge/license-APv2-blue.svg?style=flat |
| 87 | +[license-url]: LICENSE |
0 commit comments