Package org.apache.maven.continuum.model.project

Examples of org.apache.maven.continuum.model.project.ProjectGroup


        }

        Map<Integer, ProjectGroup> projectGroups = new HashMap<Integer, ProjectGroup>();
        for ( Iterator i = database.getProjectGroups().iterator(); i.hasNext(); )
        {
            ProjectGroup projectGroup = (ProjectGroup) i.next();

            // first, we must map up any schedules, etc.
            projectGroup.setBuildDefinitions( processBuildDefinitions( projectGroup.getBuildDefinitions(),
                                                                       schedules, profiles, buildDefinitions ) );

            for ( Iterator j = projectGroup.getProjects().iterator(); j.hasNext(); )
            {
                Project project = (Project) j.next();

                project.setBuildDefinitions( processBuildDefinitions( project.getBuildDefinitions(),
                                                                      schedules, profiles, buildDefinitions ) );
            }

            if ( projectGroup.getLocalRepository() != null )
            {
                projectGroup.setLocalRepository( localRepositories.get(
                                                 Integer.valueOf( projectGroup.getLocalRepository().getId() ) ) );
            }

            projectGroup = (ProjectGroup) PlexusJdoUtils.addObject( pmf.getPersistenceManager(), projectGroup );
            projectGroups.put( Integer.valueOf( projectGroup.getId() ), projectGroup );
        }

        // create project scm root data (CONTINUUM-2040)
        Map<Integer, ProjectScmRoot> projectScmRoots = new HashMap<Integer, ProjectScmRoot>();
        Set<Integer> keys = projectGroups.keySet();
        int id = 1;
        for( Integer key : keys )
        {
            ProjectGroup projectGroup = projectGroups.get( key );
            String url = " ";
            List<Project> projects =
                ProjectSorter.getSortedProjects( getProjectsByGroupIdWithDependencies( pmf, projectGroup.getId() ),
                                                 log );
            for ( Iterator j = projects.iterator(); j.hasNext(); )
            {
                Project project = (Project) j.next();
                if ( !project.getScmUrl().trim().startsWith( url ) )
                {
                    url = project.getScmUrl();
                    ProjectScmRoot projectScmRoot = new ProjectScmRoot();
                    projectScmRoot.setId( id );
                    projectScmRoot.setProjectGroup( projectGroup );
                    projectScmRoot.setScmRootAddress( url );
                    projectScmRoot.setState( project.getState() );

                    projectScmRoot = (ProjectScmRoot) PlexusJdoUtils.addObject( pmf.getPersistenceManager(), projectScmRoot );
                    projectScmRoots.put( Integer.valueOf( projectScmRoot.getId() ), projectScmRoot );
                    id++;
                }
            }
        }

        /*
        for ( RepositoryPurgeConfiguration repoPurge : (List<RepositoryPurgeConfiguration>) database.getRepositoryPurgeConfigurations() )
        {
            repoPurge.setRepository( localRepositories.get(
                                     Integer.valueOf( repoPurge.getRepository().getId() ) ) );

            if ( repoPurge.getSchedule() != null )
            {
                repoPurge.setSchedule( schedules.get(
                                       Integer.valueOf( repoPurge.getSchedule().getId() ) ) );
            }

            repoPurge = (RepositoryPurgeConfiguration) PlexusJdoUtils.addObject( pmf.getPersistenceManager(), repoPurge );
        }*/

        for ( DirectoryPurgeConfiguration dirPurge : (List<DirectoryPurgeConfiguration>) database.getDirectoryPurgeConfigurations() )
        {
            if ( dirPurge.getSchedule() != null )
            {
                dirPurge.setSchedule( schedules.get(
                                      Integer.valueOf( dirPurge.getSchedule().getId() ) ) );
            }

            dirPurge = (DirectoryPurgeConfiguration) PlexusJdoUtils.addObject( pmf.getPersistenceManager(), dirPurge );
        }

        for ( ContinuumReleaseResult releaseResult : (List<ContinuumReleaseResult>) database.getContinuumReleaseResults() )
        {
            releaseResult.setProjectGroup( projectGroups.get(
                                           Integer.valueOf( releaseResult.getProjectGroup().getId() ) ) );

            ProjectGroup group = releaseResult.getProjectGroup();

            for ( Project project : (List<Project>) group.getProjects() )
            {
                if ( project.getId() == releaseResult.getProject().getId() )
                {
                    try
                    {
View Full Code Here


                {
                    break;
                }
            }

            ProjectGroup newProjectGroup = getContinuum().getProjectGroupWithProjects( new Integer( id[0] ) );

            if ( newProjectGroup.getId() != projectGroup.getId() && isAuthorized( newProjectGroup.getName() ) )
            {
                logger.info( "Moving project " + project.getName() + " to project group " + newProjectGroup.getName() );
                project.setProjectGroup( newProjectGroup );

                // CONTINUUM-1512
                Collection<BuildResult> results = getContinuum().getBuildResultsForProject( project.getId() );
                for ( BuildResult br : results )
View Full Code Here

    }

    public ProjectNotifier getGroupNotifier( int projectGroupId, int notifierId )
        throws ContinuumException
    {
        ProjectGroup projectGroup = getProjectGroupWithBuildDetails( projectGroupId );

        List<ProjectNotifier> notifiers = projectGroup.getNotifiers();

        ProjectNotifier notifier = null;

        for ( ProjectNotifier notif : notifiers )
        {
View Full Code Here

    }

    public ProjectNotifier updateGroupNotifier( int projectGroupId, ProjectNotifier notifier )
        throws ContinuumException
    {
        ProjectGroup projectGroup = getProjectGroupWithBuildDetails( projectGroupId );

        ProjectNotifier notif = getGroupNotifier( projectGroupId, notifier.getId() );

        // I remove notifier then add it instead of update it due to a ClassCastException in jpox
        projectGroup.removeNotifier( notif );

        try
        {
            projectGroupDao.updateProjectGroup( projectGroup );
        }
View Full Code Here

        notif.setType( notifier.getType() );

        notif.setFrom( ProjectNotifier.FROM_USER );

        ProjectGroup projectGroup = getProjectGroupWithBuildDetails( projectGroupId );

        projectGroup.addNotifier( notif );
        try
        {
            projectGroupDao.updateProjectGroup( projectGroup );
        }
        catch ( ContinuumStoreException cse )
View Full Code Here

    }

    public void removeGroupNotifier( int projectGroupId, int notifierId )
        throws ContinuumException
    {
        ProjectGroup projectGroup = getProjectGroupWithBuildDetails( projectGroupId );

        ProjectNotifier n = getGroupNotifier( projectGroupId, notifierId );

        if ( n != null )
        {
            if ( n.isFromProject() )
            {
                n.setEnabled( false );

                storeNotifier( n );
            }
            else
            {
                projectGroup.removeNotifier( n );

                try
                {
                    projectGroupDao.updateProjectGroup( projectGroup );
                }
View Full Code Here

    public List<BuildDefinition> getBuildDefinitionsForProjectGroup( int projectGroupId )
        throws ContinuumException
    {

        ProjectGroup projectGroup = getProjectGroupWithBuildDetails( projectGroupId );

        return projectGroup.getBuildDefinitions();
    }
View Full Code Here

    public String getReleaseOutput( int releaseResultId )
        throws ContinuumException
    {
        ContinuumReleaseResult releaseResult = getContinuumReleaseResult( releaseResultId );

        ProjectGroup projectGroup = releaseResult.getProjectGroup();

        try
        {
            return configurationService.getReleaseOutput( projectGroup.getId(),
                                                          "releases-" + releaseResult.getStartTime() );
        }
        catch ( ConfigurationException e )
        {
            throw new ContinuumException( "Error while retrieving release output for release: " + releaseResultId );
View Full Code Here

    public ProjectScmRoot getProjectScmRootByProject( int projectId )
        throws ContinuumException
    {
        Project project = getProject( projectId );
        ProjectGroup group = getProjectGroupByProjectId( projectId );

        List<ProjectScmRoot> scmRoots = getProjectScmRootByProjectGroup( group.getId() );

        for ( ProjectScmRoot scmRoot : scmRoots )
        {
            if ( project.getScmUrl() != null && project.getScmUrl().startsWith( scmRoot.getScmRootAddress() ) )
            {
View Full Code Here

        {
            return;
        }

        //get all projects in the group
        ProjectGroup group = getProjectGroupWithProjects( projectScmRoot.getProjectGroup().getId() );

        List<Project> projects = group.getProjects();

        boolean found = false;
        for ( Project project : projects )
        {
            if ( project.getScmUrl() != null && project.getScmUrl().startsWith( projectScmRoot.getScmRootAddress() ) )
View Full Code Here

TOP

Related Classes of org.apache.maven.continuum.model.project.ProjectGroup

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.