Examples of OrganizationalUnit


Examples of it.eng.spagobi.kpi.ou.bo.OrganizationalUnit

      while (rs.next()) {
       
        String code =  rs.getString(CODE);
        String name =  rs.getString(NAME);
       
        OrganizationalUnit ou =new OrganizationalUnit();
        ou.setDescription("");
        ou.setLabel(code);
        ou.setName(name);
        String path =  parent.getPath();

        if(code != null){
          Node<OrganizationalUnit> node = new Node<OrganizationalUnit>(ou, path + S+ ou.getLabel(), parent);   
          children.add(node);
        }
      }
      rs.close();
      pstmt.close();
View Full Code Here

Examples of it.eng.spagobi.kpi.ou.bo.OrganizationalUnit

      while (rs.next()) {
       
        String code =  rs.getString(CODE);
        String name =  rs.getString(NAME);
       
        OrganizationalUnit ou =new OrganizationalUnit();
        ou.setDescription("");
        ou.setLabel(code);
        ou.setName(name);
        String path = "";
        if(level != 1){
          path = parent.getPath();
        }
        if(code != null){
          Node<OrganizationalUnit> node = new Node<OrganizationalUnit>(ou, path + S+ ou.getLabel(), parent);   
          children.add(node);
        }
      }
      rs.close();
      pstmt.close();
View Full Code Here

Examples of org.guvnor.rest.client.OrganizationalUnit

    public OrganizationalUnit getOrganizationalUnit( @PathParam("organizationalUnitName") String organizationalUnitName ) {
        logger.debug( "-----getOrganizationalUnit ---, OrganizationalUnit name: {}", organizationalUnitName );
        org.guvnor.structure.organizationalunit.OrganizationalUnit origOrgUnit
                = checkOrganizationalUnitExistence( organizationalUnitName );

        OrganizationalUnit orgUnit = new OrganizationalUnit();
        orgUnit.setName( origOrgUnit.getName() );
        orgUnit.setOwner( origOrgUnit.getOwner() );
        List<String> repoNames = new ArrayList<String>();
        for ( Repository r : origOrgUnit.getRepositories() ) {
            repoNames.add( r.getAlias() );
        }
        orgUnit.setRepositories( repoNames );

        return orgUnit;
    }
View Full Code Here

Examples of org.guvnor.rest.client.OrganizationalUnit

        Collection<org.guvnor.structure.organizationalunit.OrganizationalUnit> origOrgUnits
                = organizationalUnitService.getOrganizationalUnits();

        List<OrganizationalUnit> organizationalUnits = new ArrayList<OrganizationalUnit>();
        for ( org.guvnor.structure.organizationalunit.OrganizationalUnit ou : origOrgUnits ) {
            OrganizationalUnit orgUnit = new OrganizationalUnit();
            orgUnit.setName( ou.getName() );
            orgUnit.setOwner( ou.getOwner() );
            List<String> repoNames = new ArrayList<String>();
            for ( Repository r : ou.getRepositories() ) {
                repoNames.add( r.getAlias() );
            }
            orgUnit.setRepositories( repoNames );
            organizationalUnits.add( orgUnit );
        }

        return organizationalUnits;
    }
View Full Code Here

Examples of org.guvnor.rest.client.OrganizationalUnit

        Collection<org.guvnor.structure.organizationalunit.OrganizationalUnit> origOrgUnits
                = organizationalUnitService.getOrganizationalUnits();

        List<OrganizationalUnit> organizationalUnits = new ArrayList<OrganizationalUnit>();
        for ( org.guvnor.structure.organizationalunit.OrganizationalUnit ou : origOrgUnits ) {
            OrganizationalUnit orgUnit = new OrganizationalUnit();
            orgUnit.setName( ou.getName() );
            orgUnit.setOwner( ou.getOwner() );
            List<String> repoNames = new ArrayList<String>();
            for ( Repository r : ou.getRepositories() ) {
                repoNames.add( r.getAlias() );
            }
            orgUnit.setRepositories( repoNames );
            organizationalUnits.add( orgUnit );
        }

        return organizationalUnits;
    }
View Full Code Here

