Use a repository API to create a custom repository type for repository types that are
not shipped with Pega Platform. For example, you can build a Google Drive
custom repository type. Custom repository types appear in the Pega Platform user
interface.
Before you begin: Before
creating a repository, you must have access to the storage provider's API and you must select
the authentication mode to use with the API. For interactive authentication, use OAuth 2.0 and
the Information Mashup gadget. For more information about this gadget, see
Creating an External web component. For non-interactive authentication, use basic authentication.
Once you create a custom repository type, create one or more
connections to it. Custom repositories behave in the same way as the repositories delivered
with Pega Platform.
-
Open
your application.
-
Create
a child class of
Embed-Repository-Type
for your repository type:
Note: Do not create
a
subclass directly under Embed-Repository-Type. This class is reserved
for repositories that are implemented by Pega.
- Include the repository name at the end of the new class name. For example,
Embed-Repository-Type-Nexus.
- Create
the new class as an abstract class.
-
To add support for the custom repository type to the
Data-Repository rule form, override the
pyRepoConfiguration
section
in the new class.
-
Customize the activities for your class. The following list includes activities that
you
might
want to override:
-
pyFetchArtifact — If you need to fetch artifacts from the
repository, override this activity and then update the response on the
pyRepoFetchResponse page.
-
pyPublishArtifact — If you need to publish artifacts from this
repository, override this activity and then update the response on the
pyRepoPublishResponse page.
-
pyBrowseArtifact — If you need to browse artifacts from this
repository, override this activity and then update the response on the
pyRepoBrowseResponse page.
-
pyPingRepository — If you need to test the connection to this
repository, override this activity and then update the response on the
pyRepoPingResponse page.
-
Configure the repository type.
-
Upload
an icon that represents your custom repository type to the webwb
directory.
-
Update the Code-Pega-List.pyRepoTypes data transform with the
repository
details,
such as icon and name.
-
Implement the following repository APIs:
- Create folder API (D_pxNewFolder)
- Create file API (D_pxNewFile)
- Get file API (D_pxGetFile)
- List files API (D_pxListFiles)
- Exists API (pxExists when rule)
- Delete API (D_pxDelete)
- Is Authenticated API (D_pxIsAuthenticated)
For usage information about these APIs, see Repository APIs.