Package org.infoglue.cms.entities.structure

Examples of org.infoglue.cms.entities.structure.SiteNodeVersionVO


                  }
                }

        if(relatedSiteNodeVO.getStateId() == 0 && allowedSiteNodeVersion)
        {
          SiteNodeVersionVO siteNodeVersionVO = new SiteNodeVersionVO();
            siteNodeVersionVO.setSiteNodeVersionId(relatedSiteNodeVO.getSiteNodeVersionId());
            siteNodeVersionVO.setSiteNodeId(relatedSiteNodeVO.getSiteNodeId());
            siteNodeVersionVO.setStateId(relatedSiteNodeVO.getStateId());
            siteNodeVersionVO.setVersionModifier(relatedSiteNodeVO.getVersionModifier());
            siteNodeVersionVO.setModifiedDateTime(siteNodeVersionVO.getModifiedDateTime());
           
          siteNodeVersionIdList.add(siteNodeVersionVO);
        }
      }
     
View Full Code Here


    List<SiteNodeVersionVO> siteNodeVersionVOToCheck = new ArrayList<SiteNodeVersionVO>();
       
      Integer latestSiteNodeVersionId = siteNodeVO.getSiteNodeVersionId();
      Integer knownStateId = siteNodeVO.getStateId();
     
      SiteNodeVersionVO siteNodeVersionVO = new SiteNodeVersionVO();
      siteNodeVersionVO.setSiteNodeVersionId(latestSiteNodeVersionId);
      siteNodeVersionVO.setSiteNodeId(siteNodeVO.getSiteNodeId());
      siteNodeVersionVO.setStateId(knownStateId);
      //siteNodeVersionVO.setRepositoryId(siteNodeVO.getRepositoryId());
      siteNodeVersionVO.setVersionModifierDisplayName(siteNodeVO.getVersionModifier());
      siteNodeVersionVO.setVersionModifier(siteNodeVO.getVersionModifier());

      siteNodeVersionVO.setModifiedDateTime(siteNodeVO.getModifiedDateTime());
   
      siteNodeVersionVOToCheck.add(siteNodeVersionVO);
    RequestAnalyser.getRequestAnalyser().registerComponentStatistics("getSiteNodeAndAffectedItemsRecursive.getLatestActiveSiteNodeVersionVO", t.getElapsedTime());
   
        if(recurseSiteNodes)
