Package org.infoglue.cms.util

Examples of org.infoglue.cms.util.NotificationMessage


        {
            initializePrincipal(principalName);
            UserPropertiesVO newUserPropertiesVO = userPropertiesController.update(userPropertiesVO.getLanguageId(), userPropertiesVO.getContentTypeDefinitionId(), userPropertiesVO);
            newUserPropertiesId = newUserPropertiesVO.getId().intValue();
           
      NotificationMessage notificationMessage = new NotificationMessage("RemoteUserProperties.updateUserProperties", UserPropertiesImpl.class.getName(), principalName, NotificationMessage.PUBLISHING, newUserPropertiesVO.getId(), newUserPropertiesVO.getUserName());
      ChangeNotificationController.getInstance().addNotificationMessage(notificationMessage);
        }
        catch(Exception e)
        {
            logger.error("En error occurred when we tried to create a new userProperty:" + e.getMessage(), e);
View Full Code Here


            }  
          }

          if(forcePublication)
          {
        NotificationMessage notificationMessage = new NotificationMessage("RemoteUserProperties.updateUserProperties", UserPropertiesImpl.class.getName(), principalName, NotificationMessage.PUBLISHING, newUserPropertiesVO.getId(), newUserPropertiesVO.getUserName());
        ChangeNotificationController.getInstance().addNotificationMessage(notificationMessage);
          }
        }
        catch(Throwable e)
        {
View Full Code Here

           
            ContentVersionController.getContentVersionController().deleteDigitalAsset(contentId, languageId, assetKey);
              
          logger.info("Done with contents..");

      NotificationMessage notificationMessage = new NotificationMessage("RemoteUserProperties.deleteDigitalAsset", SystemUserImpl.class.getName(), principalName, NotificationMessage.PUBLISHING, principalName, principalName);
      ChangeNotificationController.getInstance().addNotificationMessage(notificationMessage);
        }
        catch(Throwable e)
        {
          status = new Boolean(false)
View Full Code Here

        if(user == null || (!user.getIsAdministrator() && !hasAuthorizedRole(user)))
        { 
          //throw new Exception("This user is not authorized to log in...");
          httpServletResponse.sendRedirect("unauthorizedLogin.jsp");

          NotificationMessage notificationMessage = new NotificationMessage("Authorization failed:", "Authorization", authenticatedUserName, NotificationMessage.AUTHORIZATION_FAILED, "" + authenticatedUserName, "name");
          TransactionHistoryController.getController().create(notificationMessage);
         
          return;
        }
       
        //TODO - we must fix so these caches are individual to the person - now a login will slow down for all
        //CacheController.clearCache("authorizationCache");
        //CacheController.clearCache("personalAuthorizationCache", user.getName());
        CacheController.clearCacheForGroup("personalAuthorizationCache", user.getName());

        // Store the authenticated user in the session
        if(session != null)
        {
          session.setAttribute(INFOGLUE_FILTER_USER, user);
          setUserProperties(session, user);
        }
       
        //TEST - transferring auth to deliverworking
          try
          {
            if(userName != null && password != null)
            {
              DesEncryptionHelper encHelper = new DesEncryptionHelper();
            String encryptedName = encHelper.encrypt(userName);
            String encryptedPassword = encHelper.encrypt(password);
 
              String encryptedNameAsBase64 = Base64.encodeBase64URLSafeString(encryptedName.getBytes("utf-8"));
              String encryptedPasswordAsBase64 = Base64.encodeBase64URLSafeString(encryptedPassword.getBytes("utf-8"));

            String deliverBaseUrl = CmsPropertyHandler.getComponentRendererUrl();
            String[] parts = deliverBaseUrl.split("/");
           
            deliverBaseUrl = "/" + parts[parts.length -1];
            //logger.info("used cmsBaseUrl:" + cmsBaseUrl);
           
              ServletContext servletContext = filterConfig.getServletContext().getContext(deliverBaseUrl);
              if (servletContext == null)
              {
                logger.error("Could not autologin to " + deliverBaseUrl + ". Set cross context = true in Tomcat config.");
              }
              else
              {
                logger.info("Added encryptedName:" + encryptedName + " = " + user.getName() + " to deliver context");
                servletContext.setAttribute(encryptedName, user.getName());
              }
            
              int cmsCookieTimeout = 1800; //30 minutes default
              String cmsCookieTimeoutString = null; //CmsPropertyHandler.getCmsCookieTimeout();
              if(cmsCookieTimeoutString != null)
              {
                  try
                {
                    cmsCookieTimeout = Integer.parseInt(cmsCookieTimeoutString.trim());
                }
                  catch(Exception e) {}
            }
         
             
            //Cookie cookie_iguserid = new Cookie("iguserid", encryptedName.replaceAll("=", "IGEQ"));
              Cookie cookie_iguserid = new Cookie("iguserid", encryptedNameAsBase64);
            cookie_iguserid.setPath("/");
            cookie_iguserid.setMaxAge(cmsCookieTimeout);
            httpServletResponse.addCookie(cookie_iguserid);
             
              //Cookie cookie_igpassword = new Cookie ("igpassword", encryptedPassword.replaceAll("=", "IGEQ"));
              Cookie cookie_igpassword = new Cookie ("igpassword", encryptedPasswordAsBase64);
              cookie_igpassword.setPath("/");
              cookie_igpassword.setMaxAge(cmsCookieTimeout);
              httpServletResponse.addCookie(cookie_igpassword);
 
              //logger.info(encryptedName + "=" + userName);
              //logger.info("After attribute:" + servletContext.getAttribute(encryptedName));
            }
          }
          catch (Exception e)
          {       
            logger.error("Error: " + e.getMessage(), e);
        }
          //END TEST

        String logUserName = userName;
        if(logUserName == null || logUserName.equals("") && user != null)
          logUserName = user.getName();
        if(logUserName == null || logUserName.equals(""))
          logUserName = authenticatedUserName;
        if(logUserName == null || logUserName.equals(""))
          logUserName = "Unknown";
       
        NotificationMessage notificationMessage = new NotificationMessage("Login success:", "Authentication", logUserName, NotificationMessage.AUTHENTICATION_SUCCESS, "" + authenticatedUserName, "name");
        TransactionHistoryController.getController().create(notificationMessage);
       
        logger.info("URI:" + httpServletRequest.getRequestURI() + ":" + httpServletRequest.getParameter("ticket"));
        if(httpServletRequest.getMethod().equalsIgnoreCase("get") && httpServletRequest.getParameter("ticket") != null && httpServletRequest.getParameter("ticket").length() > 0)
        {
          String remainingQueryString = HttpUtilities.removeParameter(httpServletRequest.getQueryString(), "ticket");
          logger.info("Redirecting to login without ticket");
          httpServletResponse.sendRedirect(URI + (remainingQueryString != null && !remainingQueryString.equals("") ? "?" + remainingQueryString : ""));
          return;
        }

          if(successLoginBaseUrl != null && !URL.startsWith(successLoginBaseUrl))
          {
            logger.info("Redirecting to successLoginBaseUrl: " + successLoginBaseUrl);
              checkSuccessRedirect(request, response, URL);
          }
          else
          {
            fc.doFilter(request, response);
            return;
          }
      }
      else
      {
        if(userName != null && !userName.equals(""))
        {
          NotificationMessage notificationMessage = new NotificationMessage("Login failed:", "Authentication", userName, NotificationMessage.AUTHENTICATION_FAILED, "" + userName, "name");
          TransactionHistoryController.getController().create(notificationMessage);
        }
      }
    }
    catch(Exception e)
View Full Code Here

    catch (SystemException e)
    {
      e.printStackTrace();
    }

    NotificationMessage notificationMessage = new NotificationMessage("ViewServerNodePropertiesAction.doSave():", "ServerNodeProperties", this.getInfoGluePrincipal().getName(), NotificationMessage.SYSTEM, "0", "ServerNodeProperties");
    //ChangeNotificationController.getInstance().addNotificationMessage(notificationMessage);
    RemoteCacheUpdater.getSystemNotificationMessages().add(notificationMessage);
         
      return "save";
    }
View Full Code Here

    catch (SystemException e)
    {
      e.printStackTrace();
    }

    NotificationMessage notificationMessage = new NotificationMessage("ViewServerNodePropertiesAction.doSave():", "ServerNodeProperties", this.getInfoGluePrincipal().getName(), NotificationMessage.SYSTEM, "0", "ServerNodeProperties");
    //ChangeNotificationController.getInstance().addNotificationMessage(notificationMessage);
    RemoteCacheUpdater.getSystemNotificationMessages().add(notificationMessage);

      return "save";
    }
View Full Code Here

TOP

Related Classes of org.infoglue.cms.util.NotificationMessage

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.