Package org.drools.repository

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


        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.");
          }
          if (asset.isBinary()) {
            asset.updateBinaryContentAttachment(in);
View Full Code Here


  public void delete(String path) throws UnsupportedEncodingException {
    String[] bits = split(path);
    if (bits[0].equals("packages")) {
      String fileName = bits[2].split("\\.")[0];
      AssetItem asset = repo.loadPackage(bits[1]).loadAsset(fileName);
      asset.archiveItem(true);
      asset.checkin("<removed remotely>");
    }
    else {
      throw new IllegalArgumentException("Unknown rest path for delete");
    }
View Full Code Here

                        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

                        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

                    WebDAVImpl.osxDoubleData.remove(uri);
                    return;
                }
                AssetItem item = loadAssetItemFromPackageItem(packageItem,
                        path[2]);
                item.archiveItem(true);
                item.checkin("");
            } else {
                //delete package
                packageItem.archiveItem(true);
                packageItem.checkin("");
View Full Code Here

                    WebDAVImpl.osxDoubleData.remove(uri);
                    return;
                }
                AssetItem item = loadAssetItemFromGlobalArea(repository,
                        path);
                item.archiveItem(true);
                item.checkin("");
            }
        } else {
            throw new IllegalArgumentException("Not allowed to remove this file.");
        }
View Full Code Here

            } catch (IOException e) {
                log.error("Unable to remove asset attachment",
                        e);
            }

            item.archiveItem(archive);
            PackageItem pkg = item.getPackage();
            pkg.updateBinaryUpToDate(false);
            RuleBaseCache.getInstance().remove(pkg.getUUID());
            if (archive) {
                item.checkin("archived");
View Full Code Here

        AssetItem repoAsset = repository.loadAssetByUUID( asset.uuid );
        if ( asset.metaData.lastModifiedDate.before( repoAsset.getLastModified().getTime() ) ) {
            return "ERR: Unable to save this asset, as it has been recently updated by [" + repoAsset.getLastContributor() + "]";
        }

        repoAsset.archiveItem( asset.archived );
        MetaData meta = asset.metaData;

        metaDataMapper.copyFromMetaData( meta,
                                         repoAsset );
View Full Code Here

        // If package is archived, archive all the assets under it
        if ( data.archived ) {
            for ( Iterator<AssetItem> iter = item.getAssets(); iter.hasNext(); ) {
                AssetItem assetItem = iter.next();
                assetItem.archiveItem( true );
                assetItem.checkin( data.description );
            }
        }

        BRMSSuggestionCompletionLoader loader = new BRMSSuggestionCompletionLoader();
View Full Code Here

            if ( item.getPackage().isArchived() ) {
                throw new RulesRepositoryException( "The package [" + item.getPackageName() + "] that asset [" + item.getName() + "] belongs to is archived. You need to unarchive it first." );
            }

            item.archiveItem( value );
            PackageItem pkg = item.getPackage();
            pkg.updateBinaryUpToDate( false );
            this.ruleBaseCache.remove( pkg.getUUID() );
            item.checkin( "unarchived" );
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.