Package org.infoglue.cms.entities.structure

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


         
          QueryResults results = oql.execute(Database.READONLY);
     
      while (results.hasMore())
            {
              SiteNodeVersion siteNodeVersion = (SiteNodeVersion)results.next();
        siteNodeVersions.add(siteNodeVersion.getValueObject());
            }
           
      results.close();
      oql.close();
View Full Code Here


         Iterator siteNodeVersionIterator = siteNodeVersions.iterator();
     
         boolean metaInfoContentDeleted = false;
    while (siteNodeVersionIterator.hasNext())
        {
          SiteNodeVersion siteNodeVersion = (SiteNodeVersion)siteNodeVersionIterator.next();
      Collection serviceBindings = Collections.synchronizedCollection(siteNodeVersion.getServiceBindings());
      Iterator serviceBindingIterator = serviceBindings.iterator();
      while(serviceBindingIterator.hasNext())
      {
        ServiceBinding serviceBinding = (ServiceBinding)serviceBindingIterator.next();
        if(serviceBinding.getAvailableServiceBinding().getName().equalsIgnoreCase("Meta information"))
        {
            if(!metaInfoContentDeleted)
            {
              try
              {
                if(siteNode.getMetaInfoContentId() != null)
                {
                  ContentVO contentVO = ContentController.getContentController().getContentVOWithId(siteNode.getMetaInfoContentId(), db);
                  ContentController.getContentController().delete(contentVO, db, true, true, true, infoGluePrincipal);
                  }
                //deleteMetaInfoForSiteNodeVersion(db, serviceBinding, infoGluePrincipal);
            }
              catch(Exception e)
              {
                logger.error("An error was thrown when we tried to delete the meta info for the version. Could be deleted allready");
              }
              metaInfoContentDeleted = true;
            }
            serviceBindingIterator.remove();
            db.remove(serviceBinding);
        }
        else
        {     
            serviceBindingIterator.remove();
            db.remove(serviceBinding);
        }
      }
       
      logger.info("Deleting siteNodeVersion:" + siteNodeVersion.getSiteNodeVersionId());
          siteNodeVersionIterator.remove();
      db.remove(siteNodeVersion);
        }         
    }
View Full Code Here

  }

 
  public static SiteNodeVersion getLatestPublishedSiteNodeVersion(Integer siteNodeId) throws SystemException, Bug, Exception
    {
        SiteNodeVersion siteNodeVersion = null;
       
        Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        beginTransaction(db);
View Full Code Here

    }

 
  public static SiteNodeVersion getLatestPublishedSiteNodeVersion(Integer siteNodeId, Database db) throws SystemException, Bug, Exception
    {
        SiteNodeVersion siteNodeVersion = null;
       
        OQLQuery oql = db.getOQLQuery( "SELECT cv FROM org.infoglue.cms.entities.structure.impl.simple.SiteNodeVersionImpl cv WHERE cv.owningSiteNode.siteNodeId = $1  AND cv.stateId = $2 AND cv.isActive = $3 ORDER BY cv.siteNodeVersionId desc");
      oql.bind(siteNodeId);
      oql.bind(SiteNodeVersionVO.PUBLISHED_STATE);
      oql.bind(true);
View Full Code Here

    return siteNodeVersion;
    }

  public static SiteNodeVersionVO getLatestPublishedSiteNodeVersionVO(Integer siteNodeId, Database db) throws SystemException, Bug, Exception
    {
        SiteNodeVersion siteNodeVersion = null;
       
        OQLQuery oql = db.getOQLQuery( "SELECT cv FROM org.infoglue.cms.entities.structure.impl.simple.SmallSiteNodeVersionImpl cv WHERE cv.siteNodeId = $1 AND cv.stateId = $2 AND cv.isActive = $3 ORDER BY cv.siteNodeVersionId desc");
      oql.bind(siteNodeId);
      oql.bind(SiteNodeVersionVO.PUBLISHED_STATE);
      oql.bind(true);
     
      QueryResults results = oql.execute(Database.READONLY);

    if (results.hasMore())
        {
          siteNodeVersion = (SiteNodeVersion)results.next();
        }
           
    results.close();
    oql.close();

    if(siteNodeVersion != null)
      return siteNodeVersion.getValueObject();
    else
      return null;
    }
View Full Code Here

         
          QueryResults results = oql.execute(Database.READONLY);
     
      if (results.hasMore())
            {
              SiteNodeVersion siteNodeVersion = (SiteNodeVersion)results.next();
              logger.info("found one:" + siteNodeVersion.getValueObject());
              siteNodeVersionVO = siteNodeVersion.getValueObject();
            }
           
      results.close();
      oql.close();
View Full Code Here

     
      QueryResults results = oql.execute(Database.READONLY);
   
    if (results.hasMore())
        {
          SiteNodeVersion siteNodeVersion = (SiteNodeVersion)results.next();
          logger.info("found one:" + siteNodeVersion.getValueObject());
          siteNodeVersionVO = siteNodeVersion.getValueObject();
        }
     
    results.close();
    oql.close();
View Full Code Here

   * This method returns the version previous to the one sent in.
   */
 
  public SiteNodeVersion getPreviousActiveSiteNodeVersion(Integer siteNodeId, Integer siteNodeVersionId, Database db) throws SystemException, Bug, Exception
    {
      SiteNodeVersion siteNodeVersion = null;

      OQLQuery oql = db.getOQLQuery( "SELECT cv FROM org.infoglue.cms.entities.structure.impl.simple.SiteNodeVersionImpl cv WHERE cv.owningSiteNode.siteNodeId = $1 AND cv.isActive = $2 AND cv.siteNodeVersionId < $3 ORDER BY cv.siteNodeVersionId desc");
      oql.bind(siteNodeId);
      oql.bind(new Boolean(true));
      oql.bind(siteNodeVersionId);
     
      QueryResults results = oql.execute(Database.READONLY);
   
    if (results.hasMore())
        {
          siteNodeVersion = (SiteNodeVersion)results.next();
          logger.info("found one:" + siteNodeVersion.getValueObject());
        }
     
    results.close();
    oql.close();

View Full Code Here

      QueryResults results = oql.execute(Database.READONLY);
   
    if (results.hasMore())
        {
          SiteNodeVersion siteNodeVersion = (SiteNodeVersion)results.next();
          logger.info("found one:" + siteNodeVersion.getValueObject());
          siteNodeVersionVO = siteNodeVersion.getValueObject();
        }
     
    results.close();
    oql.close();
View Full Code Here

        return publishedSiteNodeVersionVOList;
  }
 
  private List getPublishedSiteNodeVersionWithParentRecursive(SiteNode siteNode, List resultList, Database db) throws ConstraintException, SystemException, Exception
  {
      SiteNodeVersion siteNodeVersion = getLatestPublishedSiteNodeVersion(siteNode.getId(), db);
    if(siteNodeVersion != null)
      resultList.add(siteNodeVersion);
   
    // Get the children of this sitenode and do the recursion
    Collection childSiteNodeList = siteNode.getChildSiteNodes();
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.