Package org.drools.repository

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


  private void migratePackage(PackageItem pkg) {
    if (!pkg.containsAsset("drools")) {
      AssetItem asset = pkg.addAsset("drools", "");
      asset.updateFormat("package");
      asset.updateContent(pkg.getStringProperty(PackageItem.HEADER_PROPERTY_NAME));
      asset.checkin("");
    }
  }


}
View Full Code Here


        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.
        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 from 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 from external DRL" );

            }
        }

        repository.save();
View Full Code Here

            if (extension != null) {
                ai.updateFormat(extension);
            }
            ai.updateBinaryContentAttachment(is);
            ai.getModule().updateBinaryUpToDate(false);
            ai.checkin("update binary");
            rulesRepository.save();
            return toAssetEntryAbdera(ai, uriInfo);
        } catch (RuntimeException e) {
            //catch RulesRepositoryException and other exceptions. For example when the package already exists.
            throw new WebApplicationException(e);
View Full Code Here

                ai.updateCategoryList(categories);
            }
            if (state != null) {
                ai.updateState(state);
            }
            ai.checkin("Check-in (summary): " + assetEntry.getSummary());
            rulesRepository.save();
        } catch (RuntimeException e) {
            throw new WebApplicationException(e);
        }
    }
View Full Code Here

            AssetItem ai = rulesRepository.loadModule(packageName).loadAsset(assetName);
            /* Update asset */
            ai.checkout();
            ai.updateTitle(asset.getTitle());
            ai.updateDescription(asset.getDescription());
            ai.checkin(asset.getMetadata().getCheckInComment());
            rulesRepository.save();
        } catch (RuntimeException e) {
            throw new WebApplicationException(e);
        }
    }
View Full Code Here

        try {
            //Throws RulesRepositoryException if the package or asset does not exist
            AssetItem asset = rulesRepository.loadModule(packageName).loadAsset(assetName);
            asset.checkout();
            asset.updateContent(content);
            asset.checkin("Updated asset source from REST interface");
            rulesRepository.save();
        } catch (RuntimeException e) {
            throw new WebApplicationException(e);
        }
    }
View Full Code Here

        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 (RuntimeException e) {
            throw new WebApplicationException(e);
        }
    }
View Full Code Here

        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;
    }

    @PUT
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.