Examples of loadAsset()


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

    } else {
      if (resourceFile.indexOf("?version=") > -1) {
        String[] v = resourceFile.split("\\?version\\=");
        String version = v[1];
        String assetName = AssetItem.getAssetNameFromFileName(v[0])[0];
        AssetItem asset = pkg.loadAsset(assetName);
        if (asset.isArchived()) {
          Text r = new Text();
          r.data = "";
          return r;
        }
View Full Code Here

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

          r.data = "Unknown version number : " + versionNumber;
          return r;
        }
      } else {
         String assetName = AssetItem.getAssetNameFromFileName(resourceFile)[0];
        AssetItem asset = pkg.loadAsset(assetName);
        return buildAssetContentResponse(pkg, asset);
      }

    }
View Full Code Here

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

      } else {
        //new asset
        PackageItem pkg = repo.loadPackage(bits[1]);
        AssetItem asset;
        if (pkg.containsAsset(a[0])) {
          asset = pkg.loadAsset(a[0]);
          if (asset.isArchived()) {
            asset.archiveItem(false);
          } else {
            throw new RulesRepositoryException("The file " + path + " already exists, and was not archived.");
          }
View Full Code Here

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

        }
        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)) {
          throw new RulesRepositoryException("The asset was modified by: " + as.getLastContributor() + ", unable to write changes.");
        }
        if (as.isBinary()) {
          as.updateBinaryContentAttachment(in);
View Full Code Here

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

        repositoryPackageService.savePackage( data );
        data = repositoryPackageService.loadPackageConfig( uuid );
        it = impl.getRulesRepository().loadPackage( data.name );
        assertTrue( data.archived );
        assertTrue( it.loadAsset( "drools" ).isArchived() );
        assertTrue( it.loadAsset( "rule_1" ).isArchived() );

        data.archived = false;

        repositoryPackageService.savePackage( data );
View Full Code Here

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

        repositoryPackageService.savePackage( data );
        data = repositoryPackageService.loadPackageConfig( uuid );
        it = impl.getRulesRepository().loadPackage( data.name );
        assertTrue( data.archived );
        assertTrue( it.loadAsset( "drools" ).isArchived() );
        assertTrue( it.loadAsset( "rule_1" ).isArchived() );

        data.archived = false;

        repositoryPackageService.savePackage( data );
        data = repositoryPackageService.loadPackageConfig( uuid );
View Full Code Here

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

        repositoryPackageService.savePackage( data );
        data = repositoryPackageService.loadPackageConfig( uuid );
        it = impl.getRulesRepository().loadPackage( data.name );
        assertFalse( data.archived );
        assertFalse( it.loadAsset( "drools" ).isArchived() );
        assertTrue( it.loadAsset( "rule_1" ).isArchived() );

        data.archived = true;

        repositoryPackageService.savePackage( data );
View Full Code Here

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

        repositoryPackageService.savePackage( data );
        data = repositoryPackageService.loadPackageConfig( uuid );
        it = impl.getRulesRepository().loadPackage( data.name );
        assertFalse( data.archived );
        assertFalse( it.loadAsset( "drools" ).isArchived() );
        assertTrue( it.loadAsset( "rule_1" ).isArchived() );

        data.archived = true;

        repositoryPackageService.savePackage( data );
        data = repositoryPackageService.loadPackageConfig( uuid );
View Full Code Here

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

        repositoryPackageService.savePackage( data );
        data = repositoryPackageService.loadPackageConfig( uuid );
        it = impl.getRulesRepository().loadPackage( data.name );
        assertTrue( data.archived );
        assertTrue( it.loadAsset( "drools" ).isArchived() );
        assertTrue( it.loadAsset( "rule_1" ).isArchived() );

    }

    @Test
View Full Code Here

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

        repositoryPackageService.savePackage( data );
        data = repositoryPackageService.loadPackageConfig( uuid );
        it = impl.getRulesRepository().loadPackage( data.name );
        assertTrue( data.archived );
        assertTrue( it.loadAsset( "drools" ).isArchived() );
        assertTrue( it.loadAsset( "rule_1" ).isArchived() );

    }

    @Test
    @Ignore("This test is broken. Suspect changes for new Workspaces and versionable packages could have broken.")
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.