Package org.infoglue.cms.util

Examples of org.infoglue.cms.util.ConstraintExceptionBuffer


    private final static Logger logger = Logger.getLogger(ViewSiteNodeVersionUCCImpl.class.getName());
 
    public SiteNodeVersionVO viewSiteNodeVersion(Integer siteNodeVersionId) throws ConstraintException, SystemException
    {
        Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        SiteNodeVersion siteNodeVersion = null;

        beginTransaction(db);

        try
        {
            siteNodeVersion = SiteNodeVersionController.getController().getSiteNodeVersionWithId(siteNodeVersionId, db);
       
            //If any of the validations or setMethods reported an error, we throw them up now before create.
            ceb.throwIfNotEmpty();
           
            commitTransaction(db);
        }
        catch(ConstraintException ce)
        {
View Full Code Here


    private final static Logger logger = Logger.getLogger(UpdateSiteNodeVersionUCCImpl.class.getName());
    public SiteNodeVersionVO updateSiteNodeVersion(Integer siteNodeVersionId, SiteNodeVersionVO siteNodeVersionVO) throws ConstraintException, SystemException
    {
        Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        SiteNodeVersion siteNodeVersion = null;

        beginTransaction(db);

        try
        {
            //add validation here if needed
            siteNodeVersion = SiteNodeVersionController.getController().getSiteNodeVersionWithId(siteNodeVersionId, db);
            siteNodeVersion.setValueObject(siteNodeVersionVO);

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

    this.db = db;
    final ContentVO contentVO = createContentVO();
    final Document contentVersionDocument = buildContentVersionDocument();
    final ContentVersionVO contentVersionVO = createContentVersionVO(contentVersionDocument.asXML());
   
    ConstraintExceptionBuffer ceb = validate(contentVO, contentVersionVO);
    if(ceb.isEmpty())
    {
      return createContent(parentContent, contentVO, contentVersionVO, categories);
    }
    else
    {
      try
      {
        ceb.throwIfNotEmpty();
      }
      catch (ConstraintException e)
      {
        logger.error("Problem creating content:" + e.getMessage());
      }
View Full Code Here

  {
    this.db = db;
    populateContentVO(contentVO);
    final ContentVersionVO contentVersionVO = createContentVersionVO(buildContentVersionDocument().asXML());
   
    ConstraintExceptionBuffer ceb = validate(contentVO, contentVersionVO);
    if(ceb.isEmpty())
    {
      return updateContent(contentVO, contentVersionVO, categories);
    }
    else
    {
View Full Code Here

   * @param contentVersionVO
   * @return
   */
  private ConstraintExceptionBuffer validate(final ContentVO contentVO, final ContentVersionVO contentVersionVO)
  {
    final ConstraintExceptionBuffer ceb = contentVO.validate();
    ceb.add(contentVersionVO.validateAdvanced(contentTypeDefinitionVO, "en"));
    return ceb;
  }
View Full Code Here

    private final static Logger logger = Logger.getLogger(CreateSiteNodeVersionUCCImpl.class.getName());

    public SiteNodeVersionVO createSiteNodeVersion(SiteNodeVersionVO siteNodeVersionVO) throws ConstraintException, SystemException
    {
        Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        SiteNodeVersion siteNodeVersion = null;

        beginTransaction(db);

        try
        {
            //Here you might want to add some validate functonality?
            siteNodeVersion = createSiteNodeVersionEntity(db, siteNodeVersionVO);
            
            //If any of the validations or setMethods reported an error, we throw them up now before create.
            ceb.throwIfNotEmpty();
           
            commitTransaction(db);
        }
        catch(ConstraintException ce)
        {
View Full Code Here

    private final static Logger logger = Logger.getLogger(DeleteSiteNodeVersionUCCImpl.class.getName());

    public void deleteSiteNodeVersion(Integer siteNodeVersionId) throws ConstraintException, SystemException
    {
        Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        SiteNodeVersion siteNodeVersion = null;

        beginTransaction(db);
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)
        {
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)
        {
View Full Code Here

   */
 
  public List getAvailableServiceBindingVOList(Integer siteNodeTypeDefinitionId) throws ConstraintException, SystemException
  {
    Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        List availableServiceBindingVOList = null;

        beginTransaction(db);

        try
        {
          /*
          OQLQuery oql = db.getOQLQuery( "SELECT asb FROM org.infoglue.cms.entities.management.impl.simple.AvailableServiceBindingImpl asb WHERE asb.siteNodeTypeDefinition.siteNodeTypeDefinitionId = $1");
          oql.bind(siteNodeTypeDefinitionId);
         
          QueryResults results = oql.execute(Database.READONLY);
     
      while (results.hasMore())
            {
              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();
           
            commitTransaction(db);
        }
        catch(ConstraintException ce)
        {
View Full Code Here

TOP

Related Classes of org.infoglue.cms.util.ConstraintExceptionBuffer

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.