Hi Supun,

Not sure whether this is helpful now. Another way you can get  tanantID by
domain name is, if you have enabled 'carbon' jaggery module in your
environment, you can use below code as well. This is how we does it in ES.

var carbon = require('carbon');
> var domain = 'domain.name';
> var tenantId =  carbon.server.tenantId({domain: domain});
>

Thanks!
-Ayesha

On Tue, Nov 18, 2014 at 2:44 PM, Supun Sethunga <sup...@wso2.com> wrote:

> Hi Godwin,
>
> Thanks!
> Had to alter the above code as follows, though.
>
> *var tenantManagerService = new
> Packages.org.wso2.carbon.um.ws.service.TenantManagerService();*
> *var tenantId = tenantManagerService.getTenantId(tenantDomain);*
>
>
> Thanks again for pointing out where to look for. :)
>
> Regards,
>
> On Tue, Nov 18, 2014 at 1:59 PM, Godwin Amila Shrimal <god...@wso2.com>
> wrote:
>
>> Hi Supun,
>>
>> Use can use following code to get the tenantId.
>>
>> UserRealmService.getTenantManager().getTenantId(tenantDomain);
>>
>> On Tue, Nov 18, 2014 at 1:52 PM, Supun Sethunga <sup...@wso2.com> wrote:
>>
>>> Hi,
>>>
>>> How can do $subject?
>>>
>>> I was able to get the Tenant Domain as follows though.
>>>
>>> var user=jagg.getUser();
>>> var MultitenantUtils =
>>> Packages.org.wso2.carbon.utils.multitenancy.MultitenantUtils;
>>> var tenantDomain = MultitenantUtils.getTenantDomain(user);
>>>
>>> Thanks,
>>> Supun
>>>
>>> --
>>> *Supun Sethunga*
>>> Software Engineer
>>> WSO2, Inc.
>>> lean | enterprise | middleware
>>> Mobile : +94 716546324
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> *Godwin Amila Shrimal*
>> Senior Software Engineer
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>> mobile: *+94772264165*
>> linkedin: *http://lnkd.in/KUum6D <http://lnkd.in/KUum6D>*
>> twitter: https://twitter.com/godwinamila
>>
>
>
>
> --
> *Supun Sethunga*
> Software Engineer
> WSO2, Inc.
> lean | enterprise | middleware
> Mobile : +94 716546324
>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Ayesha Dissanayaka*
Software Engineer,
WSO2, Inc : http://wso2.com
<http://www.google.com/url?q=http%3A%2F%2Fwso2.com&sa=D&sntz=1&usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg>
20, Palmgrove Avenue, Colombo 3
E-Mail: aye...@wso2.com <ayshsa...@gmail.com>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to