Examples of updateContent()


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

            String format = tk.nextToken();

            AssetItem asset = pkg.addAsset( name,
                                            ctx.message );
            asset.updateFormat( format );
            asset.updateContent( new String( content ) );
        }
    }

    /**
     * root should be the last, previously created, parent folder. Each directory in the path
View Full Code Here

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

            RepositoryContext ctx = (RepositoryContext) context;
            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
View Full Code Here

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

            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>");
          asset.updateFormat(a[1]);
          if (TEXT_ASSET_TYPES.containsKey(a[1])) {
View Full Code Here

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

          }
        } else {
          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);
          }
        }
View Full Code Here

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

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

    } else {
View Full Code Here

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

            String format = tk.nextToken();

            AssetItem asset = pkg.addAsset( name,
                                            ctx.message );
            asset.updateFormat( format );
            asset.updateContent( new String( content ) );
        }
    }

    /**
     * root should be the last, previously created, parent folder. Each directory in the path
View Full Code Here

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

  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

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

        for ( Asset as : imp.getAssets() ) {

            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 {
View Full Code Here

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

                AssetItem asset = pkg.addAsset( as.name,
                                                "<imported>" );
                asset.updateFormat( as.format );

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

            }
        }
View Full Code Here

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

                ai.updateFormat(format);
            }
           
            //REVISIT: What if the client really wants to set content to ""?
            if (assetEntry.getContent() != null && !"".equals(assetEntry.getContent())) {
                ai.updateContent(assetEntry.getContent());
            }
            if (categories != null) {
                ai.updateCategoryList(categories);
            }
            if (state != null) {
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.