Package it.eng.spagobi.events.bo

Examples of it.eng.spagobi.events.bo.EventLog


   * @return the integer
   */
  public Integer registerEvent(String user, String desc, String params, List roles, String handler) { 
    logger.debug("IN");
    Integer id = null;
    EventLog eventLog = new EventLog();
    eventLog.setUser(user);
    eventLog.setDesc(desc);
    eventLog.setDate(new Timestamp(System.currentTimeMillis()));
    eventLog.setParams(params);
    eventLog.setHandler(handler);
    eventLog.setRoles(roles);
    try {
      eventLogDAO.setUserID(user);
      id = eventLogDAO.insertEventLog(eventLog);
    } catch (EMFUserError e) {
      logger.error("Error while registering event generated by user '" + user + "' at " + eventLog.getDate().toString() + " with decription " + desc, e);
    }
    logger.debug("OUT");
    return id;
  }
View Full Code Here


   *
   * @return The EventLog object with the id specified at input
   */
  public EventLog getRegisteredEvent(Integer id) {
    logger.debug("IN");
    EventLog event = null;
    try {
      event = eventLogDAO.loadEventLogById(id);
    } catch (EMFUserError e) {
      logger.error("The event with id = " + id + " was not found.", e);
    }
View Full Code Here

 
  private void getDetailEventLog(String idStr, SourceBean response) throws EMFUserError {
    try {
      Integer id = new Integer(idStr);
      EventLogDAOHibImpl eventLogDAO = new EventLogDAOHibImpl();
      EventLog event = eventLogDAO.loadEventLogById(id);
      if (event == null) {
        HashMap params = new HashMap();
        params.put(AdmintoolsConstants.PAGE, "EVENTS_MONITOR_PAGE");
        params.put("REFRESH", "TRUE");
        params.put(LightNavigationManager.LIGHT_NAVIGATOR_BACK_TO, "1");
        Vector v = new Vector();
        v.add(idStr);
        EMFUserError error = new EMFUserError(EMFErrorSeverity.ERROR, 1067, v, params);
        throw error;
      }
      String presentationHandler = event.getHandler();
      SpagoBITracer.debug(SpagoBIConstants.NAME_MODULE, this.getClass().getName(), "getDetailEventLog", "The presentation hanlder for event with id = " + idStr + " is : " + presentationHandler);
      Class presentationHandlerClass = Class.forName(presentationHandler);
      IEventPresentationHandler eventPresentationHanlder = (IEventPresentationHandler) presentationHandlerClass.newInstance();
      eventPresentationHanlder.loadEventInfo(event, response);
    } catch (EMFUserError error) {
View Full Code Here

 
  private void delDetailEventLog(String idStr, SourceBean response) throws EMFUserError, SourceBeanException  {
    try {
      EventLogDAOHibImpl eventLogDAO = new EventLogDAOHibImpl();
      Integer id = new Integer(idStr);
      EventLog eventLog = new EventLog();
      eventLog.setId(id);
      eventLogDAO.eraseEventLog(eventLog);
    } catch (EMFUserError e){
      HashMap params = new HashMap();
      params.put(AdmintoolsConstants.PAGE, "EVENTS_MONITOR_PAGE");
      params.put("REFRESH", "TRUE");
View Full Code Here

      format = format.replaceAll("m", "M");
      format = format.replaceAll("Y", "y");
    PaginatorIFace paginator = new GenericPaginator();
    Iterator it = firedEventsList.iterator();
    while (it.hasNext()) {
      EventLog eventLog = (EventLog) it.next();
      String rowSBStr = "<ROW ";
      rowSBStr += "    ID=\"" + eventLog.getId() + "\"";
      String date = StringUtils.dateToString(eventLog.getDate(), format);
      rowSBStr += "    DATE=\"" + date + "\"";
      rowSBStr += "    USER=\"" + eventLog.getUser() + "\"";
      String description = eventLog.getDesc();
      if (description != null) {
        description = GeneralUtilities.replaceInternationalizedMessages(description);
        description = description.replaceAll("<br/>", " ");
        if (description.length() > 50) description = description.substring(0, 50) + "...";
        description = description.replaceAll(">", "&gt;");
View Full Code Here

   */
  public EventLog loadEventLogById(Integer id) throws EMFUserError {
    logger.debug("IN");
    Session aSession = null;
    Transaction tx = null;
    EventLog realResult = null;
//    String hql = null;
//    Query hqlQuery = null;

    try {
      aSession = getSession();
View Full Code Here

    } logger.debug("OUT");   
  }

  private EventLog toEventsLog(SbiEventsLog hibEventLog) {
    logger.debug("IN");
    EventLog eventLog = new EventLog();
    eventLog.setId(hibEventLog.getId());
    eventLog.setUser(hibEventLog.getUser());
    eventLog.setDate(hibEventLog.getDate());
    eventLog.setDesc(hibEventLog.getDesc());
    eventLog.setParams(hibEventLog.getParams());
    eventLog.setHandler(hibEventLog.getHandlerClass());
    List roles = new ArrayList();
    Set rolesSet = hibEventLog.getRoles();
    Iterator rolesIt = rolesSet.iterator();
    while (rolesIt.hasNext()) {
      SbiEventRole hibEventRole = (SbiEventRole) rolesIt.next();
      SbiExtRoles hibRole = hibEventRole.getId().getRole();
      roles.add(hibRole.getName());
    }
    eventLog.setRoles(roles);
    logger.debug("OUT");
    return eventLog;
  }
View Full Code Here

TOP

Related Classes of it.eng.spagobi.events.bo.EventLog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.