private ActionReturn getBullhornAlerts(List<BullhornAlert> alerts) { ResourceLoader rl = new ResourceLoader("bullhorns"); if (alerts.size() > 0) { Map<String, Object> data = new HashMap<>(); data.put("alerts", alerts); data.put("i18n", rl); return new ActionReturn(data); } else { Map<String, String> i18n = new HashMap<>(); i18n.put("noAlerts", rl.getString("noAlerts")); Map<String, Object> data = new HashMap<>(); data.put("message", "NO_ALERTS"); data.put("i18n", i18n); return new ActionReturn(data); } }
private ActionReturn getBullhornAlerts(List<BullhornAlert> alerts) { ResourceLoader rl = new ResourceLoader("bullhorns"); if (alerts.size() > 0) { Map<String, Object> data = new HashMap(); data.put("alerts", alerts); data.put("i18n", rl); return new ActionReturn(data); } else { Map<String, String> i18n = new HashMap(); i18n.put("noAlerts", rl.getString("noAlerts")); Map<String, Object> data = new HashMap(); data.put("message", "NO_ALERTS"); data.put("i18n", i18n); return new ActionReturn(data); } }
@EntityCustomAction(action = "bullhornCounts", viewKey = EntityView.VIEW_LIST) public ActionReturn getBullhornCounts(EntityView view) { String currentUserId = getCheckedCurrentUser(); Map<String, Long> counts = new HashMap<>(); counts.put("academic", bullhornService.getAcademicAlertCount(currentUserId)); counts.put("social", bullhornService.getSocialAlertCount(currentUserId)); return new ActionReturn(counts); }
@EntityCustomAction(action="yyyy",viewKey="") public ActionReturn xxxAction(EntityView view) { return new ActionReturn(view.getOriginalEntityUrl()); }
@EntityCustomAction(action = "bullhornCounts", viewKey = EntityView.VIEW_LIST) public ActionReturn getBullhornCounts(EntityView view) { String currentUserId = getCheckedCurrentUser(); Map<String, Integer> counts = new HashMap(); counts.put("academic", bullhornService.getAcademicAlertCount(currentUserId)); counts.put("social", bullhornService.getSocialAlertCount(currentUserId)); return new ActionReturn(counts); }
@EntityCustomAction(action="yyyy",viewKey="") public ActionReturn xxxAction(EntityView view) { return new ActionReturn(view.getOriginalEntityUrl()); }
actionReturn = (ActionReturn) result; } else if (OutputStream.class.isAssignableFrom(resultClass)) { actionReturn = new ActionReturn(outputStream); } else if (String.class.isAssignableFrom(resultClass)) { actionReturn = new ActionReturn((String) result); } else if (List.class.isAssignableFrom(resultClass)) { actionReturn = new ActionReturn(data, (String) null); } else if (EntityData.class.isAssignableFrom(resultClass)) { actionReturn = new ActionReturn( (EntityData) result, (String) null); } else { actionReturn = new ActionReturn( ed, (String) null);
return new ActionReturn(hits); } catch (Exception e) { log.error(e.getMessage(), e);
actionReturn = (ActionReturn) result; } else if (OutputStream.class.isAssignableFrom(resultClass)) { actionReturn = new ActionReturn(outputStream); } else if (String.class.isAssignableFrom(resultClass)) { actionReturn = new ActionReturn((String) result); } else if (List.class.isAssignableFrom(resultClass)) { actionReturn = new ActionReturn(data, (String) null); } else if (EntityData.class.isAssignableFrom(resultClass)) { actionReturn = new ActionReturn( (EntityData) result, (String) null); } else { actionReturn = new ActionReturn( ed, (String) null);
return new ActionReturn(hits); } catch (Exception e) { log.error(e.getMessage(), e);
return new ActionReturn(Formats.UTF_8, Formats.HTML_MIME_TYPE, writer.toString()); } catch (IOException ioe) { throw new EntityException("Failed to format profile.", ref.getReference());
return new ActionReturn(Formats.UTF_8, Formats.HTML_MIME_TYPE, writer.toString()); } catch (IOException ioe) { throw new EntityException("Failed to format profile.", ref.getReference());
private Object myDoubleAction(EntityView view) { MyEntity me = (MyEntity) getEntity(view.getEntityReference()); MyEntity togo = me.copy(); togo.setNumber( togo.getNumber() * 2 ); return new ActionReturn(new EntityData(view.getEntityReference().toString(), togo.getStuff(), togo), (String)null); }
public Object doubleUp(EntityView view) { MyEntity me = (MyEntity) getEntity(view.getEntityReference()); MyEntity togo = me.copy(); togo.setNumber( togo.getNumber() * 2 ); return new ActionReturn(new EntityData(view.getEntityReference().toString(), togo.getStuff(), togo), (String)null); }
public Object doubleCustomAction(EntityView view) { MyEntity me = (MyEntity) getEntity(view.getEntityReference()); MyEntity togo = me.copy(); togo.setNumber( togo.getNumber() * 2 ); return new ActionReturn(new EntityData(view.getEntityReference().toString(), togo.getStuff(), togo), (String)null); }
public Object doubleCustomAction(EntityView view) { MyEntity me = (MyEntity) getEntity(view.getEntityReference()); MyEntity togo = me.copy(); togo.setNumber( togo.getNumber() * 2 ); return new ActionReturn(new EntityData(view.getEntityReference().toString(), togo.getStuff(), togo), (String)null); }
private Object myDoubleAction(EntityView view) { MyEntity me = (MyEntity) getEntity(view.getEntityReference()); MyEntity togo = me.copy(); togo.setNumber( togo.getNumber() * 2 ); return new ActionReturn(new EntityData(view.getEntityReference().toString(), togo.getStuff(), togo), (String)null); }
public Object doubleUp(EntityView view) { MyEntity me = (MyEntity) getEntity(view.getEntityReference()); MyEntity togo = me.copy(); togo.setNumber( togo.getNumber() * 2 ); return new ActionReturn(new EntityData(view.getEntityReference().toString(), togo.getStuff(), togo), (String)null); }