How to get configuration data in custom element?

Hi, Is it possible to get configuration data inside a custom component?

The only properties I saw that are available (saw in other components) are user and document . Is there a way to get data from the nuxeo.conf or other sources?

I need this because I want to create a link to some app, and the host url should be configurable somewhere… :/

Thanks in advance! Pedro Silva

0 votes

3 answers

97 views

ANSWER



Hello,

You'd better use a document property of type Directory, using a vocabulary for it: ID is the appcodename and label your host.

Regards

0 votes



Hi Gregory Carlin,

First of all, thanks for answering, but that is not what I'm looking for. I asked about a way to get configurations because the host I was talking about is not the Nuxeo one but some other external applications.

Example: Application “x” sends file to Nuxeo. That application has a specific uuid that is sent as a property of the same file. Then in Nuxeo I want to have a way to define the host of those applications given their uuid. The idea behind this is to be able to access the app who sent the file, from the Nuxeo interface.

Right now, as a workaround, I have a json file in “ui” folder of the nuxeo project, where I've created those mappings like this:

{
    "appcodename:26c14d3b-cadf-4cc9-82ef-40ebb6280cf6": {
        "host": "https://foo.bar"
    }
}

And what I do is fetch the file in the custom element that is used to preview the metadata of documents…

If there is no official way to do that, I will stay with this workaround :)

0 votes



Hello,

You can retrieve the host URL by using a nuxeo-connection element. The property rootPath will help you.

Regards

0 votes