Hi all,

I need to $ subject in a jaggery app and came across the following two
approaches.
What is the best approach to go ahead with? Or is there any other approach?

*Approach 1*

<%

var log = new Log();
var datasourceManager =
Packages.org.wso2.carbon.ndatasource.core.DataSourceManager;
var mydatasourceManager = new datasourceManager();

var coll =
mydatasourceManager.getInstance().getDataSourceRepository().getAllDataSources();
var iterator = coll.iterator();

while (iterator.hasNext()) {
   log.info(iterator.next().getDSMInfo().getName());
}


%>


*Approach 2*

<%

var log = new Log();
var carbon = require('carbon');
var masterds =
carbon.server.loadConfig('datasources/master-datasources.xml');
var ds = masterds.*::['datasources'].*::['datasource'].*::['name'].text();
log.info(ds);

%>


Thanks,
Tanya


-- 
Tanya Madurapperuma

Software Engineer,
WSO2 Inc. : wso2.com
Mobile : +94718184439
Blog : http://tanyamadurapperuma.blogspot.com
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to