Package org.drools.repository

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


           
            AssetItem ai = repository.loadPackage(packageName).addAsset(fileName, "");
            ai.checkout();
            ai.updateBinaryContentAttachmentFileName(fileName);
            if(extension != null) {
                ai.updateFormat(extension);
            }
            ai.updateBinaryContentAttachment(is);
            ai.getPackage().updateBinaryUpToDate(false);
            ai.checkin("update binary");
            repository.save();
View Full Code Here


            //Update asset
            ai.checkout();
            ai.updateTitle(assetEntry.getTitle());
            ai.updateDescription(assetEntry.getSummary());
            if (format != null) {
                ai.updateFormat(format);
            }
            if (assetEntry.getContent() != null) {
                ai.updateContent(assetEntry.getContent());
            }
            ai.checkin("Check-in (summary): " + assetEntry.getSummary());
View Full Code Here

  }

  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

          } else {
            asset.updateContent(readContent(in));
          }
        } 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

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

            conf.checkin( "" );
        }
View Full Code Here

            } else {

                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 form external DRL" );
View Full Code Here

                AssetItem lazarus = packageItem.loadAsset(resource[0]);
                lazarus.archiveItem(false);
            } else {
                AssetItem asset = packageItem.addAsset(resource[0],
                        "");
                asset.updateFormat(resource[1]);
            }
        } else if (isGlobalAreas(path)) {
            String[] resource = AssetItem.getAssetNameFromFileName(path[1]);
            PackageItem packageItem = loadGlobalAreaFromRepository(getRepo());
View Full Code Here

                AssetItem lazarus = packageItem.loadAsset(resource[0]);
                lazarus.archiveItem(false);
            } else {
                AssetItem asset = packageItem.addAsset(resource[0],
                        "");
                asset.updateFormat(resource[1]);
            }
        } else {
            throw new UnsupportedOperationException("Can't add assets here.");
        }
    }
View Full Code Here

        assertFalse( pkg.isBinaryUpToDate() );
        DroolsHeader.updateDroolsHeader( "import org.drools.Person",
                                          pkg );
        AssetItem rule1 = pkg.addAsset( "rule_1",
                                        "" );
        rule1.updateFormat( AssetFormats.DRL );
        rule1.updateContent( "rule 'rule1' \n when \np : Person() \n then \np.setAge(42); \n end" );
        rule1.checkin( "" );
        repo.save();
        assertFalse( pkg.isBinaryUpToDate() );
View Full Code Here

        ModuleItem pkg = rulesRepository.createModule( "testDependencyHistoryPackage",
                                                       "" );

        AssetItem func = pkg.addAsset( "func",
                                       "" );
        func.updateFormat( AssetFormats.FUNCTION );
        func.updateContent( "function void foo() { System.out.println(version 1); }" );
        func.checkin( "func version 1" );
        func.updateContent( "function void foo() { System.out.println(version 2); }" );
        func.checkin( "func version 2" );
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.