Skip to content

Commit

Permalink
send to IA, cuz manualAnnotations.jsp did?
Browse files Browse the repository at this point in the history
  • Loading branch information
naknomum committed Jan 14, 2025
1 parent 705e7b2 commit 232cfc4
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/main/java/org/ecocean/Annotation.java
Original file line number Diff line number Diff line change
Expand Up @@ -1236,6 +1236,7 @@ public static Base createFromApi(JSONObject payload, List<File> files, Shepherd
}
}
// must have all we need now
String context = myShepherd.getContext();
List<Annotation> annots = ma.getAnnotations(); // get before we add ours
FeatureType.initAll(myShepherd);
JSONObject fparams = new JSONObject();
Expand All @@ -1255,7 +1256,6 @@ public static Base createFromApi(JSONObject payload, List<File> files, Shepherd
myShepherd.getPM().makePersistent(ann);
/*
if (enc != null) {
String context = myShepherd.getContext();
if (IBEISIA.validForIdentification(ann, context) && iaConf.isValidIAClass(enc.getTaxonomy(myShepherd), iaClass)) {
ann.setMatchAgainst(true);
}
Expand Down Expand Up @@ -1345,6 +1345,17 @@ public static Base createFromApi(JSONObject payload, List<File> files, Shepherd
foundTrivial + " (and Feature) from " + ma + " and " + enc);
}
}
// send to IA as needed
try {
if (ma.getAcmId() == null) {
ArrayList<MediaAsset> mas = new ArrayList<MediaAsset>();
mas.add(ma);
IBEISIA.sendMediaAssetsNew(mas, context);
}
ArrayList<Annotation> anns = new ArrayList<Annotation>();
anns.add(ann);
IBEISIA.sendAnnotationsNew(anns, context, myShepherd);
} catch (Exception ex) {} // silently fail; they will be synced up later
return ann;
}

Expand Down

0 comments on commit 232cfc4

Please sign in to comment.