Package org.infoglue.cms.entities.structure

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


   * This method returns the latest sitenodeVersion there is for the given siteNode.
   */
 
  public SiteNodeVersion getLatestActiveSiteNodeVersionIfInState(SiteNode siteNode, Integer stateId, Database db) throws SystemException, Exception
  {
    SiteNodeVersion siteNodeVersion = null;
   
    Collection siteNodeVersions = siteNode.getSiteNodeVersions();

    SiteNodeVersion latestSiteNodeVersion = null;
   
    Iterator versionIterator = siteNodeVersions.iterator();
    while(versionIterator.hasNext())
    {
        SiteNodeVersion siteNodeVersionCandidate = (SiteNodeVersion)versionIterator.next()
     
      if(latestSiteNodeVersion == null || (latestSiteNodeVersion.getId().intValue() < siteNodeVersionCandidate.getId().intValue() && siteNodeVersionCandidate.getIsActive().booleanValue()))
          latestSiteNodeVersion = siteNodeVersionCandidate;
     
      if(siteNodeVersionCandidate.getIsActive().booleanValue() && siteNodeVersionCandidate.getStateId().intValue() == stateId.intValue())
      {
        if(siteNodeVersionCandidate.getOwningSiteNode().getSiteNodeId().intValue() == siteNode.getId().intValue())
        {
          if(siteNodeVersion == null || siteNodeVersion.getSiteNodeVersionId().intValue() < siteNodeVersionCandidate.getId().intValue())
          {
            siteNodeVersion = siteNodeVersionCandidate;
          }
        }
      }
View Full Code Here


     
      QueryResults results = oql.execute(Database.READONLY);

    while (results.hasMore())
        {
          SiteNodeVersion siteNodeVersion = (SiteNodeVersion)results.next();
          siteNodeVersionList.add(siteNodeVersion);
        }
           
    results.close();
    oql.close();
View Full Code Here

     
      QueryResults results = oql.execute(Database.READONLY);

    while (results.hasMore())
        {
          SiteNodeVersion siteNodeVersion = (SiteNodeVersion)results.next();
          siteNodeVersionList.add(siteNodeVersion);
        }
           
    results.close();
    oql.close();
View Full Code Here

      beginTransaction(db);

        try
        {
            SiteNodeVersion siteNodeVersion = getSiteNodeVersionWithId(siteNodeVersionId, db);
            siteNodeVersion.setIsActive(false);
           
            inactivateMetaInfoMatchingSiteNodeVersion(siteNodeVersion.getValueObject(), db);
           
            commitTransaction(db);
        }
        catch(Exception e)
        {
View Full Code Here

            content.setIsProtected(ContentVO.YES);
        }
        else if(interceptionPointCategory.equalsIgnoreCase("SiteNodeVersion"))
        { 
          Integer siteNodeVersionId = new Integer(parameters);
          SiteNodeVersion siteNodeVersion = SiteNodeVersionController.getController().getSiteNodeVersionWithId(siteNodeVersionId, db);
          if(logger.isDebugEnabled())
            logger.debug("It was a siteNodeVersion and there are access rights - set it to true:" + accessRights);
          if(!siteNodeVersion.getIsProtected().equals(SiteNodeVersionVO.YES) && !siteNodeVersion.getIsProtected().equals(SiteNodeVersionVO.YES_WITH_INHERIT_FALLBACK))
            siteNodeVersion.setIsProtected(SiteNodeVersionVO.YES);
        }
      }
      else
      {
        List accessRightsUsers = getAccessRightsUsers(interceptionPointCategory, parameters, db, true);
        if(logger.isDebugEnabled())
          logger.debug("accessRightsUsers:" + accessRightsUsers.size());
        if(accessRightsUsers == null || accessRightsUsers.size() == 0)
        {
          if(interceptionPointCategory.equalsIgnoreCase("Content"))
          { 
            Integer contentId = new Integer(parameters);
            Content content = ContentControllerProxy.getController().getContentWithId(contentId, db);
            if(content.getIsProtected().equals(ContentVO.YES))
              content.setIsProtected(ContentVO.NO);
          }
          else if(interceptionPointCategory.equalsIgnoreCase("SiteNodeVersion"))
          { 
            Integer siteNodeVersionId = new Integer(parameters);
            SiteNodeVersion siteNodeVersion = SiteNodeVersionController.getController().getSiteNodeVersionWithId(siteNodeVersionId, db);
            if(logger.isDebugEnabled())
              logger.debug("It was a siteNodeVersion and there was no access rights - set it to false:" + accessRights + ":" + siteNodeVersion.getIsProtected());
            if(siteNodeVersion.getIsProtected().equals(SiteNodeVersionVO.YES) && !siteNodeVersion.getIsProtected().equals(SiteNodeVersionVO.YES_WITH_INHERIT_FALLBACK))
            {
              siteNodeVersion.setIsProtected(SiteNodeVersionVO.NO);
              siteNodeVersion.setModifiedDateTime(DateHelper.getSecondPreciseDate());
            }
          }
        }
      }
       
View Full Code Here

          content.setIsProtected(ContentVO.YES);
      }
      else if(interceptionPointCategory.equalsIgnoreCase("SiteNodeVersion"))
      {
        Integer siteNodeVersionId = new Integer(parameters);
        SiteNodeVersion siteNodeVersion = SiteNodeVersionController.getController().getSiteNodeVersionWithId(siteNodeVersionId, db);
        if(!siteNodeVersion.getIsProtected().equals(SiteNodeVersionVO.YES))
          siteNodeVersion.setIsProtected(SiteNodeVersionVO.YES);
      }

        commitTransaction(db);
    }
    catch (Exception e)
