Package org.infoglue.cms.entities.structure

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


 
  public static SiteNodeVersion createInitialSiteNodeVersion(Database db, SiteNode siteNode, InfoGluePrincipal infoGluePrincipal) throws SystemException, Bug
  {
    ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

    SiteNodeVersion siteNodeVersion = null;

    try
    {
      int maxSortOrder;
      if (siteNode.getParentSiteNode() != null)
      {
        maxSortOrder = siteNode.getParentSiteNode().getChildSiteNodes().size()-1;
      }
      else
      {
        maxSortOrder = 0;
      }
      //SiteNode siteNode = SiteNodeController.getSiteNodeWithId(siteNodeId, db);
           
      siteNodeVersion = new SiteNodeVersionImpl();
      siteNodeVersion.setIsCheckedOut(new Boolean(false));
      siteNodeVersion.setModifiedDateTime(DateHelper.getSecondPreciseDate());
      siteNodeVersion.setOwningSiteNode((SiteNodeImpl)siteNode);
      siteNodeVersion.setStateId(new Integer(0));
      siteNodeVersion.setVersionComment("Initial version");
      siteNodeVersion.setVersionModifier(infoGluePrincipal.getName());
      siteNodeVersion.setVersionNumber(new Integer(1));
      siteNodeVersion.setSortOrder(maxSortOrder);
         
      db.create((SiteNodeVersion)siteNodeVersion);
     
      List siteNodeVersions = new ArrayList();
      siteNodeVersions.add(siteNodeVersion);
View Full Code Here


  public static SiteNodeVersion create(Integer siteNodeId, InfoGluePrincipal infoGluePrincipal, SiteNodeVersionVO siteNodeVersionVO) throws SystemException, Bug
  {
      Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

      SiteNodeVersion siteNodeVersion = null;

        beginTransaction(db);

        try
        {
          SiteNode siteNode = SiteNodeController.getController().getSiteNodeWithId(siteNodeId, db);
           
          siteNodeVersion = new SiteNodeVersionImpl();
          siteNodeVersion.setOwningSiteNode((SiteNodeImpl)siteNode);
          siteNodeVersion.setVersionModifier(infoGluePrincipal.getName());
          siteNodeVersion.setValueObject(siteNodeVersionVO);
         
          //Remove later and use a lookup....
          siteNodeVersion.setVersionNumber(new Integer(1));
         
          siteNodeVersion = (SiteNodeVersion)createEntity(siteNodeVersion, db);
            //commitTransaction(db);
        }
        catch(Exception e)
View Full Code Here

        beginTransaction(db);

        try
        {
          SiteNodeVersion siteNodeVersion = getAndRepairLatestSiteNodeVersion(db, siteNodeId);
          if(siteNodeVersion != null)
            siteNodeVersionVO = siteNodeVersion.getValueObject();
         
            commitTransaction(db);
        }
        catch(Exception e)
        {
View Full Code Here

    return siteNodeVersionVO;
    }

  public SiteNodeVersion getAndRepairLatestSiteNodeVersion(Database db, Integer siteNodeId) throws SystemException, Bug
    {
      SiteNodeVersion siteNodeVersion = getLatestSiteNodeVersion(db, siteNodeId, false);
      if(siteNodeVersion != null)
      {
        siteNodeVersion.setIsActive(true);
        siteNodeVersion.setStateId(SiteNodeVersionVO.WORKING_STATE);
        }
       
    return siteNodeVersion;
    }
View Full Code Here

    return siteNodeVersionVO;
    }

  public SiteNodeVersion getLatestActiveSiteNodeVersion(Database db, Integer siteNodeId) 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 ORDER BY cv.siteNodeVersionId desc");
    oql.bind(siteNodeId);
    oql.bind(new Boolean(true));
   
View Full Code Here

    return siteNodeVersion;
    }

  public SiteNodeVersion getLatestActiveSiteNodeVersionReadOnly(Database db, Integer siteNodeId) 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 ORDER BY cv.siteNodeVersionId desc");
    oql.bind(siteNodeId);
    oql.bind(new Boolean(true));
   
View Full Code Here

      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)
        {
View Full Code Here

      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)
      {
View Full Code Here

 
  public SiteNodeVersion getLatestSiteNodeVersion(Database db, Integer siteNodeId, boolean ReadOnly) throws SystemException, Bug
  {
    ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

    SiteNodeVersion siteNodeVersion = null;

    try
    {
      OQLQuery oql = db.getOQLQuery( "SELECT cv FROM org.infoglue.cms.entities.structure.impl.simple.SiteNodeVersionImpl cv WHERE cv.owningSiteNode.siteNodeId = $1 ORDER BY cv.siteNodeVersionId desc");
      oql.bind(siteNodeId);
View Full Code Here

  public SiteNodeVersion getLatestMediumSiteNodeVersion(Database db, Integer siteNodeId, boolean ReadOnly) throws SystemException, Bug
  {
    ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

    SiteNodeVersion siteNodeVersion = null;

    try
    {
      OQLQuery oql = db.getOQLQuery( "SELECT cv FROM org.infoglue.cms.entities.structure.impl.simple.MediumSiteNodeVersionImpl cv WHERE cv.siteNodeId = $1 ORDER BY cv.siteNodeVersionId desc");
      oql.bind(siteNodeId);
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.