Re: [Dev] [G-Reg] Added resource file not showing at the management console

2016-05-16 Thread Nalaka Perera
Hi Denuwanthi,

Thanks for the reply, I have correct the path definition and I have use
startTenantFlow. Now it's working perfectly.

Thanks,

On Mon, May 16, 2016 at 8:44 AM, Denuwanthi De Silva 
wrote:

> Hi Nalaka,
>
> Before creating the registry, could you please try loading the tenant
> registry using 'loadTenantRegistry(tenantId)' method of
> 'TenantRegistryLoader' class.
>
>
> Thanks,
>
>
>
> On Fri, May 13, 2016 at 6:45 PM, Nalaka Perera  wrote:
>
>> Hi all,
>>
>> I am adding Log analyzer alert configuration file (JSON file) to the
>> registry using TenantRegistryLoader. My code snippets as follows.
>>
>> public void saveAlertConfiguration (ScheduleAlertBean scheduleAlertBean, int 
>> tenantId) throws RegistryException {
>> try {
>> UserRegistry userRegistry = 
>> LAAlertServiceValueHolder.getInstance().getTenantConfigRegistry(tenantId);
>> createConfigurationCollection(userRegistry);
>> String configurationLocation = 
>> getConfigurationLocation(scheduleAlertBean.getAlertName());
>> if (!userRegistry.resourceExists(configurationLocation)) {
>>Resource resource = getResource(userRegistry, 
>> scheduleAlertBean);
>> if(!resource.equals(null)){
>> userRegistry.put(configurationLocation, resource);
>> userRegistry.commitTransaction();
>> }
>> }
>> } catch (RegistryException e) {
>> log.error("Unable to save Alert configurations " + 
>> e.getMessage(), e);
>> throw new RegistryException("Unable to save Alert Configuration 
>> " + e.getMessage(), e);
>> }
>> }
>>
>> private void createConfigurationCollection(UserRegistry userRegistry) {
>> try {
>> if 
>> (!userRegistry.resourceExists(LAAlertConstant.ALERT_CONFIGURATION_LOCATION)) 
>> {
>> Collection collection = userRegistry.newCollection();
>> userRegistry.put(LAAlertConstant.ALERT_CONFIGURATION_LOCATION, 
>> collection);
>> }
>> } catch (RegistryException e) {
>> log.error("Unable to create Configuration Collection in Registry " + 
>> e.getMessage(), e);
>> }
>> }
>>
>> When I am adding a file and load it's content to Log Analyzer UI(jaggery 
>> app), file content  are correctly showing at the LA UI. But file is not 
>> showing  at the management console, after restart the server file is showing 
>> at the  management console.
>>
>> I am also updating the content of that file and save, but changes of the 
>> content are not showing at the LA UI and management console. Then after 
>> restarting the server changes are showing correctly.
>>
>> Could anyone suggest a solution for this?
>>
>> Thanks
>> Nalaka
>>
>> --
>> *Nalaka Perera*
>>
>> *Intern - Software Engineering*
>> *WSO2*
>>
>> *Mobile: * *+94 71 9165748 <%2B94%2071%209165748>*
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Denuwanthi De Silva
> Software Engineer;
> WSO2 Inc.; http://wso2.com,
> Email: denuwan...@wso2.com
> Blog: https://denuwanthi.wordpress.com/
>



-- 
*Nalaka Perera*

*Intern - Software Engineering*
*WSO2*

*Mobile: * *+94 71 9165748*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [G-Reg] Added resource file not showing at the management console

2016-05-15 Thread Denuwanthi De Silva
Hi Nalaka,

Before creating the registry, could you please try loading the tenant
registry using 'loadTenantRegistry(tenantId)' method of
'TenantRegistryLoader' class.


Thanks,



On Fri, May 13, 2016 at 6:45 PM, Nalaka Perera  wrote:

> Hi all,
>
> I am adding Log analyzer alert configuration file (JSON file) to the
> registry using TenantRegistryLoader. My code snippets as follows.
>
> public void saveAlertConfiguration (ScheduleAlertBean scheduleAlertBean, int 
> tenantId) throws RegistryException {
> try {
> UserRegistry userRegistry = 
> LAAlertServiceValueHolder.getInstance().getTenantConfigRegistry(tenantId);
> createConfigurationCollection(userRegistry);
> String configurationLocation = 
> getConfigurationLocation(scheduleAlertBean.getAlertName());
> if (!userRegistry.resourceExists(configurationLocation)) {
>Resource resource = getResource(userRegistry, 
> scheduleAlertBean);
> if(!resource.equals(null)){
> userRegistry.put(configurationLocation, resource);
> userRegistry.commitTransaction();
> }
> }
> } catch (RegistryException e) {
> log.error("Unable to save Alert configurations " + 
> e.getMessage(), e);
> throw new RegistryException("Unable to save Alert Configuration " 
> + e.getMessage(), e);
> }
> }
>
> private void createConfigurationCollection(UserRegistry userRegistry) {
> try {
> if 
> (!userRegistry.resourceExists(LAAlertConstant.ALERT_CONFIGURATION_LOCATION)) {
> Collection collection = userRegistry.newCollection();
> userRegistry.put(LAAlertConstant.ALERT_CONFIGURATION_LOCATION, 
> collection);
> }
> } catch (RegistryException e) {
> log.error("Unable to create Configuration Collection in Registry " + 
> e.getMessage(), e);
> }
> }
>
> When I am adding a file and load it's content to Log Analyzer UI(jaggery 
> app), file content  are correctly showing at the LA UI. But file is not 
> showing  at the management console, after restart the server file is showing 
> at the  management console.
>
> I am also updating the content of that file and save, but changes of the 
> content are not showing at the LA UI and management console. Then after 
> restarting the server changes are showing correctly.
>
> Could anyone suggest a solution for this?
>
> Thanks
> Nalaka
>
> --
> *Nalaka Perera*
>
> *Intern - Software Engineering*
> *WSO2*
>
> *Mobile: * *+94 71 9165748 <%2B94%2071%209165748>*
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Denuwanthi De Silva
Software Engineer;
WSO2 Inc.; http://wso2.com,
Email: denuwan...@wso2.com
Blog: https://denuwanthi.wordpress.com/
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev