Skip to content

Commit

Permalink
WB-1251: part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
holmbergius committed Dec 30, 2020
1 parent 233be8a commit aa943d2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/main/java/org/ecocean/identity/IBEISIA.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import org.json.JSONException;

import java.net.URL;
import java.net.URLEncoder;

import org.ecocean.CommonConfiguration;
import org.ecocean.media.*;
Expand All @@ -65,6 +66,7 @@

import java.io.File;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.security.NoSuchAlgorithmException;
import java.security.InvalidKeyException;
Expand Down Expand Up @@ -1708,7 +1710,7 @@ public static int updateSpeciesOnIA(Shepherd myShepherd, List<Annotation> anns)
if(ann.getIAClass()==null)continue;
uuids.add(ann.getAcmId());
//species.add(taxonomyString);
species.add(ann.getIAClass());
species.add(ann.getIAClass().replaceAll("\\+","%2B"));
}
System.out.println("updateSpeciesOnIA(): " + uuids);
System.out.println("updateSpeciesOnIA(): " + species);
Expand Down Expand Up @@ -2431,6 +2433,10 @@ public static URL iaURL(String context, String urlSuffix) {
System.out.println("INFO: setting iaBaseURL=" + iaBaseURL);
}
String ustr = iaBaseURL;

System.out.println("!!!ustr: "+iaBaseURL);
System.out.println("!!!urlSuffix: "+urlSuffix);

if (urlSuffix != null) {
if (urlSuffix.indexOf("/") == 0) urlSuffix = urlSuffix.substring(1); //get rid of leading /
ustr += urlSuffix;
Expand Down Expand Up @@ -3222,10 +3228,12 @@ public static void iaUpdateSpecies(List<String> uuids, List<String> species, Str
}
JSONArray idList = new JSONArray();
JSONArray speciesList = new JSONArray();
System.out.println("!!!IGOTS: "+species.toString());
for (int i = 0 ; i < uuids.size() ; i++) {
idList.put(toFancyUUID(uuids.get(i)));
speciesList.put(species.get(i).replaceAll(" ", "_").toLowerCase());
speciesList.put(species.get(i));
}
System.out.println("!!!IPUTS: "+speciesList.toString());
JSONObject rtn = RestClient.put(iaURL(context, "/api/annot/species/json/?annot_uuid_list=" + idList.toString() + "&species_text_list=" + speciesList.toString()), null);
}

Expand Down Expand Up @@ -4436,4 +4444,5 @@ public static Map<String,String> iaSpeciesDiff(Shepherd myShepherd, boolean incl
return diff;
}


}

0 comments on commit aa943d2

Please sign in to comment.