Managing OSF Web Services Endpoints

From OSF Wiki
Jump to navigation Jump to search

Introduction

Screencast Tutorial

0.jpg

The goal of an OSF for Drupal instance is to use the OSF Web Services to create, manage, search and utilize all the data that as been indexed into a OSF instance. This means that all the actions performed by OSF for Drupal, all the data it searches and displays, come from remote web service endpoints.

In this section, we will see how we register, and manage, OSF Web Services endpoints.

A OSF for Drupal portal can use multiple endpoints at the same time. This means that different datasets can be hosted on different OSF instances. The only thing we have to do is to register these endpoints, and to expose the datasets we want to expose, and then the user will manage and use all this data without having to care where it is coming from.

Adding a New Instance

Adding a new OSF Web Services instance is really easy. What you have to do is to click on the top Configuration menu item. Then, you have to click the Configure OSF for Drupal modules.

OSF for Drupal configurations

Then make sure is that the DATASET & NETWORKS tab that

is selected. Then you have to click on the OSF API Endpoints link to get to the page where you will register your new endpoint.

OSF for Drupal main configurations page

Then you get to the form where you have to specify all the information that is required to register a new OSF Web Services endpoint to the OSF for Drupal module. The information you have to provide is:

  • Administrative title
    • This is the title that will be use to refere to this endpoint in the user interface across Drupal
  • URI
    • This is the base URL of the OSF Web Services endpoint. It usally ends with /ws/
  • Application ID
    • This is the application ID that will be used by Drupal to communicate with the OSF instance. If you don't use a default one, you will have to check with the OSF instance administrator such that he can provide one to you.
  • API Key
    • This is the API Key that is linked with the Application ID you provided above. This is required such that the Drupal instance can authenticate all the web service queries that it sends to the OSF instance.
  • Color
    • This is the color that is used to highligth that network in the user interface
  • Default
    • This is used to specify if this OSF endpoint instance is the default one. Depending on the OSF for Drupal module, some of them are only using with the default endpoin, others will all the endpoints. For example, the Search module only works with the default endpoint.

Then you have to click the Save button to register that new endpoint.

Registering the initial OSF Web Services endpoint

Once you saved the OSF Web Services to register, you will see it appearing in the list of available OSF endpoints to that Drupal instance. From that OSF API Endpoints section, you will be able to edit, modify, create and delete all the endpoints.

The newly registered endpoint is now displayed in the list of registered endpoints

The information you have in this list of endpoints is:

  • Endpoint
    • This is the name you specified for this endpoint
      • If the name starts with "Active Default:", then it means that in that list, this is the dataset that is considered to be the default dataset.
  • URI
    • This is the base URL where the web services queries will be directed to
  • Operations
  • Configuration Status
    • The ctools configuration status

Default Endpoint

A OSF for Drupal instance can have multiple OSF Web Services endpoints. One of these registered endpoints will be the default endpoint. Depending on the OSF for Drupal module, it will only work on the default endpoint, while others will be querying all of the endpoints until it gets the answer it is looking for. For example, the following modules/functionalities works on the default endpoint:

  • OSF Ontology
  • OSF QueryBuilder
  • OSF SconesField
  • Creating new Classes/Properties using OSF Entities

Deleting an Existing Instance

What you have to do is to click on the top Configuration menu item. Then, you have to click the Configure OSF for Drupal modules.

OSF for Drupal configurations

Then make sure is that the DATASET & NETWORKS tab that is selected. Then you have to click on the OSF API Endpoints link to get to the page that list all the registered endpoints.

OSF for Drupal main configurations page

Then you will get to the list of endpoints. What you have to do from here is to click the down arrow left to the Edit link of the endpoint you want to delete. Then click the Delete link to delete it. Once you clicked on that link, you will be prompted a new page that will ask you to make sure that you want to delete that endpoint from this Drupal instance.

Unregistering OSF endpoint

Changing the Default Endpoint

What you have to do is to click on the top Configuration menu item. Then, you have to click the Configure OSF for Drupal modules.

OSF for Drupal configurations

Then make sure is that the DATASET & NETWORKS tab that is selected. Then you have to click on the OSF API Endpoints link to get to the page that list all the registered endpoints.

OSF for Drupal main configurations page

Then you will get to the list of endpoints. What you have to do from here is to click the Edit link of the endpoint you want to make default.

Edit OSF endpoint

Finally, what you have to do is to make sure the Default checkbox is checked, and click the Save button.

OSF endpoint configuration page

Once you saved that endpoint, it will become the default OSF endpoint of that OSF for Drupal instance.