Package org.drools.repository

Examples of org.drools.repository.RulesRepositoryException


    public Session newSession(String userName, String password) {
        try {
            return configurator.login(userName, password);
        } catch (LoginException e) {
            throw new RulesRepositoryException("UserName: [ " + userName + "] Unable to login to JCR backend.", e);
        } catch (RepositoryException e) {
            throw new RulesRepositoryException(e);
        }
    }
View Full Code Here


        if (targets == null) targets = new ArrayList<String>();
        permsNode.setProperty(perm, targets.toArray(new String[targets.size()]));
      }
        this.repository.save();
      } catch (RepositoryException e) {
        throw new RulesRepositoryException(e);
      }
    }
View Full Code Here

      }
    }

    public void createUser(String userName) {
      if (!isValideUserName(userName)) {
        throw new RulesRepositoryException("Invalide user name");
      }
      if (containsUser(userName)) {
        throw new RulesRepositoryException("User name [" + userName + "] already exists");
      }
      try {
        Node permsNode = getUserPermissionNode(userName);
        permsNode.remove(); //remove this so we get a fresh set
        permsNode = getUserPermissionNode(userName).addNode("jcr:content", "nt:unstructured");
        this.repository.save();
      } catch (RepositoryException e) {
        throw new RulesRepositoryException(e);
      }
    }
View Full Code Here

            }
          }
        }
        return result;
      } catch (RepositoryException e) {
        throw new RulesRepositoryException(e);
      }
    }
View Full Code Here

        Node userNode = (Node) users.next();
        listing.put(userNode.getName(), listOfPermTypes(userNode));
      }
      return listing;
    } catch (RepositoryException e) {
        throw new RulesRepositoryException(e);
      }
  }
View Full Code Here

    try {
        Node permsNode = getUserPermissionNode(userName);
        permsNode.getParent().remove(); //remove this so we get a fresh set
    } catch (RepositoryException e) {
      throw new RulesRepositoryException(e);
    }

  }
View Full Code Here

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

      String[] a = fileName.split("\\.");
      PackageItem pkg = repo.loadPackage(bits[1]);
      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)) {
          throw new RulesRepositoryException("The asset was modified by: " + as.getLastContributor() + ", unable to write changes.");
        }
        if (as.isBinary()) {
          as.updateBinaryContentAttachment(in);
        } else {
          as.updateContent(readContent(in));
View Full Code Here

            out.flush();
            out.close();      
        } catch (IOException e) {
            e.printStackTrace();
            log.error( "An error occurred building the module [" + moduleItem.getName() + "]: " + e.getMessage() );
            throw new RulesRepositoryException( "An error occurred building the module.",
                    e );
        }
        return bout.toByteArray();
    }
View Full Code Here

                    data.setFile( item );
                }
            }
            return data;
        } catch ( FileUploadException e ) {
            throw new RulesRepositoryException( e );
        }
    }
View Full Code Here

TOP

Related Classes of org.drools.repository.RulesRepositoryException

Copyright © 2018 www.massapicom. 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.