# Add a resource (icons svg lib) for the new API

**URL:** <https://forum.inductiveautomation.com/t/add-a-resource-icons-svg-lib-for-the-new-api/110976>\
**Category:** Module Development\
**Tags:** ignition83, perspective\
**Created:** [September 25, 2025, 4:54pm UTC](https://forum.inductiveautomation.com/t/add-a-resource-icons-svg-lib-for-the-new-api/110976 "2025-09-25T16:54:36Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [September 25, 2025, 4:54pm UTC](https://forum.inductiveautomation.com/t/add-a-resource-icons-svg-lib-for-the-new-api/110976/1 "2025-09-25T16:54:36Z")

</div>

I would like to add a resource (icons svg lib) for the new API.

Resource will be added in C:\Program Files\Inductive Automation\Ignition\data\config\resources\core\com.inductiveautomation.perspective\icons\

pseudo code

```java

import com.inductiveautomation.ignition.common.resourcecollection.Resource
import com.inductiveautomation.ignition.common.resourcecollection.ResourceBuilder

res = ResourceBuilder().setType("icons").setPath("...testicons").setData(u"blabla").setLastModified(System.currentTimeMillis()).build()

cfg = context.getConfigurationManager()
cfg.addSystemResources(Collections.singletonList(res));

```

it is the right method to add such kind of ressources ?  
What is the type and path to provide ?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 25, 2025, 5:08pm UTC](https://forum.inductiveautomation.com/t/add-a-resource-icons-svg-lib-for-the-new-api/110976/2 "2025-09-25T17:08:58Z")

</div>

The first question is how you want your resource to behave.

Do you want end users to be able to overwrite or override your icons, or do you want to guarantee that they're available? That dictates whether to add them to the `SYSTEM` collection, or add them in `core`.

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [September 25, 2025, 5:47pm UTC](https://forum.inductiveautomation.com/t/add-a-resource-icons-svg-lib-for-the-new-api/110976/3 "2025-09-25T17:47:55Z")

</div>

I want to guarantee that they're available.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 25, 2025, 5:57pm UTC](https://forum.inductiveautomation.com/t/add-a-resource-icons-svg-lib-for-the-new-api/110976/4 "2025-09-25T17:57:59Z")

</div>

Okay, then you want to add them to system as you are, but note that the system collection only exists in memory - you won't ever see them on disk:

> [@mazeyrat](#):
>
> \resources\core\

> [@mazeyrat](#):
>
> What is the type and path to provide ?

`com.inductiveautomation.perspective.gateway.assets.icons.IconManagerImpl#RESOURCE_TYPE` is the shared reference; you could construct an equivalent `ResourceType` if that's not exposed with `new ResourceType("com.inductiveautomation.perspective", "icons")`.

So without knowing offhand what's exposed outside the Perspective module, this should get you there:

```java
        ResourceType type = new ResourceType("com.inductiveautomation.perspective", "icons");
        String mySvgData = "...";
        String fileName = "mySvgData.svg";
        JsonObject configObject = new JsonObject();
        configObject.addProperty("svgFileName", fileName);

        var resource = Resource.newBuilder()
            .setResourcePath(type.childPath("myIcons"))
            .putData(fileName, mySvgData)
            .putData(Resource.DEFAULT_JSON_KEY, configObject.toString())
            .build();

        context.getConfigurationManager().addSystemResources(List.of(resource));

```

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [September 25, 2025, 6:09pm UTC](https://forum.inductiveautomation.com/t/add-a-resource-icons-svg-lib-for-the-new-api/110976/5 "2025-09-25T18:09:53Z")

</div>

In fact those icones where here in **core** :

C:\Program Files\Inductive Automation\Ignition\data\config\resources\core\com.inductiveautomation.perspective\icons\

due to a migration from 8.1.

It's probably better the user can modify them and that the resources are visibles on disk.  
So I will need to add them to the core...

I suppose I need to use other method than ConfigurationManager::addSystemResources...?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 25, 2025, 6:13pm UTC](https://forum.inductiveautomation.com/t/add-a-resource-icons-svg-lib-for-the-new-api/110976/6 "2025-09-25T18:13:11Z")

</div>

Yes. Much the same, but specify a collection name in the builder and use `push`:

```java
        var resource = Resource.newBuilder()
            .setResourceCollectionName(ConfigurationManager.CORE)
            .setResourcePath(type.childPath("myIcons"))
            .putData(fileName, mySvgData)
            .putData(Resource.DEFAULT_JSON_KEY, configObject.toString())
            .build();

        ChangeOperation.CreateResourceOperation createOp = ChangeOperation.newCreateOp(resource);
        try {
            context.getConfigurationManager().push(List.of(createOp));
        } catch (PushException e) {
            throw new RuntimeException(e);
        }

```

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [September 25, 2025, 6:33pm UTC](https://forum.inductiveautomation.com/t/add-a-resource-icons-svg-lib-for-the-new-api/110976/7 "2025-09-25T18:33:18Z")

</div>

to create on hand without module a new Custom Icon Repository,  
the good practice is to copy another one, change the resource.json, and config.json and svg files and rescan on the gateway ?

ressources.attributes can be leave empty ?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 25, 2025, 8:00pm UTC](https://forum.inductiveautomation.com/t/add-a-resource-icons-svg-lib-for-the-new-api/110976/8 "2025-09-25T20:00:13Z")

</div>

> [@Custom Icon Library in 8.3](https://forum.inductiveautomation.com/t/custom-icon-library-in-8-3/109259/2):
>
> Okay, here's the current steps. Navigate to your install directory, and in the /data/config/resources/core/ folder, create a new folder com.inductiveautomation.perspective/ (if it doesn't already exist). Within that folder create an icons/ folder. Within that folder create a \<repository name\>/ folder. Within that folder, create: The spritesheet of your SVG, at whatever arbitrary filename you want, e.g. icons.svg. A config.json file that contains a single entry, svgFileName, that co…

Basically.

---

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [September 25, 2025, 9:12pm UTC](https://forum.inductiveautomation.com/t/add-a-resource-icons-svg-lib-for-the-new-api/110976/9 "2025-09-25T21:12:59Z")

</div>

> [@paul-griffith](#):
>
> That dictates whether to add them to the `SYSTEM` collection, or add them in `core`.

Hypothetical question: what if I wanted to add globally available Perspective style classes?

We have a theme that allows configuration via style classes, it could be cool to have the theme + PSC's wrapped up as a module.

I'm guessing this concept doesn't apply though, since style classes are a project resource.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 25, 2025, 9:17pm UTC](https://forum.inductiveautomation.com/t/add-a-resource-icons-svg-lib-for-the-new-api/110976/10 "2025-09-25T21:17:43Z")

</div>

Correct. New to 8.3, modules can contribute _an entire project_, which acts more or less like a 'system' level resource...but it's an entire project, not a piece of one. You should be able to have it participate in inheritance, though.
