Package org.infoglue.cms.entities.structure

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


    doc.add(new Field("repositoryId", "" + siteNodeVO.getRepositoryId(), Field.Store.YES, Field.Index.NOT_ANALYZED));
    doc.add(new Field("lastModifier", "" + siteNodeVO.getCreatorName(), Field.Store.YES, Field.Index.NOT_ANALYZED));
    doc.add(new Field("isAsset", "false", Field.Store.YES, Field.Index.NOT_ANALYZED));
    doc.add(new Field("isSiteNode", "true", Field.Store.YES, Field.Index.NOT_ANALYZED));
   
    SiteNodeVersionVO siteNodeVersionVO = SiteNodeVersionController.getController().getLatestActiveSiteNodeVersionVO(db, siteNodeVO.getId());
    if(siteNodeVersionVO != null)
    {
      doc.add(new NumericField("modificationDateTime", Field.Store.YES, true).setLongValue(siteNodeVersionVO.getModifiedDateTime().getTime()));
      doc.add(new Field("siteNodeVersionId", "" + siteNodeVersionVO.getId(), Field.Store.YES, Field.Index.NOT_ANALYZED));
      doc.add(new Field("stateId", "" + siteNodeVersionVO.getStateId(), Field.Store.YES, Field.Index.NOT_ANALYZED));
   
      doc.add(new Field("path", "" + getSiteNodePath(siteNodeVO.getId(), db), Field.Store.YES, Field.Index.NOT_ANALYZED));
    }
   
    // Add the uid as a field, so that index can be incrementally
