&& null != awr.getGuiIds().iterator().next()) {
// first guiid is primary.
guiId = awr.getGuiIds().iterator().next();
}
GuisettingBean gsb = getFilter(userId, guiId);
jsonString = awr.getJson();
if (StringUtils.isNotEmpty(jsonString)
&& Dispatcher.getInstance().checkAccess(userId,
"GUISETTING_STORE")) {
// we have json in request
// set in jsonString
// store it in settings (newsWidget/newsFilter)
if (null == gsb) {
gsb = new GuisettingBean();
gsb.setUserid(userId);
gsb.setCreatedby(userId);
// gsb.setGuiid("guestbookWidget");
gsb.setGuiid(guiId);
gsb.setGuikey("filter");
// gsb.setGuivalue(outer.get(key));
gsb.create();
} else {
gsb.setGuivalue(awr.getJson());
gsb.store();
}
} else if (null != gsb) {
// get from db (if it is there)
jsonString = gsb.getGuivalue();
}
if (null != jsonString && !"".equals(jsonString)
&& !"null".equals(jsonString)) {
// we have json, read filters (later used in sql)