Skip to content

Commit

Permalink
fix code blocks in docs (#830)
Browse files Browse the repository at this point in the history
  • Loading branch information
seehamrun committed Jan 24, 2020
1 parent 214ec58 commit bcebb3c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Documentation/Integration.md
Expand Up @@ -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'
```
Expand Down
16 changes: 10 additions & 6 deletions Documentation/Overview.md
Expand Up @@ -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<PhotoAlbum> albums;
Collection<PhotoModel> 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.

Expand All @@ -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<A extends AuthData, T extends DataModel> {
ExportResult<T> export(UUID jobId, A authData, Optional<ExportInformation> exportInformation)
throws Exception;
Expand All @@ -148,7 +151,8 @@ public interface Exporter<A extends AuthData, T extends DataModel> {
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<A extends AuthData, T extends DataModel> {
ImportResult importItem(UUID jobId, A authData, T data) throws Exception;
}
Expand Down
Expand Up @@ -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
Expand Down Expand Up @@ -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):

Expand All @@ -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: <http://www.w3.org/ns/solid/terms#>.
@prefix pro: <./>.
Expand Down Expand Up @@ -125,7 +125,7 @@ like:
solid:publicTypeIndex </settings/publicTypeIndex.ttl>;
n0:name "My Name";
cert:key :mycert.
````
```

## Configuring DTP

Expand All @@ -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.
by entering the path to your `client.p12` and password in that file.

0 comments on commit bcebb3c

Please sign in to comment.