View Full Code Here

        try
        {
          Date now = new Date();
         
            SiteNodeVersionVO siteNodeVersionVO = getSiteNodeVersionVOWithId(siteNodeVersionId, db);
                      
            List<ContentVersionVO> contentVersions = new ArrayList<ContentVersionVO>();
           
            SiteNodeVO siteNodeVO = SiteNodeController.getController().getSiteNodeVOWithId(siteNodeVersionVO.getSiteNodeId(), db);
           
            ContentVersionVO wantedContentVersionVO = null;
            LanguageVO masterLanguageVO = LanguageController.getController().getMasterLanguage(siteNodeVO.getRepositoryId(), db);
        if(siteNodeVO.getMetaInfoContentId() != null)
        {
          List<MediumContentVersionImpl> contentVersionList = ContentVersionController.getContentVersionController().getMediumContentVersionList(siteNodeVO.getMetaInfoContentId(), masterLanguageVO.getId(), db);
          for(MediumContentVersionImpl cv : contentVersionList)
          {
            if(Math.abs(cv.getModifiedDateTime().getTime() - siteNodeVersionVO.getModifiedDateTime().getTime()) < 1000)
            {
              wantedContentVersionVO = cv.getValueObject().copy();
              break;
            }
          }
        }
       
        if(wantedContentVersionVO != null)
        {
              siteNodeVersionVO.setStateId(0);
              siteNodeVersionVO.setIsActive(true);
              siteNodeVersionVO.setModifiedDateTime(now);
              SiteNodeVersionController.getController().createSmall(siteNodeVersionVO.getSiteNodeId(), infoGluePrincipal, siteNodeVersionVO, db);
 
              wantedContentVersionVO.setVersionModifier(infoGluePrincipal.getName());
              wantedContentVersionVO.setModifiedDateTime(new Date());
              wantedContentVersionVO.setStateId(ContentVersionVO.WORKING_STATE);
         
View Full Code Here

   * is handling.
   */

  public BaseEntityVO getNewVO()
  {
    return new SiteNodeVersionVO();
  }
View Full Code Here

                      }
                    }
                  }
            else if(event.getEntityClass().equalsIgnoreCase(SiteNodeVersion.class.getName()))
            {
              SiteNodeVersionVO siteNodeVersion = null;
              SiteNodeVO siteNode = null;
              try
                    {
                siteNodeVersion = SiteNodeVersionController.getController().getSiteNodeVersionVOWithId(event.getEntityId(), db);
                //siteNodeVersion = SiteNodeVersionController.getController().getSiteNodeVersionWithIdAsReadOnly(event.getEntityId(), db);
                if(siteNodeVersion.getSiteNodeId() != null)
                  siteNode = SiteNodeController.getController().getSiteNodeVOWithId(siteNodeVersion.getSiteNodeId(), db);
                    }
                    catch(SystemException e)
                    {
                      hasBrokenItems = true;
                      throw e;
                    }
 
              if(siteNodeVersion == null || siteNode == null)
              {
                      hasBrokenItems = true;
                  isValid = false;
              }
              else
                    {
                      if(principal != null && filter != null && filter.equalsIgnoreCase("groupBased"))
                      {
                        String versionModifier = siteNodeVersion.getVersionModifier();
                        if(versionModifier != null)
                        {
                          InfoGluePrincipal versionModifierPrincipal = UserControllerProxy.getController(db).getUser(versionModifier);
                          if(versionModifierPrincipal != null)
                          {
                            boolean hasGroup = false;
                           
                            List groups = versionModifierPrincipal.getGroups();
                            Iterator groupsIterator = groups.iterator();
                            while(groupsIterator.hasNext())
                            {
                              InfoGlueGroup group = (InfoGlueGroup)groupsIterator.next();
                              if(principal.getGroups().contains(group))
                                hasGroup = true;
                            }
                           
                            if(!hasGroup)
                              isValid = false;
                          }
                        }
                }
                      else if(principal != null && filter != null && filter.indexOf("groupNameBased_") > -1)
                      {
                        String versionModifier = siteNodeVersion.getVersionModifier();
                        if(versionModifier != null)
                        {
                          InfoGluePrincipal versionModifierPrincipal = UserControllerProxy.getController(db).getUser(versionModifier);
                          if(versionModifierPrincipal != null)
                          {
View Full Code Here

                    }
                  }
                }
          else if(event.getEntityClass().equalsIgnoreCase(SiteNodeVersion.class.getName()))
          {
            SiteNodeVersionVO siteNodeVersion = null;
            SiteNodeVO siteNode = null;
           
            try
                  {
              siteNodeVersion = SiteNodeVersionController.getController().getSiteNodeVersionVOWithId(event.getEntityId(), db);
              if(siteNodeVersion != null && siteNodeVersion.getSiteNodeId() != null)
                siteNode = SiteNodeController.getController().getSiteNodeVOWithId(siteNodeVersion.getSiteNodeId(), db);
                  }
                  catch(SystemException e)
                  {
                    isBroken = true;
                    throw e;
                  }

            if(siteNodeVersion == null || siteNode == null)
            {
                isBroken = true;
                isValid = false;
                SiteNodeVersionController.getController().delete(siteNodeVersion.getId(), db);
            }
            else
                  {
                    if(principal != null && filter != null && filter.equalsIgnoreCase("groupBased"))
                    {
                      String versionModifier = siteNodeVersion.getVersionModifier();
                      if(versionModifier != null)
                      {
                        InfoGluePrincipal versionModifierPrincipal = UserControllerProxy.getController(db).getUser(versionModifier);
                        if(versionModifierPrincipal != null)
                        {
                          boolean hasGroup = false;
                         
                          List groups = versionModifierPrincipal.getGroups();
                          Iterator groupsIterator = groups.iterator();
                          while(groupsIterator.hasNext())
                          {
                            InfoGlueGroup group = (InfoGlueGroup)groupsIterator.next();
                            if(principal.getGroups().contains(group))
                              hasGroup = true;
                          }
                         
                          if(!hasGroup)
                            isValid = false;
                        }
                      }
              }
                    else if(principal != null && filter != null && filter.indexOf("groupNameBased_") > -1)
                    {
                      String versionModifier = siteNodeVersion.getVersionModifier();
                      if(versionModifier != null)
                      {
                        InfoGluePrincipal versionModifierPrincipal = UserControllerProxy.getController(db).getUser(versionModifier);
                        if(versionModifierPrincipal != null)
                        {
View Full Code Here

    try
    {
      System.out.println(accessRight.getInterceptionPointName());
      if(accessRight.getInterceptionPointName().startsWith("SiteNodeVersion"))
      {
        SiteNodeVersionVO snvVO = SiteNodeVersionController.getController().getSiteNodeVersionVOWithId(new Integer(accessRight.getParameters()));
        String path = SiteNodeController.getController().getSiteNodePath(snvVO.getSiteNodeId(), true, false);
        sb.append("Page access right on [" + path + "]");
      }
      else if(accessRight.getInterceptionPointName().startsWith("Content"))
      {
        ContentVO contentVO = ContentController.getContentController().getContentVOWithId(new Integer(accessRight.getParameters()));
View Full Code Here

    {
      AccessRight accessRight = (AccessRight)results.next();
      //logger.info("Checking if siteNodeVersion really is missing");
      try
      {
        SiteNodeVersionVO snvVO = SiteNodeVersionController.getController().getSiteNodeVersionVOWithId(new Integer(accessRight.getParameters()), db);
        logger.info("OBS::::::::::: snvVO was not missing");
      }
      catch (Exception e)
      {
        //logger.info("snvVO was missing - ok to remove:" + accessRight.getId());
View Full Code Here

        entityName = RepositoryController.getController().getRepositoryVOWithId(new Integer(accessRightVO.getParameters()), db).getName();
      if(fullAccessRight.getInterceptionPointName().startsWith("Content."))
        entityName = ContentController.getContentController().getContentPath(new Integer(accessRightVO.getParameters()));
      if(fullAccessRight.getInterceptionPointName().equalsIgnoreCase("SiteNodeVersion."))
      {
        SiteNodeVersionVO snvVO = SiteNodeVersionController.getController().getSiteNodeVersionVOWithId(new Integer(accessRightVO.getParameters()), db);
        entityName = SiteNodeController.getController().getSiteNodePath(snvVO.getId(), db);
      }
     
      accessRightVO.setName(fullAccessRight.getInterceptionPointName() + " on " + entityName);
    }
    catch (Exception e)
View Full Code Here

        {
          logger.info("It's a expiredate coming up event... let's find add a fake subscription on the last modifier.");
          SiteNodeVO siteNodeVO = SiteNodeController.getController().getSiteNodeVOWithId(new Integer(transactionQueueVO.getTransactionObjectId()), db);
          if(siteNodeVO != null)
          {
            SiteNodeVersionVO version = SiteNodeVersionController.getController().getLatestSiteNodeVersionVO(db, siteNodeVO.getId());

            SubscriptionVO creatorSubscriptionVO = new SubscriptionVO();
            creatorSubscriptionVO.setEntityId(transactionQueueVO.getTransactionObjectId());
            creatorSubscriptionVO.setEntityName(transactionQueueVO.getTransactionObjectName());
            creatorSubscriptionVO.setInterceptionPointId(transactionQueueVO.getInterceptionPointVO().getId());
            creatorSubscriptionVO.setName("Standard subscription");
            creatorSubscriptionVO.setUserName(siteNodeVO.getCreatorName());
            subscriptionVOList.add(creatorSubscriptionVO);

            if(version != null)
            {
              if(!version.getVersionModifier().equals(siteNodeVO.getCreatorName()))
              {
                SubscriptionVO modifyerSubscriptionVO = new SubscriptionVO();
                modifyerSubscriptionVO.setEntityId(transactionQueueVO.getTransactionObjectId());
                modifyerSubscriptionVO.setEntityName(transactionQueueVO.getTransactionObjectName());
                modifyerSubscriptionVO.setInterceptionPointId(transactionQueueVO.getInterceptionPointVO().getId());
                modifyerSubscriptionVO.setName("Standard subscription");
                modifyerSubscriptionVO.setUserName(version.getVersionModifier());
                subscriptionVOList.add(modifyerSubscriptionVO);
              }
            }
          }
        }
        else if(transactionQueueVO.getInterceptionPointVO().getName().equalsIgnoreCase("Content.ExpireDateComingUp"))
        {
          logger.info("It's a expiredate coming up event... let's find add a fake subscription on the last modifier.");
          ContentVO contentVO = ContentController.getContentController().getContentVOWithId(new Integer(transactionQueueVO.getTransactionObjectId()), db);
         
          if(contentVO != null)
          {
            SubscriptionVO creatorSubscriptionVO = new SubscriptionVO();
            creatorSubscriptionVO.setEntityId(transactionQueueVO.getTransactionObjectId());
            creatorSubscriptionVO.setEntityName(transactionQueueVO.getTransactionObjectName());
            creatorSubscriptionVO.setInterceptionPointId(transactionQueueVO.getInterceptionPointVO().getId());
            creatorSubscriptionVO.setName("Standard subscription");
            creatorSubscriptionVO.setUserName(contentVO.getCreatorName());
            subscriptionVOList.add(creatorSubscriptionVO);
 
            List languages = LanguageController.getController().getLanguageVOList(contentVO.getRepositoryId(), db);
            Iterator languagesIterator = languages.iterator();
            while(languagesIterator.hasNext())
            {
              LanguageVO languageVO = (LanguageVO)languagesIterator.next();
              ContentVersionVO version = ContentVersionController.getContentVersionController().getLatestContentVersionVO(contentVO.getId(), languageVO.getId(), db);
             
              if(version != null)
              {             
                if(!version.getVersionModifier().equals(contentVO.getCreatorName()))
                {
                  SubscriptionVO modifyerSubscriptionVO = new SubscriptionVO();
                  modifyerSubscriptionVO.setEntityId(transactionQueueVO.getTransactionObjectId());
                  modifyerSubscriptionVO.setEntityName(transactionQueueVO.getTransactionObjectName());
                  modifyerSubscriptionVO.setInterceptionPointId(transactionQueueVO.getInterceptionPointVO().getId());
                  modifyerSubscriptionVO.setName("Standard subscription");
                  modifyerSubscriptionVO.setUserName(version.getVersionModifier());
                  subscriptionVOList.add(modifyerSubscriptionVO);
                }
              }
            }
          }
View Full Code Here

TOP

Related Classes of org.infoglue.cms.entities.structure.SiteNodeVersionVO

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.