Is there a way (API) to access / query for a list of enabled modules in a given subfolder? [EOM]

LabKey Support Forum (Inactive)
Is there a way (API) to access / query for a list of enabled modules in a given subfolder? [EOM] Leo Dashevskiy  2014-07-03 11:58
Status: Closed
 
Thanks.
 
 
jeckels responded:  2014-07-03 12:24
Hi Leo,

This is part of the response from LABKEY.Security.getContainers(). See the "activeModules" property:

https://www.labkey.org/download/clientapi_docs/javascript-api/symbols/LABKEY.Security.html#.getContainers

Thanks,
Josh
 
Leo Dashevskiy responded:  2014-07-03 12:37
Precisely what we might need. Thanks, Josh!
 
Leo Dashevskiy responded:  2014-07-23 14:39
A related question:

Is there some place within a custom module (in module.properties or begin.webpart.xml or some other meta file elsewhere), where a text can be inserted, which is the description of this module?

Moreover, I would want it to be query-able, so that there is a row in some table with a pair <module name> | <module description> ?

Thanks.
-Leo
 
Leo Dashevskiy responded:  2014-07-29 14:15
Anyone?
 
Ben Bimber responded:  2014-07-29 14:29
Hi Leo - it doesnt look like anything does this currently, but this small change to LABKEY.Security.getModules() would make this include description. You can see if LK wants to include this or something like it in the core.
 
Leo Dashevskiy responded:  2014-07-29 14:50
Ok, thanks Ben!

So do I understand correctly that a module's description can already be specified somewhere, if so, where exactly?
Though it is not query-able? Is that right? And your patch would make it so?
But your patch is not self-contained, is it?
getDescription() method would need to be defined for object m's class, yes?
 
Leo Dashevskiy responded:  2014-08-21 10:36
Josh, is there a difference between the API LABKEY.Security.getContainers() you mentioned above and just accessing LABKEY.container.activeModules ? (One thing I know is that the latter is instantaneous and the former needs to rely on a success callback, so I prefer the latter then...)

Ben, would you, please, comment on the questions I raised in the previous post (in reply to yours).

Thanks.
-Leo
 
jeckels responded:  2014-08-21 10:42
Hi Leo,

It should be identical for the current container. The both use the same code to build up the JSON.

LABKEY.Security.getContainers() lets you target another container, and allows you to request information about children as well.

Thanks,
Josh
 
Ben Bimber responded:  2014-08-21 10:52
Hi Leo,

Modules do have the ability to specify a description for themselves. The way they do this will vary depending on what kind of module you're using. If you have a java module, then just override Module.getDescription(). I believe file-based modules will probably have a way to set this, I'd assume either using the module.properties file or module.xml; however, I have not played around with that.

The patch I sent would simply cause this description to get included in the module JSON that is created with either LABKEY.container.activeModules or LABKEY.Security.getContainers(). Currently that JSON includes other information, but not description. I didnt see any other way for custom code to figure out module description currently.

Whether this makes modules 'queryable' will depend on exactly how you're defining that term. There isnt no SQL-based approach I know about. The APIs described above will return JSON with an array of available modules which would let your code iterate them and query that information. I'd need to know more about what you're trying to do.
 
Leo Dashevskiy responded:  2014-08-21 11:01
Thanks, Josh, makes sense.

Ben, I'm using file-based modules and in the specs I found, there is no mentioning of a 'description' field: https://help.labkey.org/wiki/home/Documentation/page.view?name=includeModulePropertiesFile&_docid=wiki%3A35edf503-f4be-1031-99a6-daf491c343ac

It would be nice, LabKey folks, to include such a functionality...

For now we have to rely on a manually maintained list.
 
Leo Dashevskiy responded:  2015-10-20 14:49
Implemented. Thanks, guys!