How to find your custom modules and themes on your Developer Portal

Guidance on how to find what custom modules and themes you installed on your Developer Portal.

The Developer Portal within API Connect comes with built-in modules and themes that you can use to customize your site. You can extend your customizations by installing external custom modules and themes, or even ones written by yourself. If you are unsure which custom modules and themes are installed on your Developer Portal, you can use one of the following methods to find out.
  1. Method 1. Developer Portal admin status report (recommended)
  2. Method 2. Developer Portal toolkit CLI
  3. Method 3. Developer Portal container

Method 1. Developer Portal admin status report (recommended)

  1. Log in to your Developer Portal as the administrator.
  2. If the administrator dashboard is not displayed, click Manage to display it.
  3. Click Manage > Reports > Status report.
    • The custom modules and themes are listed in the Custom Modules and Custom Themes sections at the end of the page. A screen capture showing the General System Information tab where you see the headings for Custom Modules and Custom Themes.
  4. Check which of your custom modules are enabled or disabled by clicking Manage > Extend.
    • The enabled modules are displayed with a selected checkbox, and the disabled ones are not selected as seen in the following example.

      A screen capture showing the enabled modules checked and disabled modules unchecked

  5. Check which of your custom themes are enabled or disabled by clicking Manage > Appearance.
    • Find your themes that are categorized into Enabled and Disabled sections.

      A screen capture showing the Enabled and Disabled themes

Method 2. Developer Portal toolkit CLI

Use the custom-module:create-export and custom-theme:create-export commands to extract your custom modules and themes into a compressed file.

The compressed file includes a list of your custom modules and themes. For more information about using the Developer Portal toolkit CLI and all the other features it offers, see Overview of the Developer Portal command-line tool.

  1. To list your modules, implement the following steps:
    1. Log in to the Developer Portal toolkit CLI as a provider organization.
    2. Run the following custom-module:create-export command against the Developer Portal.
      apic custom-module:create-export --mode portaladmin [flags]
    3. Specify the appropriate org and catalog name.

    For example,

    ❯ SERVER=myserver.ibm.com
    ❯ apic login -s $SERVER -r provider/default-idp-2 -u steve
    Warning: Using default toolkit credentials.
    Enter your API Connect credentials
    Password?
    Logged into myserver.ibm.com successfully
    
    ❯ apic -s $SERVER -m portaladmin custom-module:create-export -o ibm -c api-connect-catalog-1
    201 CREATED - Task ID: x8jupowmktkf8f2r
    
    Response Code - 202:
    
    Message(s) -
    The status of this task is: QUEUED
    
    Response Code - 200:
    
    Message(s) -
    The status of this task is: FINISHED and the artifact can now be streamed
    
    Saving File (Large files may take a while)...
    Incoming project saved to custom_module_createExport-20230322143819.tgz

    After the command has run, extract your compressed export to see the modules inside. Or use tar directly as shown in the following example.
    ❯ tar --exclude='*/*' -tvf custom_module_createExport-20230322143819.tgz
    drwxr-sr-x aegir/aegir       0 2023-03-22 12:05 chosen/
    drwxr-sr-x aegir/aegir       0 2023-03-22 12:05 google_tag/
    drwxr-sr-x aegir/aegir       0 2023-03-22 12:05 snowflakes/
  2. To check which one of your custom modules are enabled or disabled, implement the following steps:
    1. Run the following modules:list command to print the list of installed modules.
      apic modules:list --mode portaladmin [flags]
    2. Search for your custom modules from the result.

      For example,

      ❯ SERVER=myserver.ibm.com
      ❯ apic -s $SERVER -m portaladmin modules:list -o ibm -c api-connect-catalog-1 --no-core 
      .
      .
      .
      chosen:
        package: 'User interface'
        display_name: 'Chosen (chosen)'
        status: Disabled
        version: 3.0.5
      google_tag:
        package: Statistics
        display_name: 'Google Tag Manager (google_tag)'
        status: Enabled
        version: 8.x-1.6
      snowflakes:
        package: 'User interface'
        display_name: 'Snowflakes (snowflakes)'
        status: Enabled
        version: 2.0.1
      .
      .
  3. To list your custom themes, implement the following steps:
    1. Log in to the Developer Portal toolkit CLI as a provider organization.
    2. Run the following custom-theme:create-export command against the Developer Portal.
      apic custom-theme:create-export --mode portaladmin [flags]
    3. Specify the appropriate org and catalog name.

      For example,

      ❯ SERVER=myserver.ibm.com
      ❯ apic login -s $SERVER -r provider/default-idp-2 -u steve
      Warning: Using default toolkit credentials.
      Enter your API Connect credentials
      Password?
      Logged into api.fyre-ci-136264-master.fyre.ibm.com successfully
      
      ❯ apic -s $SERVER -m portaladmin custom-theme:create-export -o ibm -c api-connect-catalog-1
      201 CREATED - Task ID: oh595vuywxsz3526
      
      Response Code - 202:
      
      Message(s) -
      The status of this task is: QUEUED
      
      Response Code - 200:
      
      Message(s) -
      The status of this task is: FINISHED and the artifact can now be streamed
      
      Saving File (Large files may take a while)...
      Incoming project saved to custom_theme_createExport-20230322143856.tgz
      After the command has run, extract your compressed export to see the themes inside. Or use tar to view the contents directly as shown in the following example.
      ❯ tar --exclude='*/*' -tvf custom_theme_createExport-20230322143856.tgz
      drwxr-sr-x aegir/aegir       0 2023-03-22 14:36 emerald_theme_css/
      drwxr-sr-x aegir/aegir       0 2023-03-22 14:36 ruby_theme_scss/
      drwxr-sr-x aegir/aegir       0 2023-03-22 14:36 sapphire_theme_css/
  4. To check which of your custom themes are enabled or disabled, implement the following steps:
    1. Run the following themes:list command to print the list of installed themes.
      apic themes:list --mode portaladmin [flags]
    2. Search for your custom themes from the result.

      For example,

      ❯ SERVER=myserver.ibm.com
      ❯ apic -s $SERVER -m portaladmin themes:list -o ibm -c api-connect-catalog-1 --no-core
      bootstrap:
        package: Bootstrap
        display_name: 'Bootstrap (bootstrap)'
        status: Enabled
        version: 8.x-3.27
      .
      .
      .
      emerald_theme_css:
        package: Bootstrap
        display_name: 'emerald_theme_css (emerald_theme_css)'
        status: Disabled
        version: null
      ruby_theme_scss:
        package: Bootstrap
        display_name: 'ruby_theme_scss (ruby_theme_scss)'
        status: Disabled
        version: null
      sapphire_theme_css:
        package: Bootstrap
        display_name: 'sapphire_theme_css (sapphire_theme_css)'
        status: Disabled
        version: null

