You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 16, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+45-10Lines changed: 45 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,11 @@ module.exports = {
36
36
query:'',
37
37
},
38
38
renditions:'none',
39
+
preview:false,
40
+
auth:'',
41
+
staticAssetDownload:'false'.
42
+
staticAssetRootDir:'asset'
43
+
39
44
},
40
45
},
41
46
],
@@ -73,22 +78,55 @@ This setting controls which renditions of digital assets will be downloaded. Thi
73
78
74
79
-`custom` (default) means that only custom renditions will be downloaded.
75
80
-`none` means that only the original data will be downloaded.
76
-
-`all` means that all of the OCE-generated renditions (*thumbnail*, *small*, etc.) will be downloaded as well as any custom renditions.
81
+
-`all` means that all of the system generated renditions (*thumbnail*, *small*, etc.) will be downloaded as well as any custom renditions.
82
+
83
+
> NOTE: For each image downloaded, Gatsby will generate multiple renditions of its own to use for responsive display. This means that if you use the `all` value for renditions, Gatsby will generate resized copies of both the original image and for each of the system renditions (*thumbnail*, *small*, etc.). This can add a lot of processing time and network load to the build process for support that you may not need. It is recommended that you use the `none` or `custom` option unless you wish to explicitly use the system renditions.
84
+
85
+
**`preview`**[optional]
86
+
This setting controls whether the client will be retrieving preview (unpublished) data or not. If true, it must be used with the auth parameter. It defaults to false.
87
+
88
+
**`auth`**[optional]
89
+
This setting is used to set authentication tokens required when downloading from a secure publishing channel (preview=false) or preview items. It may use basic auth or
90
+
an OAuth bearer token. It defaults to an empty string.
91
+
92
+
**`staticAssetDownload`**[optional]
93
+
This setting is used to make the plugin download binary assets into the public directory of the site as opposed to storing them in the internal Gatsby cache. This allows items such as image files to be referenced as direct URLs rather than using GraphQL to access them. It is used in combination with the staticAssetRootDir (described below). The default value is false which means all data will be in the cache instead.
94
+
95
+
**`staticAssetRootDir`**[optional]
96
+
This setting is ignored unless staticAssetDownload is set to true. This allows a developer to define a directory in the website that will contain all the downloaded assets. This can help to segregate the items coming from the server from other static data. The default value is "asset", but it can be set to any string that is a valid directory name.
97
+
98
+
**`How to use static download:`**
99
+
Assume there is a digital asset on the server called Logo.jpg that contains an image to be used in a site.
100
+
If staticAssetDownload is false then the binary image will be stored in the cache as well as any selected renditions. (See 'renditions' flag above) These binary files can then be queried and traversed via GraphQL
101
+
102
+
If staticAssetDownload is true and staticAssetRootDir is set to 'server' then the file will be available in the website as: /server/Logo.jpg and could be displayed
103
+
in an \<img\> tag as \<img src="/server/Logo.jpg"\/> . If the user has chosen to download all the renditions of the digital assets in their site then the following urls
104
+
will be available:
105
+
/server/Logo.jpg (the original)
106
+
/server/Large/Logo.jpg (the large rendition)
107
+
/server/Medium/Logo.jpg (the medium rendition)
108
+
/server/Small/Logo.jpg (the small rendition)
109
+
/server/Thumbnail/Logo.jpg (the thumbnail rendition)
110
+
111
+
If there are any custom renditions, then they will also appear as
112
+
/server/*custom rendition name*/Logo.jpg
113
+
114
+
115
+
77
116
78
-
> NOTE: For each image downloaded, Gatsby will generate multiple renditions of its own to use for responsive display. This means that if you use the `all` value for renditions, Gatsby will generate resized copies of both the original image and for each of the OCE renditions (*thumbnail*, *small*, etc.). This can add a lot of processing time and network load to the build process for support that you may not need. It is recommended that you use the `none` or `custom` option unless you wish to explicitly use the OCE renditions.
79
117
80
118
### Content Model
81
119
82
-
The data model used for OCE data in Gatsby closely models the JSON data provided by the OCE REST interface. There are a few small exceptions though that are needed to avoid conflicts between Gatsby node reserved fields and OCE data. These include:
120
+
The data model used for content data in Gatsby closely models the JSON data provided by the Oracle Content Management REST interface. There are a few small exceptions though that are needed to avoid conflicts between Gatsby node reserved fields and Oracle Content Management data. These include:
83
121
84
122
- All assets are typed as `oceAsset` so that they can be distinguished from other assets in GraphQL queries.
85
-
- Some OCE asset fields are renamed to avoid conflicts with reserved Gatsby node field names. `id` becomes `oceId`, `fields` becomes `oceFields`, and `type` becomes `oceType`.
86
-
- In traditional OCE usage, a digital asset provides a URL that can be used to retrieve the binary form(s) of the asset from the server. As Gatsby builds static sites, these binary values must be stored locally and are placed in file nodes in the GraphQL store. To allow these binary forms to be retrieved easily in a site, a link is established between the file nodes and the digital asset nodes. What this means is that it is possible to traverse an `oceAsset` and find the internal Gatsby representations of its binary data without having to load the file nodes as well. All of an `oceAsset`'s file data can be found under the field `childrenFile`.
123
+
- Some Oracle Content Management asset fields are renamed to avoid conflicts with reserved Gatsby node field names. `id` becomes `oceId`, `fields` becomes `oceFields`, and `type` becomes `oceType`.
124
+
- In traditional Oracle Content Management usage, a digital asset provides a URL that can be used to retrieve the binary form(s) of the asset from the server. As Gatsby builds static sites, these binary values must be stored locally and are placed in file nodes in the GraphQL store. To allow these binary forms to be retrieved easily in a site, a link is established between the file nodes and the digital asset nodes. What this means is that it is possible to traverse an `oceAsset` and find the internal Gatsby representations of its binary data without having to load the file nodes as well. All of an `oceAsset`'s file data can be found under the field `childrenFile`.
87
125
88
126
## Examples
89
127
90
128
You can query `OceAsset` nodes in the following manner:
91
-
(This returns the names and types of all assets. Note that the `type` field is internal to Gatsby, so we use the `oceType` field to get the OCE name for each definition )
129
+
(This returns the names and types of all assets. Note that the `type` field is internal to Gatsby, so we use the `oceType` field to get the Oracle Content Management name for each definition )
92
130
93
131
```graphql
94
132
{
@@ -124,10 +162,7 @@ Load the information needed to display the image `Banner1.jpg` as a fluid (respo
0 commit comments