Package org.infoglue.cms.util

Examples of org.infoglue.cms.util.NotificationMessage


            if(!valueString.equals(oldEnabledLanguages))
              changed = true;
 
            if(changed)
            {
            NotificationMessage notificationMessage = new NotificationMessage("UpdateSiteNodeAction", "ServerNodeProperties", this.getInfoGluePrincipal().getName(), NotificationMessage.SYSTEM, "0", "ServerNodeProperties");
            ChangeNotificationController.getInstance().addNotificationMessage(notificationMessage);
            //RemoteCacheUpdater.getSystemNotificationMessages().add(notificationMessage);
            }
           
              CacheController.clearCache("childSiteNodesCache");
View Full Code Here


    // Update live site!!!
    try
    {
      logger.info("Notifying the entire system about a publishing...");
      NotificationMessage notificationMessage = new NotificationMessage("PublicationController.createAndPublish():", PublicationImpl.class.getName(), infoGluePrincipal.getName(), NotificationMessage.PUBLISHING, publicationVO.getId(), publicationVO.getName());
      //NotificationMessage notificationMessage = new NotificationMessage("PublicationController.createAndPublish():", NotificationMessage.PUBLISHING_TEXT, infoGluePrincipal.getName(), NotificationMessage.PUBLISHING, publicationVO.getId(), "org.infoglue.cms.entities.publishing.impl.simple.PublicationImpl");
      ChangeNotificationController.getInstance().addNotificationMessage(notificationMessage);
          RemoteCacheUpdater.pushAndClearSystemNotificationMessages(infoGluePrincipal);
      //RemoteCacheUpdater.clearSystemNotificationMessages();
      logger.info("Finished Notifying...");
View Full Code Here

    // Update live site!!!
    try
    {
      logger.info("Notifying the entire system about a publishing...");
      NotificationMessage notificationMessage = new NotificationMessage("PublicationController.createAndPublish():", PublicationImpl.class.getName(), publisherName, NotificationMessage.PUBLISHING, publicationVO.getId(), publicationVO.getName());
      //NotificationMessage notificationMessage = new NotificationMessage("PublicationController.createAndPublish():", NotificationMessage.PUBLISHING_TEXT, infoGluePrincipal.getName(), NotificationMessage.PUBLISHING, publicationVO.getId(), "org.infoglue.cms.entities.publishing.impl.simple.PublicationImpl");
      ChangeNotificationController.getInstance().addNotificationMessage(notificationMessage);
          RemoteCacheUpdater.pushAndClearSystemNotificationMessages(publisherName);
      //RemoteCacheUpdater.clearSystemNotificationMessages();
      logger.info("Finished Notifying...");
View Full Code Here

    //Update live site!!!
    try
    {
      logger.info("Notifying the entire system about an unpublishing...");
      NotificationMessage notificationMessage = new NotificationMessage("PublicationController.unPublish():", PublicationImpl.class.getName(), infoGluePrincipal.getName(), NotificationMessage.UNPUBLISHING, publication.getId(), publication.getName());
          ChangeNotificationController.getInstance().addNotificationMessage(notificationMessage);
          RemoteCacheUpdater.pushAndClearSystemNotificationMessages(infoGluePrincipal);
          //RemoteCacheUpdater.clearSystemNotificationMessages();
          logger.info("Finished Notifying...");
    }
View Full Code Here

        if(extraInfo != null && object.getClass().getName().indexOf("SiteNodeVersion") > -1 && extraInfo.containsKey("skipSiteNodeVersionUpdate"))
          skipRemoteUpdate = true;
        //System.out.println("skipRemoteUpdate:" + skipRemoteUpdate);
      //This uses a hook and adds extra info to the notification if it exists
        String storedClassName = getNotificationClassNameAndAddExtraInfo(object, false);
      NotificationMessage notificationMessage = new NotificationMessage("CmsJDOCallback", storedClassName, userName, NotificationMessage.TRANS_UPDATE, getObjectIdentity(object), getObjectName(object), CacheController.getExtraInfo(storedClassName, getObjectIdentity(object).toString()));
      if(!skipRemoteUpdate)
        ChangeNotificationController.getInstance().addNotificationMessage(notificationMessage);
 
      if(object.getClass().getName().indexOf("org.infoglue.cms.entities.management") > -1 &&
          !object.getClass().getName().equals(RegistryImpl.class.getName()) &&
View Full Code Here

          userName = principal.getName();
        }
      catch (NoClassDefFoundError e){}
     
        String storedClassName = getNotificationClassNameAndAddExtraInfo(object, false);
          NotificationMessage notificationMessage = new NotificationMessage("CMSJDOCallback", storedClassName, userName, NotificationMessage.TRANS_CREATE, getObjectIdentity(object), getObjectName(object), CacheController.getExtraInfo(storedClassName, getObjectIdentity(object).toString()));
          ChangeNotificationController.getInstance().addNotificationMessage(notificationMessage);

          if(object.getClass().getName().indexOf("org.infoglue.cms.entities.management") > -1 &&
              !object.getClass().getName().equals(RegistryImpl.class.getName()) &&
              object.getClass().getName().indexOf("AccessRight") == -1)
View Full Code Here

          userName = principal.getName();
      }
      catch (NoClassDefFoundError e){}

        String storedClassName = getNotificationClassNameAndAddExtraInfo(object, true);
        NotificationMessage notificationMessage = new NotificationMessage("CMSJDOCallback", storedClassName, userName, NotificationMessage.TRANS_DELETE, getObjectIdentity(object), getObjectName(object), CacheController.getExtraInfo(storedClassName, getObjectIdentity(object).toString()));
        ChangeNotificationController.getInstance().addNotificationMessage(notificationMessage);

      if(object.getClass().getName().indexOf("org.infoglue.cms.entities.management") > -1 &&
          !object.getClass().getName().equals(RegistryImpl.class.getName()) &&
          object.getClass().getName().indexOf("AccessRight") == -1
View Full Code Here

      List<String> existingSignatures = new ArrayList<String>();
      logger.info("Before AAAAA:" + internalMessageList.size() + ":" + existingSignatures.size());
      Iterator<NotificationMessage> cleanupInternalMessageListIterator = internalMessageList.iterator();
      while(cleanupInternalMessageListIterator.hasNext())
      {
        NotificationMessage notificationMessage = cleanupInternalMessageListIterator.next();
        logger.info("Indexing........:" + notificationMessage.getClassName());

        if(notificationMessage.getClassName().equals(ContentImpl.class.getName()) || notificationMessage.getClassName().equals(Content.class.getName()))
        {
          ContentVO contentVO = ContentController.getContentController().getContentVOWithId((Integer)notificationMessage.getObjectId());

          ContentTypeDefinitionVO ctdVO = null;
          try
          {
            ctdVO = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOWithId(contentVO.getContentTypeDefinitionId());
          }
          catch (SystemException sex)
          {
            logger.warn("Failed to get the content type definition for content with Id: " + contentVO.getContentId() + ". The content will not be indexed. Message: " + sex.getMessage());
            logger.info("Failed to get the content type definition for content with Id: " + contentVO.getContentId(), sex);
          }
          if(ctdVO != null && ctdVO.getName().equals("Meta info"))
          {
            SiteNodeVO siteNodeVO = SiteNodeController.getController().getSiteNodeVOWithMetaInfoContentId(contentVO.getContentId());
            NotificationMessage newNotificationMessage = new NotificationMessage("" + siteNodeVO.getName(), SiteNodeImpl.class.getName(), "SYSTEM", notificationMessage.getType(), siteNodeVO.getId(), "" + siteNodeVO.getName());
            String key = "" + newNotificationMessage.getClassName() + "_" + newNotificationMessage.getObjectId() + "_"  + "_" + newNotificationMessage.getType();
            if(!existingSignatures.contains(key))
            {
              logger.info("++++++++++++++Got an META PAGE notification - just adding it AS A PAGE instead: " + newNotificationMessage.getObjectId());               
              baseEntitiesToIndexMessageList.add(newNotificationMessage);
              existingSignatures.add(key);
            }
            else
            {
              logger.info("++++++++++++++Skipping Content notification - duplicate existed: " + notificationMessage.getObjectId());
            }

          }
          else
          {
            String key = "" + notificationMessage.getClassName() + "_" + notificationMessage.getObjectId() + "_"  + "_" + notificationMessage.getType();
            if(!existingSignatures.contains(key))
            {
              logger.info("++++++++++++++Got an Content notification - just adding it: " + notificationMessage.getObjectId());
              baseEntitiesToIndexMessageList.add(notificationMessage);
              existingSignatures.add(key);
            }
            else
            {
              logger.info("++++++++++++++Skipping Content notification - duplicate existed: " + notificationMessage.getObjectId());
            }
          }
        }
        else if(notificationMessage.getClassName().equals(ContentVersionImpl.class.getName()) || notificationMessage.getClassName().equals(ContentVersion.class.getName()))
        {
          logger.info("++++++++++++++Got an ContentVersion notification - focus on content: " + notificationMessage.getObjectId());
          ContentVersionVO contentVersionVO = ContentVersionController.getContentVersionController().getContentVersionVOWithId((Integer)notificationMessage.getObjectId());
          ContentVO contentVO = ContentController.getContentController().getContentVOWithId(contentVersionVO.getContentId());

          if(contentVO.getContentTypeDefinitionId() != null)
          {
            ContentTypeDefinitionVO ctdVO = null;
            try
            {
              ctdVO = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOWithId(contentVO.getContentTypeDefinitionId());
            }
            catch (SystemException sex)
            {
              logger.warn("Failed to get the content type definition for content with Id: " + contentVO.getContentId() + ". The content version will not be indexed. Message: " + sex.getMessage());
              logger.info("Failed to get the content type definition for content with Id: " + contentVO.getContentId(), sex);
            }
            if(ctdVO != null && ctdVO.getName().equals("Meta info"))
            {
              SiteNodeVO siteNodeVO = SiteNodeController.getController().getSiteNodeVOWithMetaInfoContentId(contentVO.getContentId());

              if (siteNodeVO == null)
              {
                logger.warn("Got meta info notification but could not find a page for the Content-id. Content.id: " + contentVO.getContentId());
              }
              else
              {
                NotificationMessage newNotificationMessage = new NotificationMessage("" + siteNodeVO.getName(), SiteNodeImpl.class.getName(), "SYSTEM", notificationMessage.getType(), siteNodeVO.getId(), "" + siteNodeVO.getName());
                String key = "" + newNotificationMessage.getClassName() + "_" + newNotificationMessage.getObjectId() + "_"  + newNotificationMessage.getType();
                if(!existingSignatures.contains(key))
                {
                  logger.info("++++++++++++++Got an META PAGE notification - just adding it AS A PAGE instead: " + newNotificationMessage.getObjectId());
                  baseEntitiesToIndexMessageList.add(newNotificationMessage);
                  existingSignatures.add(key);
                }
                else
                {
                  logger.info("++++++++++++++Skipping Content notification - duplicate existed: " + notificationMessage.getObjectId());
                }
              }
            }
            else
            {
              NotificationMessage newNotificationMessage = new NotificationMessage("" + contentVersionVO.getContentName(), ContentImpl.class.getName(), "SYSTEM", notificationMessage.getType(), contentVersionVO.getContentId(), "" + contentVersionVO.getContentName());
              String key = "" + newNotificationMessage.getClassName() + "_" + newNotificationMessage.getObjectId() + "_" + newNotificationMessage.getType();
              if(!existingSignatures.contains(key))
              {
                logger.info("++++++++++++++Got an Content notification - just adding it: " + newNotificationMessage.getObjectId());
                baseEntitiesToIndexMessageList.add(newNotificationMessage);
                existingSignatures.add(key);
              }
              else
              {
                logger.info("++++++++++++++Skipping Content notification - duplicate existed: " + notificationMessage.getObjectId());
              }
            }
          }
        }
        else if(notificationMessage.getClassName().equals(DigitalAssetImpl.class.getName()) ||
            notificationMessage.getClassName().equals(MediumDigitalAssetImpl.class.getName()) ||
            notificationMessage.getClassName().equals(DigitalAsset.class.getName()) ||
            notificationMessage.getClassName().equals(SiteNodeImpl.class.getName()) ||
            notificationMessage.getClassName().equals(SiteNode.class.getName()) ||
            notificationMessage.getClassName().equals(SiteNodeVersionImpl.class.getName()) ||
            notificationMessage.getClassName().equals(SiteNodeVersion.class.getName()))
        {
          logger.info("notificationMessage.getClassName():" + notificationMessage.getClassName());
          String key = "" + notificationMessage.getClassName() + "_" + notificationMessage.getObjectId() + "_"  + "_" + notificationMessage.getType();

          if(notificationMessage.getClassName().equals(SiteNodeVersionImpl.class.getName()) || notificationMessage.getClassName().equals(SiteNodeVersion.class.getName()))
          {
            logger.info("PPPPPPPPPPPPPPPPPPPPPPPPPP:" + notificationMessage.getObjectId());
            SiteNodeVersionVO siteNodeVersionVO = SiteNodeVersionController.getController().getSiteNodeVersionVOWithId((Integer)notificationMessage.getObjectId());
            SiteNodeVO siteNodeVO = SiteNodeController.getController().getSiteNodeVOWithId(siteNodeVersionVO.getSiteNodeId());
            NotificationMessage newNotificationMessage = new NotificationMessage("" + siteNodeVO.getName(), SiteNodeImpl.class.getName(), "SYSTEM", notificationMessage.getType(), siteNodeVO.getId(), "" + siteNodeVO.getName());
            key = "" + newNotificationMessage.getClassName() + "_" + newNotificationMessage.getObjectId() + "_" + newNotificationMessage.getType();
         
            if(!existingSignatures.contains(key))
            {
              logger.info("++++++++++++++Got an SiteNodeVersionImpl notification - just adding it as SiteNodeImpl: " + newNotificationMessage.getClassName() + ":" + newNotificationMessage.getObjectId());
              baseEntitiesToIndexMessageList.add(newNotificationMessage);
              existingSignatures.add(key);
            }
            else
            {
              logger.info("++++++++++++++Skipping notification - duplicate existed: " + notificationMessage.getClassName() + ":" + notificationMessage.getObjectId());
            }
          }
          else if(notificationMessage.getClassName().equals(SiteNodeImpl.class.getName()) || notificationMessage.getClassName().equals(SiteNode.class.getName()))
          {
            if(!existingSignatures.contains(key))
            {
              logger.info("++++++++++++++Got an Page notification - just adding it: " + notificationMessage.getClassName() + ":" + notificationMessage.getObjectId());
              baseEntitiesToIndexMessageList.add(notificationMessage);
              existingSignatures.add(key);
            }
            else
            {
              logger.info("++++++++++++++Skipping notification - duplicate existed: " + notificationMessage.getClassName() + ":" + notificationMessage.getObjectId());
            }
          }
          else
          {
            NotificationMessage newNotificationMessage = new NotificationMessage("" + notificationMessage.getName(), DigitalAssetImpl.class.getName(), "SYSTEM", notificationMessage.getType(), notificationMessage.getObjectId(), "" + notificationMessage.getName());
            key = "" + newNotificationMessage.getClassName() + "_" + newNotificationMessage.getObjectId() + "_"  + "_" + newNotificationMessage.getType();

            if(!existingSignatures.contains(key))
            {
              logger.info("++++++++++++++Got an Content notification - just adding it: " + notificationMessage.getClassName() + ":" + notificationMessage.getObjectId());
              baseEntitiesToIndexMessageList.add(newNotificationMessage);
              existingSignatures.add(key);
            }
            else
            {
              logger.info("++++++++++++++Skipping notification - duplicate existed: " + notificationMessage.getClassName() + ":" + notificationMessage.getObjectId());
            }
          }
        }
      }
      internalMessageList = baseEntitiesToIndexMessageList;
      logger.info("After in [" + CmsPropertyHandler.getContextRootPath() + "]:" + internalMessageList.size() + ":" + existingSignatures.size());
     
      try
      {
        logger.info("notifyListeners actually running");
        if(getIsIndexedLocked())
        {
          logger.warn("The index should not be locked as no indexing is registered to be carried out. Lets unlock it as it may be the result of a crash.");
          unlockIndex();
        }
       
        //logger.error("Starting indexin of " + qeuedMessages.size());
        Timer t = new Timer();
       
        IndexWriter writer = getIndexWriter();
        //t.printElapsedTime("Creating writer took");
 

        Database db = CastorDatabaseService.getDatabase();
   
        beginTransaction(db);
       
        try
        {     
          int numberOfMessages = internalMessageList.size();
          Iterator internalMessageListIterator = internalMessageList.iterator();
          while(internalMessageListIterator.hasNext())
          {
            NotificationMessage notificationMessage = (NotificationMessage)internalMessageListIterator.next();
            try
            {
              if(logger.isInfoEnabled())
                logger.info("Starting indexin of " + notificationMessage);
              indexInformation(notificationMessage, writer, internalMessageList, forceVersionIndexing, db);
View Full Code Here

      logger.info("versions in getNotificationMessagesForStructure:" + versions.size());
     
      logger.info("Looping versions:" + versions.size());
      for(ContentVersionVO version : versions)
      {
        NotificationMessage notificationMessage = new NotificationMessage("LuceneController", ContentVersionImpl.class.getName(), "SYSTEM", NotificationMessage.TRANS_UPDATE, version.getId(), "dummy");
        notificationMessages.add(notificationMessage);
        newLastSiteNodeVersionId = version.getId().intValue();
      }
           
      logger.info("Finished round 1:" + notificationMessages.size() + ":" + newLastSiteNodeVersionId);
View Full Code Here

            while(digitalAssetVOListIterator.hasNext())
            {
              DigitalAssetVO assetVO = (DigitalAssetVO)digitalAssetVOListIterator.next();
              if(assetVO.getAssetFileSize() < 10000000) //Do not index large files
              {
                NotificationMessage assetNotificationMessage = new NotificationMessage("LuceneController", DigitalAssetImpl.class.getName(), "SYSTEM", NotificationMessage.TRANS_UPDATE, assetVO.getId(), "dummy");
                notificationMessages.add(assetNotificationMessage);
              }
            }
          }

          NotificationMessage notificationMessage = new NotificationMessage("LuceneController", ContentVersionImpl.class.getName(), "SYSTEM", NotificationMessage.TRANS_UPDATE, smallestContentVersionImpl.getId(), "dummy");
          notificationMessages.add(notificationMessage);
          previousContentId = smallestContentVersionImpl.getContentId();
        }
        newLastContentVersionId = smallestContentVersionImpl.getId().intValue();
        lastCommitedContentVersionId = newLastContentVersionId;
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.