Skip to content

Commit

Permalink
Merge pull request #556 from Esri/2.7.2
Browse files Browse the repository at this point in the history
Stac Delete Collection, Pagination Fix
  • Loading branch information
mhogeweg authored Sep 10, 2024
2 parents e66b758 + d8b7e65 commit 25cdbba
Show file tree
Hide file tree
Showing 33 changed files with 570 additions and 1,815 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ public static GeoportalContext getInstance() {
private boolean parseGml;
private boolean supportsCollections = false;
// HashMap stores userName and List of User Groups in ArcGISAuthentication
private HashMap<String,ArrayList<Group>> userGroupMap = new HashMap<String,ArrayList<Group>>();
private HashMap<String,ArrayList<Group>> userGroupMap = new HashMap<String,ArrayList<Group>>();
private int numStacFeaturesAddItem = 100;
private boolean validateStacFields = false;


public HashMap<String, ArrayList<Group>> getUserGroupMap() {
Expand Down Expand Up @@ -178,6 +180,22 @@ public boolean getSupportsCollections() {
public void setSupportsCollections(boolean supportsCollections) {
this.supportsCollections = supportsCollections;
}
//Number of Stac features allowed in POST request
public int getNumStacFeaturesAddItem() {
return numStacFeaturesAddItem;
}

public void setNumStacFeaturesAddItem(int numStacFeaturesAddItem) {
this.numStacFeaturesAddItem = numStacFeaturesAddItem;
}
//Validate Stac fields in Stac Feature in POST request
public boolean isValidateStacFields() {
return this.validateStacFields;
}

public void setValidateStacFields(boolean validateStacFields) {
this.validateStacFields = validateStacFields;
}

/** Methods =============================================================== */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,30 +223,24 @@ public String send(String method, String url, String data, String dataContentTyp
}
}
}
br = new BufferedReader(new InputStreamReader(con.getInputStream(),charset));
int code = ((HttpURLConnection) con).getResponseCode();
//In case of error, Read error stream
if(code >= 400)
{
br = new BufferedReader(new InputStreamReader(((HttpURLConnection) con).getErrorStream(),charset));
}
else
{
br = new BufferedReader(new InputStreamReader(con.getInputStream(),charset));
}

int nRead = 0;
char[] buffer = new char[4096];
while ((nRead = br.read(buffer,0,4096)) >= 0) {
sw.write(buffer,0,nRead);
}
result = sw.toString();
// } catch(IOException ex) {
// try {
// if (con != null && br == null) {
// int code = con.getResponseCode();
// System.err.println("code="+code);
// br = new BufferedReader(new InputStreamReader(con.getInputStream(),charset));
// int nRead = 0;
// char[] buffer = new char[4096];
// while ((nRead = br.read(buffer,0,4096)) >= 0) {
// sw.write(buffer,0,nRead);
// }
// System.err.println("error="+sw.toString());
// }
// } catch (Exception ex1) {
// ex1.printStackTrace();
// }
// throw ex;

} finally {
try {if (wr != null) wr.close();} catch(Exception ef) {ef.printStackTrace();}
try {if (br != null) br.close();} catch(Exception ef) {ef.printStackTrace();}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,15 @@ public class FieldNames {

/** FIELD_STAC_UPDATED = "updated" */
public static String FIELD_STAC_UPDATED = "updated";

//Added in Stac item to make compatible with Geoportal
public static String FIELD_URL_GRANULE_S = "url_granule_s";

public static String FIELD_SHAPE_GEO = "shape_geo";
public static String FIELD_ENVELOPE_GEO = "envelope_geo";
public static String FIELD_GEOMETRY = "geometry";
public static String FIELD_BBOX = "bbox";
public static String FIELD_ASSETS = "assets";
public static String FIELD_THUMBNAIL = "thumbnail";

}
Loading

0 comments on commit 25cdbba

Please sign in to comment.