Skip to content

Commit bfd9cb2

Browse files
committed
Added initial documentation; populated production configuration; minor cosmetic style changes
1 parent e354488 commit bfd9cb2

File tree

8 files changed

+79
-25
lines changed

8 files changed

+79
-25
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
.idea/
66
*~
77
.zat
8+
tmp/

README.md

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
# App name
1+
# Orpheus lookup
22

3-
[brief description of the app]
3+
This application interacts with [Orpheus API](https://orpheus-prod.lib.ds.cam.ac.uk) to populate manuscript submission ticket fields with relevant information from publisher policies.
44

55
### The following information is displayed:
66

7-
* info1
8-
* info2
9-
* info3
7+
* Journal's Article Processing Charges (APC) range
8+
* Embargo duration
9+
* Self-archiving allowed versions
10+
* Green licence
11+
* Gold OA options
1012

11-
Please submit bug reports to [Insert Link](). Pull requests are welcome.
13+
Please submit bug reports to [info(at)openaccess.cam.ac.uk](mailto:[email protected]).
1214

1315
### Screenshot(s):
14-
[put your screenshots down here.]
16+
[![Orpheus lookup in Ticket view](images/orpheus-lookup-screenshot.png)]()
17+

assets/iframe.html

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<html>
22
<head>
33
<meta charset="utf-8">
4-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/bootstrap/4.0.0/css/bootstrap.min.css">
4+
<link href="https://cdn.jsdelivr.net/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" >
55
<link href="main.css" rel="stylesheet">
66
</head>
77
<body>
@@ -14,16 +14,20 @@
1414
<!-- Scripts -->
1515
<script id="orpheus-template" type="text/x-handlebars-template">
1616
<br>
17-
<table class="table table-sm ">
17+
<table class="table table-sm">
1818
<tbody>
19+
{{#if publisher_name}}
1920
<tr>
2021
<td><b>Publisher name</b></td>
2122
<td>{{publisher_name}}</td>
2223
</tr>
24+
{{/if}}
25+
{{#if journal_apc_ange}}
2326
<tr>
2427
<td><b>APC range</b></td>
2528
<td>{{journal_apc_ange}}</td>
2629
</tr>
30+
{{/if}}
2731
{{#if embargo_duration}}
2832
<tr>
2933
<td><b>Embargo duration</b></td>

assets/main.css

+2-8
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ footer {
33
padding-top: 20px;
44
}
55

6-
.data {
7-
color: #363;
8-
padding-left: 6px;
9-
}
10-
116
#content td {
12-
font-size: 12px;
13-
padding-top: 2px;
14-
}
7+
font-size: 14px;
8+
}

assets/resources/config_prod.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
var gOptions = {
22
orpheus_api_url: "https://orpheus-prod.lib.cam.ac.uk/policies/api/cambridge/",
3-
issn_field_id: '360009657254',
4-
eissn_field_id: '360009578193',
5-
journal_name_field_id: '38889247',
6-
apc_range_field_id: '360008808174',
7-
green_licence_field_id: '360008808154',
8-
embargo_duration_field_id: '360008807274',
9-
gold_licence_options_field_id: '360008808494',
10-
green_allowed_version_field_id: '360008807234'
3+
issn_field_id: '360009704474',
4+
eissn_field_id: '360009704634',
5+
journal_name_field_id: '24069493',
6+
apc_range_field_id: '360008258194',
7+
green_licence_field_id: '24117506',
8+
embargo_duration_field_id: '24072173',
9+
gold_licence_options_field_id: '360009704814',
10+
green_allowed_version_field_id: '24072163'
1111
};

docs/howto/DEPLOY.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## Test instructions #
2+
3+
See [Zendesk apps docs](https://developer.zendesk.com/apps/docs/developer-guide/setup) for preparing the testing environment.
4+
## Deploy instructions #
5+
Create the app package from command line
6+
```
7+
zat package
8+
```
9+
10+
The app package will be created in a "tmp" directory within the apps project root folder.
11+
12+
## Installing in Zendesk notes
13+
14+
* For fields to be pre-populated, either a dedicated form (e.g. "Orpheus details") including the fields to be modified needs to be created, or the relevant fields need to be added to an existing form.
15+

docs/system/Apache_config.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# App and Apache configuration #
2+
This app requires for Cross-Origin Resource Sharing (CORS) to be enabled at both the application level (i.e. when performing Ajax requests), and at the Apache web server level.
3+
4+
As per Zendesk documentation, any requests to Orpheus API from the app have to include the "cors" property:
5+
6+
```javascript
7+
var settingsOrpheus = {
8+
url: orpheusUrl,
9+
cors: true,
10+
type: 'GET',
11+
dataType: 'json'
12+
};
13+
14+
client.request(settingsOrpheus).then(
15+
function (data) {
16+
console.log(data);
17+
}, function (response) {
18+
console.log(response);
19+
}
20+
);
21+
```
22+
23+
Lastly, Zendesk domain needs to be whitelisted in the Apache configuration file.
24+
This file is located under the Apache installation folder:
25+
```apache2/sites-available/25-orpheus-prod.ds.lib.cam.ac.uk-ssl.conf``` (for production environment); ```apache2/sites-available/25-orpheus-dev.ds.lib.cam.ac.uk-ssl.conf``` for development environment.
26+
27+
Add the following line to the configuration file
28+
```
29+
# For development environment
30+
Header Set Access-Control-Allow-Origin "https://camacuk1470327064.zendesk.com"
31+
```
32+
33+
```
34+
# For production environment
35+
Header Set Access-Control-Allow-Origin "https://camacuk.zendesk.com"
36+
```
37+

images/orpheus-lookup-screenshot.png

142 KB
Loading

0 commit comments

Comments
 (0)