View Full Code Here


    doc.add(new Field("isSiteNode", "true", Field.Store.YES, Field.Index.NOT_ANALYZED));
    //doc.add(new Field("contentTypeDefinitionId", "" + ContentTypeDefinitionController.getController().getContentTypeDefinitionVOWithName("Meta info", db).getId(), Field.Store.YES, Field.Index.NOT_ANALYZED));
   
    try
    {
      SiteNodeVersionVO siteNodeVersionVO = SiteNodeVersionController.getController().getLatestActiveSiteNodeVersionVO(db, contentVersionVO.getSiteNodeId());
      if(siteNodeVersionVO != null)
        doc.add(new Field("siteNodeVersionId", "" + siteNodeVersionVO.getId(), Field.Store.YES, Field.Index.NOT_ANALYZED));
      else
        logger.warn("No site node version found on siteNode: " + contentVersionVO.getSiteNodeId());
    }
    catch (Exception e)
    {
View Full Code Here

          String siteNodeId = doc.get("siteNodeId");
          String siteNodeVersionId = doc.get("siteNodeVersionId");
         
          try
          {
            SiteNodeVersionVO snvo = new SiteNodeVersionVO();
            snvo.setSiteNodeId(new Integer(siteNodeId));
            if(siteNodeVersionId == null && siteNodeId != null)
            {
              SiteNodeVersionVO siteNodeVersionVO = SiteNodeVersionController.getController().getLatestActiveSiteNodeVersionVO(db, new Integer(siteNodeId));
              snvo.setSiteNodeVersionId(siteNodeVersionVO.getId());
            }
            else
              snvo.setSiteNodeVersionId(new Integer(siteNodeVersionId));
           
            snvo.setSiteNodeName(doc.get("path"));
View Full Code Here

      {
        siteNodeId = (Integer)siteNodeIdMap.get(siteNodeVersionId);
      }
      if(siteNodeId == null)
      {
        SiteNodeVersionVO siteNodeVersionVO = getSiteNodeVersionVOWithId(siteNodeVersionId);
        siteNodeId = siteNodeVersionVO.getSiteNodeId();
        siteNodeIdMap.put(siteNodeVersionId, siteNodeId);
      }

      return siteNodeId;
    }
View Full Code Here

  public SiteNodeVersionVO getAndRepairLatestSiteNodeVersionVO(Integer siteNodeId) throws SystemException, Bug
    {
    Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

      SiteNodeVersionVO siteNodeVersionVO = null;

        beginTransaction(db);

        try
        {
View Full Code Here

  public SiteNodeVersionVO getLatestActiveSiteNodeVersionVO(Integer siteNodeId) throws SystemException, Bug
    {
    Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

      SiteNodeVersionVO siteNodeVersionVO = null;

        beginTransaction(db);

        try
        {
View Full Code Here

 
  public SiteNodeVersionVO getLatestSiteNodeVersionVO(Integer siteNodeId) throws SystemException, Bug
    {
    String key = "" + siteNodeId;
    SiteNodeVersionVO siteNodeVersionVO = (SiteNodeVersionVO)CacheController.getCachedObjectFromAdvancedCache("latestSiteNodeVersionCache", key);
    if(siteNodeVersionVO != null)
    {
      if(logger.isInfoEnabled())
        logger.info("There was an cached siteNodeVersionVO:" + siteNodeVersionVO);
    }
    else
    {
        SiteNodeVersion siteNodeVersion = null;
       
        Database db = CastorDatabaseService.getDatabase();
          ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

          beginTransaction(db);

          try
          {
          OQLQuery oql = db.getOQLQuery( "SELECT cv FROM org.infoglue.cms.entities.structure.impl.simple.SmallSiteNodeVersionImpl cv WHERE cv.siteNodeId = $1 ORDER BY cv.siteNodeVersionId desc");
        oql.bind(siteNodeId);
       
        QueryResults results = oql.execute(Database.READONLY);
       
        if (results.hasMore())
          {
            siteNodeVersion = (SiteNodeVersion)results.next();
            }
   
        results.close();
        oql.close();
   
          if(siteNodeVersion != null)
            siteNodeVersionVO = siteNodeVersion.getValueObject();
          else
            logger.warn("The siteNode " + siteNodeId + " did not have a latest active siteNodeVersion - very strange.");
       
        if(siteNodeVersionVO != null)
        {
              String groupKey1 = CacheController.getPooledString(4, siteNodeVersionVO.getId());
              String groupKey2 = CacheController.getPooledString(3, siteNodeId);
              CacheController.cacheObjectInAdvancedCache("latestSiteNodeVersionCache", key, siteNodeVersionVO, new String[]{groupKey1, groupKey2}, true);
        }
           
        commitTransaction(db);
View Full Code Here

    }

  public SiteNodeVersionVO getLatestSiteNodeVersionVO(Database db, Integer siteNodeId) throws SystemException, Bug, Exception
    {
    String key = "" + siteNodeId;
    SiteNodeVersionVO siteNodeVersionVO = (SiteNodeVersionVO)CacheController.getCachedObjectFromAdvancedCache("latestSiteNodeVersionCache", key);
    if(siteNodeVersionVO != null)
    {
      if(logger.isInfoEnabled())
        logger.info("There was an cached siteNodeVersionVO:" + siteNodeVersionVO);
    }
    else
    {
        SiteNodeVersion siteNodeVersion = null;
       
        OQLQuery oql = db.getOQLQuery( "SELECT cv FROM org.infoglue.cms.entities.structure.impl.simple.SmallSiteNodeVersionImpl cv WHERE cv.siteNodeId = $1 ORDER BY cv.siteNodeVersionId desc");
      oql.bind(siteNodeId);
     
      QueryResults results = oql.execute(Database.READONLY);
     
      if (results.hasMore())
        {
          siteNodeVersion = (SiteNodeVersion)results.next();
          }
 
      results.close();
      oql.close();
 
        if(siteNodeVersion != null)
          siteNodeVersionVO = siteNodeVersion.getValueObject();
        else
          logger.warn("The siteNode " + siteNodeId + " did not have a latest active siteNodeVersion - very strange.");
     
      if(siteNodeVersionVO != null)
      {
            String groupKey1 = CacheController.getPooledString(4, siteNodeVersionVO.getId());
            String groupKey2 = CacheController.getPooledString(3, siteNodeId);
            CacheController.cacheObjectInAdvancedCache("latestSiteNodeVersionCache", key, siteNodeVersionVO, new String[]{groupKey1, groupKey2}, true);
      }
     
    }
View Full Code Here


  public SiteNodeVersionVO getLatestActiveSiteNodeVersionVO(Database db, Integer siteNodeId) throws SystemException, Bug, Exception
    {
    String key = "" + siteNodeId + "_active";
    SiteNodeVersionVO siteNodeVersionVO = (SiteNodeVersionVO)CacheController.getCachedObjectFromAdvancedCache("latestSiteNodeVersionCache", key);
    if(siteNodeVersionVO != null)
    {
      if(logger.isInfoEnabled())
        logger.info("There was an cached siteNodeVersionVO:" + siteNodeVersionVO);
    }
    else
    {
      SmallSiteNodeVersionImpl siteNodeVersion = null;
       
        OQLQuery oql = db.getOQLQuery( "SELECT cv FROM org.infoglue.cms.entities.structure.impl.simple.SmallSiteNodeVersionImpl cv WHERE cv.siteNodeId = $1 AND cv.isActive = $2 ORDER BY cv.siteNodeVersionId desc");
      oql.bind(siteNodeId);
      oql.bind(new Boolean(true));
     
      QueryResults results = oql.execute(Database.READONLY);
     
      if (results.hasMore())
        {
          siteNodeVersion = (SmallSiteNodeVersionImpl)results.next();
          }
 
      results.close();
      oql.close();

        if(siteNodeVersion != null)
          siteNodeVersionVO = siteNodeVersion.getValueObject();
        else
          logger.warn("The siteNode " + siteNodeId + " did not have a latest active siteNodeVersion - very strange.");

      if(siteNodeVersionVO != null)
      {
            String groupKey1 = CacheController.getPooledString(4, siteNodeVersionVO.getId());
            String groupKey2 = CacheController.getPooledString(3, siteNodeId);
            CacheController.cacheObjectInAdvancedCache("latestSiteNodeVersionCache", key, siteNodeVersionVO, new String[]{groupKey1, groupKey2}, true);
      }
     
    }
View Full Code Here

  /**
   * This method does not cache! Use {@link #getLatestActiveSiteNodeVersionVO(Database, Integer)} if possible.
   */
  public SiteNodeVersionVO getLatestActiveSiteNodeVersionVO(Database db, Integer siteNodeId, Integer stateId) throws SystemException, Bug, Exception
  {
    SiteNodeVersionVO siteNodeVersionVO = null;
    SmallSiteNodeVersionImpl siteNodeVersion = null;

      OQLQuery oql = db.getOQLQuery( "SELECT cv FROM org.infoglue.cms.entities.structure.impl.simple.SmallSiteNodeVersionImpl cv WHERE cv.siteNodeId = $1 AND cv.isActive = $2 AND cv.stateId >= $3 ORDER BY cv.siteNodeVersionId desc");
    oql.bind(siteNodeId);
    oql.bind(new Boolean(true));
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.