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)

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

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (Timer)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • addToBackStack (FragmentTransaction)
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • JCheckBox (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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