Package org.guvnor.common.services.project.model

Examples of org.guvnor.common.services.project.model.Project


            @Override
            public void run() {
                try {
                    logger.info( "Incremental build request being processed: " + resource.toURI() + " (deleted)." );
                    final Project project = projectService.resolveProject( resource );

                    //Fall back to a Full Build in lieu of an Incremental Build if the Project has not been previously built
                    if ( buildService.isBuilt( project ) ) {
                        final IncrementalBuildResults results = buildService.deletePackageResource( resource );
                        incrementalBuildResultsEvent.fire( results );
View Full Code Here


        }
    }

    //Schedule a re-build of a Project (changes to pom.xml or kmodule.xml require a full build)
    private void scheduleProjectResourceUpdate( final Path resource ) {
        final Project project = projectService.resolveProject( resource );
        executor.execute( new Runnable() {

            @Override
            public void run() {
                try {
                    logger.info( "Incremental build request being processed: " + project.getRootPath() + " (updated)." );
                    final BuildResults results = buildService.build( project );
                    buildResultsEvent.fire( results );

                } catch ( Exception e ) {
                    logger.error( e.getMessage(),
View Full Code Here

            @Override
            public void run() {
                try {
                    logger.info( "Incremental build request being processed: " + resource.toURI() + " (updated)." );
                    final Project project = projectService.resolveProject( resource );

                    //Fall back to a Full Build in lieu of an Incremental Build if the Project has not been previously built
                    if ( buildService.isBuilt( project ) ) {
                        final IncrementalBuildResults results = buildService.updatePackageResource( resource );
                        incrementalBuildResultsEvent.fire( results );
View Full Code Here

        for ( Map.Entry<Path, Collection<ResourceChange>> pathCollectionEntry : batch.entrySet() ) {
            for ( final ResourceChange change : pathCollectionEntry.getValue() ) {
                final Path resource = pathCollectionEntry.getKey();

                //If resource is not within a Package it cannot be used for an incremental build
                final Project project = projectService.resolveProject( resource );
                final Package pkg = projectService.resolvePackage( resource );
                if ( project != null && pkg != null ) {
                    if ( !projectBatchChanges.containsKey( project ) ) {
                        projectBatchChanges.put( project,
                                                 new HashMap<Path, Collection<ResourceChange>>() );
                    }
                    final Map<Path, Collection<ResourceChange>> projectChanges = projectBatchChanges.get( project );
                    if ( !projectChanges.containsKey( pathCollectionEntry.getKey() ) ) {
                        projectChanges.put( pathCollectionEntry.getKey(), new ArrayList<ResourceChange>() );
                    }
                    projectChanges.get( pathCollectionEntry.getKey() ).add( change );
                    logger.info( "- Batch content: " + pathCollectionEntry.getKey().toURI() + " (" + change.getType().toString() + ")." );
                }
            }
        }

        //Schedule an incremental build for each Project
        for ( final Map.Entry<Project, Map<Path, Collection<ResourceChange>>> e : projectBatchChanges.entrySet() ) {
            executor.execute( new Runnable() {

                @Override
                public void run() {
                    try {
                        logger.info( "Batch incremental build request being processed." );
                        final Project project = e.getKey();
                        final Map<Path, Collection<ResourceChange>> changes = e.getValue();

                        //Fall back to a Full Build in lieu of an Incremental Build if the Project has not been previously built
                        if ( buildService.isBuilt( project ) ) {
                            final IncrementalBuildResults results = buildService.applyBatchResourceChanges( project,
View Full Code Here

    private void processResourceChange( final SessionInfo sessionInfo,
                                        final Path path,
                                        final ResourceChangeType changeType,
                                        final Map<String, Boolean> notifiedProjects ) {
        //Only process Project resources
        final Project project = projectService.resolveProject( path );
        if ( project == null ) {
            return;
        }

        if ( logger.isDebugEnabled() ) {
            logger.debug( "Processing resource change for sessionInfo: " + sessionInfo
                                  + ", project: " + project
                                  + ", path: " + path
                                  + ", changeType: " + changeType );
        }

        if ( !notifiedProjects.containsKey( project.getRootPath().toURI() ) && isObservableResource( path ) ) {
            invalidateDMOProjectCacheEvent.fire( new InvalidateDMOProjectCacheEvent( sessionInfo,
                                                                                     project,
                                                                                     path ) );
            notifiedProjects.put( project.getRootPath().toURI(),
                                  Boolean.TRUE );
        }

    }
View Full Code Here

            pomService.create( projectRootPath,
                               baseUrl,
                               pom );

            //Raise an event for the new project
            final Project project = resolveProject( projectRootPath );
            newProjectEvent.fire( new NewProjectEvent( project, sessionInfo ) );

            //Create a default workspace based on the GAV
            final String legalJavaGroupId[] = IdentifierUtils.convertMavenIdentifierToJavaIdentifier( pom.getGav().getGroupId().split( "\\.",
                                                                                                                                       -1 ) );
View Full Code Here

    @Override
    public Project simpleProjectInstance( final org.uberfire.java.nio.file.Path nioProjectRootPath ) {
        final Path projectRootPath = Paths.convert( nioProjectRootPath );

        return new Project( projectRootPath,
                            Paths.convert( nioProjectRootPath.resolve( POM_PATH ) ),
                            projectRootPath.getFileName() );

    }
View Full Code Here

        try {
            final String content = ioService.readAllString( path );
            final GuidedDecisionTree model = GuidedDecisionTreeXMLPersistence.getInstance().unmarshal( content );

            final Project project = projectService.resolveProject( Paths.convert( path ) );
            final Package pkg = projectService.resolvePackage( Paths.convert( path ) );

            final DefaultIndexBuilder builder = new DefaultIndexBuilder( project,
                                                                         pkg );
            final GuidedDecisionTreeModelIndexVisitor visitor = new GuidedDecisionTreeModelIndexVisitor( builder,
View Full Code Here

        }
    }

    private Project makeProject( final org.uberfire.java.nio.file.Path nioProjectRootPath ) {
        final Path projectRootPath = Paths.convert( nioProjectRootPath );
        final Project project = simpleProjectInstance( nioProjectRootPath );

        //Copy in Security Roles required to access this resource
        final ConfigGroup projectConfiguration = findProjectConfig( projectRootPath );
        if ( projectConfiguration != null ) {
            ConfigItem<List<String>> roles = projectConfiguration.getConfigItem( "security:roles" );
            if ( roles != null ) {
                for ( String role : roles.getValue() ) {
                    project.getRoles().add( role );
                }
            }
        }
        return project;
    }
View Full Code Here

    }

    public Project simpleProjectInstance( final org.uberfire.java.nio.file.Path nioProjectRootPath ) {
        final Path projectRootPath = Paths.convert( nioProjectRootPath );

        return new Project( projectRootPath,
                            Paths.convert( nioProjectRootPath.resolve( POM_PATH ) ),
                            Paths.convert( nioProjectRootPath.resolve( KMODULE_PATH ) ),
                            Paths.convert( nioProjectRootPath.resolve( PROJECT_IMPORTS_PATH ) ),
                            projectRootPath.getFileName() );
    }
View Full Code Here

TOP

Related Classes of org.guvnor.common.services.project.model.Project

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.