use of org.openforis.idm.metamodel.xml.CodeListImporter in project collect by openforis.
the class CodeListItemPersisterPR method persistItem.
protected void persistItem() {
CodeListImporter binder = getImporter();
PersistedCodeListItem persistedItem = (PersistedCodeListItem) item;
persistedItem.setSystemId(binder.nextItemId());
persistedItem.setSortOrder(calculateSortOrder());
if (parentItem != null) {
int parentId = ((PersistedCodeListItem) parentItem).getSystemId();
persistedItem.setParentId(parentId);
}
binder.persistItem(persistedItem);
itemPersisted = true;
}
use of org.openforis.idm.metamodel.xml.CodeListImporter in project collect by openforis.
the class CodeListManager method importCodeLists.
@Transactional
public void importCodeLists(CollectSurvey survey, InputStream is) throws CodeListImportException {
int nextSystemId = codeListItemDao.nextSystemId();
CollectCodeListService service = new CollectCodeListService();
service.setCodeListManager(this);
CodeListImporter binder = new CodeListImporter(service, nextSystemId);
try {
binder.importCodeLists(survey, is);
} catch (IdmlParseException e) {
throw new CodeListImportException(e);
}
}
Aggregations