use of ubic.gemma.core.analysis.report.WhatsNew in project Gemma by PavlidisLab.
the class GemmaClassicHomePageController method updateCounts.
public void updateCounts() {
Map<String, Long> stats = new HashMap<String, Long>();
long bioAssayCount = bioAssayService.countAll();
long arrayDesignCount = arrayDesignService.countAll();
/*
* Sort taxa by name.
*/
TreeMap<Taxon, Long> eesPerTaxon = new TreeMap<Taxon, Long>(new Comparator<Taxon>() {
@Override
public int compare(Taxon o1, Taxon o2) {
return o1.getScientificName().compareTo(o2.getScientificName());
}
});
eesPerTaxon.putAll(expressionExperimentService.getPerTaxonCount());
long expressionExperimentCount = 0;
long otherTaxaEECount = 0;
for (Iterator<Taxon> it = eesPerTaxon.keySet().iterator(); it.hasNext(); ) {
Taxon t = it.next();
Long c = eesPerTaxon.get(t);
// TODO problem with this is we want to make a link to them.
if (c < 10) {
// temporary, hide 'uncommon' taxa from this table. See bug 2052
otherTaxaEECount += c;
it.remove();
}
expressionExperimentCount += c;
}
if (otherTaxaEECount > 0) {
// eesPerTaxon.put( otherTaxa, otherTaxaEECount );
}
WhatsNew wn = whatsNewService.retrieveReport();
stats.put("bioAssayCount", bioAssayCount);
stats.put("arrayDesignCount", arrayDesignCount);
mav.addObject("stats", stats);
mav.addObject("taxonCount", eesPerTaxon);
mav.addObject("expressionExperimentCount", expressionExperimentCount);
if (wn != null && wn.getDate() != null) {
mav.addObject("whatsNew", wn);
}
}
use of ubic.gemma.core.analysis.report.WhatsNew in project Gemma by PavlidisLab.
the class RssFeedControllerTest method setup.
@Before
public void setup() {
WhatsNew wn = whatsNewService.retrieveReport();
super.getTestPersistentExpressionExperiment();
super.getTestPersistentExpressionExperiment();
whatsNewService.generateWeeklyReport();
wn = whatsNewService.retrieveReport();
Collection<ExpressionExperiment> updatedExperiments = wn.getUpdatedExpressionExperiments();
Collection<ExpressionExperiment> newExperiments = wn.getNewExpressionExperiments();
for (ExpressionExperiment e : updatedExperiments) {
experiments.put(e, "Updated");
}
for (ExpressionExperiment e : newExperiments) {
experiments.put(e, "New");
}
updateCount = updatedExperiments.size();
newCount = newExperiments.size();
}
use of ubic.gemma.core.analysis.report.WhatsNew in project Gemma by PavlidisLab.
the class RssFeedController method getLatestExperiments.
/**
* Show all experiments
*/
@RequestMapping(value = { "/rssfeed" }, method = RequestMethod.GET)
public ModelAndView getLatestExperiments(HttpServletRequest request, HttpServletResponse response) {
WhatsNew wn = whatsNewService.retrieveReport();
if (wn == null) {
wn = whatsNewService.getReport();
}
int updatedExperimentsCount = 0;
int newExperimentsCount = 0;
Map<ExpressionExperiment, String> experiments = new HashMap<>();
if (wn != null) {
Collection<ExpressionExperiment> updatedExperiments = wn.getUpdatedExpressionExperiments();
Collection<ExpressionExperiment> newExperiments = wn.getNewExpressionExperiments();
for (ExpressionExperiment e : updatedExperiments) {
experiments.put(e, "Updated");
}
for (ExpressionExperiment e : newExperiments) {
experiments.put(e, "New");
}
updatedExperimentsCount = updatedExperiments.size();
newExperimentsCount = newExperiments.size();
}
ModelAndView mav = new ModelAndView();
mav.setView(customRssViewer);
mav.addObject("feedContent", experiments);
mav.addObject("updateCount", updatedExperimentsCount);
mav.addObject("newCount", newExperimentsCount);
log.debug("RSS experiments loaded.");
return mav;
}
use of ubic.gemma.core.analysis.report.WhatsNew in project Gemma by PavlidisLab.
the class WhatsNewController method weekly.
@RequestMapping("/weekly.html")
public ModelAndView weekly(HttpServletRequest request, HttpServletResponse response) {
ModelAndView mav = new ModelAndView("wnWeek");
Calendar c = Calendar.getInstance();
Date date = c.getTime();
date = DateUtils.addWeeks(date, -1);
WhatsNew wn = whatsNewService.getReport(date);
mav.addObject("whatsnew", wn);
mav.addObject("timeSpan", "In the past week");
return mav;
}
use of ubic.gemma.core.analysis.report.WhatsNew in project Gemma by PavlidisLab.
the class WhatsNewController method daily.
@RequestMapping("/daily.html")
public ModelAndView daily(HttpServletRequest request, HttpServletResponse response) {
ModelAndView mav = new ModelAndView("wnDay");
Calendar c = Calendar.getInstance();
Date date = c.getTime();
date = DateUtils.addDays(date, -1);
WhatsNew wn = whatsNewService.getReport(date);
mav.addObject("whatsnew", wn);
mav.addObject("timeSpan", "In the past day");
return mav;
}
Aggregations