/** * Deletes all relations for the given resource and all its siblings.<p> * * @param dbc the current database context * @param resource the resource to delete the resource for * * @throws CmsException if something goes wrong */ protected void deleteRelationsWithSiblings(CmsDbContext dbc, CmsResource resource) throws CmsException { // get all siblings List siblings; if (resource.getSiblingCount() > 1) { siblings = readSiblings(dbc, resource, CmsResourceFilter.ALL); } else { siblings = new ArrayList(); siblings.add(resource); } // clean the relations in content for all siblings Iterator it = siblings.iterator(); while (it.hasNext()) { CmsResource sibling = (CmsResource)it.next(); // clean the relation information for this sibling m_vfsDriver.deleteRelations( dbc, dbc.currentProject().getUuid(), sibling, CmsRelationFilter.TARGETS.filterDefinedInContent()); } }
/** * Deletes all relations for the given resource and all its siblings.<p> * * @param dbc the current database context * @param resource the resource to delete the resource for * * @throws CmsException if something goes wrong */ protected void deleteRelationsWithSiblings(CmsDbContext dbc, CmsResource resource) throws CmsException { // get all siblings List<CmsResource> siblings; if (resource.getSiblingCount() > 1) { siblings = readSiblings(dbc, resource, CmsResourceFilter.ALL); } else { siblings = new ArrayList<CmsResource>(); siblings.add(resource); } // clean the relations in content for all siblings I_CmsVfsDriver vfsDriver = getVfsDriver(dbc); Iterator<CmsResource> it = siblings.iterator(); while (it.hasNext()) { CmsResource sibling = it.next(); // clean the relation information for this sibling vfsDriver.deleteRelations( dbc, dbc.currentProject().getUuid(), sibling, CmsRelationFilter.TARGETS.filterDefinedInContent()); } }