HI Viduranga,

You can get the content in a registry resource as follows,

Object content = resource.getContent();
String jsonContent = RegistryUtils.decodeBytes((byte[]) content);

This will retourn the You have to get the resource from the tenant registry
you need.

[1] - https://github.com/wso2/carbon-governance-extensions/
blob/master/components/governance-extensions/org.wso2.carbon.governance.
platform.extensions/src/org/wso2/carbon/governance/platform/extensions/util/
Utils.java#L42
[2] -
https://github.com/wso2/carbon-kernel/blob/4.4.x/core/org.wso2.carbon.registry.core/src/main/java/org/wso2/carbon/registry/core/utils/RegistryUtils.java#L1952
<https://github.com/wso2/carbon-governance-extensions/blob/master/components/governance-extensions/org.wso2.carbon.governance.platform.extensions/src/org/wso2/carbon/governance/platform/extensions/util/Utils.java#L42>

Thanks

*Prasanna Dangalla*
Senior Software Engineer, WSO2, Inc.; http://wso2.com/
lean.enterprise.middleware


*cell: +94 718 11 27 51*
*twitter: @prasa77*

On Thu, Dec 7, 2017 at 11:03 AM, Viduranga Gunarathne <[email protected]>
wrote:

> Hi Irham, Mushthaq
>
> @Mushthaq, thanks for the prompt reply. I will look into it.
>
>
> On Thu, Dec 7, 2017 at 10:57 AM, Irham Iqbal <[email protected]> wrote:
>
>> Hi Viduranga,
>>
>> What exactly you're trying to do ?
>> I mean are you trying to directly read the files from Jaggery or trying
>> to access the registry resources by using admin service from Jaggery ?
>>
>> I need to read the configuration from the registry. This config can be
> different from one tenant to another. So the value that should be displayed
> in the Store UI should change based on the tenant who has published the API.
>
>
>> Thanks,
>> Iqbal
>>
>> On Thu, Dec 7, 2017 at 10:48 AM, Viduranga Gunarathne <[email protected]
>> > wrote:
>>
>>> Hi,
>>>
>>> I'm working on APIM 2.1.0 and I need to read a configuration in the
>>> tenant registry that is specific to each tenant, from the jaggery layer so
>>> that it can be displayed in the Store UI.
>>>
>>> Any tips on how to do this?
>>>
>>> Also, The media type of the "tenant-conf" is json and can that be
>>> accessed as a json object or is it returned as a resource and we have to
>>> convert it to a json object at the jaggery level ?
>>>
>>> Thanks in advance!
>>> Viduranga.
>>> --
>>> Regards,
>>>
>>> *Viduranga Gunarathne*
>>>
>>> *Software Engineer Intern*
>>>
>>>
>>> *WSO2*
>>> Email : [email protected]
>>> Mobile : +94712437484 <+94%2071%20243%207484>
>>> Web : http://wso2.com
>>> [image: https://wso2.com/signature] <https://wso2.com/signature>
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> [email protected]
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Irham Iqbal
>> Software Engineer
>> WSO2
>> phone: +94 777888452
>> <http://wso2.com/signature>
>>
>>
>
>
> --
> Regards,
>
> *Viduranga Gunarathne*
>
> *Software Engineer Intern*
>
>
> *WSO2*
> Email : [email protected]
> Mobile : +94712437484 <+94%2071%20243%207484>
> Web : http://wso2.com
> [image: https://wso2.com/signature] <https://wso2.com/signature>
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to