private AssessmentFolderShortVo getAssessmentFolder(UserAssessmentFavouritesShortVo voFavourite, String folderName) { if(voFavourite != null && voFavourite.getAssessmentFolderIsNotNull()) { for (int i = 0; i < voFavourite.getAssessmentFolder().size(); i++) { String currentFolder = voFavourite.getAssessmentFolder().get(i).getFolder(); if(currentFolder != null && currentFolder.equals(folderName)) return voFavourite.getAssessmentFolder().get(i); } } AssessmentFolderShortVo voFolder = new AssessmentFolderShortVo(); voFolder.setFolder(folderName); voFolder.setUserDefinedForms(new UserDefinedObjectShortVoCollection()); return voFolder; }
private AssessmentFolderShortVo getFolder(UserAssessmentFavouritesShortVo favoriteShortVo, String rootFolder) { if(favoriteShortVo == null || favoriteShortVo.getAssessmentFolder() == null) return null; for (int i = 0; i < favoriteShortVo.getAssessmentFolder().size(); i++) { if(favoriteShortVo.getAssessmentFolder().get(i).getFolder() != null && favoriteShortVo.getAssessmentFolder().get(i).getFolder().equals(rootFolder)) return favoriteShortVo.getAssessmentFolder().get(i); } return null; }
private String getAleradyInFavorites(UserAssessmentFavouritesShortVo favoriteShortVo, UserDefinedObjectShortVo voUserDefinedObjectShort) { if(favoriteShortVo != null && voUserDefinedObjectShort != null && favoriteShortVo.getAssessmentFolderIsNotNull()) { for(int i=0; i<favoriteShortVo.getAssessmentFolder().size(); i++) { AssessmentFolderShortVo voAssessmentFolder = favoriteShortVo.getAssessmentFolder().get(i); if(voAssessmentFolder.getUserDefinedFormsIsNotNull() && voAssessmentFolder.getUserDefinedForms().indexOf(voUserDefinedObjectShort) >= 0) return voAssessmentFolder.getFolder(); } } return null; }