Skip to content

Commit

Permalink
feat!: add support for experience builder
Browse files Browse the repository at this point in the history
BREAKING CHANGE:

This project is now a true proxy that should work with any route that answers on the destination server. This dramatically simplifies account data as well as usage.

See [the new docs](README.md#Usage) for the new usage.

Fixes #124,  closes #53
  • Loading branch information
stdavis committed Jun 10, 2024
1 parent 59f9b6b commit 22aff04
Show file tree
Hide file tree
Showing 7 changed files with 4,072 additions and 7,073 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"packagejson",
"printproxy",
"promisify",
"proxied",
"utahkoopserver"
]
}
31 changes: 16 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,22 @@ This project solves this problem by acting as a proxy between web applications a
## Usage

1. [Open a pull request](https://github.com/agrc/serverless-print-proxy/compare) to add a configuration for a new [account](./accounts.js).
1. Use the following url in place of an Esri print service (e.g. [default AGOL service](https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task)):

```url
https://print.agrc.utah.gov/<accountNumber>/arcgis/rest/services/GPServer/export
```
1. Take the path to your print service...

<!-- markdownlint-disable MD033 -->
<pre>
https://<b>utility.arcgisonline.com</b>/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task
</pre>

...and replace the domain name with `print.ugrc.utah.gov/v2/<account-number>` like this...

<pre>
https://<b>print.ugrc.utah.gov/v2/99</b>/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task
</pre>
<!-- markdownlint-enable MD033 -->

You can use this new URL in place of the original print service in any Esri products.

_The account number must have a corresponding key in [`accounts.js`](./accounts.js)._

Expand All @@ -34,21 +45,11 @@ _The account number must have a corresponding key in [`accounts.js`](./accounts.
1. `touch .env && echo 'OPEN_QUAD_WORD=<wide-open-quad-word>' >> .env`
1. `npm install` & `npm start`

### URL Requirements for Web App Builder Print Widget

The print widget performs validation on the URL in the properties form. It appears that it has to match something like:

```regex
/https?:\/\/.+\/GPServer\/.*/
```

If the URL passes validation, then it makes a GET request (`arcgis/rest/info?f=json`) to get info about the server.

## Testing

Run `npm test` to run tests.

There's also an [AGOL web app](https://utah.maps.arcgis.com/apps/webappviewer/index.html?id=177c2b166a8d4cb79d888f28f950b33a) that you can test with.
There's also an [AGOL web app](https://experience.arcgis.com/experience/2ade141aca3244ee99b8e16185a76f32) that you can test the different environments with.

## Deployment

Expand Down
80 changes: 23 additions & 57 deletions accounts.js
Original file line number Diff line number Diff line change
@@ -1,135 +1,101 @@
export default {
// used by tests
'-2': {
arcgisServer: 'http://127.0.0.1:8085',
quadWord: 'verify-quad-word',
},
'-1': {
serviceUrl: 'https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer',
exportTaskName: 'Export Web Map Task',
getTemplatesTaskName: 'Get Layout Templates Info Task',
arcgisServer: 'https://utility.arcgisonline.com',
quadWord: 'test-quad-word',
},
1: {
// Created for Tom Thompson at DOGM
serviceUrl: 'https://maps.dnr.utah.gov/arcgis/rest/services/Utilities/PrintingTools/GPServer',
exportTaskName: 'Export Web Map Task',
getTemplatesTaskName: 'Get Layout Templates Info Task',
arcgisServer: 'https://maps.dnr.utah.gov',
quadWord: 'famous-florida-quiet-passive',
},
2: {
// agrc agol org
serviceUrl: 'https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer',
exportTaskName: 'Export Web Map Task',
getTemplatesTaskName: 'Get Layout Templates Info Task',
arcgisServer: 'https://utility.arcgisonline.com',
quadWord: 'temple-memphis-medusa-corner',
},
3: {
// salt lake county
serviceUrl: 'https://slco.org/slcogis/rest/services/Utilities/PrintingTools/GPServer',
exportTaskName: 'Export Web Map Task',
getTemplatesTaskName: 'Get Layout Templates Info Task',
arcgisServer: 'https://slco.org',
quadWord: 'optimal-polygon-contour-local',
},
5: {
// parcels.utah.gov
serviceUrl: 'https://mapserv.utah.gov/arcgis/rest/services/Utilities/PrintingTools/GPServer',
exportTaskName: 'Export Web Map Task',
getTemplatesTaskName: 'Get Layout Templates Info Task',
arcgisServer: 'https://mapserv.utah.gov',
quadWord: 'alfred-plaster-crystal-dexter',
},
6: {
// wfrc
serviceUrl: 'https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer',
exportTaskName: 'Export Web Map Task',
getTemplatesTaskName: 'Get Layout Templates Info Task',
arcgisServer: 'https://utility.arcgisonline.com',
quadWord: 'chance-source-liquid-nelson',
},
7: {
// atlas.utah.gov
serviceUrl: 'https://mapserv.utah.gov/arcgis/rest/services/Utilities/PrintingTools/GPServer',
exportTaskName: 'Export Web Map Task',
getTemplatesTaskName: 'Get Layout Templates Info Task',
arcgisServer: 'https://mapserv.utah.gov',
quadWord: 'career-exhibit-panel-stadium',
},
9: {
// wri - dev
serviceUrl: 'https://wrimaps.at.utah.gov/arcgis/rest/services/WRI_DEV/Print/GPServer',
exportTaskName: 'Export Web Map',
getTemplatesTaskName: '',
arcgisServer: 'https://wrimaps.at.utah.gov',
quadWord: 'fractal-crack-beach-cello',
},
10: {
// wri - at
serviceUrl: 'https://wrimaps.at.utah.gov/arcgis/rest/services/WRI_AT/Print/GPServer',
exportTaskName: 'Export Web Map',
getTemplatesTaskName: '',
arcgisServer: 'https://wrimaps.at.utah.gov',
quadWord: 'fractal-crack-beach-cello',
},
11: {
// wri - prod
serviceUrl: 'https://wrimaps.utah.gov/arcgis/rest/services/WRI/Print/GPServer',
exportTaskName: 'Export Web Map',
getTemplatesTaskName: '',
arcgisServer: 'https://wrimaps.utah.gov',
quadWord: 'delete-prefix-stretch-giant',
},
12: {
// summit county
serviceUrl: 'https://maps.summitcounty.org/arcgis/rest/services/Geoprocessing/ExportWebMap/GPServer',
exportTaskName: 'Export Web Map',
getTemplatesTaskName: 'Get Layout Templates Info',
arcgisServer: 'https://maps.summitcounty.org',
quadWord: 'spark-sardine-domain-telecom',
},
13: {
// south davis sewer district
serviceUrl: 'https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer',
exportTaskName: 'Export Web Map Task',
getTemplatesTaskName: 'Get Layout Templates Info Task',
arcgisServer: 'https://utility.arcgisonline.com',
quadWord: 'congo-fuji-philips-bucket',
},
14: {
// enviro.deq.utah.gov
serviceUrl: 'https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer',
exportTaskName: 'Export Web Map Task',
getTemplatesTaskName: 'Get Layout Templates Info Task',
arcgisServer: 'https://utility.arcgisonline.com',
quadWord: 'result-table-secure-antenna',
},
15: {
// broadband.utah.gov/map
serviceUrl: 'https://mapserv.utah.gov/arcgis/rest/services/Broadband/ExportWebMap/GPServer',
exportTaskName: 'Export Web Map',
getTemplatesTaskName: '',
arcgisServer: 'https://mapserv.utah.gov',
quadWord: 'reserve-tactic-cricket-spider',
},
16: {
// dnr agol
serviceUrl: 'https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer',
exportTaskName: 'Export Web Map Task',
getTemplatesTaskName: 'Get Layout Templates Info Task',
arcgisServer: 'https://utility.arcgisonline.com',
quadWord: 'famous-florida-quiet-passive',
},
17: {
// salt lake county - with ESRI print service
serviceUrl: 'https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer',
exportTaskName: 'Export Web Map Task',
getTemplatesTaskName: 'Get Layout Templates Info Task',
arcgisServer: 'https://utility.arcgisonline.com',
quadWord: 'optimal-polygon-contour-local',
},
18: {
// carbon county
serviceUrl: 'https://maps.carbon.utah.gov/arcgis/rest/services/Utilities/PrintingTools/GPServer',
exportTaskName: 'Export Web Map Task',
getTemplatesTaskName: 'Get Layout Templates Info Task',
arcgisServer: 'https://maps.carbon.utah.gov',
quadWord: 'gloria-corona-bombay-prize',
},
19: {
// elections.utah.gov
serviceUrl: 'https://mapserv.utah.gov/arcgis/rest/services/LtGovPoliticalDistricts/ExportWebMap/GPServer',
exportTaskName: 'Export Web Map',
getTemplatesTaskName: '',
arcgisServer: 'https://mapserv.utah.gov',
quadWord: 'andrea-permit-weekend-cable',
},
20: {
// atlas.dev.utah.gov
serviceUrl: 'https://mapserv.utah.gov/arcgis/rest/services/Utilities/PrintingTools/GPServer',
exportTaskName: 'Export Web Map Task',
getTemplatesTaskName: 'Get Layout Templates Info Task',
arcgisServer: 'https://mapserv.utah.gov',
quadWord: 'wedding-tactic-enrico-yes',
},
};
Loading

0 comments on commit 22aff04

Please sign in to comment.