Codota Logo
NodeUtils
Code IndexAdd Codota to your IDE (free)

How to use
NodeUtils
in
org.drools.repository.utils

Best Java code snippets using org.drools.repository.utils.NodeUtils (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: org.drools/guvnor-repository

/**
 * This will create a child category under this one
 */
public CategoryItem addCategory(String name,
                String description) {
  try {
    String nodePath = NodeUtils.makeJSR170ComplaintName(name);
    Node child = this.node.addNode(nodePath, CategoryItem.TAG_NODE_TYPE_NAME);
    this.rulesRepository.getSession().save();
    return new CategoryItem(this.rulesRepository, child);
  } catch (Exception e) {
    if (e instanceof RuntimeException) {
      throw (RuntimeException) e;
    } else {
      throw new RulesRepositoryException(e);
    }
  }
}
origin: org.drools/guvnor-repository

/**
 * This will copy the module to the snapshot area. Creating a copy for
 * deployment, etc.
 */
public void createModuleSnapshot(String moduleName,
                 String snapshotName) {
  log.debug("Creating snapshot for [" + moduleName + "] called [" + snapshotName + "]");
  try {
    Node snaps = this.getAreaNode(MODULE_SNAPSHOT_AREA);
    String nodePath = NodeUtils.makeJSR170ComplaintName(moduleName);
    if (!snaps.hasNode(nodePath)) {
      snaps.addNode(nodePath,
          "nt:folder");
      save();
    }
    String newName = snaps.getNode(nodePath).getPath() + "/" + snapshotName;
    Node moduleNode = this.getAreaNode(MODULE_AREA).getNode(moduleName);
    long start = System.currentTimeMillis();
    this.session.getWorkspace().copy(moduleNode.getPath(),
        newName);
    log.debug("Time taken for snap: " + (System.currentTimeMillis() - start));
  } catch (RepositoryException e) {
    log.error("Unable to create snapshot",
        e);
    throw new RulesRepositoryException(e);
  }
}
origin: org.chtijbug.drools/guvnor-repository

/**
 * This will copy the module to the snapshot area. Creating a copy for
 * deployment, etc.
 */
public void createModuleSnapshot(String moduleName,
                 String snapshotName) {
  log.debug("Creating snapshot for [" + moduleName + "] called [" + snapshotName + "]");
  try {
    Node snaps = this.getAreaNode(MODULE_SNAPSHOT_AREA);
    String nodePath = NodeUtils.makeJSR170ComplaintName(moduleName);
    if (!snaps.hasNode(nodePath)) {
      snaps.addNode(nodePath,
          "nt:folder");
      save();
    }
    String newName = snaps.getNode(nodePath).getPath() + "/" + snapshotName;
    Node moduleNode = this.getAreaNode(MODULE_AREA).getNode(moduleName);
    long start = System.currentTimeMillis();
    this.session.getWorkspace().copy(moduleNode.getPath(),
        newName);
    log.debug("Time taken for snap: " + (System.currentTimeMillis() - start));
  } catch (RepositoryException e) {
    log.error("Unable to create snapshot",
        e);
    throw new RulesRepositoryException(e);
  }
}
origin: org.chtijbug.drools/guvnor-repository

/**
 * This will create a child category under this one
 */
public CategoryItem addCategory(String name,
                String description) {
  try {
    String nodePath = NodeUtils.makeJSR170ComplaintName(name);
    Node child = this.node.addNode(nodePath, CategoryItem.TAG_NODE_TYPE_NAME);
    this.rulesRepository.getSession().save();
    return new CategoryItem(this.rulesRepository, child);
  } catch (Exception e) {
    if (e instanceof RuntimeException) {
      throw (RuntimeException) e;
    } else {
      throw new RulesRepositoryException(e);
    }
  }
}
origin: org.drools/guvnor-repository

/**
 * Create a status node of the given name.
 */
public StateItem createState(String name) {
  try {
    Node folderNode = this.getAreaNode(STATE_AREA);
    String nodePath = NodeUtils.makeJSR170ComplaintName(name);
    Node stateNode = RulesRepository.addNodeIfNew(folderNode,
        nodePath,
        StateItem.STATE_NODE_TYPE_NAME);
    log.debug("Created the status [" + name + "] at [" + nodePath + "]");
    return new StateItem(this,
        stateNode);
  } catch (Exception e) {
    log.error(e.getMessage(),
        e);
    throw new RulesRepositoryException(e);
  }
}
origin: org.chtijbug.drools/guvnor-repository

/**
 * Create a status node of the given name.
 */
public StateItem createState(String name) {
  try {
    Node folderNode = this.getAreaNode(STATE_AREA);
    String nodePath = NodeUtils.makeJSR170ComplaintName(name);
    Node stateNode = RulesRepository.addNodeIfNew(folderNode,
        nodePath,
        StateItem.STATE_NODE_TYPE_NAME);
    log.debug("Created the status [" + name + "] at [" + nodePath + "]");
    return new StateItem(this,
        stateNode);
  } catch (Exception e) {
    log.error(e.getMessage(),
        e);
    throw new RulesRepositoryException(e);
  }
}
origin: org.drools/guvnor-repository

/**
 * Gets a StateItem for the specified state name. If a node for the
 * specified state does not yet exist, one is first created.
 *
 * @param name the name of the state to get
 * @return a StateItem object encapsulating the retrieved node
 * @throws RulesRepositoryException
 */
public StateItem getState(String name) throws RulesRepositoryException {
  try {
    Node folderNode = this.getAreaNode(STATE_AREA);
    String nodePath = NodeUtils.makeJSR170ComplaintName(name);
    if (!folderNode.hasNode(nodePath)) {
      throw new RulesRepositoryException("The state called [" + name + "] does not exist.");
    }
    Node stateNode = folderNode.getNode(nodePath);
    // RulesRepository.addNodeIfNew(folderNode, name, StateItem.STATE_NODE_TYPE_NAME);
    return new StateItem(this,
        stateNode);
  } catch (Exception e) {
    log.error(e.getMessage(),
        e);
    throw new RulesRepositoryException(e);
  }
}
origin: org.drools/guvnor-repository

String assetPath = NodeUtils.makeJSR170ComplaintName(subModuleName);
Node ruleSubPackageNode = subModulesNode.addNode(assetPath,
    ModuleItem.MODULE_TYPE_NAME);
origin: org.chtijbug.drools/guvnor-repository

/**
 * Gets a StateItem for the specified state name. If a node for the
 * specified state does not yet exist, one is first created.
 *
 * @param name the name of the state to get
 * @return a StateItem object encapsulating the retrieved node
 * @throws RulesRepositoryException
 */
public StateItem getState(String name) throws RulesRepositoryException {
  try {
    Node folderNode = this.getAreaNode(STATE_AREA);
    String nodePath = NodeUtils.makeJSR170ComplaintName(name);
    if (!folderNode.hasNode(nodePath)) {
      throw new RulesRepositoryException("The state called [" + name + "] does not exist.");
    }
    Node stateNode = folderNode.getNode(nodePath);
    // RulesRepository.addNodeIfNew(folderNode, name, StateItem.STATE_NODE_TYPE_NAME);
    return new StateItem(this,
        stateNode);
  } catch (Exception e) {
    log.error(e.getMessage(),
        e);
    throw new RulesRepositoryException(e);
  }
}
origin: org.chtijbug.drools/guvnor-repository

String assetPath = NodeUtils.makeJSR170ComplaintName(subModuleName);
Node ruleSubPackageNode = subModulesNode.addNode(assetPath,
    ModuleItem.MODULE_TYPE_NAME);
origin: org.chtijbug.drools/guvnor-repository

assetName = assetName.trim();
Node assetsFolder = this.node.getNode(ASSET_FOLDER_NAME);
String assetPath = NodeUtils.makeJSR170ComplaintName(assetName);
assetNode = assetsFolder.addNode(assetPath,
    AssetItem.ASSET_NODE_TYPE_NAME);
origin: org.drools/guvnor-repository

assetName = assetName.trim();
Node assetsFolder = this.node.getNode(ASSET_FOLDER_NAME);
String assetPath = NodeUtils.makeJSR170ComplaintName(assetName);
assetNode = assetsFolder.addNode(assetPath,
    AssetItem.ASSET_NODE_TYPE_NAME);
origin: org.chtijbug.drools/guvnor-repository

String nodePath = NodeUtils.makeJSR170ComplaintName(name);
Node moduleNode = folderNode.addNode(nodePath,
    ModuleItem.MODULE_TYPE_NAME);
origin: org.drools/guvnor-repository

String nodePath = NodeUtils.makeJSR170ComplaintName(name);
Node moduleNode = folderNode.addNode(nodePath,
    ModuleItem.MODULE_TYPE_NAME);
origin: org.chtijbug.drools/guvnor-repository

@Test
public void testNodePathConversion5() {
  final String assetName = "one]two";
  final String pathName = NodeUtils.makeJSR170ComplaintName( assetName );
  assertEquals( "one_two",
         pathName );
}
origin: org.chtijbug.drools/guvnor-repository

@Test
public void testNodePathConversion7() {
  final String assetName = "one\"two";
  final String pathName = NodeUtils.makeJSR170ComplaintName( assetName );
  assertEquals( "one_two",
         pathName );
}
origin: org.chtijbug.drools/guvnor-repository

@Test
public void testNodePathConversion3() {
  final String assetName = "one*two";
  final String pathName = NodeUtils.makeJSR170ComplaintName( assetName );
  assertEquals( "one_two",
         pathName );
}
origin: org.chtijbug.drools/guvnor-repository

@Test
public void testNodePathConversion6() {
  final String assetName = "one'two";
  final String pathName = NodeUtils.makeJSR170ComplaintName( assetName );
  assertEquals( "one_two",
         pathName );
}
origin: org.chtijbug.drools/guvnor-repository

@Test
public void testNodePathConversion2() {
  final String assetName = "one:two";
  final String pathName = NodeUtils.makeJSR170ComplaintName( assetName );
  assertEquals( "one_two",
         pathName );
}
origin: org.chtijbug.drools/guvnor-repository

@Test
public void testNodePathConversion1() {
  final String assetName = "one/two";
  final String pathName = NodeUtils.makeJSR170ComplaintName( assetName );
  assertEquals( "one_two",
         pathName );
}
org.drools.repository.utilsNodeUtils

Javadoc

Utilities relating to a ModuleItem.

Most used methods

  • makeJSR170ComplaintName
    Construct a validate JCR Node path name per JSR-170 from an asset name. Only the following character

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • findViewById (Activity)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Notification (javax.management)
  • Reference (javax.naming)
  • JTextField (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now