Package org.drools.repository

Examples of org.drools.repository.AssetItem.archiveItem()


                if ( path[1].startsWith( "._" ) ) {
                    WebDAVImpl.osxDoubleData.remove( uri );
                    return;
                }
                AssetItem item = loadAssetItemFromGlobalArea( path );
                item.archiveItem( true );
                item.checkin( "" );
            }
        } else {
            throw new IllegalArgumentException( "Not allowed to remove this file." );
        }
View Full Code Here


    void handleArchivedForSaveModule(Module data,
                                      ModuleItem item) {
        for (Iterator<AssetItem> iter = item.getAssets(); iter.hasNext(); ) {
            AssetItem assetItem = iter.next();
            if ( !assetItem.isArchived() ) {
                assetItem.archiveItem( true );
                assetItem.checkin( data.getDescription() );
            }
        }
    }
View Full Code Here

        for (Iterator<AssetItem> iter = item.getAssets(); iter.hasNext(); ) {
            AssetItem assetItem = iter.next();
            // Unarchive the assets archived after the package
            // ( == at the same time that the package was archived)
            if ( assetItem.getLastModified().compareTo( lastModified ) >= 0 ) {
                assetItem.archiveItem( false );
                assetItem.checkin( data.getDescription() );
            }
        }
    }
View Full Code Here

    void handleArchivedForSaveModule(Module data,
                                      ModuleItem item) {
        for (Iterator<AssetItem> iter = item.getAssets(); iter.hasNext(); ) {
            AssetItem assetItem = iter.next();
            if ( !assetItem.isArchived() ) {
                assetItem.archiveItem( true );
                assetItem.checkin( data.getDescription() );
            }
        }
    }
View Full Code Here

        for (Iterator<AssetItem> iter = item.getAssets(); iter.hasNext(); ) {
            AssetItem assetItem = iter.next();
            // Unarchive the assets archived after the package
            // ( == at the same time that the package was archived)
            if ( assetItem.getLastModified().compareTo( lastModified ) >= 0 ) {
                assetItem.archiveItem( false );
                assetItem.checkin( data.getDescription() );
            }
        }
    }
View Full Code Here

            }
        } catch ( IOException e ) {
            log.error( "Unable to remove asset attachment",
                       e );
        }
        item.archiveItem( archive );
        ModuleItem pkg = item.getModule();
        pkg.updateBinaryUpToDate( false );
        RuleBaseCache.getInstance().remove( pkg.getUUID() );
        if ( archive ) {
            item.checkin( "archived" );
View Full Code Here

                ModuleItem pkg = rulesRepository.loadModule(bits[1]);
                AssetItem asset;
                if (pkg.containsAsset(a[0])) {
                    asset = pkg.loadAsset(a[0]);
                    if (asset.isArchived()) {
                        asset.archiveItem(false);
                    } else {
                        throw new RulesRepositoryException("The file " + path + " already exists, and was not archived.");
                    }
                    if (asset.isBinary()) {
                        asset.updateBinaryContentAttachment(in);
View Full Code Here

    public void delete(String path) throws UnsupportedEncodingException {
        String[] bits = split(path);
        if (bits[0].equals("packages")) {
            String fileName = bits[2].split("\\.")[0];
            AssetItem asset = rulesRepository.loadModule(bits[1]).loadAsset(fileName);
            asset.archiveItem(true);
            asset.checkin("<removed remotely>");
        }
        else {
            throw new IllegalArgumentException("Unknown rest path for delete");
        }
View Full Code Here

        AssetItem rule1 = it.addAsset( "rule_1",
                                       "" );
        rule1.updateFormat( AssetFormats.DRL );
        rule1.updateContent( "rule 'rule1' \n when \np : Person() \n then \np.setAge(42); \n end" );
        rule1.archiveItem( true );
        rule1.checkin( "" );
        impl.getRulesRepository().save();

        repositoryPackageService.savePackage( data );
        data = repositoryPackageService.loadPackageConfig( uuid );
View Full Code Here

        AssetItem rule1 = it.addAsset( "rule_1",
                                       "" );
        rule1.updateFormat( AssetFormats.DRL );
        rule1.updateContent( "rule 'rule1' \n when \np : Person() \n then \np.setAge(42); \n end" );
        rule1.archiveItem( true );
        rule1.checkin( "" );
        impl.getRulesRepository().save();

        repositoryPackageService.savePackage( data );
        data = repositoryPackageService.loadPackageConfig( uuid );
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.