# Extension manager category list

**URL:** <https://discourse.slicer.org/t/extension-manager-category-list/160>\
**Category:** Development\
**Created:** [April 21, 2017, 3:21am UTC](https://discourse.slicer.org/t/extension-manager-category-list/160 "2017-04-21T03:21:35Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [April 21, 2017, 3:21am UTC](https://discourse.slicer.org/t/extension-manager-category-list/160/1 "2017-04-21T03:21:36Z")

</div>

Only the first 14 category names show up in the extension manager (Windows, latest nightly):

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/d/6de2042f77cf616431ca9cd6d8e95965d76051ea.png)

For example, Registration category is not shown.

How should we fix this?

- Option A: fix category in all s4ext files to have meaningful categories(current categories are quite useless now, as there are only 1-2 extensions in most of them)
- Option B: Fix Midas3 slicerappstore to show all categories

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [April 21, 2017, 8:27pm UTC](https://discourse.slicer.org/t/extension-manager-category-list/160/2 "2017-04-21T20:27:43Z")

</div>

### Option A

> [@lassoan](#):
>
> Option A: fix category in all s4ext files to have meaningful categories(current categories are quite useless now, as there are only 1-2 extensions in most of them)

Given the current infrastructure, we would have to submit an update to the project itself since it used to generate the description file.

### Option B

> [@lassoan](#):
>
> Option B: Fix Midas3 slicerappstore to show all categories

Note that all categories (and sub-categories) are expected to be visible if they have at least one extension.

On the frontend, generation of the current category list happen here:

> <https://github.com/midasplatform/slicerappstore/blob/4b6c4ddfc4bff11a7137c88e24631741152301c6/public/js/index/index.index.js#L273-L277>

and the corresponding data are gathered using a call like this one:

> **[@KitwareMedical/slicer-extensions-webapp](http://slicer.kitware.com/midas3/slicerappstore/index/categories?os=win&arch=amd64&revision=25939)**

returning

```json
{
  "Applications":"1",
  "Astronomy":"0",
  "CARMA":"0",
  "Cardiac":"2",
  "Cardiac MRI toolkit":"0",
  "Chest Imaging Platform":"1",
  "Converters":"1",
  "DICOM":"1",
  "Developer Tools":"3",
  "Diffusion":"2",
  "Diffusion.Tractography":"1",
  "Editor Effects":"1",
  "Editor Effects New":"0",
  "Epilepsy":"0",
  "Examples":"1",
  "Exporter":"1",
  "FiberViewer":"0",
  "Filtering":"2",
  "Filtering.Anomalous Filters":"0",
  "Filtering.Morphology":"0",
  "Heart":"0",
  "IGT":"9",
  "Informatics":"4",
  "Informatics Utilities 'Developer Tools'":"1",
  "Libraries":"1",
  "MARGIN CALCULATOR":"0",
  "Machine Learning":"1",
  "Mesh Generation":"1",
  "Microscopy":"0",
  "MultiDimension":"0",
  "Multidimensional data":"0",
  "Nuclear Medicine":"1",
  "Pathology":"0",
  "Port Placement":"0",
  "Quantification":"7",
  "Radiotherapy":"3",
  "Registration":"2",
  "Remote":"0",
  "Scoliosis":"0",
  "Segmentation":"11",
  "Sequences":"1",
  "Shape Analysis":"5",
  "Shape AnalysisRegistration":"0",
  "Surface Models":"0",
  "Thingiverse":"0",
  "Tractography":"0",
  "Training":"1",
  "Transforms":"1",
  "Utilities":"0",
  "Vascular Modeling Toolkit":"1",
  "Volume Rendering":"0",
  "Web System Tools":"1",
  "Wizards":"1",
  "\u201cIGT\u201d":"0",
  "\u201cRadiotherapy\u201d":"0"
}

```

Json formatted using [https://jsonformatter.curiousconcept.com/](https://jsonformatter.curiousconcept.com/)

### Alternative idea

Categorization could be done one our side without expecting extension maintainer to assign a category.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [April 21, 2017, 8:40pm UTC](https://discourse.slicer.org/t/extension-manager-category-list/160/3 "2017-04-21T20:40:28Z")

</div>

We control the ExtensionsIndex, so we can change the categories.

The category list is cut off at about 14 elements. For example, you don’t see Registration category until you remove some modules by filtering, for example:

All modules are shown - Registration category not visible:  
[http://slicer.kitware.com/midas3/slicerappstore/?os=win&arch=amd64&revision=25939&category=&search=&layout=layout](http://slicer.kitware.com/midas3/slicerappstore/?os=win&arch=amd64&revision=25939&category=&search=&layout=layout)

Only a few modules are shown, Registration category shows up:  
[http://slicer.kitware.com/midas3/slicerappstore/?os=win&arch=amd64&revision=25939&category=&search=ela&layout=layout](http://slicer.kitware.com/midas3/slicerappstore/?os=win&arch=amd64&revision=25939&category=&search=ela&layout=layout)

If we cannot fix Midas then we should probably override category submissions in the ExtensionsIndex.

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [April 21, 2017, 9:33pm UTC](https://discourse.slicer.org/t/extension-manager-category-list/160/4 "2017-04-21T21:33:20Z")

</div>

I suspect the category with quote is causing trouble. `Informatics Utilities 'Developer Tools'` … looking at the code now.

> [@lassoan](#):
>
> If we cannot fix Midas then we should probably override category submissions in the ExtensionsIndex

I think that will prove to be a lot of work with the current process in place. This means that every PR would have to be manually tweaked or fixed after integration.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [April 21, 2017, 9:52pm UTC](https://discourse.slicer.org/t/extension-manager-category-list/160/5 "2017-04-21T21:52:44Z")

</div>

Not many extensions use git hashes and updates are not that frequent anyway. When we get an updated s4ext with a mismatched category name, we would ask developers to update their extension with the new category name and regenerate the s4ext.

Fixing Midas would be useful regardless.

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [April 22, 2017, 12:37am UTC](https://discourse.slicer.org/t/extension-manager-category-list/160/6 "2017-04-22T00:37:36Z")

</div>

> [@lassoan](#):
>
> Not many extensions use git hashes and updates are not that frequent anyway. When we get an updated s4ext with a mismatched category name, we would ask developers to update their extension with the new category name and regenerate the s4ext.

It means we should document the current valid and accepted category. That would help both “maintainer of” and “contributor to” the extension index.

Inclusion of new category would then be discussed and agreed within the community.

> [@lassoan](#):
>
> Fixing Midas would be useful regardless.

Look like the culprit is indeed the category with quote, it should be easy to fix by having a robust sanitize function …

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/0/f0571c6be4cc5a2e5aed7430acf104e3f5b9754f.png)

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [April 22, 2017, 12:39am UTC](https://discourse.slicer.org/t/extension-manager-category-list/160/7 "2017-04-22T00:39:01Z")

</div>

The problem is here:

> <https://github.com/midasplatform/slicerappstore/blob/4b6c4ddfc4bff11a7137c88e24631741152301c6/public/js/index/index.index.js#L240>

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [April 22, 2017, 1:03am UTC](https://discourse.slicer.org/t/extension-manager-category-list/160/8 "2017-04-22T01:03:01Z")

</div>

Issue has been fixed in [midasplatform/slicerappstore@68db48e](https://github.com/midasplatform/slicerappstore/commit/68db48e7b0f74f15752b4dfdbc26eab5f537224f) and deployed on the server.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/1/61b58aee1da575081e5957b5acc63acb9246ee6b.png)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [April 22, 2017, 1:42am UTC](https://discourse.slicer.org/t/extension-manager-category-list/160/9 "2017-04-22T01:42:56Z")

</div>

This is great, thank you. Some more tuning may be needed, as clicking on the category with ’ in the name does not bring up any extension:

[http://slicer.kitware.com/midas3/slicerappstore/?os=win&arch=amd64&revision=25939&category=Informatics%20Utilities%20’Developer%20Tools’&search=&layout=layout](http://slicer.kitware.com/midas3/slicerappstore/?os=win&arch=amd64&revision=25939&category=Informatics%20Utilities%20'Developer%20Tools'&search=&layout=layout)

I’ll start a new topic on defining good extension category names.
