Package org.drools.repository

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


            conf = pkg.addAsset( "drools",
                                 "" );
            conf.updateFormat( "package" );
            conf.updateContent( string );

            conf.checkin( "" );
        }

    }
}
View Full Code Here


        AssetItem item = repository.loadAssetByUUID( uuid );

        item.updateBinaryContentAttachment( fileData );
        item.updateBinaryContentAttachmentFileName( fileName );
        item.getPackage().updateBinaryUpToDate( false );
        item.checkin( "Attached file: " + fileName );

        // Special treatment for model and ruleflow attachments.
        ContentHandler handler = ContentManager.getHandler( item.getFormat() );
        if ( handler instanceof ICanHasAttachment ) {
            ((ICanHasAttachment) handler).onAttachmentAdded( item );
View Full Code Here

            if ( existing && pkg.containsAsset( as.name ) ) {
                AssetItem asset = pkg.loadAsset( as.name );
                if ( asset.getFormat().equals( as.format ) ) {
                    asset.updateContent( as.content );
                    if ( newVer ) asset.checkin( "Imported change form external DRL" );
                } //skip it if not the right format

            } else {

                AssetItem asset = pkg.addAsset( as.name,
View Full Code Here

                                                "<imported>" );
                asset.updateFormat( as.format );

                asset.updateContent( as.content );
                asset.updateExternalSource( "Imported from external DRL" );
                if ( newVer ) asset.checkin( "Imported change form external DRL" );

            }
        }

        repository.save();
View Full Code Here

                    return;
                }
                AssetItem item = loadAssetItemFromPackageItem(packageItem,
                        path[2]);
                item.archiveItem(true);
                item.checkin("");
            } else {
                //delete package
                packageItem.archiveItem(true);
                packageItem.checkin("");
            }
View Full Code Here

                    return;
                }
                AssetItem item = loadAssetItemFromGlobalArea(repository,
                        path);
                item.archiveItem(true);
                item.checkin("");
            }
        } else {
            throw new IllegalArgumentException("Not allowed to remove this file.");
        }
View Full Code Here

                asset.updateBinaryContentAttachment(content);
            }
            //here we could save, or check in, depending on if enough time has passed to justify
            //a new version. Otherwise we will pollute the version history with lots of trivial versions.
            //if (shouldCreateNewVersion(asset.getLastModified())) {
            asset.checkin("<content from webdav>");
            //}
        } else if (isGlobalAreas(path)) {
            if (path[1].startsWith("._")) {
                try {
                    WebDAVImpl.osxDoubleData.put(uri,
View Full Code Here

                asset.updateBinaryContentAttachment(content);
            }
            //here we could save, or check in, depending on if enough time has passed to justify
            //a new version. Otherwise we will pollute the version history with lots of trivial versions.
            //if (shouldCreateNewVersion(asset.getLastModified())) {
            asset.checkin("<content from webdav>");
            //}
        } else {
            throw new UnsupportedOperationException("Unable to save content to this location.");
        }
View Full Code Here

            }

            item.updateBinaryContentAttachment(new ByteArrayInputStream(bais
                    .toByteArray()));

            item.checkin("Updated " + fileName);

        } catch (IOException e) {
            throw new RulesRepositoryException(e);
        } finally {
            if (jis != null) {
View Full Code Here

    public void startServers() throws Exception {
        ModuleItem pkgA = rulesRepository.createModule("applyChangeSetTwice",
                "this is package applyChangeSetTwice");
        AssetItem ruleA1 = pkgA.addAsset("ruleA1", "", null, AssetFormats.DRL);
        ruleA1.updateContent("rule 'ruleA1' when org.drools.Person() then end");
        ruleA1.checkin("version 1");
        AssetItem ruleA2 = pkgA.addAsset("ruleA2", "", null, AssetFormats.DRL);
        ruleA2.updateContent("rule 'ruleA2' when org.drools.Person() then end");
        ruleA2.checkin("version 1");
        repositoryPackageService.createModuleSnapshot(pkgA.getName(), "snapshotA1", false, "",false,"","","",false,"","",false,"");
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.