Set up custom scripts in your Folio libraries

Folio lets users create and manage pre-configured libraries. When a user creates a document in a specially configured AODocs Folio library, a new pre-configured library is created.

This article is for administrators of Folio libraries who are setting up Folio on their domain.

Important: You must create a custom script to manage libraries. You can choose to do this either from actions in documents or from workflows. The snapshot custom scripts are optional.

The following custom scripts are available for your Folio library:

Automatically generated table of contents


Custom script to manage libraries from actions in documents

This Update Action custom script lets you create, update and delete libraries by creating, updating and deleting documents in your Folio libraries.

As a library administrator of a Folio library:

1. Open the library administration and select Custom Scripts.

2. Click <Add a new value> and name your new custom script. 

3. Select the Update Action type from the drop-down list.

image01.png

4. Click the name of your new custom script to configure it. 

5. Leave the default option Run with current user's privileges for the Security mode.

6. Add the following optional parameters and values:

  • parameter:Backend_Url
    default value: https://folio.eu.aodocs.app/_ah/api/folio/v1/router or https://folio.aodocs.app/_ah/api/folio/v1/router
  • parameter: Backend_Url_migration
    default value: https://folio.eu.aodocs.app/_ah/api/folio/v1/routerMigration  or https://folio.aodocs.app/_ah/api/folio/v1/routerMigration 
  • parameter: Url_Field_Name
    default value: Library Link
  • parameter: Library_Field_Name
    default value: Library Name
  • parameter: Is_Migration_Field_Name
    default value: Migration ID
  • parameter: Backend_Tech_User
    default value: [email address of your domain's technical account

Learn more about Folio instances: Access Folio.

7. Copy and paste the code snippets from this custom script into the Imports field and the bottom field (overwrite the existing text).

8. Click Save.

image02.png


Custom script to manage libraries from workflows

This Workflow Transition Action custom script lets you create, update and delete libraries through workflow transitions.

As a library administrator of a Folio library:

1. Open the library administration and select Custom Scripts.

2. Click <Add a new value> and name your new custom script. 

3. Select the Workflow Transition Action type from the drop-down list.

image03.png

4. Click the name of your new custom script to configure it. 

5. Leave the default option Run with current user's privileges for the Security mode.

6. Add the following optional parameters and values:

  • parameter:Backend_Url
    default value: https://folio.eu.aodocs.app/api/folio/v1/workflow-change or https://folio.aodocs.app/api/folio/v1/workflow-change
  • parameter: Action
    no default value
    possible values to use in your workflow: CREATE, UPDATE, READ_ONLY, DEFAULT, or DELETE

Learn more about Folio instances: Access Folio.

7. Copy and paste the code snippets from this custom script into the Imports field and the bottom field (overwrite the existing text).

8. Click Save.

image04.png


Custom script to create a snapshot document 

This custom script is required to create a snapshot document that you can use to create a snapshot of a library created with Folio.

As a library administrator of a Folio library:

1. Open the library administration and select Custom Scripts.

2. Click <Add a new value> and name your new custom script. 

3. Select the Update Action type from the drop-down list.

image03.png

4. Click the name of your new custom script to configure it. 

5. Leave the default option Run with current user's privileges for the Security mode.

6. Add the following optional parameters and values:

  • parameter:SNAPSHOT_ROLE
    default value: Snapshot Users
    description: Name of the role that has access to the Snapshot feature
  • parameter: SNAPSHOT_CLASS_NAME
    default value: Snapshot
    description: Name of the Snapshot class
  • parameter: REQUESTER_FIELD_NAME
    default value: Requester
    description: Name of the field to store the requester email
  • parameter: REQUEST_DATE_FIELD_NAME
    default value: Request Date
    description: Name of the request date field to store the date of the request
  • parameter: ACCESS_FIELD_NAME
    default value: Access
    description: Name of the access field
  • parameter: ENGAGEMENT_SNAPSHOT_RELATION
    default value: SOP - Snapshot
    description: Name of the relation between the SOP and the Snapshot

7. Copy and paste the code snippets from this custom script into the Imports field and the bottom field (overwrite the existing text).

8. Click Save.


Custom script to create a snapshot library

This custom script is required to create a snapshot of a library created with Folio from your snapshot document.

As a library administrator of a Folio library:

1. Open the library administration and select Custom Scripts.

2. Click <Add a new value> and name your new custom script. 

3. Select the Workflow transition action type from the drop-down list.

image04.png

4. Click the name of your new custom script to configure it. 

5. Leave the default option Run with current user's privileges for the Security mode.

6. Add the following optional parameters and values:

  • parameter:BACKEND_URL
    default value: https://aodocs-folio-qa.appspot.com/_ah/api/folio/v1/createSnapshot
  • parameter: ENGAGEMENT_SNAPSHOT_RELATION
    default value: SOP - Snapshot
    where SOP - Snapshot is the name of the relation between the document classes in your Folio library
  • parameter: LIBRARY_ID_FIELD_NAME
    default value: Library ID
  • parameter: ACCESS_FIELD_NAME
    default value: Access

7. Copy and paste the code snippets from this custom script into the Imports field and the bottom field (overwrite the existing text).

8. Click Save.


Custom script to delete a snapshot library

This custom script is required to delete a snapshot of a library that you created with Folio from your snapshot document.

As a library administrator of a Folio library:

1. Open the library administration and select Custom Scripts.

2. Click <Add a new value> and name your new custom script. 

3. Select the Workflow transition action type from the drop-down list.

image05.png

4. Click the name of your new custom script to configure it. 

5. Leave the default option Run with current user's privileges for the Security mode.

6. Add the following optional parameters and values:

  • parameter:BACKEND_URL
    default value: https://aodocs-folio-qa.appspot.com/_ah/api/folio/v1/deleteLibrary
  • parameter: LIBRARY_URL_FIELD_NAME
    default value: Link to Snapshot Library

7. Copy and paste the code snippets from this custom script into the Imports field and the bottom field (overwrite the existing text).

8. Click Save.

Was this article helpful? 1 out of 1 found this helpful
If you didn’t find what you were looking for, don’t hesitate to leave a comment!
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.