Package org.infoglue.cms.entities.management

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


    public void delete(RepositoryVO repositoryVO, boolean forceDelete, InfoGluePrincipal infoGluePrincipal) throws ConstraintException, SystemException
    {
    Database db = CastorDatabaseService.getDatabase();
    ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

    Repository repository = null;
 
    beginTransaction(db);

    try
    {
View Full Code Here


        beginTransaction(db);

        try
        {
          Repository repository = RepositoryController.getController().getRepositoryWithId(repositoryVO.getRepositoryId(), db);
         
          RepositoryLanguageController.getController().deleteRepositoryLanguages(repository, db);

          //add validation here if needed        
            List repositoryLanguageList = new ArrayList();
            if(languageValues != null)
      {
        for (int i=0; i < languageValues.length; i++)
              {
                Language language = LanguageController.getController().getLanguageWithId(new Integer(languageValues[i]), db);
                RepositoryLanguage repositoryLanguage = RepositoryLanguageController.getController().create(repositoryVO.getRepositoryId(), new Integer(languageValues[i]), new Integer(i), db);
                repositoryLanguageList.add(repositoryLanguage);
          language.getRepositoryLanguages().add(repositoryLanguage);
              }
      }
     
      repository.setValueObject(repositoryVO);
      repository.setRepositoryLanguages(repositoryLanguageList);
     
      repositoryVO = repository.getValueObject();
     
            //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

       
        QueryResults results = oql.execute(Database.READONLY);
 
        if (results.hasMore())
        {
          Repository repository = (Repository)results.next();
          repositoryVO = repository.getValueObject();
          CacheController.cacheObject("repositoryCache", key, repositoryVO);
        }
        else
        {
          CacheController.cacheObject("repositoryCache", key, new NullObject());
View Full Code Here

   * @throws Bug
   */

  public Repository getRepositoryWithName(String name, Database db) throws SystemException, Bug
  {
    Repository repository = null;
   
    try
    {
      OQLQuery oql = db.getOQLQuery("SELECT f FROM org.infoglue.cms.entities.management.impl.simple.RepositoryImpl f WHERE f.name = $1");
      oql.bind(name);
View Full Code Here

          QueryResults results = oql.execute();
      this.logger.info("Fetching entity in read/write mode");

      if (results.hasMore())
            {
                Repository repository = (Repository)results.next();
                repositoryVO = repository.getValueObject();
            }
           
      results.close();
      oql.close();
View Full Code Here

      oql.bind(false);
     
      QueryResults results = oql.execute(Database.READONLY);
      while (results.hasMore())
            {
                Repository repository = (Repository)results.next();
                repositoryVOListNotMarkedForDeletion.add(repository.getValueObject());
            }
           
      results.close();
      oql.close();
View Full Code Here

      oql.bind(true);
     
      QueryResults results = oql.execute(Database.READONLY);
      while (results.hasMore())
            {
        Repository repository = (Repository)results.next();
        Integer repositoryId = repository.getRepositoryId();

        if(AccessRightController.getController().getIsPrincipalAuthorized(db, infoGluePrincipal, "Repository.Read", repositoryId.toString()) && AccessRightController.getController().getIsPrincipalAuthorized(db, infoGluePrincipal, "Repository.Write", repositoryId.toString()))
        {
          repositoryVOListMarkedForDeletion.add(repository.getValueObject());
        }
      }
     
      results.close();
      oql.close();
View Full Code Here

      return list;
    }

    List<LanguageVO> languageVOList = new ArrayList<LanguageVO>();

    Repository repository = RepositoryController.getController().getRepositoryWithId(repositoryId, db);
    Collection<RepositoryLanguage> repositoryLanguageList = repository.getRepositoryLanguages();
    Iterator<RepositoryLanguage> repositoryLanguageIterator = repositoryLanguageList.iterator();
    while(repositoryLanguageIterator.hasNext())
    {
      RepositoryLanguage repositoryLanguage = repositoryLanguageIterator.next();
      languageVOList.add(repositoryLanguage.getLanguage().getValueObject());
View Full Code Here

 
  private List<Language> getLanguageList(Integer repositoryId, Database db) throws ConstraintException, SystemException
  {
    List<Language> languageList = new ArrayList<Language>();

    Repository repository = RepositoryController.getController().getRepositoryWithId(repositoryId, db);
    Collection repositoryLanguageList = repository.getRepositoryLanguages();
    Iterator repositoryLanguageIterator = repositoryLanguageList.iterator();
    while(repositoryLanguageIterator.hasNext())
    {
      RepositoryLanguage repositoryLanguage = (RepositoryLanguage)repositoryLanguageIterator.next();
      languageList.add(repositoryLanguage.getLanguage());
View Full Code Here

  protected void initializeContentVO() throws WorkflowException
  {
    try
    {
      logger.debug("Using repository=["+ repositoryName + "] path=["+ path + "]");
      final Repository repository = RepositoryController.getController().getRepositoryWithName(repositoryName, getDatabase());
      if(repository == null)
      {
        throwException("No repository with the name [" + repositoryName + "] found.");
      }
      setContentVO(ContentController.getContentController().getContentVOWithPath(repository.getId(), path, false, getPrincipal(), getDatabase()));
    }
    catch(Exception e)
    {
      throwException(e);
    }
View Full Code Here

TOP

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

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.