List of usage examples for org.jfree.util Log warn
public static void warn(final Object message, final Exception e)
From source file:com.serotonin.m2m2.CoreLicenseDefinition.java
private String getSpecificGuid(Host.Specificity specificity) { for (Host host : this.hosts) { if ((host.getSpecificity() == specificity) && (host.matches())) { try { String guid = host.guid(); if (!StringUtils.isBlank(guid)) return guid; } catch (IOException e) { Log.warn("Host exception: ", e); }//w w w . j a v a 2 s. com } } return null; }
From source file:org.intermine.web.struts.ReportController.java
private InterMineObject getRequestedObject(InterMineAPI im, HttpServletRequest request) { String idString = request.getParameter("id"); if (!StringUtils.isNumeric(idString) || StringUtils.isBlank(idString)) { return null; }/* ww w . ja v a 2 s. c o m*/ Integer id = new Integer(Integer.parseInt(idString)); ObjectStore os = im.getObjectStore(); InterMineObject requestedObject = null; try { requestedObject = os.getObjectById(id); } catch (ObjectStoreException e) { Log.warn("Accessed report page with id: " + id + " but failed to find object.", e); } return requestedObject; }
From source file:org.oscarehr.web.admin.ProviderPreferencesUIBean.java
public static final ProviderPreference updateOrCreateProviderPreferences(HttpServletRequest request) { ProviderPreference providerPreference = getLoggedInProviderPreference(); // update preferences based on request parameters String temp;//from w ww . j a va 2 s. co m HttpSession session = request.getSession(); // new tickler window temp = StringUtils.trimToNull(request.getParameter("new_tickler_warning_window")); if (temp != null) { providerPreference.setNewTicklerWarningWindow(temp); } else { temp = StringUtils.trimToNull((String) session.getAttribute("newticklerwarningwindow")); if (temp != null) providerPreference.setNewTicklerWarningWindow(temp); } // default pmm temp = StringUtils.trimToNull(request.getParameter("default_pmm")); if (temp != null) { providerPreference.setDefaultCaisiPmm(temp); } else { temp = StringUtils.trimToNull((String) session.getAttribute("default_pmm")); if (temp == null) providerPreference.setDefaultCaisiPmm("disabled"); else providerPreference.setDefaultCaisiPmm(temp); } // default billing preference (edit or delete) temp = StringUtils.trimToNull(request.getParameter("caisiBillingPreferenceNotDelete")); if (temp != null) { try { providerPreference.setDefaultDoNotDeleteBilling(Integer.parseInt(temp)); } catch (NumberFormatException e) { MiscUtils.getLogger().error("Error", e); } } else { temp = StringUtils.trimToNull(String.valueOf(session.getAttribute("caisiBillingPreferenceNotDelete"))); if (temp == null) providerPreference.setDefaultDoNotDeleteBilling(0); else { int defBilling = 0; try { defBilling = Integer.parseInt(temp); } catch (NumberFormatException e) { Log.warn("warning", e); } providerPreference.setDefaultDoNotDeleteBilling(defBilling); } } // default billing dxCode temp = StringUtils.trimToNull(request.getParameter("dxCode")); if (temp != null) providerPreference.setDefaultDxCode(temp); // rest temp = StringUtils.trimToNull(request.getParameter("start_hour")); if (temp != null) providerPreference.setStartHour(Integer.parseInt(temp)); temp = StringUtils.trimToNull(request.getParameter("end_hour")); if (temp != null) providerPreference.setEndHour(Integer.parseInt(temp)); temp = StringUtils.trimToNull(request.getParameter("every_min")); if (temp != null) providerPreference.setEveryMin(Integer.parseInt(temp)); temp = StringUtils.trimToNull(request.getParameter("mygroup_no")); if (temp != null) providerPreference.setMyGroupNo(temp); temp = StringUtils.trimToNull(request.getParameter("default_servicetype")); if (temp != null) providerPreference.setDefaultServiceType(temp); temp = StringUtils.trimToNull(request.getParameter("color_template")); if (temp != null) providerPreference.setColourTemplate(temp); providerPreference.setPrintQrCodeOnPrescriptions(WebUtils.isChecked(request, "prescriptionQrCodes")); // get encounterForms for appointment screen temp = StringUtils.trimToNull(request.getParameter("appointmentScreenFormsNameDisplayLength")); if (temp != null) providerPreference.setAppointmentScreenLinkNameDisplayLength(Integer.parseInt(temp)); String[] formNames = request.getParameterValues("encounterFormName"); Collection<String> formNamesList = providerPreference.getAppointmentScreenForms(); formNamesList.clear(); if (formNames != null) { for (String formName : formNames) { formNamesList.add(formName); } } // get eForms for appointment screen String[] formIds = request.getParameterValues("eformId"); Collection<Integer> eFormsIdsList = providerPreference.getAppointmentScreenEForms(); eFormsIdsList.clear(); if (formIds != null) { for (String formId : formIds) { eFormsIdsList.add(Integer.parseInt(formId)); } } // external prescriber prefs providerPreference.setERxEnabled(WebUtils.isChecked(request, "erx_enable")); temp = StringUtils.trimToNull(request.getParameter("erx_username")); if (temp != null) providerPreference.setERxUsername(temp); temp = StringUtils.trimToNull(request.getParameter("erx_password")); if (temp != null) providerPreference.setERxPassword(temp); temp = StringUtils.trimToNull(request.getParameter("erx_facility")); if (temp != null) providerPreference.setERxFacility(temp); providerPreference.setERxTrainingMode(WebUtils.isChecked(request, "erx_training_mode")); temp = StringUtils.trimToNull(request.getParameter("erx_sso_url")); if (temp != null) providerPreference.setERx_SSO_URL(temp); providerPreferenceDao.merge(providerPreference); return (providerPreference); }
From source file:org.xwiki.contrib.mailarchive.timeline.internal.TimeLineGenerator.java
/** * Formats a timeline bubble content, ie html presenting list of mails related to a given topic. * /*from w w w . j av a 2 s . c o m*/ * @param topicid * @param topicsubject * @return * @throws QueryException * @throws XWikiException */ protected String getExtract(String topicid) throws QueryException, XWikiException { String extract = ""; logger.debug("Retrieving first email linked to topic with id " + topicid); String xwql_topic = "select mail.body, mail.bodyhtml from Document doc, " + "doc.object(" + XWikiPersistence.CLASS_MAILS + ") as mail where mail.topicid='" + topicid + "' and doc.space='MailArchiveItems' order by mail.date asc"; final List<Object[]> msgs = queryManager.createQuery(xwql_topic, Query.XWQL).setLimit(1).execute(); if (CollectionUtils.isNotEmpty(msgs)) { final String body = (String) msgs.get(0)[0]; final String bodyhtml = (String) msgs.get(0)[1]; extract = body; try { DecodedMailContent decoded = mailUtils.decodeMailContent(bodyhtml, body, true); if (decoded != null) { if (decoded.isHtml() && StringUtils.isEmpty(decoded.getText())) { extract = textUtils.htmlToPlainText(bodyhtml); } else { extract = decoded.getText(); } } } catch (IOException e) { Log.warn("Could not decoded HTML content {}", e); } extract = StringUtils.normalizeSpace(extract); extract = StringUtils.abbreviate(extract, 200); } return extract; }