* A custom query to retrieve gadget data for unsigned users
*
* @return array of strings containing the gadget name and URLs
*/
private String[] getGadgetUrlSetForUnSignedUser() {
Registry registry;
try {
registry = getConfigSystemRegistry();
Resource comQuery = registry.newResource();
String sql = "SELECT R.REG_NAME, R.REG_PATH_ID FROM REG_RESOURCE R, REG_PROPERTY P, REG_RESOURCE_PROPERTY RP, REG_PATH PA WHERE "
+ "R.REG_VERSION=RP.REG_VERSION AND "
+ "P.REG_NAME='"
+ DashboardConstants.UNSIGNED_USER_GADGET
+ "' AND "
+ "P.REG_VALUE='true' AND "
+ "P.REG_ID=RP.REG_PROPERTY_ID AND "
+ "PA.REG_PATH_ID=R.REG_PATH_ID";
HashMap<String, String> map = new HashMap<String, String>();
map.put("query", sql);
Collection qResults = registry.executeQuery(null, map);
String[] qPaths = (String[]) qResults.getContent();
ArrayList gadgetUrlsList = new ArrayList();
for (String qPath : qPaths) {
if (registry.resourceExists(qPath)) {
Resource tempRes = registry.get(qPath);
String gadgetNameTmp = tempRes.getProperty(DashboardConstants.GADGET_NAME);
String gadgetUrlTmp = tempRes.getProperty(DashboardConstants.GADGET_URL);
if (isGadgetAutharized(CarbonConstants.REGISTRY_ANONNYMOUS_USERNAME, gadgetUrlTmp)) {
gadgetUrlsList.add(gadgetNameTmp + "," + gadgetUrlTmp);
}