Package org.drools.repository

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


                } catch ( Exception e ) {
                    //default
                    asset.updateBinaryContentAttachment( content );
                }
            } else {
                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.updateValid(assetValidator.validate(asset));
View Full Code Here


                    while ( (line = reader.readLine()) != null ) {
                        if ( !line.startsWith( "package " ) ) {
                            sb.append( line ).append( "\n" );
                        }
                    }
                    asset.updateBinaryContentAttachment( new ByteArrayInputStream( sb.toString().getBytes( "UTF-8" ) ) );
                } catch ( Exception e ) {
                    //default
                    asset.updateBinaryContentAttachment( content );
                }
            } else {
View Full Code Here

                        }
                    }
                    asset.updateBinaryContentAttachment( new ByteArrayInputStream( sb.toString().getBytes( "UTF-8" ) ) );
                } catch ( Exception e ) {
                    //default
                    asset.updateBinaryContentAttachment( content );
                }
            } else {
                asset.updateBinaryContentAttachment( content );
            }
            //here we could save, or check in, depending on if enough time has passed to justify
View Full Code Here

                } catch ( Exception e ) {
                    //default
                    asset.updateBinaryContentAttachment( content );
                }
            } else {
                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.updateValid(assetValidator.validate(asset));
View Full Code Here

        //here we should mark the binary data as invalid on the package (which means moving something into repo modle)

        AssetItem item = repository.loadAssetByUUID( uuid );

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

        // Special treatment for model and ruleflow attachments.
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 = rulesRepository.loadModule(packageName).loadAsset(assetName);
            asset.checkout();
            asset.updateBinaryContentAttachment(is);
            asset.checkin("Update binary");
            rulesRepository.save();
        } catch (Exception e) {
            throw new WebApplicationException(e);
        }
View Full Code Here

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

        AssetItem ai = rulesRepository.loadModule(packageName).loadAsset(assetName);
        ai.checkout();
        ai.updateDescription(asset.getDescription());
        ai.updateBinaryContentAttachmentFileName(asset.getBinaryContentAttachmentFileName());
        ai.updateFormat(asset.getMetadata().getFormat());
        ai.updateBinaryContentAttachment(is);
        ai.getModule().updateBinaryUpToDate(false);
        ai.checkin(asset.getMetadata().getCheckInComment());
        rulesRepository.save();
        return asset;
    }
View Full Code Here

                    i.close();
                    jos.closeEntry();
                }
            }

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

            item.checkin("Updated " + fileName);

        } catch (IOException e) {
View Full Code Here

        //here we should mark the binary data as invalid on the package (which means moving something into repo modle)

        AssetItem item = repository.loadAssetByUUID( uuid );

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

        // Special treatment for model and ruleflow attachments.
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.