Package org.guvnor.asset.management.model

Examples of org.guvnor.asset.management.model.ProjectStructureModel


    @Override
    public ProjectStructureModel load( final Repository repository, boolean includeModules ) {

        if ( repository == null ) return null;

        ProjectStructureModel model = new ProjectStructureModel();
        Path path = repository.getRoot();
        final Project project = projectService.resolveToParentProject( path );

        if ( project != null ) {
            model.setPOM( pomService.load( project.getPomXMLPath() ) );
            model.setPOMMetaData( metadataService.getMetadata( project.getPomXMLPath() ) );
            model.setPathToPOM( project.getPomXMLPath() );
            model.setModules( new ArrayList<String>( project.getModules() ) );
            if ( includeModules && project.getModules() != null ) {
                org.uberfire.java.nio.file.Path parentPath = Paths.convert( project.getRootPath() );
                Project moduleProject;
                for ( String module : project.getModules() ) {
                    moduleProject = projectService.resolveProject( Paths.convert( parentPath.resolve( module ) ) );
                    model.getModulesProject().put( module, moduleProject );
                }
            }

        } else {
            //if no parent pom.xml present we must check if there are orphan projects for this repository.
            List<Project> repositoryProjects = getProjects( repository );
            if ( !repositoryProjects.isEmpty() ) {
                model.setOrphanProjects( repositoryProjects );
                POM pom;
                for ( Project orphanProject : repositoryProjects ) {
                    pom = pomService.load( orphanProject.getPomXMLPath() );
                    model.getOrphanProjectsPOM().put( orphanProject.getSignatureId(), pom );
                }
            } else {
                model = null;
            }
        }
View Full Code Here


                }
                concurrentUpdateSessionInfo = null;

                if ( model == null ) {

                    ProjectStructurePresenter.this.model = new ProjectStructureModel();
                    view.getDataView().setMode( ProjectStructureDataView.ViewMode.CREATE_STRUCTURE );
                    view.getModulesView().setMode( ProjectModulesView.ViewMode.PROJECTS_VIEW );
                    view.setModel( ProjectStructurePresenter.this.model );
                    view.setModulesViewVisible( false );
                    pathToProjectStructure = null;
View Full Code Here

TOP

Related Classes of org.guvnor.asset.management.model.ProjectStructureModel

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.