Method 3. Developer Portal container

If you are unable to access the Developer Portal settings or the Developer Portal toolkit CLI, check the Developer Portal container running within your Kubernetes or Red Hat OpenShift environment.

Note: You need access to the Developer Portal Kubernetes pods to be able to perform these steps.
  1. Use kubectl or oc for Red Hat OpenShift environment to obtain a shell to the Developer Portal running container.

    Your Developer Portal sites are located within the portal-www pod in the admin container within the namespace that your Developer Portal subsystem is deployed to as seen in the following example.
    ❯ kubectl get pods -n apic | grep www
    portal-014179b4-www-0     2/2     Running     0        8d
    
    ❯ kubectl exec -n apic -it portal-014179b4-www-0 -c admin -- bash
    bash-4.4$
  2. After you access the container, use the command list_sites -a to obtain the site alias for your Developer Portal. For example,
    bash-4.4$ list_sites -a
    daae4642-b1e2-4fd8-a5a7-77a68ed812ef.944dce4f-bbad-41ce-b166-aa2c9f8c4b17 => ibm.api-connect-catalog-1.portal.fyre-ci-136264-master.fyre.ibm.com (INSTALLED)
    daae4642-b1e2-4fd8-a5a7-77a68ed812ef.c560c004-852d-42c3-ae4e-797144a857af => ibm.api-connect-catalog-2.portal.fyre-ci-136264-master.fyre.ibm.com (INSTALLED)

    The Developer Portal portal.fyre-ci-136264-master.fyre.ibm.com/ibm/api-connect-catalog-1 has the site alias ibm.api-connect-catalog-1.portal.fyre-ci-136264-master.fyre.ibm.com.

  3. After you identify the Developer Portal that you want to look at, use the alias string within a find command to list your modules and themes, as shown in the following example.
    bash-4.4$ find /web/platforms/devportal*/sites/myserver.ibm.com/modules -mindepth 1 -maxdepth 1 -type d -exec basename {} \;
    chosen
    google_tag
    snowflake
    
    bash-4.4$ find /web/platforms/devportal*/sites/ibm.api-connect-catalog-1.portal.fyre-ci-136264-master.fyre.ibm.com/themes -mindepth 1 -maxdepth 1 -type d -exec basename {} \;
    emerald_theme_css
    ruby_theme_scss
    sapphire_theme_css
  4. To check which of your custom modules and themes are enabled or disabled, implement the following sub-steps:
    1. Use the drush command-line tool within the container to print the list of installed modules and themes for your Developer Portal.
    2. Then, use the site alias that you obtained earlier to run the following drush command and find your custom modules and themes.
      bash-4.4$ drush @myserver.ibm.com pml --no-core
      Running: drush -y @daae4642-b1e2-4fd8-a5a7-77a68ed812ef-944dce4f-bbad-41ce-b166-aa2c9f8c4b17 pml --no-core
       --------------------------------- ----------------------------------------------------------------------------------- ---------- ----------------
        Package                           Name                                                                                Status     Version
       --------------------------------- ----------------------------------------------------------------------------------- ---------- ----------------
        User                              Account Field Split (account_field_split)                                           Enabled
        Access control                    ACL (acl)                                                                           Enabled
        .
        .
        .
        User interface                    Chosen (chosen)                                                                     Disabled   3.0.5
        Statistics                        Google Tag Manager (google_tag)                                                     Disabled   8.x-1.6
        User interface                    Snowflakes (snowflakes)                                                             Disabled   2.0.1
      
        Bootstrap                         Bootstrap (bootstrap)                                                               Enabled    8.x-3.27
        Bootstrap                         connect_theme (connect_theme)                                                       Enabled    8.x-99.0.15
        Bootstrap                         emerald_theme_css (emerald_theme_css)                                               Disabled
        Bootstrap                         ruby_theme_scss (ruby_theme_scss)                                                   Disabled
        Bootstrap                         sapphire_theme_css (sapphire_theme_css)                                             Disabled

Results

By using one of the three methods discussed in the topic, you managed to successfully list the custom modules and themes installed on your Developer Portal. This also allowed you to see which of these custom modules and themes are enabled or disabled.
  1. Method 1. Developer Portal admin status report (recommended)
  2. Method 2. Developer Portal toolkit CLI
  3. Method 3. Developer Portal container

Next steps

Ensure that you keep your custom modules and themes up to date, and remove deprecated code within your own written custom modules and themes. If you are not using a custom module or theme, consider removing it. This helps mitigate problems when you want to migrate or upgrade your Developer Portal.