congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
ModuleItem.checkout
Code IndexAdd Tabnine to your IDE (free)

How to use
checkout
method
in
org.drools.repository.ModuleItem

Best Java code snippets using org.drools.repository.ModuleItem.checkout (Showing top 14 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew ArrayList()
  • Codota Iconnew LinkedList()
  • Smart code suggestions by Tabnine
}
origin: org.chtijbug.drools/guvnor-repository

/**
 * Set this to indicate if the binary is up to date, or not.
 */
public void updateBinaryUpToDate(boolean status) {
  try {
    checkIsUpdateable();
    this.checkout();
    node.setProperty(BINARY_UP_TO_DATE,
        status);
  } catch (RepositoryException e) {
    log.error("fail to update drools:binaryUpToDate of " + getName(),
        e);
  }
}
origin: org.drools/guvnor-repository

/**
 * Set this to indicate if the binary is up to date, or not.
 */
public void updateBinaryUpToDate(boolean status) {
  try {
    checkIsUpdateable();
    this.checkout();
    node.setProperty(BINARY_UP_TO_DATE,
        status);
  } catch (RepositoryException e) {
    log.error("fail to update drools:binaryUpToDate of " + getName(),
        e);
  }
}
origin: org.chtijbug.drools/guvnor-repository

public ModuleItem updateCompiledBinary(InputStream data) {
  checkout();
  try {
    Binary binary = this.node.getSession().getValueFactory().createBinary(data);
    this.node.setProperty(COMPILED_PACKAGE_PROPERTY_NAME,
        binary);
    this.node.setProperty(LAST_MODIFIED_PROPERTY_NAME,
        Calendar.getInstance());
    return this;
  } catch (RepositoryException e) {
    log.error("Unable to update the assets binary content",
        e);
    throw new RulesRepositoryException(e);
  }
}
origin: org.drools/guvnor-repository

public ModuleItem updateCompiledBinary(InputStream data) {
  checkout();
  try {
    Binary binary = this.node.getSession().getValueFactory().createBinary(data);
    this.node.setProperty(COMPILED_PACKAGE_PROPERTY_NAME,
        binary);
    this.node.setProperty(LAST_MODIFIED_PROPERTY_NAME,
        Calendar.getInstance());
    return this;
  } catch (RepositoryException e) {
    log.error("Unable to update the assets binary content",
        e);
    throw new RulesRepositoryException(e);
  }
}
origin: org.chtijbug.drools/guvnor-repository

public void updateCategoryRules(String keys,
                String values) throws RulesRepositoryException {
  //System.out.println("(updateCategoryRules) keys: " + keys + " Values: " + values );
  try {
    this.checkout();
    this.updateStringProperty(keys,
        CATEGORY_RULE_KEYS_PROPERTY_NAME);
    this.updateStringProperty(values,
        CATEGORY_RULE_VALUES_PROPERTY_NAME);
  } catch (Exception e) {
    log.error("Caught Exception",
        e);
    throw new RulesRepositoryException(e);
  }
}
origin: org.drools/guvnor-repository

public void updateCategoryRules(String keys,
                String values) throws RulesRepositoryException {
  //System.out.println("(updateCategoryRules) keys: " + keys + " Values: " + values );
  try {
    this.checkout();
    this.updateStringProperty(keys,
        CATEGORY_RULE_KEYS_PROPERTY_NAME);
    this.updateStringProperty(values,
        CATEGORY_RULE_VALUES_PROPERTY_NAME);
  } catch (Exception e) {
    log.error("Caught Exception",
        e);
    throw new RulesRepositoryException(e);
  }
}
origin: org.chtijbug.drools/guvnor-repository

this.checkout();
log.info("USER: {} CREATEING submodule [{}] under [{}]",
    new Object[]{getCurrentUserName(), subModuleName, getName()});
origin: org.drools/guvnor-repository

this.checkout();
log.info("USER: {} CREATEING submodule [{}] under [{}]",
    new Object[]{getCurrentUserName(), subModuleName, getName()});
origin: org.chtijbug.drools/guvnor-repository

public static void updateHeader(String h, ModuleItem pkg) {
  pkg.checkout();
  AssetItem as = null;
  if (pkg.containsAsset("drools")) {
    as = pkg.loadAsset("drools");
  } else {
    as = pkg.addAsset("drools", "");
  }
  as.updateContent(h);
  //as.checkin("");
}
origin: org.chtijbug.drools/guvnor-repository

