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

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


            if ( resource == null ) {
                return null;
            }

            //If Path is not within a Project we cannot resolve a package
            final Project project = resolveProject( resource );
            if ( project == null ) {
                return null;
            }

            //pom.xml and kmodule.xml are not inside packages
View Full Code Here


            if ( resource == null ) {
                return false;
            }

            //Check if path equals pom.xml
            final Project project = resolveProject( resource );

            //It's possible that the Incremental Build attempts to act on a Project file before the project has been fully created.
            //This should be a short-term issue that will be resolved when saving a project batches pom.xml, kmodule.xml and project.imports
            //etc into a single git-batch. At present they are saved individually leading to multiple Incremental Build requests.
            if ( project == null ) {
                return false;
            }

            final org.uberfire.java.nio.file.Path path = Paths.convert( resource ).normalize();
            final org.uberfire.java.nio.file.Path pomFilePath = Paths.convert( project.getPomXMLPath() );
            return path.startsWith( pomFilePath );

        } catch ( Exception e ) {
            throw ExceptionUtilities.handleException( e );
        }
View Full Code Here

            if ( resource == null ) {
                return false;
            }

            //Check if path equals kmodule.xml
            final Project project = resolveProject( resource );
            //It's possible that the Incremental Build attempts to act on a Project file before the project has been fully created.
            //This should be a short-term issue that will be resolved when saving a project batches pom.xml, kmodule.xml and project.imports
            //etc into a single git-batch. At present they are saved individually leading to multiple Incremental Build requests.
            if ( project == null ) {
                return false;
            }

            final org.uberfire.java.nio.file.Path path = Paths.convert( resource ).normalize();
            final org.uberfire.java.nio.file.Path kmoduleFilePath = Paths.convert( project.getKModuleXMLPath() );
            return path.startsWith( kmoduleFilePath );

        } catch ( Exception e ) {
            throw ExceptionUtilities.handleException( e );
        }
View Full Code Here

            ioService.createFile( Paths.convert( projectConfigPath ) );
            ioService.write( Paths.convert( projectConfigPath ),
                             projectConfigurationContentHandler.toString( createProjectImports() ) );

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

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

            if ( ioService.exists( newProjectPath ) ) {
                throw new FileAlreadyExistsException( newProjectPath.toString() );
            }

            final Path oldProjectDir = Paths.convert( projectDirectory );
            final Project oldProject = resolveProject( oldProjectDir );

            content.setName( newName );
            final Path newPathToPomXML = Paths.convert( newProjectPath.resolve( "pom.xml" ) );
            ioService.startBatch();
            ioService.move( projectDirectory, newProjectPath, makeCommentedOption( comment ) );
            pomService.save( newPathToPomXML, content, null, comment );
            ioService.endBatch();
            final Project newProject = resolveProject( Paths.convert( newProjectPath ) );
            invalidateDMOCache.fire( new InvalidateDMOProjectCacheEvent( sessionInfo, oldProject, oldProjectDir ) );
            renameProjectEvent.fire( new RenameProjectEvent( oldProject, newProject ) );

            return newPathToPomXML;
        } catch ( final Exception e ) {
View Full Code Here

    @Override
    public void delete( final Path pathToPomXML,
                        final String comment ) {
        try {
            final org.uberfire.java.nio.file.Path projectDirectory = Paths.convert( pathToPomXML ).getParent();
            final Project project2Delete = resolveProject( Paths.convert( projectDirectory ) );

            ioService.delete( projectDirectory, StandardDeleteOption.NON_EMPTY_DIRECTORIES, new CommentedOption( sessionInfo.getId(), identity.getName(), null, comment ) );
            deleteProjectEvent.fire( new DeleteProjectEvent( project2Delete ) );
        } catch ( final Exception e ) {
            throw ExceptionUtilities.handleException( e );
View Full Code Here

            final Path newPathToPomXML = Paths.convert( newProjectPath.resolve( "pom.xml" ) );
            ioService.startBatch();
            ioService.copy( projectDirectory, newProjectPath, makeCommentedOption( comment ) );
            pomService.save( newPathToPomXML, content, null, comment );
            ioService.endBatch();
            final Project newProject = resolveProject( Paths.convert( newProjectPath ) );
            newProjectEvent.fire( new NewProjectEvent( newProject ) );

        } catch ( final Exception e ) {
            throw ExceptionUtilities.handleException( e );
        }
View Full Code Here

        return false;
    }

    private void fireDeleteEvent( final org.uberfire.backend.vfs.Path _path ) {
        final Path path = ioService.get( URI.create( _path.toURI() ) );
        final Project project = projectService.simpleProjectInstance( path.getParent() );
        deleteProjectEvent.fire( new DeleteProjectEvent( project ) );
    }
View Full Code Here

    @Override
    public void runScenario( final Path path,
                             final Scenario scenario ) {
        try {

            final Project project = projectService.resolveProject( path );
            final KieSession session = sessionService.newKieSession( project );
            final ScenarioRunnerWrapper runner = new ScenarioRunnerWrapper( testResultMessageEvent,
                                                                            getMaxRuleFirings() );

            runner.run( scenario,
View Full Code Here

    //@Override
    public void runAllScenarios( final Path testResourcePath,
                                 Event<TestResultMessage> customTestResultEvent ) {
        try {
            final Project project = projectService.resolveProject( testResourcePath );
            List<Path> scenarioPaths = loadScenarioPaths( testResourcePath );
            List<Scenario> scenarios = new ArrayList<Scenario>();
            for ( Path path : scenarioPaths ) {
                Scenario s = load( path );
                scenarios.add( s );
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.