Package org.infoglue.cms.entities.structure

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


    //t.printElapsedTime("Executed query.....");
   
    int lastBegunParentSiteNodeId = -1;
    while (results.hasMore())
    {
      SiteNode siteNode = (SiteNode)results.next();
      childrenVOList.add(siteNode.getValueObject());
     
      if(siteNode.getValueObject().getParentSiteNodeId() !=null && lastBegunParentSiteNodeId != siteNode.getValueObject().getParentSiteNodeId())
        lastBegunParentSiteNodeId = siteNode.getValueObject().getParentSiteNodeId();
     
      String key = "" + siteNode.getValueObject().getParentSiteNodeId();
      List<SiteNodeVO> siteNodeChildrenVOList = (List<SiteNodeVO>)CacheController.getCachedObjectFromAdvancedCache("childSiteNodesCache", key);
         if(siteNodeChildrenVOList == null)
      {
           siteNodeChildrenVOList = new ArrayList<SiteNodeVO>();
        CacheController.cacheObjectInAdvancedCache("childSiteNodesCache", key, siteNodeChildrenVOList, new String[] {CacheController.getPooledString(3, siteNode.getValueObject().getParentSiteNodeId())}, true);
      }
         boolean contains = false;
         for(SiteNodeVO existingSiteNodeVO : siteNodeChildrenVOList)
         {
           if(existingSiteNodeVO.getId().equals(siteNode.getValueObject().getId()))
           {
             contains = true;
             break;
           }
         }
         if(!contains)
         {
           siteNodeChildrenVOList.add(siteNode.getValueObject());
        String siteNodeCacheKey = "" + siteNode.getValueObject().getId();
        CacheController.cacheObjectInAdvancedCache("siteNodeCache", siteNodeCacheKey, siteNode.getValueObject());
         }
    }

    logger.info("Clearing last node as we are probably not done with all it's children");
    CacheController.clearCacheForGroup("childSiteNodesCache", CacheController.getPooledString(3, lastBegunParentSiteNodeId));
