Package org.infoglue.cms.util

Examples of org.infoglue.cms.util.ConstraintExceptionBuffer


    {
      return contentVO;
    }

        Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        beginTransaction(db);

        try
        {
            logger.info("Fetching the root content for the repository " + repositoryId);
      //OQLQuery oql = db.getOQLQuery( "SELECT c FROM org.infoglue.cms.entities.content.impl.simple.ContentImpl c WHERE is_undefined(c.parentContent) AND c.repository.repositoryId = $1");
      OQLQuery oql = db.getOQLQuery( "SELECT c FROM org.infoglue.cms.entities.content.impl.simple.SmallContentImpl c WHERE is_undefined(c.parentContentId) AND c.repositoryId = $1");
      oql.bind(repositoryId);
     
          QueryResults results = oql.execute(Database.READONLY);     
      if (results.hasMore())
            {
        Content content = (Content)results.next();
        contentVO = content.getValueObject();
          }
            else
            {
        //None found - we create it and give it the name of the repository.
        logger.info("Found no rootContent so we create a new....");
        ContentVO rootContentVO = new ContentVO();
        RepositoryVO repositoryVO = RepositoryController.getController().getRepositoryVOWithId(repositoryId);
        rootContentVO.setCreatorName(userName);
        rootContentVO.setName(repositoryVO.getName());
        rootContentVO.setIsBranch(new Boolean(true));
              Content content = create(db, null, null, repositoryId, rootContentVO);
              contentVO = content.getValueObject();
            }
           
      results.close();
      oql.close();

            //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


    {
      return contentVO;
    }

    Database db = CastorDatabaseService.getDatabase();
    ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

    beginTransaction(db);

    try
    {
      contentVO = getRootContentVO(db, repositoryId, userName, createIfNonExisting);
     
      //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<ContentVO> getContentChildrenVOList(Integer parentContentId, List<LanguageVO> languageVOList, String[] allowedContentTypeIds, Boolean showDeletedItems) throws ConstraintException, SystemException
    {
    Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        List childrenVOList = new ArrayList();

        beginTransaction(db);
        try
        {
          childrenVOList = getContentChildrenVOList(parentContentId, languageVOList, allowedContentTypeIds, showDeletedItems, 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

      */
    
     public List<ContentVO> getContentChildrenVOList(Integer parentContentId, String[] allowedContentTypeIds) throws ConstraintException, SystemException
    {
    Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        List childrenVOList = new ArrayList();

        beginTransaction(db);
        try
        {
         
          childrenVOList = getContentChildrenVOList(parentContentId, allowedContentTypeIds, db); //getContentChildrenVOList(parentContentId, allowedContentTypeIds, 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

      if(logger.isInfoEnabled())
        logger.info("There was an cached childContentVOList:" + cachedChildContentVOList.size());
      return cachedChildContentVOList;
    }
   
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        List childrenVOList = new ArrayList();

      String contentTypeINClause = "";
      if(allowedContentTypeIds != null && allowedContentTypeIds.length > 0)
View Full Code Here

   */
 
  public ContentTypeDefinitionVO getContentTypeDefinition(Integer contentId) throws ConstraintException, SystemException
    {
        Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();
       
        ContentTypeDefinitionVO contentTypeDefinitionVO = null;
       
        beginTransaction(db);

        try
        {
          ContentVO smallContentVO = getSmallContentVOWithId(contentId, db);
          if(smallContentVO != null && smallContentVO.getContentTypeDefinitionId() != null)
            contentTypeDefinitionVO = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOWithId(smallContentVO.getContentTypeDefinitionId(), 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

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

        List languages = null;
       
        beginTransaction(db);

        try
        {
            languages = getAvailableLanguagesForContentWithId(contentId, 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

    }       

    public List getRepositoryLanguagesEx(Integer contentId) throws ConstraintException, SystemException
    {
        Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        List languages = null;
       
        beginTransaction(db);

        try
        {
          Content content = getContentWithId(contentId, db);
        if(content != null)
        {
          Repository repository = content.getRepository();
          if(repository != null)
          {
             languages = LanguageController.getController().getLanguageVOList(repository.getId(), db);
           
             //If any of the validations or setMethods reported an error, we throw them up now before create.
             ceb.throwIfNotEmpty();
           
             commitTransaction(db);
          }
        }
        }
View Full Code Here

    public List getContentVOWithParentRecursive(Integer contentId, ProcessBean processBean) throws ConstraintException, SystemException
  {
      List<ContentVO> contentVOList = new ArrayList<ContentVO>();
     
      Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        beginTransaction(db);

        try
        {
View Full Code Here

  public List<ContentVO> getUpcomingExpiringContents(int numberOfWeeks) throws Exception
  {
    List<ContentVO> contentVOList = new ArrayList<ContentVO>();

    Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        beginTransaction(db);

        try
        {
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.