@Test public void testFilterOwnedLeafs_emptyInputList() { List filteredList = catalogService.filterOwnedLeafs(myIdentity, new ArrayList()); assertNotNull("result could not be null", filteredList); assertTrue("Should filter out catalog-entry of TYPE_NODE", filteredList.isEmpty()); }
@Override public List filterOwnedLeafs(final Identity identity, final List catalogEntries) { final List ownedEntries = new ArrayList(); final Iterator iter = catalogEntries.iterator(); while (iter.hasNext()) { final CatalogEntry cate = (CatalogEntry) iter.next(); if (cate.getType() == CatalogEntry.TYPE_LEAF) { final RepositoryEntry repe = cate.getRepositoryEntry(); final SecurityGroup secGroup = repe.getOwnerGroup(); if (securityManager.isIdentityInSecurityGroup(identity, secGroup)) { ownedEntries.add(cate); } } } return ownedEntries; }
CatalogServiceImpl extends BasicManager implements UserDataDeletable, Initializable, CatalogService { @Override public List filterOwnedLeafs(final Identity identity, final List catalogEntries) { final List ownedEntries = new ArrayList(); final Iterator iter = catalogEntries.iterator(); while (iter.hasNext()) { final CatalogEntry cate = (CatalogEntry) iter.next(); if (cate.getType() == CatalogEntry.TYPE_LEAF) { final RepositoryEntry repe = cate.getRepositoryEntry(); final SecurityGroup secGroup = repe.getOwnerGroup(); if (securityManager.isIdentityInSecurityGroup(identity, secGroup)) { ownedEntries.add(cate); } } } return ownedEntries; } }
CatalogServiceImpl extends BasicManager implements UserDataDeletable, Initializable, CatalogService { @Override public List filterOwnedLeafs(final Identity identity, final List catalogEntries) { final List ownedEntries = new ArrayList(); final Iterator iter = catalogEntries.iterator(); while (iter.hasNext()) { final CatalogEntry cate = (CatalogEntry) iter.next(); if (cate.getType() == CatalogEntry.TYPE_LEAF) { final RepositoryEntry repe = cate.getRepositoryEntry(); final SecurityGroup secGroup = repe.getOwnerGroup(); if (securityManager.isIdentityInSecurityGroup(identity, secGroup)) { ownedEntries.add(cate); } } } return ownedEntries; } @SuppressWarnings("unused") private  CatalogServiceImpl();   CatalogServiceImpl(CatalogDao catalogDao, BaseSecurity securityManager, BookmarkService bookmarkService, DeletionModule deletionModule); }
CatalogServiceImpl extends BasicManager implements UserDataDeletable, Initializable, CatalogService { @Override public List filterOwnedLeafs(final Identity identity, final List catalogEntries) { final List ownedEntries = new ArrayList(); final Iterator iter = catalogEntries.iterator(); while (iter.hasNext()) { final CatalogEntry cate = (CatalogEntry) iter.next(); if (cate.getType() == CatalogEntry.TYPE_LEAF) { final RepositoryEntry repe = cate.getRepositoryEntry(); final SecurityGroup secGroup = repe.getOwnerGroup(); if (securityManager.isIdentityInSecurityGroup(identity, secGroup)) { ownedEntries.add(cate); } } } return ownedEntries; } @SuppressWarnings("unused") private  CatalogServiceImpl();   CatalogServiceImpl(CatalogDao catalogDao, BaseSecurity securityManager, BookmarkService bookmarkService, DeletionModule deletionModule); @Override CatalogEntry createCatalogEntry(); @Override List<CatalogEntry> getChildrenOf(final CatalogEntry ce); @Override List<CatalogEntry> getAllCatalogNodes(); @Override boolean hasChildEntries(final CatalogEntry ce, final int type); @Override List filterOwnedLeafs(final Identity identity, final List catalogEntries); @Override CatalogEntry loadCatalogEntry(final CatalogEntry catalogEntry); @Override CatalogEntry loadCatalogEntry(final Long catEntryId); @Override void saveCatalogEntry(final CatalogEntry ce); @Override void updateCatalogEntry(final CatalogEntry ce); @Override void deleteCatalogEntry(final CatalogEntry ce); @Override List getCatalogCategoriesFor(final RepositoryEntry repoEntry); @Override List getCatalogEntriesOwnedBy(final Identity identity); @Override void addCatalogEntry(final CatalogEntry parent, final CatalogEntry newEntry); @Override List getRootCatalogEntries(); @Override void init(); @Override boolean moveCatalogEntry(CatalogEntry toBeMovedEntry, CatalogEntry newParentEntry); @Override void resourceableDeleted(final RepositoryEntry repositoryEntry); @Override void deleteUserData(final Identity identity, final String newDeletedUserName); @Override boolean isEntryWithinCategory(final CatalogEntry toBeCheckedEntry, final List<CatalogEntry> entriesList); @Override OLATResourceable createOLATResouceableFor(final CatalogEntry currentCatalogEntry); @Override CatalogEntry createCatalogEntryLeaf(RepositoryEntry repositoryEntry, String parentNodeIdent); @Override CatalogEntry createCatalogEntryLeafAndAddParent(RepositoryEntry repositoryEntry, CatalogEntry parentCatalogEntry); @Override boolean hasParentAllreadyCatalogEntryAsChild(String nodeIdent, RepositoryEntry toBeAddedEntry); CatalogEntry importStructure(); @Override boolean isOwner(CatalogEntry ce, Identity identity); @Override void addOwners(CatalogEntry catalogEntry, List<Identity> addIdentities); @Override void removeOwners(CatalogEntry catalogEntry, List<Identity> removeIdentities); @Override CatalogEntry createCatalogEntryWithoutRepositoryEntry(CatalogEntry parentCatalogEntry); @Override CatalogEntry setEmptyOwnerGroup(CatalogEntry currentCatalogEntry); List<Identity> getCaretakerFormCatalogEntryList(List<CatalogEntry> historyStack); }
CatalogServiceImpl extends BasicManager implements UserDataDeletable, Initializable, CatalogService { @Override public List filterOwnedLeafs(final Identity identity, final List catalogEntries) { final List ownedEntries = new ArrayList(); final Iterator iter = catalogEntries.iterator(); while (iter.hasNext()) { final CatalogEntry cate = (CatalogEntry) iter.next(); if (cate.getType() == CatalogEntry.TYPE_LEAF) { final RepositoryEntry repe = cate.getRepositoryEntry(); final SecurityGroup secGroup = repe.getOwnerGroup(); if (securityManager.isIdentityInSecurityGroup(identity, secGroup)) { ownedEntries.add(cate); } } } return ownedEntries; } @SuppressWarnings("unused") private  CatalogServiceImpl();   CatalogServiceImpl(CatalogDao catalogDao, BaseSecurity securityManager, BookmarkService bookmarkService, DeletionModule deletionModule); @Override CatalogEntry createCatalogEntry(); @Override List<CatalogEntry> getChildrenOf(final CatalogEntry ce); @Override List<CatalogEntry> getAllCatalogNodes(); @Override boolean hasChildEntries(final CatalogEntry ce, final int type); @Override List filterOwnedLeafs(final Identity identity, final List catalogEntries); @Override CatalogEntry loadCatalogEntry(final CatalogEntry catalogEntry); @Override CatalogEntry loadCatalogEntry(final Long catEntryId); @Override void saveCatalogEntry(final CatalogEntry ce); @Override void updateCatalogEntry(final CatalogEntry ce); @Override void deleteCatalogEntry(final CatalogEntry ce); @Override List getCatalogCategoriesFor(final RepositoryEntry repoEntry); @Override List getCatalogEntriesOwnedBy(final Identity identity); @Override void addCatalogEntry(final CatalogEntry parent, final CatalogEntry newEntry); @Override List getRootCatalogEntries(); @Override void init(); @Override boolean moveCatalogEntry(CatalogEntry toBeMovedEntry, CatalogEntry newParentEntry); @Override void resourceableDeleted(final RepositoryEntry repositoryEntry); @Override void deleteUserData(final Identity identity, final String newDeletedUserName); @Override boolean isEntryWithinCategory(final CatalogEntry toBeCheckedEntry, final List<CatalogEntry> entriesList); @Override OLATResourceable createOLATResouceableFor(final CatalogEntry currentCatalogEntry); @Override CatalogEntry createCatalogEntryLeaf(RepositoryEntry repositoryEntry, String parentNodeIdent); @Override CatalogEntry createCatalogEntryLeafAndAddParent(RepositoryEntry repositoryEntry, CatalogEntry parentCatalogEntry); @Override boolean hasParentAllreadyCatalogEntryAsChild(String nodeIdent, RepositoryEntry toBeAddedEntry); CatalogEntry importStructure(); @Override boolean isOwner(CatalogEntry ce, Identity identity); @Override void addOwners(CatalogEntry catalogEntry, List<Identity> addIdentities); @Override void removeOwners(CatalogEntry catalogEntry, List<Identity> removeIdentities); @Override CatalogEntry createCatalogEntryWithoutRepositoryEntry(CatalogEntry parentCatalogEntry); @Override CatalogEntry setEmptyOwnerGroup(CatalogEntry currentCatalogEntry); List<Identity> getCaretakerFormCatalogEntryList(List<CatalogEntry> historyStack);  }