Package org.guvnor.structure.repositories

Examples of org.guvnor.structure.repositories.Repository


        final OrganizationalUnit selectedOrganizationalUnit = ( selectedOrganizationalUnitIndex < 0 ? null : sortedOrganizationalUnits.get( selectedOrganizationalUnitIndex ) );
        if ( selectedOrganizationalUnit == null ) {
            return;
        }
        final int selectedRepositoryIndex = lstOrganizationalUnitRepositories.getSelectedIndex();
        final Repository selectedRepository = ( selectedRepositoryIndex < 0 ? null : sortedOrganizationalUnitRepositories.get( selectedRepositoryIndex ) );
        if ( selectedRepository == null ) {
            return;
        }
        presenter.removeOrganizationalUnitRepository( selectedOrganizationalUnit,
                                                      selectedRepository );
View Full Code Here


        String gitRepo = (String) getParameter(commandContext, "GitRepository");
        BeanManager beanManager = CDIUtils.lookUpBeanManager(commandContext);
        logger.debug("BeanManager " + beanManager);
        RepositoryService repositoryService = CDIUtils.createBean(RepositoryService.class, beanManager);

        Repository repository = repositoryService.getRepository(gitRepo);
        if (repository == null) {
            throw new IllegalArgumentException("No repository found for alias " + gitRepo);
        }

        Collection<String> branchNames = repository.getBranches();

        List<BranchInfo> branchInfos = new ArrayList<BranchInfo>();
        for (String branch : branchNames) {
          branchInfos.add(new BranchInfo("default://"+branch+"@"+gitRepo, branch));
        }
View Full Code Here

      RepositoryService repositoryService = CDIUtils.createBean(RepositoryService.class, beanManager);
      logger.debug("RepositoryService " + repositoryService);
     
      if (repositoryService != null) {
         
        Repository repo = repositoryService.getRepository(repository);
       
        Map<String, Object> config = new HashMap<String, Object>();
        config.put("branch", branchToUpdate + "-" + version);
       
        repo = repositoryService.updateRepository(repo, config);
View Full Code Here

        BeanManager beanManager = CDIUtils.lookUpBeanManager(commandContext);
        logger.debug("BeanManager " + beanManager);

        RepositoryService repositoryService = CDIUtils.createBean(RepositoryService.class, beanManager);

        Repository repository = repositoryService.getRepository(gitRepo);
        if (repository == null) {
            throw new IllegalArgumentException("No repository found for alias " + gitRepo);
        }

View Full Code Here

        rootDirectories.add(createPath("default://branch1@uf-playground"));

        ConfigGroup configGroup = getConfigGroup();
        configGroup.setName("test");

        Repository repository = helper.newRepository(configGroup);

        assertEquals(3, repository.getBranches().size());
        assertEquals("master",repository.getCurrentBranch());
    }
View Full Code Here

        rootDirectories.add(createPath("default://branch1@uf-playground"));

        ConfigGroup configGroup = getConfigGroup();
        configGroup.setName("test");

        Repository repository = helper.newRepository(configGroup,"branch1");

        assertEquals(3, repository.getBranches().size());
        assertEquals("branch1",repository.getCurrentBranch());
    }
View Full Code Here

    @PostConstruct
    public void loadRepositories() {
        final List<ConfigGroup> repoConfigs = configurationService.getConfiguration( REPOSITORY );
        if ( !( repoConfigs == null || repoConfigs.isEmpty() ) ) {
            for ( final ConfigGroup config : repoConfigs ) {
                final Repository repository = repositoryFactory.newRepository( config );
                configuredRepositories.put( repository.getAlias(), repository );
                rootToRepo.put( repository.getRoot(), repository );
            }
        }

        ioService.onNewFileSystem( new IOService.NewFileSystemListener() {
View Full Code Here

    @Override
    public Repository createRepository( final OrganizationalUnit organizationalUnit,
                                        final String scheme,
                                        final String alias,
                                        final Map<String, Object> env ) throws RepositoryAlreadyExistsException {
        final Repository repository = createRepository( scheme, alias, env );
        if ( organizationalUnit != null ) {
            organizationalUnitService.addRepository( organizationalUnit, repository );
        }
        return repository;
    }
View Full Code Here

                repositoryConfig.addConfigItem( configurationFactory.newConfigItem( entry.getKey(),
                                                                                    entry.getValue() ) );
            }
        }

        final Repository repo = createRepository( repositoryConfig );

        event.fire( new NewRepositoryEvent( repo ) );

        return repo;
    }
View Full Code Here

        return repo;
    }

    //Save the definition
    private Repository createRepository( final ConfigGroup repositoryConfig ) {
        final Repository repository = repositoryFactory.newRepository( repositoryConfig );
        configurationService.addConfiguration( repositoryConfig );
        configuredRepositories.put( repository.getAlias(), repository );
        rootToRepo.put( repository.getRoot(), repository );
        return repository;
    }
View Full Code Here

TOP

Related Classes of org.guvnor.structure.repositories.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.