Package org.drools.guvnor.server.builder

Examples of org.drools.guvnor.server.builder.ModuleAssembler


        ModuleItem p = rulesRepository.loadModule(packageName, versionNumber);
        byte[] result = p.getCompiledBinaryBytes();
       
        //REVISIT: https://issues.jboss.org/browse/GUVNOR-1232: Force a package rebuild before every package check in operation.
        if (result != null) {
            ModuleAssembler moduleAssembler = ModuleAssemblerManager.getModuleAssembler(p.getFormat(), p, null);
            String fileName = packageName + "." + moduleAssembler.getBinaryExtension();
            return Response.ok(result).header("Content-Disposition", "attachment; filename=" + fileName).
                    header("Last-Modified", createDateFormat().format(this.convertToGmt(p.getLastModified()).getTime())).build();
        } else {
            return Response.status(500).entity("This package version has no compiled binary").type("text/plain").build();
        }
View Full Code Here


        rulesRepository.createModuleSnapshot( moduleName,
                snapshotName );
        ModuleItem item = rulesRepository.loadModuleSnapshot( moduleName,
                snapshotName );
       ModuleAssembler moduleAssembler = ModuleAssemblerManager.getModuleAssembler(item.getFormat(), item, assemblerConfiguration);
       List<AssetItem>  listAssets= moduleAssembler.getAllNotToIncludeAssets();
       for (AssetItem itemToDelete : listAssets){
           itemToDelete.remove();
       }
       
        item.updateCheckinComment( comment );
View Full Code Here

        if ( !force && item.isBinaryUpToDate() ) {
            // we can just return all OK if its up to date.
            return BuilderResult.emptyResult();
        }
       
        ModuleAssembler moduleAssembler = ModuleAssemblerManager.getModuleAssembler(item.getFormat(), item, moduleAssemblerConfiguration);
        moduleAssembler.compile();

        if ( moduleAssembler.hasErrors() ) {
            BuilderResult result = new BuilderResult();
            BuilderResultHelper builderResultHelper = new BuilderResultHelper();
            result.addLines( builderResultHelper.generateBuilderResults( moduleAssembler.getErrors() ) );
            return result;
        }

        return BuilderResult.emptyResult();
    }
View Full Code Here

                        null ) );
    }

    protected String buildModuleSource(String moduleUUID) throws SerializationException {
        ModuleItem item = rulesRepository.loadModuleByUUID( moduleUUID );
        ModuleAssembler moduleAssembler = ModuleAssemblerManager.getModuleAssembler(item.getFormat(), item, null);
        return moduleAssembler.getCompiledSource();
    }
View Full Code Here

    //Drools specific
    protected String[] listRulesInPackage(String packageName) throws SerializationException {
        ModuleItem item = rulesRepository.loadModule( packageName );

        ModuleAssembler moduleAssembler = ModuleAssemblerManager.getModuleAssembler(item.getFormat(), item, null);

        List<String> result = new ArrayList<String>();
        try {

            String drl = moduleAssembler.getCompiledSource();
            if ( drl == null || "".equals( drl ) ) {
                return new String[0];
            } else {
                parseRulesToPackageList( moduleAssembler,
                        result );
View Full Code Here

                                    boolean isLatest,
                                    OutputStream out) throws IOException {
        ModuleItem item = null;
        if ( isLatest ) {
            item = repository.loadModule( packageName );
            ModuleAssembler moduleAssembler = ModuleAssemblerManager.getModuleAssembler(item.getFormat(), item, null);
            String drl = moduleAssembler.getCompiledSource();
            out.write( drl.getBytes() );
            out.flush();
            return packageName + ".drl";
        } else {
            item = repository.loadModuleSnapshot( packageName,
                                                   packageVersion );
            ModuleAssembler moduleAssembler = ModuleAssemblerManager.getModuleAssembler(item.getFormat(), item, null);
            String drl = moduleAssembler.getCompiledSource();
            out.write( drl.getBytes() );
            out.flush();
            return packageName + "_" + URLEncoder.encode( packageVersion,
                                                          "UTF-8" ) + ".drl";
        }
View Full Code Here

        if ( !force && item.isBinaryUpToDate() ) {
            // we can just return all OK if its up to date.
            return BuilderResult.emptyResult();
        }
       
        ModuleAssembler moduleAssembler = ModuleAssemblerManager.getModuleAssembler(item.getFormat(), item, moduleAssemblerConfiguration);
        moduleAssembler.compile();

        if ( moduleAssembler.hasErrors() ) {
            BuilderResult result = new BuilderResult();
            BuilderResultHelper builderResultHelper = new BuilderResultHelper();
            result.addLines( builderResultHelper.generateBuilderResults( moduleAssembler.getErrors() ) );
            return result;
        }

        return BuilderResult.emptyResult();
    }
View Full Code Here

                        null ) );
    }

    protected String buildModuleSource(String moduleUUID) throws SerializationException {
        ModuleItem item = rulesRepository.loadModuleByUUID( moduleUUID );
        ModuleAssembler moduleAssembler = ModuleAssemblerManager.getModuleAssembler(item.getFormat(), item, null);
        return moduleAssembler.getCompiledSource();
    }
View Full Code Here

    //Drools specific
    protected String[] listRulesInPackage(String packageName) throws SerializationException {
        ModuleItem item = rulesRepository.loadModule( packageName );

        ModuleAssembler moduleAssembler = ModuleAssemblerManager.getModuleAssembler(item.getFormat(), item, null);

        List<String> result = new ArrayList<String>();
        try {

            String drl = moduleAssembler.getCompiledSource();
            if ( drl == null || "".equals( drl ) ) {
                return new String[0];
            } else {
                parseRulesToPackageList( moduleAssembler,
                        result );
View Full Code Here

                                    boolean isLatest,
                                    OutputStream out) throws IOException {
        ModuleItem item = null;
        if ( isLatest ) {
            item = repository.loadModule( packageName );
            ModuleAssembler moduleAssembler = ModuleAssemblerManager.getModuleAssembler(item.getFormat(), item, null);
            String drl = moduleAssembler.getCompiledSource();
            out.write( drl.getBytes() );
            out.flush();
            return packageName + ".drl";
        } else {
            item = repository.loadModuleSnapshot( packageName,
                                                   packageVersion );
            ModuleAssembler moduleAssembler = ModuleAssemblerManager.getModuleAssembler(item.getFormat(), item, null);
            String drl = moduleAssembler.getCompiledSource();
            out.write( drl.getBytes() );
            out.flush();
            return packageName + "_" + URLEncoder.encode( packageVersion,
                                                          "UTF-8" ) + ".drl";
        }
View Full Code Here

TOP

Related Classes of org.drools.guvnor.server.builder.ModuleAssembler

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.