String tagItemUUID = this.node.getSession().getValueFactory().createValue( tagItem.getNode() ).getString(); newTagValues[i] = oldTagValues[i]; newTagValues[oldTagValues.length] = this.node.getSession().getValueFactory().createValue( tagItem.getNode() ); updateCategories( newTagValues ); } catch ( PathNotFoundException e ) { newTagValues[0] = this.node.getSession().getValueFactory().createValue( tagItem.getNode() ); updateCategories( newTagValues );
/** * Rename a category. * * @param originalPath The full path to the category. * @param newName The new name (just the name, not the path). */ public void renameCategory(String originalPath, String newName) { try { Node node = loadCategory(originalPath).getNode(); String sourcePath = node.getPath(); String destPath = node.getParent().getPath() + "/" + newName; this.session.move(sourcePath, destPath); save(); } catch (RepositoryException e) { log.error(e.getMessage(), e); throw new RulesRepositoryException(e); } }
/** * Rename a category. * * @param originalPath The full path to the category. * @param newName The new name (just the name, not the path). */ public void renameCategory(String originalPath, String newName) { try { Node node = loadCategory(originalPath).getNode(); String sourcePath = node.getPath(); String destPath = node.getParent().getPath() + "/" + newName; this.session.move(sourcePath, destPath); save(); } catch (RepositoryException e) { log.error(e.getMessage(), e); throw new RulesRepositoryException(e); } }
String tagItemUUID = this.node.getSession().getValueFactory().createValue( tagItem.getNode() ).getString(); newTagValues[i] = oldTagValues[i]; newTagValues[oldTagValues.length] = this.node.getSession().getValueFactory().createValue( tagItem.getNode() ); updateCategories( newTagValues ); } catch ( PathNotFoundException e ) { newTagValues[0] = this.node.getSession().getValueFactory().createValue( tagItem.getNode() ); updateCategories( newTagValues );
/** * This will retrieve a list of RuleItem objects - that are allocated to the * provided category. Only the latest versions of each RuleItem will be * returned (you will have to delve into the assets deepest darkest history * yourself... mahahahaha). * <p/> * Pass in startRow of 0 to start at zero, numRowsToReturn can be set to -1 * should you want it all. * * @param filter an AssetItem filter */ public AssetItemPageResult findAssetsByCategory(String categoryTag, boolean seekArchivedAsset, int skip, int numRowsToReturn, RepositoryFilter filter) throws RulesRepositoryException { CategoryItem item = this.loadCategory(categoryTag); try { return loadLinkedAssets(seekArchivedAsset, skip, numRowsToReturn, item.getNode(), filter); } catch (RepositoryException e) { throw new RulesRepositoryException(e); } }
/** * This will retrieve a list of RuleItem objects - that are allocated to the * provided category. Only the latest versions of each RuleItem will be * returned (you will have to delve into the assets deepest darkest history * yourself... mahahahaha). * <p/> * Pass in startRow of 0 to start at zero, numRowsToReturn can be set to -1 * should you want it all. * * @param filter an AssetItem filter */ public AssetItemPageResult findAssetsByCategory(String categoryTag, boolean seekArchivedAsset, int skip, int numRowsToReturn, RepositoryFilter filter) throws RulesRepositoryException { CategoryItem item = this.loadCategory(categoryTag); try { return loadLinkedAssets(seekArchivedAsset, skip, numRowsToReturn, item.getNode(), filter); } catch (RepositoryException e) { throw new RulesRepositoryException(e); } }
/** * This method sets the categories in one hit, making the * ASSUMPTION that the categories were previously set up ! * (via CategoryItem of course !). */ public void updateCategoryList(String[] categories) { this.checkIsUpdateable(); try { Value[] newCats = new Value[categories.length]; for ( int i = 0; i < categories.length; i++ ) { CategoryItem item = this.rulesRepository.loadCategory( categories[i] ); newCats[i] = this.node.getSession().getValueFactory().createValue( item.getNode() ); } updateCategories( newCats ); } catch ( RepositoryException e ) { throw new RulesRepositoryException(e); } }
/** * This method sets the categories in one hit, making the * ASSUMPTION that the categories were previously set up ! * (via CategoryItem of course !). */ public void updateCategoryList(String[] categories) { this.checkIsUpdateable(); try { Value[] newCats = new Value[categories.length]; for ( int i = 0; i < categories.length; i++ ) { CategoryItem item = this.rulesRepository.loadCategory( categories[i] ); newCats[i] = this.node.getSession().getValueFactory().createValue( item.getNode() ); } updateCategories( newCats ); } catch ( RepositoryException e ) { throw new RulesRepositoryException(e); } }