From bcebb3c76aa5c9d1f8fab830505650f3416cfb95 Mon Sep 17 00:00:00 2001 From: Siham Hussein Date: Fri, 24 Jan 2020 11:46:53 -0600 Subject: [PATCH] fix code blocks in docs (#830) --- Documentation/Integration.md | 2 +- Documentation/Overview.md | 16 ++++++++++------ .../SolidAuthSetup.md | 10 +++++----- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Documentation/Integration.md b/Documentation/Integration.md index c4c179677..5a5dce72b 100644 --- a/Documentation/Integration.md +++ b/Documentation/Integration.md @@ -57,7 +57,7 @@ Transfer Extensions are located in the [extensions/data-transfer module](https:/ ``` 4. Add an entry for your extension in root settings.gradle -``` javascript +```javascript // Foo transfer extension include ':extensions:data-transfer:portability-data-transfer-foo' ``` diff --git a/Documentation/Overview.md b/Documentation/Overview.md index 4e7de41bc..4fcb982ee 100644 --- a/Documentation/Overview.md +++ b/Documentation/Overview.md @@ -110,25 +110,27 @@ Where standards exist, the model will encapsulate the standard. Example model for data type "Photo" vertical: -> class PhotosModelWrapper implements DataModel { +```java +class PhotosModelWrapper implements DataModel { Collection albums; Collection photos; ContinuationInformation continuationInformation; } -> class PhotoAlbum { +class PhotoAlbum { String id; String name; String description; } -> class PhotoModel { +class PhotoModel { String title; String fetchableUrl; String description; String mediaType; - String albumId + String albumId; } +``` For a given vertical there doesn't need to be only one data specification, but there should be no more than a handful. @@ -139,7 +141,8 @@ Each adapter needs to provide 3 pieces of functionality: authorization, export, Authorization is ideally provided by OAuth, in which case a common auth code can be reused, but adapters are free to define arbitrary auth protocols as needed. The [export interface](https://github.com/google/data-transfer-project/blob/master/portability-spi-transfer/src/main/java/org/datatransferproject/spi/transfer/provider/Exporter.java) can be implemented to allow each service's adapter code to retrieve data and return it in a common data model format. It also allows for continuation and pagination of data: -``` + +```java public interface Exporter { ExportResult export(UUID jobId, A authData, Optional exportInformation) throws Exception; @@ -148,7 +151,8 @@ public interface Exporter { ExportInformation contains a ContainerResource and PaginationData. A ContainerResource represents a collection (such as an album or playlist) so that it is clear which collection subsequent data should be added to. PaginationData contains information about what the next page is - for example, if the job is currently looking at page 2 of a collection, then PaginationData should direct to page 3. The [import interface](https://github.com/google/data-transfer-project/blob/master/portability-spi-transfer/src/main/java/org/datatransferproject/spi/transfer/provider/Importer.java) allows for implementations to import or upload the data stored in a common data model format, which may include a collection of data or single data item: -``` + +```java public interface Importer { ImportResult importItem(UUID jobId, A authData, T data) throws Exception; } diff --git a/extensions/data-transfer/portability-data-transfer-solid/SolidAuthSetup.md b/extensions/data-transfer/portability-data-transfer-solid/SolidAuthSetup.md index f626b1e6d..0dd5be883 100644 --- a/extensions/data-transfer/portability-data-transfer-solid/SolidAuthSetup.md +++ b/extensions/data-transfer/portability-data-transfer-solid/SolidAuthSetup.md @@ -15,7 +15,7 @@ with a URI pointing to your profile in the certificate. The first thing to do is create a configuration file to tell openssl that you want to define a Subject Alternative Name. It should look something like: -```` +``` [ req ] default_bits = 2048 default_keyfile = server-key.pem @@ -63,7 +63,7 @@ nsComment = "OpenSSL Generated Certificate" [ alternate_names ] # Customize this URI = "https://example.inrupt.net/profile/card#me" -```` +``` Next run (assuming your config file is named san.cnf): @@ -86,7 +86,7 @@ modulus and exponent from your key. You can get those by running: Then you need to make a post request to `https://example.inrupt.net/profile/card` with something like: - ```` + ``` @prefix : <#>. @prefix solid: . @prefix pro: <./>. @@ -125,7 +125,7 @@ like: solid:publicTypeIndex ; n0:name "My Name"; cert:key :mycert. - ```` + ``` ## Configuring DTP @@ -134,4 +134,4 @@ your cert into your browser and then logging into Solid, selecting the WebID-TLS Currently we don't have Solid auth hooked up in production, but you can test it localy via the [ManualTest](src/test/java/org/datatransferproject/transfer/solid/contacts/ManualTest.java) -by entering the path to your `client.p12` and password in that file. \ No newline at end of file +by entering the path to your `client.p12` and password in that file.