/** * Is a pool a descendant of the other? */ public boolean isDescendantOf(Long poolA,Long poolB, String agentId) { try{ Long tempPoolId = poolA; while((tempPoolId !=null)&&(tempPoolId.toString().compareTo("0")>0)){ QuestionPoolFacade tempPool = getPool(tempPoolId, agentId); if(tempPool.getParentPoolId().toString().compareTo(poolB.toString())==0) return true; tempPoolId = tempPool.getParentPoolId(); } return false; }catch(Exception e){ log.error(e.getMessage(), e); return false; } }
/** * Is a pool a descendant of the other? */ public boolean isDescendantOf(Long poolA,Long poolB, String agentId) { try{ Long tempPoolId = poolA; while((tempPoolId !=null)&&(tempPoolId.toString().compareTo("0")>0)){ QuestionPoolFacade tempPool = getPool(tempPoolId, agentId); if(tempPool.getParentPoolId().toString().compareTo(poolB.toString())==0) return true; tempPoolId = tempPool.getParentPoolId(); } return false; }catch(Exception e){ log.error(e.getMessage(), e); return false; } }
/** * Is destination a descendant of the source? */ public boolean isDescendantOf(QuestionPoolFacade destPool, QuestionPoolFacade sourcePool) { Long tempPoolId = destPool.getQuestionPoolId(); try { while((tempPoolId != null) && (!tempPoolId.equals(QuestionPoolFacade.ROOT_POOL))) { QuestionPoolFacade tempPool = getPoolById(tempPoolId); if (tempPool.getParentPoolId().equals(sourcePool.getQuestionPoolId())) { return true; } tempPoolId = tempPool.getParentPoolId(); } return false; } catch (Exception e) { log.warn(e.getMessage()); return false; } }
/** * Is destination a descendant of the source? */ public boolean isDescendantOf(QuestionPoolFacade destPool, QuestionPoolFacade sourcePool) { Long tempPoolId = destPool.getQuestionPoolId(); try { while((tempPoolId != null) && (!tempPoolId.equals(QuestionPoolFacade.ROOT_POOL))) { QuestionPoolFacade tempPool = getPoolById(tempPoolId); if (tempPool.getParentPoolId().equals(sourcePool.getQuestionPoolId())) { return true; } tempPoolId = tempPool.getParentPoolId(); } return false; } catch (Exception e) { log.warn(e.getMessage()); return false; } }
if (destId.equals(oldPool.getParentPoolId())) { duplicate = true;
if (destId.equals(oldPool.getParentPoolId())) { duplicate = true;