}
Gadget[] gadgetList = new Gadget[rsList.size()];
Resource tempRes;
Gadget tempGadget;
try {
registry = getConfigSystemRegistry();
for (int i = 0; i < rsList.size(); i++) {
tempRes = rsList.get(i);
if ((tempRes.getProperty(DashboardConstants.GADGET_NAME) != null)
&& (tempRes.getProperty(DashboardConstants.GADGET_URL) != null)) {
tempGadget = new Gadget();
tempGadget.setGadgetName(tempRes
.getProperty(DashboardConstants.GADGET_NAME));
tempGadget.setGadgetUrl(tempRes
.getProperty(DashboardConstants.GADGET_URL));
if (tempRes.getProperty(DashboardConstants.GADGET_DESC) != null) {
tempGadget.setGadgetDesc(tempRes
.getProperty(DashboardConstants.GADGET_DESC));
} else {
tempGadget.setGadgetDesc("");
}
if (tempRes.getProperty(DashboardConstants.USER_CONTER) != null)
tempGadget.setUserCount(tempRes
.getProperty(DashboardConstants.USER_CONTER));
if (tempRes.getProperty(DashboardConstants.DEFAULT_GADGET) != null)
tempGadget
.setDefaultGadget(tempRes
.getProperty(DashboardConstants.DEFAULT_GADGET));
if (tempRes
.getProperty(DashboardConstants.UNSIGNED_USER_GADGET) != null)
tempGadget
.setUnsignedUserGadget(tempRes
.getProperty(DashboardConstants.UNSIGNED_USER_GADGET));
if (tempRes.getProperty(DashboardConstants.GADGET_THUMB_URL) != null) {
tempGadget.setThumbUrl(tempRes.getProperty(DashboardConstants.GADGET_THUMB_URL));
}
tempGadget.setGadgetPath(tempRes.getPath());
tempGadget.setRating(registry.getAverageRating(tempRes
.getPath()));
gadgetList[i] = tempGadget;
}