Package org.infoglue.cms.entities.management

Examples of org.infoglue.cms.entities.management.SiteNodeTypeDefinition


        logger.info("******************************************");
       
        //Fetch related entities here if they should be referenced       
       
        SiteNode parentSiteNode = null;
        SiteNodeTypeDefinition siteNodeTypeDefinition = null;

        if(parentSiteNodeId != null)
        {
           parentSiteNode = getSiteNodeWithId(parentSiteNodeId, db);
      if(repositoryId == null)
View Full Code Here


      logger.info("******************************************");
           
          //Fetch related entities here if they should be referenced       
     
      SiteNode parentSiteNode = null;
      SiteNodeTypeDefinition siteNodeTypeDefinition = null;

      if(parentSiteNodeId != null)
      {
        parentSiteNode = getSiteNodeWithId(parentSiteNodeId, db);
        if(repositoryId == null)
View Full Code Here

        beginTransaction(db);

        try
        {
          SiteNode siteNode = getSiteNodeWithId(siteNodeId, db);
          SiteNodeTypeDefinition sntd = SiteNodeTypeDefinitionController.getController().getSiteNodeTypeDefinitionWithId(siteNodeTypeDefinitionId, db);
          if(siteNode != null && sntd != null)
            siteNode.setSiteNodeTypeDefinition((SiteNodeTypeDefinitionImpl)sntd);
         
          commitTransaction(db);
View Full Code Here

      logger.info("createStructure with siteNode:" + siteNode);
    Integer originalSiteNodeId = siteNode.getValueObject().getSiteNodeId();

    logger.info("originalSiteNodeId:" + originalSiteNodeId);

    SiteNodeTypeDefinition originalSiteNodeTypeDefinition = siteNode.getSiteNodeTypeDefinition();
    logger.info("originalSiteNodeTypeDefinition:" +originalSiteNodeTypeDefinition);
   
    if(originalSiteNodeTypeDefinition == null)
    {
      Integer siteNodeTypeDefinitionId = siteNode.getValueObject().getSiteNodeTypeDefinitionId();
      logger.info("siteNodeTypeDefinitionId: " + siteNodeTypeDefinitionId);
      originalSiteNodeTypeDefinition = siteNodeTypeDefinitions.get(siteNodeTypeDefinitionId);
      logger.info("siteNodeTypeDefinitions: " + siteNodeTypeDefinitions);
      logger.info("originalSiteNodeTypeDefinition: " + originalSiteNodeTypeDefinition);
    }
   
    SiteNodeTypeDefinition siteNodeTypeDefinition = null;
    if(originalSiteNodeTypeDefinition != null)
    {
      logger.info("originalSiteNodeTypeDefinition:" + originalSiteNodeTypeDefinition);
      siteNodeTypeDefinition = SiteNodeTypeDefinitionController.getController().getSiteNodeTypeDefinitionWithName(originalSiteNodeTypeDefinition.getName(), db, false);
      logger.info("siteNodeTypeDefinition:" + siteNodeTypeDefinition);
      if(siteNodeTypeDefinition == null)
      {
          db.create(originalSiteNodeTypeDefinition);
          siteNodeTypeDefinition = originalSiteNodeTypeDefinition;
        logger.info("originalSiteNodeTypeDefinition ID:" + originalSiteNodeTypeDefinition.getId());
      }
      else
        logger.info("siteNodeTypeDefinition ID:" + siteNodeTypeDefinition.getId());

      siteNode.setSiteNodeTypeDefinition((SiteNodeTypeDefinitionImpl)siteNodeTypeDefinition);
      siteNode.getValueObject().setSiteNodeTypeDefinitionId(siteNodeTypeDefinition.getId());
    }
   
   
    String mappedMetaInfoContentId = "-1";
    if(siteNode.getMetaInfoContentId() != null)
View Full Code Here

   * @throws Bug
   */

  public SiteNodeTypeDefinition getSiteNodeTypeDefinitionWithName(String name, Database db, boolean readOnly) throws SystemException, Bug
  {
    SiteNodeTypeDefinition siteNodeTypeDefinition = null;
   
    try
    {
      OQLQuery oql = db.getOQLQuery("SELECT s FROM org.infoglue.cms.entities.management.impl.simple.SiteNodeTypeDefinitionImpl s WHERE s.name = $1");
      oql.bind(name);
View Full Code Here

    public SiteNodeTypeDefinitionVO update(SiteNodeTypeDefinitionVO siteNodeTypeDefinitionVO) throws ConstraintException, SystemException
    {
        Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        SiteNodeTypeDefinition siteNodeTypeDefinition = null;

        beginTransaction(db);

        try
        {
            //add validation here if needed
            siteNodeTypeDefinition = getSiteNodeTypeDefinitionWithId(siteNodeTypeDefinitionVO.getSiteNodeTypeDefinitionId(), db);
            siteNodeTypeDefinition.setValueObject(siteNodeTypeDefinitionVO);

            //If any of the validations or setMethods reported an error, we throw them up now before create.
            ceb.throwIfNotEmpty();
           
            commitTransaction(db);
        }
        catch(ConstraintException ce)
        {
            logger.warn("An error occurred so we should not complete the transaction:" + ce, ce);
            rollbackTransaction(db);
            throw ce;
        }
        catch(Exception e)
        {
            logger.error("An error occurred so we should not complete the transaction:" + e, e);
            rollbackTransaction(db);
            throw new SystemException(e.getMessage());
        }

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

    public SiteNodeTypeDefinitionVO update(SiteNodeTypeDefinitionVO siteNodeTypeDefinitionVO, String[] availableServiceBindingValues) throws ConstraintException, SystemException
    {
        Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        SiteNodeTypeDefinition siteNodeTypeDefinition = null;

        beginTransaction(db);

        try
        {
            siteNodeTypeDefinition = SiteNodeTypeDefinitionController.getController().getSiteNodeTypeDefinitionWithId(siteNodeTypeDefinitionVO.getSiteNodeTypeDefinitionId(), db);
            siteNodeTypeDefinition.setValueObject(siteNodeTypeDefinitionVO);

            //add validation here if needed
            List availableServiceBindingList = new ArrayList();
            if(availableServiceBindingValues != null)
      {
            for (int i=0; i < availableServiceBindingValues.length; i++)
              {
                AvailableServiceBinding availableServiceBinding = AvailableServiceBindingController.getController().getAvailableServiceBindingWithId(new Integer(availableServiceBindingValues[i]), db);
                availableServiceBindingList.add(availableServiceBinding);
                //siteNodeTypeDefinition.getAvailableServiceBindings().add(availableServiceBinding);
              }
      }
     
      //logger.info("availableServiceBindingList:" + availableServiceBindingList);
      siteNodeTypeDefinition.setAvailableServiceBindings(availableServiceBindingList);
     
            //If any of the validations or setMethods reported an error, we throw them up now before create.
            ceb.throwIfNotEmpty();
           
            commitTransaction(db);
        }
        catch(ConstraintException ce)
        {
            logger.warn("An error occurred so we should not complete the transaction:" + ce, ce);
            rollbackTransaction(db);
            throw ce;
        }
        catch(Exception e)
        {
            logger.error("An error occurred so we should not complete the transaction:" + e, e);
            rollbackTransaction(db);
            throw new SystemException(e.getMessage());
        }
        finally
        {
          closeDatabase(db);
        }

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

              AvailableServiceBinding availableServiceBinding = (AvailableServiceBinding)results.next();
        availableServiceBindingVOList.add(availableServiceBinding.getValueObject());
            }
            */

          SiteNodeTypeDefinition siteNodeTypeDefinition = getSiteNodeTypeDefinitionWithIdAsReadOnly(siteNodeTypeDefinitionId, db);
          Collection availableServiceBindingList = siteNodeTypeDefinition.getAvailableServiceBindings();
          availableServiceBindingVOList = toVOList(availableServiceBindingList);

            //If any of the validations or setMethods reported an error, we throw them up now before create.
            ceb.throwIfNotEmpty();
           
View Full Code Here

          AvailableServiceBinding availableServiceBinding = (AvailableServiceBinding)results.next();
      availableServiceBindingVOList.add(availableServiceBinding.getValueObject());
        }
        */

      SiteNodeTypeDefinition siteNodeTypeDefinition = getSiteNodeTypeDefinitionWithIdAsReadOnly(siteNodeTypeDefinitionId, db);
        Collection availableServiceBindingList = siteNodeTypeDefinition.getAvailableServiceBindings();
      availableServiceBindingVOList = toVOList(availableServiceBindingList);

        return availableServiceBindingVOList;
  }
View Full Code Here

    return (SiteNodeTypeDefinitionVO) getVOWithId(SiteNodeTypeDefinitionImpl.class, siteNodeTypeDefinitionId, db);
    }

    public SiteNodeTypeDefinitionVO create(SiteNodeTypeDefinitionVO vo) throws ConstraintException, SystemException
    {
        SiteNodeTypeDefinition ent = new SiteNodeTypeDefinitionImpl();
        ent.setValueObject(vo);
        ent = (SiteNodeTypeDefinition) createEntity(ent);
        return ent.getValueObject();
    }    
View Full Code Here

TOP

Related Classes of org.infoglue.cms.entities.management.SiteNodeTypeDefinition

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.