Examples of loadAsset()


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()

        } else {
            pkg = repository.loadPackageSnapshot( packageName,
                                                  packageVersion );
        }

        AssetItem item = pkg.loadAsset( assetName );
        ContentHandler handler = ContentManager.getHandler( item.getFormat() );
        StringBuilder stringBuilder = new StringBuilder();
        if ( handler.isRuleAsset() ) {

            BRMSPackageBuilder builder = new BRMSPackageBuilder();
View Full Code Here

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

                WebDAVImpl.osxDoubleData.put(uri,
                        null);
                return;
            }
            if (packageItem.containsAsset(resource[0])) {
                AssetItem lazarus = packageItem.loadAsset(resource[0]);
                lazarus.archiveItem(false);
            } else {
                AssetItem asset = packageItem.addAsset(resource[0],
                        "");
                asset.updateFormat(resource[1]);
View Full Code Here

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

                WebDAVImpl.osxDoubleData.put(uri,
                        null);
                return;
            }
            if (packageItem.containsAsset(resource[0])) {
                AssetItem lazarus = packageItem.loadAsset(resource[0]);
                lazarus.archiveItem(false);
            } else {
                AssetItem asset = packageItem.addAsset(resource[0],
                        "");
                asset.updateFormat(resource[1]);
View Full Code Here

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

                path[1]);
        if (path[2].startsWith("._")) {
            return WebDAVImpl.osxDoubleData.containsKey(uri);
        }
        String assetName = AssetItem.getAssetNameFromFileName(path[2])[0];
        return pkg.containsAsset(assetName) && !pkg.loadAsset(assetName).isArchived();
    }

    public void removeObject(ITransaction iTransaction,
                             String uri) {
        RulesRepository repository = getRepo();
View Full Code Here

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

                    builder.writePDF( out );

                } else if ( helper.isPng() ) {
                    PackageItem pkg = fm.getRepository().loadPackage( helper.getPackageName() );
                    AssetItem asset = pkg.loadAsset(helper.getAssetName());

                    fileName = getFileManager().loadFileAttachmentByUUID( asset.getUUID(),
                                                                                 out );
                } else {
                    if ( req.getRequestURI().endsWith( "SCENARIOS" ) ) {
View Full Code Here

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

                        int lastIndexOfSlash = uri.lastIndexOf('/');
                        String assetName = uri.substring(lastIndexOfSlash + 1);
                        fileName = assetName + ".xml";

                        PackageItem pkg = fm.getRepository().loadPackage( helper.getPackageName() );
                        AssetItem asset = pkg.loadAsset(assetName);
                        out.write(asset.getBinaryContentAsBytes());

                    } else {
                        fileName = fm.loadBinaryPackage( helper.getPackageName(),
                                helper.getVersion(),
View Full Code Here

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

        public void applyAction(Object context) throws Exception {
            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 );
        }
    }
View Full Code Here

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

        public void applyAction(Object context) throws Exception {
            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 );
        }
    }
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.