Package org.drools.repository

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


        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 (Exception 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 (Exception e) {
            throw new WebApplicationException(e);
        }
    }
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

        AssetItem conf;
        if ( pkg.containsAsset( "drools" ) ) {
            conf = pkg.loadAsset( "drools" );
            conf.updateContent( string );

            conf.checkin( "" );
        } else {
            conf = pkg.addAsset( "drools",
                                 "" );
            conf.updateFormat( "package" );
            conf.updateContent( string );
View Full Code Here

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

            conf.checkin( "" );
        }

    }
}
View Full Code Here

        if (!asset.getFormat().equals(AssetFormats.TEST_SCENARIO) || asset.getFormat().equals(AssetFormats.ENUMERATION)) {
            ModuleItem pkg = repoAsset.getModule();
            pkg.updateBinaryUpToDate(false);
            RuleBaseCache.getInstance().remove(pkg.getUUID());
        }
        repoAsset.checkin(asset.getCheckinComment());

        return repoAsset.getUUID();
    }

    private Calendar dateToCalendar(Date date) {
View Full Code Here

            PackageItem pkg = ctx.repository.loadPackage( toPackageName( path ) );
            String name = file.substring( 0,
                                          file.indexOf( '.' ) );
            AssetItem asset = pkg.loadAsset( name );
            asset.updateContent( new String( newContent ) );
            asset.checkin( ctx.message );
        }
    }

    public static class CopyFile
        implements
View Full Code Here

          } else {
            asset.updateBinaryContentAttachment(in);
          }
        }

        asset.checkin(comment);
      }
    } else {
      throw new IllegalArgumentException("Unknown rest path for post.");
    }
  }
View Full Code Here

        if (as.isBinary()) {
          as.updateBinaryContentAttachment(in);
        } else {
          as.updateContent(readContent(in));
        }
        as.checkin(comment);
      }

    } else {
      throw new IllegalArgumentException("Unknown rest path for put");
    }
View Full Code Here

    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

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.