DataManager dm = gc.getBean(DataManager.class);
AccessManager accessMan = gc.getBean(AccessManager.class);
UserSession us = context.getUserSession();
context.info("Get selected metadata");
SelectionManager sm = SelectionManager.getManager(us);
Set<Integer> metadata = new HashSet<Integer>();
Set<Integer> notFound = new HashSet<Integer>();
Set<Integer> notOwner = new HashSet<Integer>();
final MetadataRepository metadataRepository = context.getBean(MetadataRepository.class);
synchronized(sm.getSelection("metadata")) {
for (Iterator<String> iter = sm.getSelection("metadata").iterator(); iter.hasNext();) {
String uuid = (String) iter.next();
String id = dm.getMetadataId(uuid);
final Integer iId = Integer.valueOf(id);