Skip to content

Commit 8194711

Browse files
author
Alex Tan
committed
Add boilerplate notice to source header, update readme file
1 parent 692e1f3 commit 8194711

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+103
-90
lines changed

README.md

Lines changed: 62 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,87 @@
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.
34
In order to mimic a real document management system, we implements a simple file exchange system to
45
achieve the goal. A maven tomcat7 plugin is embedded in the project to serve the application.
56

7+
## Usage
68

79
The steps to run the application are as follows:
810

9-
1) mvn clean package -Pwebhooks-app
11+
#### 1) mvn clean package -Pwebhooks-app
1012

1113
This will create webhooks-app-1.0-SNAPSHOT-war-exec.jar, war-exec.manifest and war-exec.properties files under target directory.
1214

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]
1416

1517
options:
1618

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
4545
message body: {"Id":"1", "name":"[email protected]", "password":"test"}
4646

4747
This should give back the json response
4848

49-
{
50-
51-
"links": [
52-
{
53-
"rel": "self",
54-
"href": "http://localhost:9966/webhooks-app/rest/accounts/1"
55-
}
56-
]
57-
}
49+
{
50+
&nbsp;&nbsp;&nbsp;&nbsp;"name": "[email protected]",
51+
&nbsp;&nbsp;&nbsp;&nbsp;"links": [
52+
&nbsp;&nbsp;&nbsp;&nbsp; {
53+
&nbsp;&nbsp;&nbsp;&nbsp; "rel": "self",
54+
&nbsp;&nbsp;&nbsp;&nbsp; "href": "http://localhost:9966/webhooks-app/rest/accounts/1"
55+
&nbsp;&nbsp;&nbsp;&nbsp; }
56+
&nbsp;&nbsp;&nbsp;&nbsp; ]
57+
}
5858

5959

60-
// get a list of folders/documents under those published directories
60+
#####get a list of folders/documents under those published directories
6161

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
6869

6970
This will return a list of metadata for files/folders.
7071

71-
72+
## Configuration File
7273

7374
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.
7475

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

src/main/java/webhooks/config/ConfigBean.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2014 AtTask, Inc.
2+
* Copyright 2015 Workfront, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

src/main/java/webhooks/config/WebhooksContextListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2014 AtTask, Inc.
2+
* Copyright 2015 Workfront, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

src/main/java/webhooks/core/models/entities/Account.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2014 AtTask, Inc.
2+
* Copyright 2015 Workfront, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

src/main/java/webhooks/core/models/entities/Document.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2014 AtTask, Inc.
2+
* Copyright 2015 Workfront, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

src/main/java/webhooks/core/repositories/IAccountRepo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2014 AtTask, Inc.
2+
* Copyright 2015 Workfront, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

src/main/java/webhooks/core/repositories/IDocumentRepo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2014 AtTask, Inc.
2+
* Copyright 2015 Workfront, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

src/main/java/webhooks/core/repositories/jpa/JpaAccountRepo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2014 AtTask, Inc.
2+
* Copyright 2015 Workfront, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

src/main/java/webhooks/core/repositories/jpa/jpaDocumentRepo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2014 AtTask, Inc.
2+
* Copyright 2015 Workfront, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

src/main/java/webhooks/core/services/IAccountService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2014 AtTask, Inc.
2+
* Copyright 2015 Workfront, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)