Examples of org.guvnor.rest.client.OrganizationalUnit

    public OrganizationalUnit getOrganizationalUnit( @PathParam("organizationalUnitName") String organizationalUnitName ) {
        logger.debug( "-----getOrganizationalUnit ---, OrganizationalUnit name: {}", organizationalUnitName );
        org.guvnor.structure.organizationalunit.OrganizationalUnit origOrgUnit
                = checkOrganizationalUnitExistence( organizationalUnitName );

        OrganizationalUnit orgUnit = new OrganizationalUnit();
        orgUnit.setName( origOrgUnit.getName() );
        orgUnit.setOwner( origOrgUnit.getOwner() );
        List<String> repoNames = new ArrayList<String>();
        for ( Repository r : origOrgUnit.getRepositories() ) {
            repoNames.add( r.getAlias() );
        }
        orgUnit.setRepositories( repoNames );

        return orgUnit;
    }
View Full Code Here

Examples of org.guvnor.structure.organizationalunit.OrganizationalUnit

                                                                      put( "crypt:password", DROOLS_WB_PLAYGROUND_PWD );
                                                                  }} );
            }

            // TODO in case Organizational Units are not defined
            OrganizationalUnit organizationalUnit1 = organizationalUnitService.getOrganizationalUnit( DROOLS_WB_ORGANIZATIONAL_UNIT1 );
            if ( organizationalUnit1 == null ) {
                final List<Repository> repositories = new ArrayList<Repository>();
                repositories.add( repository1 );
                organizationalUnitService.createOrganizationalUnit( DROOLS_WB_ORGANIZATIONAL_UNIT1,
                                                                    DROOLS_WB_ORGANIZATIONAL_UNIT1_OWNER,
View Full Code Here

Examples of org.guvnor.structure.organizationalunit.OrganizationalUnit

            result.setStatus( JobStatus.BAD_REQUEST );
            result.setResult( "OrganizationalUnit name and owner must be provided" );
            return result;
        }

        OrganizationalUnit organizationalUnit = null;
        List<org.guvnor.structure.repositories.Repository> repositories = new ArrayList<org.guvnor.structure.repositories.Repository>();
        if ( repositoryNameList != null && repositoryNameList.size() > 0 ) {
            for ( String repoName : repositoryNameList ) {
                org.uberfire.java.nio.file.Path repositoryPath = getRepositoryRootPath( repoName );

                if ( repositoryPath == null ) {
                    result.setStatus( JobStatus.RESOURCE_NOT_EXIST );
                    result.setResult( "Repository [" + repoName + "] does not exist" );
                    return result;
                }
                GitRepository repo = new GitRepository( repoName );
                repositories.add( repo );
            }
            organizationalUnit = organizationalUnitService.createOrganizationalUnit( organizationalUnitName,
                                                                                     organizationalUnitOwner,
                                                                                     repositories );
        } else {
            organizationalUnit = organizationalUnitService.createOrganizationalUnit( organizationalUnitName,
                                                                                     organizationalUnitOwner );
        }

        if ( organizationalUnit != null ) {
            result.setResult( "OrganizationalUnit " + organizationalUnit.getName() + " is created successfully." );
            result.setStatus( JobStatus.SUCCESS );
        } else {
            result.setStatus( JobStatus.FAIL );
        }
        return result;
View Full Code Here

Examples of org.guvnor.structure.organizationalunit.OrganizationalUnit

            result.setStatus( JobStatus.RESOURCE_NOT_EXIST );
            result.setResult( "Repository [" + repositoryName + "] does not exist" );
            return result;
        }

        OrganizationalUnit organizationalUnit = new OrganizationalUnitImpl( organizationalUnitName,
                                                                            null );

        GitRepository repo = new GitRepository( repositoryName );
        try {
            organizationalUnitService.addRepository( organizationalUnit,
                                                     repo );
        } catch ( IllegalArgumentException e ) {
            result.setStatus( JobStatus.BAD_REQUEST );
            result.setResult( "OrganizationalUnit " + organizationalUnit.getName() + " not found" );
            return result;
        }

        result.setStatus( JobStatus.SUCCESS );
        return result;
View Full Code Here

Examples of org.guvnor.structure.organizationalunit.OrganizationalUnit

            result.setStatus( JobStatus.RESOURCE_NOT_EXIST );
            result.setResult( "Repository [" + repositoryName + "] does not exist" );
            return result;
        }

        OrganizationalUnit organizationalUnit = new OrganizationalUnitImpl( organizationalUnitName, null );
        GitRepository repo = new GitRepository( repositoryName );
        try {
            organizationalUnitService.removeRepository( organizationalUnit,
                                                        repo );
        } catch ( IllegalArgumentException e ) {
            result.setStatus( JobStatus.BAD_REQUEST );
            result.setResult( "OrganizationalUnit " + organizationalUnit.getName() + " not found" );
            return result;
        }

        result.setStatus( JobStatus.SUCCESS );
        return result;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.