}
public List getRemainingLanguages(Integer repositoryId) throws ConstraintException, SystemException
{
Database db = CastorDatabaseService.getDatabase();
ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();
List remainingLanguages = new ArrayList();
beginTransaction(db);
try
{
Repository repository = RepositoryController.getController().getRepositoryWithId(repositoryId, db);
Collection repositoryLanguageList = repository.getRepositoryLanguages();
List languageList = LanguageController.getController().getLanguageVOList();
remainingLanguages.addAll(languageList);
Iterator languageIterator = languageList.iterator();
while(languageIterator.hasNext())
{
LanguageVO languageVO = (LanguageVO)languageIterator.next();
logger.info("Language:" + languageVO.getName());
Iterator repositoryLanguageIterator = repositoryLanguageList.iterator();
while(repositoryLanguageIterator.hasNext())
{
RepositoryLanguage repositoryLanguage = (RepositoryLanguage)repositoryLanguageIterator.next();
logger.info("Comparing" + languageVO.getLanguageId().intValue() + " and " + repositoryLanguage.getLanguage().getLanguageId().intValue());
if(languageVO.getLanguageId().intValue() == repositoryLanguage.getLanguage().getLanguageId().intValue())
{
remainingLanguages.remove(languageVO);
}
}
}
//If any of the validations or setMethods reported an error, we throw them up now before create.
ceb.throwIfNotEmpty();
commitTransaction(db);
}
catch(ConstraintException ce)
{