Package org.drools.repository

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


    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

        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

        PackageAssembler asm = new PackageAssembler(pkg);
        asm.compile();
        assertTrue(asm.hasErrors());

        rule2.archiveItem(true);
        rule2.checkin("");

        assertTrue(rule2.isArchived());
        asm = new PackageAssembler(pkg);
        asm.compile();
View Full Code Here

    RestAPI api = new RestAPI(repo);
    Text res = (Text) api.get("packages/testVersionHistoryAndArchived");
    System.err.println(res.data);
    assertTrue(res.data.indexOf("asset2.drl") > -1);

    asset2.archiveItem(true);
    asset2.checkin("");

    res = (Text) api.get("packages/testVersionHistoryAndArchived");
    assertEquals(-1, res.data.indexOf("asset2.drl"));
View Full Code Here

        repo.save();

        ContentPackageAssembler asm = new ContentPackageAssembler( pkg );
        assertTrue( asm.hasErrors() );

        rule2.archiveItem( true );
        rule2.checkin( "" );

        assertTrue( rule2.isArchived() );
        asm = new ContentPackageAssembler( pkg );
        assertFalse( asm.hasErrors() );
View Full Code Here

                PackageItem pkg = repo.loadPackage(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 = repo.loadPackage(bits[1]).loadAsset(fileName);
            asset.archiveItem(true);
            asset.checkin("<removed remotely>");
        }
        else {
            throw new IllegalArgumentException("Unknown rest path for delete");
        }
View Full Code Here

    void handleArchivedForSavePackage(PackageConfigData data,
                                      PackageItem 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( packageLastModified ) >= 0 ) {
                assetItem.archiveItem( false );
                assetItem.checkin( data.getDescription() );
            }
        }
    }
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.