Package org.drools.repository

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


                                              "" );
        AssetItem model = pkg.addAsset( "model",
                                        "qed" );
        model.updateFormat( AssetFormats.MODEL );

        model.updateBinaryContentAttachment( this.getClass().getResourceAsStream( "/billasurf.jar" ) );
        model.checkin( "" );

        ServiceImplementation.updateDroolsHeader( "import com.billasurf.Board\n global com.billasurf.Person customer",
                                                  pkg );
View Full Code Here


        PackageItem pkg = repo.createPackage( "testErrorsInRuleAsset",
                                              "" );
        AssetItem model = pkg.addAsset( "model",
                                        "qed" );
        model.updateFormat( AssetFormats.MODEL );
        model.updateBinaryContentAttachment( this.getClass().getResourceAsStream( "/billasurf.jar" ) );
        model.checkin( "" );
        ServiceImplementation.updateDroolsHeader( "import com.billasurf.Board\n global com.billasurf.Person customer",
                                                  pkg );
        repo.save();
View Full Code Here

                                              "" );
        AssetItem model = pkg.addAsset( "model",
                                        "qed" );
        model.updateFormat( AssetFormats.MODEL );

        model.updateBinaryContentAttachment( this.getClass().getResourceAsStream( "/eventing-example.jar" ) );
        model.checkin( "" );

        ServiceImplementation.updateDroolsHeader( "import org.drools.examples.eventing.EventRequest\n",
                                                  pkg );
        AssetItem asset = pkg.addAsset("whee", "");
View Full Code Here

                        asset.archiveItem(false);
                    } else {
                        throw new RulesRepositoryException("The file " + path + " already exists, and was not archived.");
                    }
                    if (asset.isBinary()) {
                        asset.updateBinaryContentAttachment(in);
                    } else {
                        asset.updateContent(readContent(in));
                    }
                } else {
                    asset = pkg.addAsset(a[0], "<added remotely>");
View Full Code Here

                    asset = pkg.addAsset(a[0], "<added remotely>");
                    asset.updateFormat(a[1]);
                    if (TEXT_ASSET_TYPES.containsKey(a[1])) {
                        asset.updateContent(readContent(in));
                    } else {
                        asset.updateBinaryContentAttachment(in);
                    }
                }

                asset.checkin(comment);
            }
View Full Code Here

                AssetItem as = pkg.loadAsset(a[0]);
                if (lastModified != null && as.getLastModified().after(lastModified)) {
                    throw new RulesRepositoryException("The asset was modified by: " + as.getLastContributor() + ", unable to write changes.");
                }
                if (as.isBinary()) {
                    as.updateBinaryContentAttachment(in);
                } else {
                    as.updateContent(readContent(in));
                }
                as.checkin(comment);
            }
View Full Code Here

            ai.checkout();
            ai.updateBinaryContentAttachmentFileName(fileName);
            if (extension != null) {
                ai.updateFormat(extension);
            }
            ai.updateBinaryContentAttachment(is);
            ai.getPackage().updateBinaryUpToDate(false);
            ai.checkin("update binary");
            repository.save();
            return toAssetEntryAbdera(ai, uriInfo);
        } catch (Exception e) {
View Full Code Here

    public void updateAssetBinary(@PathParam("packageName") String packageName, @PathParam("assetName") String assetName, InputStream is) {
        try {
            //Throws RulesRepositoryException if the package or asset does not exist
            AssetItem asset = repository.loadPackage(packageName).loadAsset(assetName);
            asset.checkout();
            asset.updateBinaryContentAttachment(is);
            asset.checkin("Update binary");
            repository.save();
        } catch (Exception e) {
            throw new WebApplicationException(e);
        }
View Full Code Here

       
        AssetItem ai = repository.loadPackage(packageName).addAsset(assetName, asset.getDescription());
        ai.checkout();
        ai.updateBinaryContentAttachmentFileName(asset.getMetadata().getBinaryContentAttachmentFileName());
        ai.updateFormat(asset.getMetadata().getFormat());
        ai.updateBinaryContentAttachment(is);
        ai.getPackage().updateBinaryUpToDate(false);
        ai.checkin(asset.getCheckInComment());
        repository.save();
        return asset;
    }
View Full Code Here

        AssetItem ai = repository.loadPackage(packageName).loadAsset(assetName);
        ai.checkout();
        ai.updateDescription(asset.getDescription());
        ai.updateBinaryContentAttachmentFileName(asset.getMetadata().getBinaryContentAttachmentFileName());
        ai.updateFormat(asset.getMetadata().getFormat());
        ai.updateBinaryContentAttachment(is);
        ai.getPackage().updateBinaryUpToDate(false);
        ai.checkin(asset.getCheckInComment());
        repository.save();
        return asset;
    }
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.