@Test
public void testImportExportWithShareableNodes() throws Exception {
  RulesRepository repo = getRepo();
  AssetItem item = repo.loadDefaultModule().addAsset("testImportExportShareableNodeOriginal", "desc");
  item.updateContent("la");
  ModuleItem.ensureMixinType(item, "mix:shareable");
  ModuleItem source = repo.createModule("testImportExportShareableNodesPackage", "desc");
  repo.save();
  source.checkout();
  Session session = item.getNode().getSession();
  Workspace workspace = session.getWorkspace();
  String path = "/drools:repository/drools:package_area/testImportExportShareableNodesPackage/assets/testImportExportShareableNodeShared";
  workspace.clone(workspace.getName(), item.getNode().getPath(), path, false);
  repo.save();
  byte[] repository_backup;
  ByteArrayOutputStream bout = new ByteArrayOutputStream();
  repo.exportRepositoryToStream(bout);
  repository_backup = bout.toByteArray();
  assertNotNull(repository_backup);
  repo.importRulesRepositoryFromStream(new ByteArrayInputStream(
      repository_backup));
  assertTrue(repo.containsModule("testImportExportShareableNodesPackage"));
  assertTrue(repo.loadModule("testImportExportShareableNodesPackage").containsAsset("testImportExportShareableNodeOriginal"));
}
origin: org.chtijbug.drools/guvnor-repository

@Test
public void testShareableNodesWithQuery() throws Exception {
  RulesRepository repo = getRepo();
  AssetItem item = repo.loadGlobalArea().addAsset("testShareableNodesWithQueryOriginal", "desc");
  item.updateFormat("xyz");
  item.getNode().addMixin("mix:shareable");
  ModuleItem source = repo.createModule("testShareableNodesWithQueryPackage", "desc");
  repo.save();
  AssetItemIterator it = repo.loadGlobalArea().queryAssets( "drools:format='xyz'" );
  List list = iteratorToList( it );
  assertEquals(1, list.size());
  assertTrue(list.get( 0 ) instanceof AssetItem);
  
  source.checkout();
  Session session = repo.getSession();
  Workspace workspace = session.getWorkspace();
  String path = "/drools:repository/drools:package_area/testShareableNodesWithQueryPackage/assets/testShareableNodesWithQueryShared";
  workspace.clone(workspace.getName(), item.getNode().getPath(), path, false);
  repo.save();
  AssetItem originalItem = repo.loadGlobalArea().loadAsset("testShareableNodesWithQueryOriginal");
  AssetItem sharedItem = repo.loadModule("testShareableNodesWithQueryPackage").loadAsset("testShareableNodesWithQueryShared");
  assertTrue( originalItem.getFormat().equals("xyz"));
  assertTrue( sharedItem.getFormat().equals("xyz"));
  it = repo.loadGlobalArea().queryAssets( "drools:format='xyz'" );
  list = iteratorToList( it );
  assertEquals(1, list.size());
  assertTrue(list.get( 0 ) instanceof AssetItem);
}
origin: org.chtijbug.drools/guvnor-repository

@Test
public void testShareableNodes() throws Exception {
  RulesRepository repo = getRepo();
  AssetItem item = repo.loadDefaultModule().addAsset("testShareableNodeOriginal", "desc");
  item.updateContent("la");
  item.getNode().addMixin("mix:shareable");
  ModuleItem source = repo.createModule("testShareableNodesPackage", "desc");
  repo.save();
  source.checkout();
  Session session = repo.getSession();
  Workspace workspace = session.getWorkspace();
  String path = "/drools:repository/drools:package_area/testShareableNodesPackage/assets/testShareableNodeShared";
  workspace.clone(workspace.getName(), item.getNode().getPath(), path, false);
  repo.save();
  AssetItem originalItem = repo.loadDefaultModule().loadAsset("testShareableNodeOriginal");
  AssetItem sharedItem = repo.loadModule("testShareableNodesPackage").loadAsset("testShareableNodeShared");
  assertTrue( originalItem.getContent().equals("la"));
  assertTrue( sharedItem.getContent().equals("la"));
  originalItem.remove();
}
origin: org.chtijbug.drools/guvnor-repository

    dependencies[0]);
item.checkout();
item.checkin("v1");
ModuleItem historicalPackage = getRepo().loadModule("testDependenciesWithHistoricalVersion", 2);
    dependencies[0]);
item.checkout();
item.checkin("v2");
historicalPackage = getRepo().loadModule("testDependenciesWithHistoricalVersion", 3);
origin: org.chtijbug.drools/guvnor-repository

pkg.checkout();
pkg.checkin("version 3");
org.drools.repositoryModuleItemcheckout

Popular methods of ModuleItem

  • addAsset
    This adds an asset to the current physical module (you can move it later). With the given category.
  • containsAsset
    Returns true if this module contains an asset of the given name.
  • getName
    Return the name of the module.
  • getStringProperty
  • listAssetsByFormat
    This will load an iterator for assets of the given format type.
  • loadAsset
    Load a specific asset by name.
  • updateStringProperty
  • <init>
    Constructs an object of type ModuleItem corresponding the specified node
  • checkin
  • createSubModule
    Creates a nested package.
  • ensureMixinType
  • getAssets
    Return an iterator for the rules in this module
  • ensureMixinType,
  • getAssets,
  • getAssetsWithStatus,
  • getDependencies,
  • getDescription,
  • getFormat,
  • getLastModified,
  • getNode,
  • getStringPropertyArray

Popular in Java

  • Start an intent from android
  • startActivity (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (Timer)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Runner (org.openjdk.jmh.runner)
  • Option (scala)
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now