/** * returns the name of the snapshot, if this module is really a snapshot. * If it is not, it will just return the name of the module, so use wisely * ! */ public String getSnapshotName() { try { return this.node.getName(); } catch (RepositoryException e) { throw new RulesRepositoryException(e); } }
protected String getPath() { try { return this.node.getPath(); } catch ( RepositoryException e ) { throw new RulesRepositoryException( e ); } } }
private boolean containsDoNotInstallSampleNode() throws RepositoryException { Node rootNode = this.session.getRootNode().getNode(RULES_REPOSITORY_NAME); try { return rootNode.hasNode(DO_NOT_INSTALL_SAMPLE_NODE); } catch (RepositoryException e) { throw new RulesRepositoryException(e); } }
/** * This returns true if the repository contains the specified module name. */ public boolean containsModule(String name) { Node folderNode = this.getAreaNode(MODULE_AREA); try { return folderNode.hasNode(name); } catch (RepositoryException e) { throw new RulesRepositoryException(e); } }
/** * This returns true if the repository contains the specified module name. */ public boolean containsModule(String name) { Node folderNode = this.getAreaNode(MODULE_AREA); try { return folderNode.hasNode(name); } catch (RepositoryException e) { throw new RulesRepositoryException(e); } }
/** * Returns true if this module contains an asset of the given name. */ public boolean containsAsset(String name) { Node content; try { content = getVersionContentNode(); return content.getNode(ASSET_FOLDER_NAME).hasNode(name); } catch (RepositoryException e) { throw new RulesRepositoryException(e); } }
public VersionableItem archiveItem(boolean data) { checkout(); try { this.node.setProperty(CONTENT_PROPERTY_ARCHIVE_FLAG, data); return this; } catch (RepositoryException e) { log.error("Unable to update this VersionableItem binary archive flag"); throw new RulesRepositoryException(e); } }
/** * True if this is a binary asset (or has binary content). */ public boolean isBinary() { try { Node assetNode = getVersionContentNode(); return assetNode.hasProperty( CONTENT_PROPERTY_BINARY_NAME ); } catch ( RepositoryException e ) { log.error( e.getMessage(), e ); throw new RulesRepositoryException( e ); } }
public void exportRepositoryToStream(OutputStream output) { try { session.refresh(false); session.exportSystemView("/" + RULES_REPOSITORY_NAME, output, false, false); } catch (Exception e) { log.error(e.getMessage(), e); throw new RulesRepositoryException(e); } }
public ModuleItem loadModuleSnapshot(String moduleName, String snapshotName) { try { Node n = this.getAreaNode(MODULE_SNAPSHOT_AREA).getNode(moduleName).getNode(snapshotName); return new ModuleItem(this, n); } catch (RepositoryException e) { log.error(e.getMessage(), e); throw new RulesRepositoryException(e); } }
protected Boolean getBooleanProperty(String property) { try { Node theNode = getVersionContentNode(); if ( theNode.hasProperty( property ) ) { Property data = theNode.getProperty( property ); return data.getValue().getBoolean(); } else { return false; } } catch ( RepositoryException e ) { throw new RulesRepositoryException( e ); } }
public AssetHistoryIterator(RulesRepository rulesRepository, Node head) { this.head = head; this.rulesRepository = rulesRepository; try { this.versionIterator = VersionableItem.getVersionManager(head).getVersionHistory(head.getPath()).getAllVersions(); } catch ( RepositoryException e ) { throw new RulesRepositoryException( e ); } }
public ModuleHistoryIterator(RulesRepository rulesRepository, Node head) { this.head = head; this.rulesRepository = rulesRepository; try { this.versionIterator = VersionableItem.getVersionManager(head).getVersionHistory(head.getPath()).getAllVersions(); } catch ( RepositoryException e ) { throw new RulesRepositoryException( e ); } }
/** * Use the current sessions userName to get to the info node. */ public UserInfo(RulesRepository repo) throws RulesRepositoryException { try { init(repo, repo.getSession().getUserID()); } catch (RepositoryException e) { log.error("Unable to init UserInfo", e); throw new RulesRepositoryException(e); } }
public void remove() { try { PropertyIterator pi = this.node.getReferences(); if ( pi.hasNext() ) { throw new RulesRepositoryException( "The status still has some assets linked to it. You will need to remove the links so you can delete the status." ); } this.node.remove(); } catch ( RepositoryException e ) { log.error( "Unable to remove state item.", e ); } } }
/** * Use the current sessions userName to get to the info node. */ public UserInfo(RulesRepository repo) throws RulesRepositoryException { try { init(repo, repo.getSession().getUserID()); } catch (RepositoryException e) { log.error("Unable to init UserInfo", e); throw new RulesRepositoryException(e); } }
public ModuleHistoryIterator(RulesRepository rulesRepository, Node head) { this.head = head; this.rulesRepository = rulesRepository; try { this.versionIterator = VersionableItem.getVersionManager(head).getVersionHistory(head.getPath()).getAllVersions(); } catch ( RepositoryException e ) { throw new RulesRepositoryException( e ); } }
public AssetHistoryIterator(RulesRepository rulesRepository, Node head) { this.head = head; this.rulesRepository = rulesRepository; try { this.versionIterator = VersionableItem.getVersionManager(head).getVersionHistory(head.getPath()).getAllVersions(); } catch ( RepositoryException e ) { throw new RulesRepositoryException( e ); } }
public void removeUserPermissions(String userName) { if (!isValideUserName(userName)) { return; } try { Node permsNode = getUserPermissionNode(userName); permsNode.getParent().remove(); //remove this so we get a fresh set } catch (RepositoryException e) { throw new RulesRepositoryException(e); } }
public void removeUserPermissions(String userName) { if (!isValideUserName(userName)) { return; } try { Node permsNode = getUserPermissionNode(userName); permsNode.getParent().remove(); //remove this so we get a fresh set } catch (RepositoryException e) { throw new RulesRepositoryException(e); } }