View Full Code Here

              content.setIsProtected(ContentVO.NO);
          }
          else if(interceptionPointCategory.equalsIgnoreCase("SiteNodeVersion"))
          { 
            Integer siteNodeVersionId = new Integer(parameters);
            SiteNodeVersion siteNodeVersion = SiteNodeVersionController.getController().getSiteNodeVersionWithId(siteNodeVersionId, db);
            if(siteNodeVersion.getIsProtected().equals(SiteNodeVersionVO.YES))
              siteNodeVersion.setIsProtected(SiteNodeVersionVO.NO);
          }
        }
        }
       
        commitTransaction(db);
View Full Code Here

    else*/ if(interceptionPointVO.getName().equalsIgnoreCase("SiteNodeVersion.Write"))
    {
      logger.info("******************************************************");
      logger.info("SiteNodeVersion.ChangeAccessRights");
      Integer siteNodeVersionId = (Integer)extradata.get("siteNodeVersionId");
      SiteNodeVersion siteNodeVersion = SiteNodeVersionController.getController().getSiteNodeVersionWithId(siteNodeVersionId, db);
      logger.info("VersionModifier:" + siteNodeVersion.getVersionModifier());
      logger.info("infoGluePrincipal:" + infoGluePrincipal.getName());
      if(!siteNodeVersion.getVersionModifier().equalsIgnoreCase(infoGluePrincipal.getName()))
      {
        Integer protectedSiteNodeVersionId = SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getProtectedSiteNodeVersionId(siteNodeVersionId, db);
        if(protectedSiteNodeVersionId != null && !AccessRightController.getController().getIsPrincipalAuthorized(db, infoGluePrincipal, "SiteNodeVersion.Write", siteNodeVersionId.toString()))
          ceb.add(new AccessConstraintException("SiteNodeVersion.siteNodeVersionId", "1001"));
      }
View Full Code Here

    ContentTypeDefinitionVO contentTypeDefinitionVO = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOWithId(contentVO.getContentTypeDefinitionId(), db);

    contentVersion.setValueObject(contentVersionVO);
    contentVersion.getValueObject().setContentId(contentVO.getContentId());

    SiteNodeVersion latestSiteNodeVersion = null;
    if(principal != null && contentTypeDefinitionVO.getName().equalsIgnoreCase("Meta info"))
    {
      SiteNodeVO siteNode = SiteNodeController.getController().getSiteNodeVOWithMetaInfoContentId(db, contentVO.getContentId());
      if(siteNode.getMetaInfoContentId() != null && siteNode.getMetaInfoContentId().equals(contentVO.getContentId()))
      {
        latestSiteNodeVersion = SiteNodeVersionController.getController().getLatestMediumSiteNodeVersion(db, siteNode.getId(), false);
        latestSiteNodeVersion.setVersionModifier(contentVersionVO.getVersionModifier());
        latestSiteNodeVersion.setModifiedDateTime(DateHelper.getSecondPreciseDate());
        SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().acUpdate(principal, latestSiteNodeVersion.getValueObject(), db);
      }
    }
    registryController.updateContentVersionThreaded(contentVersion.getValueObject(), latestSiteNodeVersion == null ? null : latestSiteNodeVersion.getValueObject());

    return contentVersion.getValueObject();
  }
View Full Code Here

          logger.info("Going to index all versions of " + siteNode.getName());
         
          Iterator siteNodeVersionsIterator = siteNode.getSiteNodeVersions().iterator();
        while(siteNodeVersionsIterator.hasNext())
        {
            SiteNodeVersion siteNodeVersion = (SiteNodeVersion)siteNodeVersionsIterator.next();
            registryController.updateSiteNodeVersion(siteNodeVersion.getValueObject(), db);
        }
      }

      //Checks the relations from contents
      List contents = ContentController.getContentController().getRepositoryContents(this.repositoryId, db);
View Full Code Here

TOP

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

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.