Examples of updateStringProperty()


Examples of org.drools.repository.PackageItem.updateStringProperty()

      if (a[1].equals("package")) {
        //updating package header
        if (lastModified != null && pkg.getLastModified().after(lastModified)) {
          throw new RulesRepositoryException("The package was modified by: " + pkg.getLastContributor() + ", unable to write changes.");
        }
        pkg.updateStringProperty(readContent(in), PackageItem.HEADER_PROPERTY_NAME);
        pkg.checkin(comment);
        repo.save();
      } else {
        AssetItem as = pkg.loadAsset(a[0]);
        if (lastModified != null && as.getLastModified().after(lastModified)) {
View Full Code Here

Examples of org.drools.repository.PackageItem.updateStringProperty()

  public void testGetBasics() throws Exception {


    RulesRepository repo = RepositorySessionUtil.getRepository();
    PackageItem pkg = repo.createPackage("testRestGetBasics", "");
    pkg.updateStringProperty("This is some header", PackageItem.HEADER_PROPERTY_NAME);
    repo.save();


    AssetItem asset1 = pkg.addAsset("asset1", "");
    asset1.updateContent("this is content");
View Full Code Here

Examples of org.drools.repository.PackageItem.updateStringProperty()

  }

  public void testPost() throws Exception {
    RulesRepository repo = RepositorySessionUtil.getRepository();
    PackageItem pkg = repo.createPackage("testRestPost", "");
    pkg.updateStringProperty("This is some header", PackageItem.HEADER_PROPERTY_NAME);
    repo.save();

    RestAPI api = new RestAPI(repo);
    ByteArrayInputStream in = new ByteArrayInputStream("abc".getBytes());
    api.post("/packages/testRestPost/asset1.drl", in, "a comment");
View Full Code Here

Examples of org.drools.repository.PackageItem.updateStringProperty()

  public void testPut() throws Exception {
    //need to test both asset and .package shite.
    RulesRepository repo = RepositorySessionUtil.getRepository();
    PackageItem pkg = repo.createPackage("testRestPut", "");
    pkg.updateStringProperty("This is some header", PackageItem.HEADER_PROPERTY_NAME);
    repo.save();

    AssetItem asset1 = pkg.addAsset("asset1", "");
    asset1.updateContent("this is content");
    asset1.updateFormat("drl");
View Full Code Here

Examples of org.drools.repository.PackageItem.updateStringProperty()

  }

  public void testDelete() throws Exception {
    RulesRepository repo = RepositorySessionUtil.getRepository();
    PackageItem pkg = repo.createPackage("testRestDelete", "");
    pkg.updateStringProperty("This is some header", PackageItem.HEADER_PROPERTY_NAME);
    repo.save();

    AssetItem asset1 = pkg.addAsset("asset1", "");
    asset1.updateContent("this is content");
    asset1.updateFormat("drl");
View Full Code Here

Examples of org.drools.repository.PackageItem.updateStringProperty()

    sess.save();

    MigrateDroolsPackage mig = new MigrateDroolsPackage();

    PackageItem pkg = repo.createPackage("testMigratePackage", "");
    pkg.updateStringProperty("some header", PackageItem.HEADER_PROPERTY_NAME);
    sess.save();

    repo.createPackageSnapshot("testMigratePackage", "SNAP1");
    repo.createPackageSnapshot("testMigratePackage", "SNAP2");
View Full Code Here

Examples of org.drools.repository.PackageItem.updateStringProperty()

            String[] a = fileName.split("\\.");
            if (a[1].equals("package")) {
                //new package
                PackageItem pkg = repo.createPackage(bits[1], "<added remotely>");
                pkg.updateCheckinComment(comment);
                pkg.updateStringProperty(readContent(in), PackageItem.HEADER_PROPERTY_NAME);
                repo.save();
            } else {
                //new asset
                PackageItem pkg = repo.loadPackage(bits[1]);
                AssetItem asset;
View Full Code Here

Examples of org.drools.repository.PackageItem.updateStringProperty()

            if (a[1].equals("package")) {
                //updating package header
                if (lastModified != null && pkg.getLastModified().after(lastModified)) {
                    throw new RulesRepositoryException("The package was modified by: " + pkg.getLastContributor() + ", unable to write changes.");
                }
                pkg.updateStringProperty(readContent(in), PackageItem.HEADER_PROPERTY_NAME);
                pkg.checkin(comment);
                repo.save();
            } else {
                AssetItem as = pkg.loadAsset(a[0]);
                if (lastModified != null && as.getLastModified().after(lastModified)) {
View Full Code Here

Examples of org.drools.repository.PackageItem.updateStringProperty()

    sess.save();

    MigrateDroolsPackage mig = new MigrateDroolsPackage();

    PackageItem pkg = repo.createPackage("testMigratePackage", "");
    pkg.updateStringProperty("some header", PackageItem.HEADER_PROPERTY_NAME);
    sess.save();

    repo.createPackageSnapshot("testMigratePackage", "SNAP1");
    repo.createPackageSnapshot("testMigratePackage", "SNAP2");
View Full Code Here

Examples of org.drools.repository.PackageItem.updateStringProperty()

    @Test
  public void testGetBasics() throws Exception {
    RulesRepository repo = RepositorySessionUtil.getRepository();
    PackageItem pkg = repo.createPackage("testRestGetBasics", "");
    pkg.updateStringProperty("This is some header", PackageItem.HEADER_PROPERTY_NAME);
    repo.save();


    AssetItem asset1 = pkg.addAsset("asset1", "");
    asset1.updateContent("this is content");
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.