/** * 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; } }
ItemFacade item = (ItemFacade)questionItemsArray[i]; item.setSequence(Integer.valueOf(i + 1)); qps.addItemToPool(item.getItemId(),savedPool.getQuestionPoolId());
newPool.setQuestionPoolItems(prepareQuestions(newPool.getQuestionPoolId(), itemDataArray)); newPool.setQuestions(itemDataArray); newPool = savePool(newPool); while (citer.hasNext()) { Long childPoolId = (Long) citer.next(); copyPool(tree, agentId, childPoolId, newPool.getQuestionPoolId(), prependString1, prependString2);
newPool.setQuestionPoolItems(prepareQuestions(newPool.getQuestionPoolId(), itemDataArray)); newPool.setQuestions(itemDataArray); newPool = savePool(newPool); while (citer.hasNext()) { Long childPoolId = (Long) citer.next(); copyPool(tree, agentId, childPoolId, newPool.getQuestionPoolId(), prependString1, prependString2);
String baseId = questionpool.getQuestionPoolId().toString(); boolean isUnique=questionPoolService.poolIsUnique(baseId,title,"0", me); questionPoolItem.setQuestionPoolId(questionpool.getQuestionPoolId()); questionPoolItem.setItemId(item.getItemId()); questionpool.addQuestionPoolItem((QuestionPoolItemIfc) questionPoolItem); questionPoolService.deletePool(questionpool.getQuestionPoolId(), AgentFacade.getAgentString(), null); throw new RuntimeException(e);
String baseId = questionpool.getQuestionPoolId().toString(); boolean isUnique=questionPoolService.poolIsUnique(baseId,title,"0", me); questionPoolItem.setQuestionPoolId(questionpool.getQuestionPoolId()); questionPoolItem.setItemId(item.getItemId()); questionpool.addQuestionPoolItem((QuestionPoolItemIfc) questionPoolItem); questionPoolService.deletePool(questionpool.getQuestionPoolId(), AgentFacade.getAgentString(), null); throw new RuntimeException(e);
sourcePool.setParentPoolId(destPool.getQuestionPoolId()); int retryCount = PersistenceService.getInstance().getPersistenceHelper().getRetryCount(); while (retryCount > 0){
sourcePool.setParentPoolId(destPool.getQuestionPoolId()); int retryCount = PersistenceService.getInstance().getPersistenceHelper().getRetryCount(); while (retryCount > 0){