Package org.drools.repository

Examples of org.drools.repository.RulesRepository.loadPackage()


                                         "" );
        asset.updateFormat( AssetFormats.DSL );
        asset.updateContent( dsl );
        asset.checkin( "ok" );

        item = repo.loadPackage( "testLoadDSLs" );
        BRMSSuggestionCompletionLoader loader = new BRMSSuggestionCompletionLoader();

        SuggestionCompletionEngine eng = loader.getSuggestionEngine( item );
        assertFalse( eng.hasDataEnumLists() );
        assertFalse( loader.hasErrors() );
View Full Code Here


                                         "" );
        asset.updateFormat( AssetFormats.ENUMERATION );
        asset.updateContent( enumeration );
        asset.checkin( "ok" );

        item = repo.loadPackage( "testLoadEnums" );
        BRMSSuggestionCompletionLoader loader = new BRMSSuggestionCompletionLoader();
        SuggestionCompletionEngine sce = loader.getSuggestionEngine( item );

        assertFalse( loader.hasErrors() );
        assertEquals( 1,
View Full Code Here

        assertEquals( 1,
                      sce.getDataEnumListsSize() );

        asset.updateContent( "goober boy" );
        asset.checkin( "yeah" );
        item = repo.loadPackage( "testLoadEnums" );
        loader = new BRMSSuggestionCompletionLoader();
        sce = loader.getSuggestionEngine( item );
        assertTrue( loader.hasErrors() );

    }
View Full Code Here

            if ( path.length > 2 ) {
                throw new UnsupportedOperationException( "Can't nest packages." );
            }
            RulesRepository repository = getRepo();
            if ( repository.containsPackage( path[1] ) ) {
                PackageItem pkg = repository.loadPackage( path[1] );
                pkg.archiveItem( false );
                pkg.checkin( "<restored by webdav>" );
            } else {
                repository.createPackage( path[1],
                                          "<from webdav>" );
View Full Code Here

                throw new UnsupportedOperationException( "Can't do nested packages." );
            }
            String packageName = path[1];
            String[] resource = AssetItem.getAssetNameFromFileName( path[2] );
            RulesRepository repository = getRepo();
            PackageItem pkg = repository.loadPackage( packageName );

            //for mac OSX, ignore these resource fork files
            if ( path[2].startsWith( "._" ) ) {
                this.osxDoubleData.put( uri,
                                        null );
View Full Code Here

            if ( path.length == 1 ) {
                listPackages( repository,
                              result );
            } else if ( checkPackagePermission( path[1],
                                                RoleTypes.PACKAGE_READONLY ) ) {
                PackageItem pkg = repository.loadPackage( path[1] );
                Iterator<AssetItem> it = pkg.getAssets();
                while ( it.hasNext() ) {
                    AssetItem asset = it.next();
                    if ( !asset.isArchived() ) {
                        result.add( asset.getName() + "." + asset.getFormat() );
View Full Code Here

        RulesRepository repository = getRepo();
        String[] path = getPath( uri );
        if ( path.length < 2 ) return new Date();
        if ( path[0].equals( "packages" ) && checkPackagePermission( path[1],
                                                                     RoleTypes.PACKAGE_READONLY ) ) {
            PackageItem pkg = repository.loadPackage( path[1] );
            if ( path.length == 2 ) {
                //dealing with package
                return pkg.getCreatedDate().getTime();
            } else {
                String fileName = path[2];
View Full Code Here

        RulesRepository repository = getRepo();
        String[] path = getPath( uri );
        if ( path.length < 2 ) return new Date();
        if ( path[0].equals( "packages" ) && checkPackagePermission( path[1],
                                                                     RoleTypes.PACKAGE_READONLY ) ) {
            PackageItem pkg = repository.loadPackage( path[1] );
            if ( path.length == 2 ) {
                //dealing with package
                return pkg.getLastModified().getTime();
            } else {
                String fileName = path[2];
View Full Code Here

            return so;
        }
        if ( path[0].equals( "packages" ) && checkPackagePermission( path[1],
                                                                     RoleTypes.PACKAGE_READONLY ) ) {
            PackageItem pkg = repository.loadPackage( path[1] );
            if ( path.length == 2 ) {
                //dealing with package
                return createStoredObject( uri,
                                           pkg,
                                           0 );
View Full Code Here

        String[] path = getPath( uri );
        if ( path[0].equals( "packages" ) && checkPackagePermission( path[1],
                                                                     RoleTypes.PACKAGE_READONLY ) ) {
            String pkg = path[1];
            String asset = AssetItem.getAssetNameFromFileName( path[2] )[0];
            AssetItem assetItem = repository.loadPackage( pkg ).loadAsset( asset );
            return getAssetData( assetItem );
        } else if ( path[0].equals( "snapshots" ) && checkPackagePermission( path[1],
                                                                             RoleTypes.PACKAGE_READONLY ) ) {
            String pkg = path[1];
            String snap = path[2];
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.