Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
api_browser
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
api_browser
Commits
1e65d63a
Commit
1e65d63a
authored
4 months ago
by
Jim Birch
Browse files
Options
Downloads
Patches
Plain Diff
Resolve
#3471391
"Update the readme"
parent
3058257b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2
Resolve #3471391 "Update the readme"
Pipeline
#270575
canceled
4 months ago
Stage: build
Stage: validate
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+122
-0
122 additions, 0 deletions
README.md
README.txt
+0
-1
0 additions, 1 deletion
README.txt
with
122 additions
and
1 deletion
README.md
0 → 100644
+
122
−
0
View file @
1e65d63a
# Project Browser API Browser
The Project Browser API Browser module provides a way to create Project Browsers
that connect with external APIs to provide the content source. This allows
organizations to create curated lists of projects for content administrators to
browse and install.
## Features
The Project Browser API Browser creates a configuration entity named
*Service*
.
The Service is the endpoint you are connecting to.
For example, Packagist:
`api_browser.service.packagist.yml`
```
id: packagist
name: 'Packagist'
description: 'Packagist is the main Composer repository. It aggregates public PHP packages installable with Composer.'
listing:
endpoint: 'https://packagist.org/packages/list.json'
method: GET
auth: no_auth
path: packages
pagination: true
page: ''
per_page: ''
search:
-
parameter: vendor
value: 'drupal'
-
parameter: type
value: 'drupal-recipe'
-
parameter: 'fields[]'
value: 'type'
-
parameter: 'fields[]'
value: 'repository'
-
parameter: 'fields[]'
value: 'abandoned'
project:
enable: true
endpoint: 'https://packagist.org/packages/{{item_key}}.json'
method: GET
auth: no_auth
path: package
field_mapping:
type: '{{ type | replace({"drupal-":""}) }}'
package_name: '{{ name }}'
machine_name: '{{ name }}'
url: '{{ repository }}'
logo: "{{ url('<front>') }}core/misc/logo/drupal-logo.svg"
title: '{{ name | split("/")[1] }}'
short_description: '{{ description }}'
long_description: '{{ description }}'
compatible: '{{ TRUE }}'
maintained: '{{ abandoned != TRUE }}'
covered: '{{ FALSE }}'
active: '{{ abandoned != TRUE }}'
star_user_count: '{{ github_stars }}'
project_usage_total: '{{ downloads.total }}'
created: '{{ (packages | first).time }}'
changed: '{{ (packages | last).time }}'
author: "{{ (authors| column('name')) | join(', ') }}"
categories: ''
images: ''
warnings: ''
```
Twig is used for being able to parse and manipulate the data returned from the
API endpoint to return the needed values for each of the browser requirements.
A derivative is used in the module's code to dynamically generate Project
Browser Services from these new config entities.
## Post-Installation
Change "Project Browser API Settings" to "API Browser Settings"
Click Add Service
After you install this module, visit the Project Browser API Browser Settings
page in your Drupal admin.
In the Admin menu visit:
Configuration > Development > Project Browser
Click on API Browser Settings
From there, you can see the services that have already been installed.
After you are content with those, visit the Project Browser's configuration page
and select the Project Browser Service you want to make available. Save and view
your changes in the Project Browser.
## Additional Requirements
There is a known issue [#3457003] in Project Browser at the moment and is
necessary for the required patch.
This module requires Project Browser which is currently in contrib. Once Project
Browser is merged into core, there should be no changes.
## Recommended modules/libraries
None at this time.
## Similar projects
*
[
Project Browser Source Example
](
https://git.drupalcode.org/project/project_browser/-/tree/2.0.x/modules/project_browser_source_example?ref_type=heads
)
*
A Submodule of Project Browser that provides an example browser.
*
[Project Browser Drupal Packagist(https://www.drupal.org/project/pb_drupal_packagist)]
*
Use packages.drupal.org as the source of information to bring Drupal modules
into Project Browser. Helped us understand the power to extending Project
Browser!
*
[
Project Browser Gitlab
](
https://www.drupal.org/project/project_browser_gitlab
)
*
Integrates Project Browser with Gitlab in order to browse (and install in
the future) projects from a Gitlab instance.
This diff is collapsed.
Click to expand it.
README.txt
deleted
100644 → 0
+
0
−
1
View file @
3058257b
# Project Browser API Browser
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment