openactive-dataset_site 0.2.0 → 6.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2902c20149703083193d00af98941fdc09b9441f3fdf4bfc0f92d659c1c8610
4
- data.tar.gz: 0e78849b3f6839f78dca7d14b30c58c641c4a4e4a6c25874f7cc2778b5b663bc
3
+ metadata.gz: 41e57531c64aa44f749dd5cc7cac95caa1bdf7820eb01f054c908d3dbedc051f
4
+ data.tar.gz: 98d245c810e947288b2698872868f15af642f42b7e1616cd8cd5ec0f2a06e3b9
5
5
  SHA512:
6
- metadata.gz: 783a20e7737802746b0f0a9b18a2778e2976d3c2005f12cda49e3bead00dcec6ed245e09769e21b50a2bf2a662f51d820fc229f01cd95fad6dfb26f8ac4bc84c
7
- data.tar.gz: 45d28ecc9d3cc266811c2f103180e03d39f83de60d097126dce83abf82485c1bebc41841430b450709149e1668280b6bc63ec37ef32fd62e472c7fa83aeb4f83
6
+ metadata.gz: e41ca1b251354680130a47f1da2f24b7ff90e902b84257ecf7a08310777aaec11e26d4fcea9f402657f535de5fc9d0b1ebc0f25e87cbd882e56f27027273fdbe
7
+ data.tar.gz: e7c7e3e02a9543c57a8d04d8cba145ba2fe2863ba24b402803c373efbb9d142465a88532e212cc2d2c8138b17fb015bd3bec3277e2e40c9e47bc22343a5e09e4
@@ -0,0 +1,63 @@
1
+ name: Update Dataset Site Template
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ repository_dispatch:
6
+ types: [dataset-site-template-update]
7
+
8
+ jobs:
9
+ generate:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - name: Checkout
14
+ uses: actions/checkout@v2
15
+ with:
16
+ ref: master
17
+
18
+ - name: Setup Node.js 14.x
19
+ uses: actions/setup-node@v1
20
+ with:
21
+ node-version: 14.x
22
+
23
+ - name: Update dataset site template to latest version
24
+ run: npx @openactive/dataset-site-template@latest --raw "./lib/openactive/dataset_site/"
25
+ working-directory: ./
26
+
27
+ - name: git stash if material changes have not been made
28
+ # When considering whether it's worth making a PR, ignore the following:
29
+ # - The dataset-site-template minor or patch version number updating within the template in datasetsite.mustache and datasetsite-csp.mustache (affects one line)
30
+ # - Any updates to datasetsite-csp.static.zip
31
+ # git stashing if no material changes allows the next step to close the PR if one is already open
32
+ run: if [ "$(git diff --numstat | grep -vc '^1\s.*datasetsite\.mustache\|1\s.*datasetsite-csp\.mustache\|.*datasetsite-csp\.static\.zip$')" -eq "0" ]; then git stash; else echo "Material changes found"; fi
33
+ working-directory: ./
34
+
35
+ - name: Create Pull Request
36
+ id: cpr
37
+ uses: peter-evans/create-pull-request@v3
38
+ with:
39
+ path: ./
40
+ token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
41
+ commit-message: Update dataset site template
42
+ committer: openactive-bot <openactive-bot@users.noreply.github.com>
43
+ author: openactive-bot <openactive-bot@users.noreply.github.com>
44
+ signoff: false
45
+ branch: ci/update-data-models
46
+ delete-branch: true
47
+ title: 'Update dataset site template'
48
+ body: |
49
+ Update to the latest version of the [Dataset Site Template](https://github.com/openactive/dataset-site-template)
50
+
51
+ **Reviewer note:** Major version numbers of this library should match those of the `dataset-site-template` on which this library depends. Any updates to the dataset site template files or assets should always be a major version update in both libraries. Hence this PR, once merged, should be released with a major version bump to match its contents.
52
+
53
+ labels: |
54
+ automated pr
55
+ team-reviewers: |
56
+ owners
57
+ maintainers
58
+ draft: false
59
+
60
+ - name: Check outputs
61
+ run: |
62
+ echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
63
+ echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
@@ -24,3 +24,43 @@ jobs:
24
24
 
25
25
  - name: Run tests
26
26
  run: bundle exec rspec
27
+
28
+ - name: Create output directory
29
+ run: mkdir -p ./output/
30
+
31
+ - name: Output rendering basic_example as an artifact
32
+ run: ruby examples/basic_example.rb > ./output/basic_example.html
33
+
34
+ - name: Output rendering basic_example_with_booking as an artifact
35
+ run: ruby examples/basic_example_with_booking.rb > ./output/basic_example_with_booking.html
36
+
37
+ - name: Output rendering basic_example_with_booking_minimal as an artifact
38
+ run: ruby examples/basic_example_with_booking_minimal.rb > ./output/basic_example_with_booking_minimal.html
39
+
40
+ - name: Output rendering basic_csp_example_with_booking as an artifact
41
+ run: ruby examples/basic_csp_example_with_booking.rb > ./output/basic_csp_example_with_booking.html
42
+
43
+ - name: Output rendering dataset_example as an artifact
44
+ run: ruby examples/dataset_example.rb > ./output/dataset_example.html
45
+
46
+ - name: Output rendering dataset_example_with_booking as an artifact
47
+ run: ruby examples/dataset_example_with_booking.rb > ./output/dataset_example_with_booking.html
48
+
49
+ - name: Output rendering dataset_csp_example_with_booking as an artifact
50
+ run: ruby examples/dataset_csp_example_with_booking.rb > ./output/dataset_csp_example_with_booking.html
51
+
52
+ - name: Output rendering dataset_patch as an artifact
53
+ run: ruby examples/dataset_patch.rb > ./output/dataset_patch.html
54
+
55
+ - name: Output rendering specific_feed_override_example as an artifact
56
+ run: ruby examples/specific_feed_override_example.rb > ./output/specific_feed_override_example.html
57
+
58
+ - name: Output rendering specific_feed_override_example2 as an artifact
59
+ run: ruby examples/specific_feed_override_example2.rb > ./output/specific_feed_override_example2.html
60
+
61
+ - name: Upload example renderings
62
+ uses: actions/upload-artifact@v2
63
+ if: ${{ success() || failure() }}
64
+ with:
65
+ name: example-rendering-ruby-${{ matrix.ruby-version }}
66
+ path: ./output/
data/README.md CHANGED
@@ -34,13 +34,21 @@ renderer = OpenActive::DatasetSite::TemplateRenderer.new(settings)
34
34
  puts renderer.render
35
35
  ```
36
36
 
37
+ Or to render a [CSP-compatible template](https://developer.openactive.io/publishing-data/dataset-sites#template-hosting-options), first ensure that you are serving the [CSP compatible static assets](/lib/openactive/dataset_site/datasetsite-csp.static.zip) from this version of the Ruby gem at a URL, and then including the following:
38
+ ```ruby
39
+
40
+ # Render compiled CSP-compatible template with data
41
+ renderer = OpenActive::DatasetSite::TemplateRenderer.new(settings, "./path/to/assets")
42
+ puts renderer.render
43
+ ```
44
+
37
45
  Where `settings` could be defined like the following (as an example):
38
46
  ```ruby
39
47
  settings = OpenActive::DatasetSite::Settings.new(
40
48
  open_data_feed_base_url: "https://customer.example.com/feed/",
41
49
  dataset_site_url: "https://halo-odi.legendonlineservices.co.uk/openactive/",
42
50
  dataset_discussion_url: "https://github.com/gll-better/opendata",
43
- dataset_documentation_url: "https://docs.acmebooker.example.com/",
51
+ dataset_documentation_url: "https://permalink.openactive.io/dataset-site/open-data-documentation",
44
52
  dataset_languages: ["en-GB"],
45
53
  organisation_name: "Better",
46
54
  organisation_url: "https://www.better.org.uk/",
@@ -50,9 +58,15 @@ settings = OpenActive::DatasetSite::Settings.new(
50
58
  organisation_email: "info@better.org.uk",
51
59
  platform_name: "AcmeBooker",
52
60
  platform_url: "https://acmebooker.example.com/",
53
- platform_software_version: "2.0",
61
+ platform_software_version: "2.0.1",
54
62
  background_image_url: "https://data.better.org.uk/images/bg.jpg",
55
63
  date_first_published: "2019-10-28",
64
+ open_booking_api_base_url: "https://reference-implementation.openactive.io/api/openbooking",
65
+ open_booking_api_authentication_authority_url: "https://auth.reference-implementation.openactive.io",
66
+ open_booking_api_documentation_url: "https://permalink.openactive.io/dataset-site/open-booking-api-documentation",
67
+ open_booking_api_terms_service_url: "https://example.com/api-terms-page",
68
+ open_booking_api_registration_url: "https://example.com/api-landing-page",
69
+ test_suite_certificate_url: "https://certificates.reference-implementation.openactive.io/examples/all-features/controlled/",
56
70
  data_feed_types: [
57
71
  OpenActive::DatasetSite::FeedType::FACILITY_USE,
58
72
  OpenActive::DatasetSite::FeedType::SCHEDULED_SESSION,
@@ -110,9 +124,21 @@ settings = OpenActive::DatasetSite::Settings.new(
110
124
  ```ruby
111
125
  dataset = OpenActive::Models::Dataset.new(
112
126
  id: "http://example.com/dataset/",
127
+ url: "http://example.com/dataset/",
113
128
  description:
114
129
  "Near real-time availability and rich descriptions relating to the facilities and sessions available from Simpleweb",
115
- url: "http://example.com/dataset/",
130
+ access_service:
131
+ OpenActive::Models::WebAPI.new(
132
+ name: 'Open Booking API',
133
+ description: "API that allows for seamless booking experiences to be created for facilities and sessions available from Simpleweb",
134
+ documentation: "https://permalink.openactive.io/dataset-site/open-booking-api-documentation",
135
+ terms_of_service: "https://example.com/api-terms-page",
136
+ endpoint_url: "https://reference-implementation.openactive.io/api/openbooking",
137
+ authentication_authority: "https://auth.reference-implementation.openactive.io",
138
+ conforms_to: ["https://openactive.io/open-booking-api/EditorsDraft/"],
139
+ endpoint_description: "https://www.openactive.io/open-booking-api/EditorsDraft/swagger.json",
140
+ landing_page: "https://example.com/api-landing-page"
141
+ ),
116
142
  dateModified: "2019-12-09T15:36:15+00:00",
117
143
  keywords:
118
144
  ["Facilities",
@@ -170,8 +196,15 @@ dataset = OpenActive::Models::Dataset.new(
170
196
  url:
171
197
  "https://simpleweb.co.uk/wp-content/uploads/2017/06/IMG_8994-500x500-c-default.jpg",
172
198
  ),
173
- documentation: "https://developer.openactive.io/",
199
+ documentation: "https://permalink.openactive.io/dataset-site/open-data-documentation",
174
200
  name: "Simpleweb Facilities and Sessions",
201
+ booking_service:
202
+ OpenActive::Models::BookingService.new(
203
+ name: "SimpleWeb Booking",
204
+ url: "https://www.example.com/",
205
+ software_version: "2.0.0",
206
+ has_credential: "https://certificates.reference-implementation.openactive.io/examples/all-features/controlled/",
207
+ )
175
208
  )
176
209
 
177
210
  renderer = OpenActive::DatasetSite::TemplateRenderer.new(dataset)
@@ -203,35 +236,43 @@ Accepts a config hash containing the following keys:
203
236
 
204
237
  ##### Settings
205
238
 
206
- | Key | Type | Description |
207
- | --------------------------------------- | ----------- | ----------- |
208
- | `open_data_feed_base_url` | `string` | The the base URL for the open data feeds |
209
- | `dataset_site_url` | `string` | The URL where this dataset site is displayed (the page's own URL) |
210
- | `dataset_discussion_url` | `string` | The GitHub issues page for the dataset |
211
- | `dataset_documentation_url` | `string` | Any documentation specific to the dataset. Defaults to https://developer.openactive.io/ if not provided, which should be used if no documentation is available. |
212
- | `dataset_languages` | `string[]` | The languages available in the dataset, following the IETF BCP 47 standard. Defaults to `array("en-GB")`. |
213
- | `organisation_name` | `string` | The publishing organisation's name |
214
- | `organisation_url` | `string` | The publishing organisation's URL |
215
- | `organisation_legal_entity` | `string` | The legal name of the publishing organisation of this dataset |
216
- | `organisation_plain_text_description` | `string` | A plain text description of this organisation |
217
- | `organisation_logo_url` | `string` | An image URL of the publishing organisation's logo, ideally in PNG format |
218
- | `organisation_email` | `string` | The contact email of the publishing organisation of this dataset |
219
- | `platform_name` | `string` | The software platform's name. Only set this if different from the publishing organisation, otherwise leave as null to exclude platform metadata. |
220
- | `platform_url` | `string` | The software platform's website |
221
- | `platform_software_version` | `string` | The software platform's software version |
222
- | `background_image_url` | `string` | The background image to show on the Dataset Site page |
223
- | `date_first_published` | `string` | The date the dataset was first published |
224
- | `data_feed_types` | `FeedType[]`| A list of supported DataFeed types |
239
+ | Key | Type | Description |
240
+ | ----------------------------------------------- | ----------- | ----------- |
241
+ | `open_data_feed_base_url` | `string` | The the base URL for the open data feeds |
242
+ | `dataset_site_url` | `string` | The URL where this dataset site is displayed (the page's own URL) |
243
+ | `dataset_discussion_url` | `string` | The GitHub issues page for the dataset |
244
+ | `dataset_documentation_url` | `string` | Any documentation specific to the dataset. Defaults to https://permalink.openactive.io/dataset-site/open-data-documentation if not provided, which should be used if no documentation is available. |
245
+ | `dataset_languages` | `string[]` | The languages available in the dataset, following the IETF BCP 47 standard. Defaults to `array("en-GB")`. |
246
+ | `organisation_name` | `string` | The publishing organisation's name |
247
+ | `organisation_url` | `string` | The publishing organisation's URL |
248
+ | `organisation_legal_entity` | `string` | The legal name of the publishing organisation of this dataset |
249
+ | `organisation_plain_text_description` | `string` | A plain text description of this organisation |
250
+ | `organisation_logo_url` | `string` | An image URL of the publishing organisation's logo, ideally in PNG format |
251
+ | `organisation_email` | `string` | The contact email of the publishing organisation of this dataset |
252
+ | `platform_name` | `string` | The software platform's name. Only set this if different from the publishing organisation, otherwise leave as null to exclude platform metadata. |
253
+ | `platform_url` | `string` | The software platform's website |
254
+ | `platform_software_version` | `string` | The software platform's software version |
255
+ | `background_image_url` | `string` | The background image to show on the Dataset Site page |
256
+ | `date_first_published` | `string` | The date the dataset was first published |
257
+ | `open_booking_api_base_url` | `string` | The Base URI of this implementation of the Open Booking API |
258
+ | `open_booking_api_authentication_authority_url` | `string` | The location of the OpenID Provider that must be used to access the API |
259
+ | `open_booking_api_documentation_url` | `string` | The URL of documentation related to how to use the Open Booking API. Defaults to https://permalink.openactive.io/dataset-site/open-booking-api-documentation if not provided, which should be used if no system-specific documentation is available. |
260
+ | `open_booking_api_terms_service_url` | `string` | The URL of terms of service related to the use of this API |
261
+ | `open_booking_api_registration_url` | `string` | The URL of a web page that the Broker may use to obtain access to the API, e.g. via a web form |
262
+ | `test_suite_certificate_url` | `string` | The URL of the OpenActive Test Suite certificate for this booking system |
263
+ | `data_feed_types` | `FeedType[]`| A list of supported DataFeed types |
225
264
 
226
265
  And `data_feed_types` must be an array of `FeedType` constants, which auto-generates the metadata associated which each feed using best-practice values. See [available types](#feedtype)
227
266
 
228
- #### OpenActive::DatasetSite::TemplateRenderer.new(settings)
267
+ #### OpenActive::DatasetSite::TemplateRenderer.new(settings, static_assets_path_url = nil)
268
+
269
+ Accepts a [`settings`](#settings) or [`DataSet`](#dataset) object. This is a Mustache engine.
229
270
 
230
- Accepts a settings or a DataSet object. This is a Mustache engine.
271
+ If `static_assets_path_url` is provided, the [CSP-compatible template](https://developer.openactive.io/publishing-data/dataset-sites#template-hosting-options) is rendered. In this case you must ensure that you are serving the contents of the [CSP compatible static assets archive](/lib/openactive/dataset_site/datasetsite-csp.static.zip) at this location, using the assets archive in this version of the Ruby gem.
231
272
 
232
273
  ##### .render
233
274
 
234
- Returns a string corresponding to the compiled HTML, based on the `datasetsite.mustache`, the provided [`settings`](#settings)
275
+ Returns a string corresponding to the compiled HTML, based on the `datasetsite.mustache`, and the provided [`settings`](#settings) or [`DataSet`](#dataset) object
235
276
 
236
277
  #### `FeedType`
237
278
 
@@ -249,3 +290,9 @@ A class containing the supported distribution types:
249
290
  | `SCHEDULED_SESSION` | `ScheduledSession` |
250
291
  | `SESSION_SERIES` | `SessionSeries` |
251
292
  | `SLOT` | `Slot` |
293
+
294
+ ## Contribution
295
+
296
+ ### Release
297
+
298
+ Major version numbers of this library should match those of the `dataset-site-template` on which this library depends. Any updates to the dataset site template files or assets should always be a major version update in both libraries.
@@ -0,0 +1,41 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ require "openactive/dataset_site"
5
+
6
+ feed_types = [
7
+ OpenActive::DatasetSite::FeedType::FACILITY_USE,
8
+ OpenActive::DatasetSite::FeedType::SCHEDULED_SESSION,
9
+ OpenActive::DatasetSite::FeedType::SESSION_SERIES,
10
+ OpenActive::DatasetSite::FeedType::SLOT,
11
+ ]
12
+
13
+ settings = OpenActive::DatasetSite::Settings.new(
14
+ open_data_feed_base_url: "http://example.com/feed/",
15
+ dataset_site_url: "http://example.com/dataset/",
16
+ dataset_discussion_url: "https://github.com/simpleweb/sw-oa-php-test-site",
17
+ dataset_documentation_url: "https://permalink.openactive.io/dataset-site/open-data-documentation",
18
+ dataset_languages: ["en-GB"],
19
+ organisation_name: "Simpleweb",
20
+ organisation_url: "https://www.simpleweb.co.uk/",
21
+ organisation_legal_entity: "Simpleweb Ltd",
22
+ organisation_plain_text_description: "Simpleweb is a purpose driven software company that specialises in new "\
23
+ "technologies, product development, and human interaction.",
24
+ organisation_logo_url: "https://simpleweb.co.uk/wp-content/uploads/2015/07/facebook-default.png",
25
+ organisation_email: "spam@simpleweb.co.uk",
26
+ background_image_url: "https://simpleweb.co.uk/wp-content/uploads/2017/06/IMG_8994-500x500-c-default.jpg",
27
+ date_first_published: "2019-11-05",
28
+ platform_name: "AcmeBooker",
29
+ platform_url: "https://acmebooker.example.com/",
30
+ open_booking_api_base_url: "https://reference-implementation.openactive.io/api/openbooking",
31
+ open_booking_api_authentication_authority_url: "https://auth.reference-implementation.openactive.io",
32
+ open_booking_api_documentation_url: "https://permalink.openactive.io/dataset-site/open-booking-api-documentation",
33
+ open_booking_api_terms_service_url: "https://example.com/api-terms-page",
34
+ open_booking_api_registration_url: "https://example.com/api-landing-page",
35
+ test_suite_certificate_url: "https://certificates.reference-implementation.openactive.io/examples/all-features/controlled/",
36
+ data_feed_types: feed_types,
37
+ )
38
+
39
+ renderer = OpenActive::DatasetSite::TemplateRenderer.new(settings, "./path/to/assets")
40
+
41
+ puts renderer.render
@@ -14,7 +14,7 @@ settings = OpenActive::DatasetSite::Settings.new(
14
14
  open_data_feed_base_url: "http://example.com/feed/",
15
15
  dataset_site_url: "http://example.com/dataset/",
16
16
  dataset_discussion_url: "https://github.com/simpleweb/sw-oa-php-test-site",
17
- dataset_documentation_url: "https://developer.openactive.io/",
17
+ dataset_documentation_url: "https://permalink.openactive.io/dataset-site/open-data-documentation",
18
18
  dataset_languages: ["en-GB"],
19
19
  organisation_name: "Simpleweb",
20
20
  organisation_url: "https://www.simpleweb.co.uk/",
@@ -24,7 +24,7 @@ settings = OpenActive::DatasetSite::Settings.new(
24
24
  organisation_logo_url: "https://simpleweb.co.uk/wp-content/uploads/2015/07/facebook-default.png",
25
25
  organisation_email: "spam@simpleweb.co.uk",
26
26
  background_image_url: "https://simpleweb.co.uk/wp-content/uploads/2017/06/IMG_8994-500x500-c-default.jpg",
27
- date_first_published: "2019-11-05", # remember, remember the fifth of November...
27
+ date_first_published: "2019-11-05",
28
28
  data_feed_types: feed_types,
29
29
  )
30
30
 
@@ -0,0 +1,42 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ require "openactive/dataset_site"
5
+
6
+ feed_types = [
7
+ OpenActive::DatasetSite::FeedType::FACILITY_USE,
8
+ OpenActive::DatasetSite::FeedType::SCHEDULED_SESSION,
9
+ OpenActive::DatasetSite::FeedType::SESSION_SERIES,
10
+ OpenActive::DatasetSite::FeedType::SLOT,
11
+ ]
12
+
13
+ settings = OpenActive::DatasetSite::Settings.new(
14
+ open_data_feed_base_url: "http://example.com/feed/",
15
+ dataset_site_url: "http://example.com/dataset/",
16
+ dataset_discussion_url: "https://github.com/simpleweb/sw-oa-php-test-site",
17
+ dataset_documentation_url: "https://permalink.openactive.io/dataset-site/open-data-documentation",
18
+ dataset_languages: ["en-GB"],
19
+ organisation_name: "Simpleweb",
20
+ organisation_url: "https://www.simpleweb.co.uk/",
21
+ organisation_legal_entity: "Simpleweb Ltd",
22
+ organisation_plain_text_description: "Simpleweb is a purpose driven software company that specialises in new "\
23
+ "technologies, product development, and human interaction.",
24
+ organisation_logo_url: "https://simpleweb.co.uk/wp-content/uploads/2015/07/facebook-default.png",
25
+ organisation_email: "spam@simpleweb.co.uk",
26
+ background_image_url: "https://simpleweb.co.uk/wp-content/uploads/2017/06/IMG_8994-500x500-c-default.jpg",
27
+ date_first_published: "2019-11-05",
28
+ platform_name: "AcmeBooker",
29
+ platform_url: "https://acmebooker.example.com/",
30
+ platform_software_version: "2.0.1",
31
+ open_booking_api_base_url: "https://reference-implementation.openactive.io/api/openbooking",
32
+ open_booking_api_authentication_authority_url: "https://auth.reference-implementation.openactive.io",
33
+ open_booking_api_documentation_url: "https://permalink.openactive.io/dataset-site/open-booking-api-documentation",
34
+ open_booking_api_terms_service_url: "https://example.com/api-terms-page",
35
+ open_booking_api_registration_url: "https://example.com/api-landing-page",
36
+ test_suite_certificate_url: "https://certificates.reference-implementation.openactive.io/examples/all-features/controlled/",
37
+ data_feed_types: feed_types,
38
+ )
39
+
40
+ renderer = OpenActive::DatasetSite::TemplateRenderer.new(settings)
41
+
42
+ puts renderer.render
@@ -0,0 +1,35 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ require "openactive/dataset_site"
5
+
6
+ feed_types = [
7
+ OpenActive::DatasetSite::FeedType::FACILITY_USE,
8
+ OpenActive::DatasetSite::FeedType::SCHEDULED_SESSION,
9
+ OpenActive::DatasetSite::FeedType::SESSION_SERIES,
10
+ OpenActive::DatasetSite::FeedType::SLOT,
11
+ ]
12
+
13
+ settings = OpenActive::DatasetSite::Settings.new(
14
+ open_data_feed_base_url: "http://example.com/feed/",
15
+ dataset_site_url: "http://example.com/dataset/",
16
+ dataset_discussion_url: "https://github.com/simpleweb/sw-oa-php-test-site",
17
+ dataset_languages: ["en-GB"],
18
+ organisation_name: "Simpleweb",
19
+ organisation_url: "https://www.simpleweb.co.uk/",
20
+ organisation_legal_entity: "Simpleweb Ltd",
21
+ organisation_plain_text_description: "Simpleweb is a purpose driven software company that specialises in new "\
22
+ "technologies, product development, and human interaction.",
23
+ organisation_logo_url: "https://simpleweb.co.uk/wp-content/uploads/2015/07/facebook-default.png",
24
+ organisation_email: "spam@simpleweb.co.uk",
25
+ background_image_url: "https://simpleweb.co.uk/wp-content/uploads/2017/06/IMG_8994-500x500-c-default.jpg",
26
+ date_first_published: "2019-11-05",
27
+ open_booking_api_base_url: "https://reference-implementation.openactive.io/api/openbooking",
28
+ open_booking_api_registration_url: "https://example.com/api-landing-page",
29
+ test_suite_certificate_url: "https://certificates.reference-implementation.openactive.io/examples/all-features/controlled/",
30
+ data_feed_types: feed_types,
31
+ )
32
+
33
+ renderer = OpenActive::DatasetSite::TemplateRenderer.new(settings)
34
+
35
+ puts renderer.render
@@ -0,0 +1,93 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ require "openactive/dataset_site"
5
+
6
+ dataset = OpenActive::Models::Dataset.new(
7
+ id: "http://example.com/dataset/",
8
+ url: "http://example.com/dataset/",
9
+ description:
10
+ "Near real-time availability and rich descriptions relating to the facilities and sessions available from Simpleweb",
11
+ access_service:
12
+ OpenActive::Models::WebAPI.new(
13
+ name: 'Open Booking API',
14
+ description: "API that allows for seamless booking experiences to be created for facilities and sessions available from Simpleweb",
15
+ documentation: "https://permalink.openactive.io/dataset-site/open-booking-api-documentation",
16
+ terms_of_service: "https://example.com/api-terms-page",
17
+ endpoint_url: "https://reference-implementation.openactive.io/api/openbooking",
18
+ authentication_authority: "https://auth.reference-implementation.openactive.io",
19
+ conforms_to: ["https://openactive.io/open-booking-api/EditorsDraft/"],
20
+ endpoint_description: "https://www.openactive.io/open-booking-api/EditorsDraft/swagger.json",
21
+ landing_page: "https://example.com/api-landing-page"
22
+ ),
23
+ date_modified: "2019-12-09T15:36:15+00:00",
24
+ keywords:
25
+ ["Facilities",
26
+ "Sessions",
27
+ "Activities",
28
+ "Sports",
29
+ "Physical Activity",
30
+ "OpenActive"],
31
+ schema_version: "https://www.openactive.io/modelling-opportunity-data/2.0/",
32
+ license: "https://creativecommons.org/licenses/by/4.0/",
33
+ publisher:
34
+ OpenActive::Models::Organization.new(
35
+ name: "Simpleweb",
36
+ description:
37
+ "Simpleweb is a purpose driven software company that specialises in new technologies, product development, and human interaction.",
38
+ url: "https://www.simpleweb.co.uk/",
39
+ legalName: "Simpleweb Ltd",
40
+ logo:
41
+ OpenActive::Models::ImageObject.new(
42
+ url:
43
+ "https://simpleweb.co.uk/wp-content/uploads/2015/07/facebook-default.png",
44
+ ),
45
+ email: "spam@simpleweb.co.uk",
46
+ ),
47
+ discussion_url: "https://github.com/simpleweb/sw-oa-php-test-site",
48
+ date_published: "2019-11-05T00:00:00+00:00",
49
+ in_language: ["en-GB"],
50
+ distribution:
51
+ [OpenActive::Models::DataDownload.new(
52
+ name: "FacilityUse",
53
+ additional_type: "https://openactive.io/FacilityUse",
54
+ encoding_format: "application/vnd.openactive.rpde+json; version=1",
55
+ content_url: "http://example.com/feed/facility-uses",
56
+ ),
57
+ OpenActive::Models::DataDownload.new(
58
+ name: "ScheduledSession",
59
+ additional_type: "https://openactive.io/ScheduledSession",
60
+ encoding_format: "application/vnd.openactive.rpde+json; version=1",
61
+ content_url: "http://example.com/feed/scheduled-sessions",
62
+ ),
63
+ OpenActive::Models::DataDownload.new(
64
+ name: "SessionSeries",
65
+ additional_type: "https://openactive.io/SessionSeries",
66
+ encoding_format: "application/vnd.openactive.rpde+json; version=1",
67
+ content_url: "http://example.com/feed/session_series",
68
+ ),
69
+ OpenActive::Models::DataDownload.new(
70
+ name: "Slot",
71
+ additional_type: "https://openactive.io/Slot",
72
+ encoding_format: "application/vnd.openactive.rpde+json; version=1",
73
+ content_url: "http://example.com/feed/slots",
74
+ )],
75
+ background_image:
76
+ OpenActive::Models::ImageObject.new(
77
+ url:
78
+ "https://simpleweb.co.uk/wp-content/uploads/2017/06/IMG_8994-500x500-c-default.jpg",
79
+ ),
80
+ documentation: "https://permalink.openactive.io/dataset-site/open-data-documentation",
81
+ name: "Simpleweb Facilities and Sessions",
82
+ booking_service:
83
+ OpenActive::Models::BookingService.new(
84
+ name: "SimpleWeb Booking",
85
+ url: "https://www.example.com/",
86
+ software_version: "2.0.0",
87
+ has_credential: "https://certificates.reference-implementation.openactive.io/examples/all-features/controlled/",
88
+ ),
89
+ )
90
+
91
+ renderer = OpenActive::DatasetSite::TemplateRenderer.new(dataset, "./path/to/assets")
92
+
93
+ puts renderer.render
@@ -5,9 +5,9 @@ require "openactive/dataset_site"
5
5
 
6
6
  dataset = OpenActive::Models::Dataset.new(
7
7
  id: "http://example.com/dataset/",
8
+ url: "http://example.com/dataset/",
8
9
  description:
9
10
  "Near real-time availability and rich descriptions relating to the facilities and sessions available from Simpleweb",
10
- url: "http://example.com/dataset/",
11
11
  date_modified: "2019-12-09T15:36:15+00:00",
12
12
  keywords:
13
13
  ["Facilities",
@@ -65,8 +65,13 @@ dataset = OpenActive::Models::Dataset.new(
65
65
  url:
66
66
  "https://simpleweb.co.uk/wp-content/uploads/2017/06/IMG_8994-500x500-c-default.jpg",
67
67
  ),
68
- documentation: "https://developer.openactive.io/",
68
+ documentation: "https://permalink.openactive.io/dataset-site/open-data-documentation",
69
69
  name: "Simpleweb Facilities and Sessions",
70
+ booking_service:
71
+ OpenActive::Models::BookingService.new(
72
+ name: "SimpleWeb Booking",
73
+ url: "https://www.example.com/",
74
+ ),
70
75
  )
71
76
 
72
77
  renderer = OpenActive::DatasetSite::TemplateRenderer.new(dataset)
@@ -0,0 +1,93 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ require "openactive/dataset_site"
5
+
6
+ dataset = OpenActive::Models::Dataset.new(
7
+ id: "http://example.com/dataset/",
8
+ url: "http://example.com/dataset/",
9
+ description:
10
+ "Near real-time availability and rich descriptions relating to the facilities and sessions available from Simpleweb",
11
+ access_service:
12
+ OpenActive::Models::WebAPI.new(
13
+ name: 'Open Booking API',
14
+ description: "API that allows for seamless booking experiences to be created for facilities and sessions available from Simpleweb",
15
+ documentation: "https://permalink.openactive.io/dataset-site/open-booking-api-documentation",
16
+ terms_of_service: "https://example.com/api-terms-page",
17
+ endpoint_url: "https://reference-implementation.openactive.io/api/openbooking",
18
+ authentication_authority: "https://auth.reference-implementation.openactive.io",
19
+ conforms_to: ["https://openactive.io/open-booking-api/EditorsDraft/"],
20
+ endpoint_description: "https://www.openactive.io/open-booking-api/EditorsDraft/swagger.json",
21
+ landing_page: "https://example.com/api-landing-page"
22
+ ),
23
+ date_modified: "2019-12-09T15:36:15+00:00",
24
+ keywords:
25
+ ["Facilities",
26
+ "Sessions",
27
+ "Activities",
28
+ "Sports",
29
+ "Physical Activity",
30
+ "OpenActive"],
31
+ schema_version: "https://www.openactive.io/modelling-opportunity-data/2.0/",
32
+ license: "https://creativecommons.org/licenses/by/4.0/",
33
+ publisher:
34
+ OpenActive::Models::Organization.new(
35
+ name: "Simpleweb",
36
+ description:
37
+ "Simpleweb is a purpose driven software company that specialises in new technologies, product development, and human interaction.",
38
+ url: "https://www.simpleweb.co.uk/",
39
+ legalName: "Simpleweb Ltd",
40
+ logo:
41
+ OpenActive::Models::ImageObject.new(
42
+ url:
43
+ "https://simpleweb.co.uk/wp-content/uploads/2015/07/facebook-default.png",
44
+ ),
45
+ email: "spam@simpleweb.co.uk",
46
+ ),
47
+ discussion_url: "https://github.com/simpleweb/sw-oa-php-test-site",
48
+ date_published: "2019-11-05T00:00:00+00:00",
49
+ in_language: ["en-GB"],
50
+ distribution:
51
+ [OpenActive::Models::DataDownload.new(
52
+ name: "FacilityUse",
53
+ additional_type: "https://openactive.io/FacilityUse",
54
+ encoding_format: "application/vnd.openactive.rpde+json; version=1",
55
+ content_url: "http://example.com/feed/facility-uses",
56
+ ),
57
+ OpenActive::Models::DataDownload.new(
58
+ name: "ScheduledSession",
59
+ additional_type: "https://openactive.io/ScheduledSession",
60
+ encoding_format: "application/vnd.openactive.rpde+json; version=1",
61
+ content_url: "http://example.com/feed/scheduled-sessions",
62
+ ),
63
+ OpenActive::Models::DataDownload.new(
64
+ name: "SessionSeries",
65
+ additional_type: "https://openactive.io/SessionSeries",
66
+ encoding_format: "application/vnd.openactive.rpde+json; version=1",
67
+ content_url: "http://example.com/feed/session_series",
68
+ ),
69
+ OpenActive::Models::DataDownload.new(
70
+ name: "Slot",
71
+ additional_type: "https://openactive.io/Slot",
72
+ encoding_format: "application/vnd.openactive.rpde+json; version=1",
73
+ content_url: "http://example.com/feed/slots",
74
+ )],
75
+ background_image:
76
+ OpenActive::Models::ImageObject.new(
77
+ url:
78
+ "https://simpleweb.co.uk/wp-content/uploads/2017/06/IMG_8994-500x500-c-default.jpg",
79
+ ),
80
+ documentation: "https://permalink.openactive.io/dataset-site/open-data-documentation",
81
+ name: "Simpleweb Facilities and Sessions",
82
+ booking_service:
83
+ OpenActive::Models::BookingService.new(
84
+ name: "SimpleWeb Booking",
85
+ url: "https://www.example.com/",
86
+ software_version: "2.0.0",
87
+ has_credential: "https://certificates.reference-implementation.openactive.io/examples/all-features/controlled/",
88
+ ),
89
+ )
90
+
91
+ renderer = OpenActive::DatasetSite::TemplateRenderer.new(dataset)
92
+
93
+ puts renderer.render