...
Expand | ||
---|---|---|
| ||
Let’s use a new Custom component and name it ‘Confluence adapter’ Make a copy and edit… |
Expand | ||
---|---|---|
| ||
Let’s say git@bitbucket.org:interfaceware/atlassian |
Expand | ||
---|---|---|
| ||
For instance: |
Expand | ||
---|---|---|
| ||
Use ‘View Remote’ for the now named ATTL library … and specify new REPOSITORY name for this Library to be associated with | ||
Expand | ||
| ||
This gets all the prefixes consistent. |
Expand | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
So in the case of Atlassian we need:
This adheres with Naming convention for table parameters in Iguana. These should just be passed through in the table arguments. So the code becomes:
|
...
Expand | ||
---|---|---|
| ||
Append to Client’s meta table the three newly added methods and the ‘space_id’ variable declaration
|
Expand | ||
---|---|---|
| ||
Add Help files to explain what parameters your custom methods expect. Other users will appreciate this!Take opportunity to obsolete the ATTLclient.help file and to publish this information as client.help file in the ‘help’ folder, along with the rest of help files. |
Expand | ||
---|---|---|
| ||
Let’s create a simple main.lua file
|
Expand | ||
---|---|---|
| ||
Right after declaration of Client instance and passing the parameters to it, we discover the Confluence Space ID. This value couldn’t be known without running this API call. Next we prepare for paginated API call and require only 2 calls to be executed by setting ‘count’ variable to number 2. This will save the time while testing. And finally, we request from API and get a to return the listing of descendants for 50 pages. |
Expand | ||
---|---|---|
| ||
So, we can query Atlassian API for Confluence! What it is good for? We can query documents, we can edit documents, we can modify/export/add/delete content in any manner we imagine. The complete documentation for this API is available here. Just create more API methods and more Custom methods. Custom methods are very helpful to keep the API methods true to vendors API documentation. Custom methods will help to create your specific parameters combination, and to massage the responses. Custom methods are the interface, between your code , to clean and true API methods. |