View Full Code Here


    beginTransaction(db);

    try
    {
      SiteNode siteNode = getSiteNodeWithId(parentSiteNodeId, db);
      Collection children = siteNode.getChildSiteNodes();
      childrenVOList = SiteNodeController.toVOList(children);
         
      //If any of the validations or setMethods reported an error, we throw them up now before create.
      ceb.throwIfNotEmpty();
           
View Full Code Here

    oql.bind(0);

    QueryResults results = oql.execute(Database.READONLY);
    while (results.hasMore())
    {
      SiteNode siteNode = (SiteNode)results.next();

      if(CmsPropertyHandler.getAllowLocalizedSortAndVisibilityProperties())
      { 
        //logger.info("Name:" + siteNode.getName() + ":" + siteNode.getValueObject().getStateId() + ":" + siteNode.getValueObject().getIsProtected() + ":" + siteNode.getValueObject().getIsProtected());
        ContentVersionVO latestVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(siteNode.getMetaInfoContentId(), sortLanguageId, db);
        if(latestVersionVO == null)
        {
          //LanguageVO masterLanguageVO = LanguageController.getController().getMasterLanguage(siteNode.getValueObject().getRepositoryId(), db);
          //latestVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(siteNode.getMetaInfoContentId(), masterLanguageVO.getLanguageId(), db);
        }
        if(latestVersionVO != null)
        {
          String localizedIsHidden = ContentVersionController.getContentVersionController().getAttributeValue(latestVersionVO, "HideInNavigation", false);
          String localizedSortOrder = ContentVersionController.getContentVersionController().getAttributeValue(latestVersionVO, "SortOrder", false);
   
          //System.out.println("localizedIsHidden:" + localizedIsHidden);
          //System.out.println("localizedSortOrder:" + localizedSortOrder);
          if(localizedIsHidden != null/* && !localizedIsHidden.equals("")*/)
          {
            if(localizedIsHidden.equals("true"))
              siteNode.getValueObject().setLocalizedIsHidden(true);
            else
              siteNode.getValueObject().setLocalizedIsHidden(false);
          }
         
          if(localizedSortOrder != null && !localizedSortOrder.equals(""))
          {
            siteNode.getValueObject().setLocalizedSortOrder(new Integer(localizedSortOrder));
          }
          else
            siteNode.getValueObject().setLocalizedSortOrder(new Integer(100));
        }
        else
          siteNode.getValueObject().setLocalizedSortOrder(new Integer(100));
      }
     
      childrenVOList.add(siteNode.getValueObject());
    }
   
    results.close();
    oql.close();
       
View Full Code Here

    oql.bind(repositoryId);
   
    QueryResults results = oql.execute(Database.READONLY);
    if (results.hasMore())
    {
      SiteNode siteNode = (SiteNode)results.next();
      siteNodeVO = siteNode.getValueObject();
    }

    results.close();
    oql.close();
View Full Code Here

   * This method fetches the root siteNode for a particular repository within a certain transaction.
   */
         
  public SiteNode getRootSiteNode(Integer repositoryId, Database db) throws ConstraintException, SystemException, Exception
  {
    SiteNode siteNode = null;
   
    OQLQuery oql = db.getOQLQuery( "SELECT s FROM org.infoglue.cms.entities.structure.impl.simple.SiteNodeImpl s WHERE is_undefined(s.parentSiteNode) AND s.repository.repositoryId = $1");
    oql.bind(repositoryId);
   
    QueryResults results = oql.execute();
View Full Code Here

  public void moveSiteNode(SiteNodeVO siteNodeVO, Integer newParentSiteNodeId, InfoGluePrincipal principal) throws ConstraintException, SystemException
  {
    Database db = CastorDatabaseService.getDatabase();
    ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

    SiteNode siteNode          = null;
    SiteNode newParentSiteNode = null;
    SiteNode oldParentSiteNode = null;
   
    Map<String,String> pageUrls = new HashMap<String, String>();

    beginTransaction(db);

    try
    {
      //Validation that checks the entire object
      siteNodeVO.validate();

      if(newParentSiteNodeId == null)
      {
        logger.warn("You must specify the new parent-siteNode......");
        throw new ConstraintException("SiteNode.parentSiteNodeId", "3403");
      }

      if(siteNodeVO.getId().intValue() == newParentSiteNodeId.intValue())
      {
        logger.warn("You cannot have the siteNode as it's own parent......");
        throw new ConstraintException("SiteNode.parentSiteNodeId", "3401");
      }
     
      siteNode          = getSiteNodeWithId(siteNodeVO.getSiteNodeId(), db);
      oldParentSiteNode = siteNode.getParentSiteNode();
      newParentSiteNode = getSiteNodeWithId(newParentSiteNodeId, db);

      if(oldParentSiteNode.getId().intValue() == newParentSiteNodeId.intValue())
      {
        logger.warn("You cannot specify the same node as it originally was located in......");
        throw new ConstraintException("SiteNode.parentSiteNodeId", "3404");
      }

      SiteNode tempSiteNode = newParentSiteNode.getParentSiteNode();
      while(tempSiteNode != null)
      {
        if(tempSiteNode.getId().intValue() == siteNode.getId().intValue())
        {
          logger.warn("You cannot move the node to a child under it......");
          throw new ConstraintException("SiteNode.parentSiteNodeId", "3402");
        }
        tempSiteNode = tempSiteNode.getParentSiteNode();
      }

      pageUrls = RedirectController.getController().getNiceURIMapBeforeMove(db, siteNodeVO.getRepositoryId(), siteNodeVO.getSiteNodeId(), principal);

      logger.info("Setting the new Parent siteNode:" + siteNode.getSiteNodeId() + " " + newParentSiteNode.getSiteNodeId());
View Full Code Here

          siteNode.setRepository((RepositoryImpl)newRepository);
        Iterator ChildSiteNodesIterator = siteNode.getChildSiteNodes().iterator();
        while(ChildSiteNodesIterator.hasNext())
        {
            SiteNode childSiteNode = (SiteNode)ChildSiteNodesIterator.next();
            changeRepositoryRecursive(childSiteNode, newRepository, principal, db);
        }
      }
  }
View Full Code Here

     
      QueryResults results = oql.execute();
   
    while(results.hasMore())
        {
          SiteNode siteNode = (SiteNodeImpl)results.next();
          siteNodes.add(siteNode);
        }
   
    results.close();
    oql.close();
View Full Code Here

     
      QueryResults results = oql.execute(Database.READONLY);
   
    while(results.hasMore())
        {
          SiteNode siteNode = (SiteNodeImpl)results.next();
          siteNodes.add(siteNode);
        }
   
    results.close();
    oql.close();
View Full Code Here

    }      

    public void setMetaInfoContentId(Integer siteNodeId, Integer metaInfoContentId, Database db) throws ConstraintException, SystemException
    {
        SiteNode siteNode = getSiteNodeWithId(siteNodeId, db);
        siteNode.setMetaInfoContentId(metaInfoContentId);
    }      
View Full Code Here

TOP

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

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.