Skip to content

Commit

Permalink
add parameter for geocat editing parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Eichar committed Sep 10, 2015
1 parent ab55324 commit d112fe8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Expand Up @@ -821,6 +821,7 @@ private void computeQuery(ServiceContext srvContext, Element request, ServiceCon
grpList.append(" or ");
grpList.append(g);
}

String grps = grpList.toString();
for (Content elem : operations) {
if (elem.getValue().equalsIgnoreCase("view")) {
Expand All @@ -838,7 +839,22 @@ private void computeQuery(ServiceContext srvContext, Element request, ServiceCon
}
}
}
// GEOCAT Hack to get editable MD. This is required because geocat doesn't really use the editing privilege
// so if gcediting == y then get all MD that are owned by one of the groups the current user is part of then
if (request.getChildText("gcediting") != null) {
StringBuilder grpList = new StringBuilder();
for (Integer g : userGroups) {
if (grpList.length() > 0)
grpList.append(" or ");
grpList.append(g);
}

request.removeChild("gcediting");
request.addContent(new Element(Geonet.IndexFieldNames.GROUP_OWNER).setText(grpList.toString()));
request.addContent(new Element(Geonet.IndexFieldNames.IS_HARVESTED).setText("n"));
request.addContent(new Element(Geonet.IndexFieldNames.IS_TEMPLATE).setText("n"));
}
// END GEOCAT
if (_styleSheetName.equals(Geonet.File.SEARCH_Z3950_SERVER)) {
// Construct Lucene query by XSLT, not Java, for Z3950 anyway :-)
Element xmlQuery = _sm.transform(_styleSheetName, request);
Expand Down
Expand Up @@ -146,7 +146,7 @@
<div class="form-group" ng-if="user['@authenticated'] == 'true'">
<label for="toeditF" class="col-md-4 col-sm-12 control-label" translate>toEdit</label>
<div class="col-sm-8">
<input id="toeditF" type="checkbox" data-ng-model="searchObj.params.editable" ng-true-value="true" ng-false-value="''">
<input id="toeditF" type="checkbox" data-ng-model="searchObj.params.gcediting" ng-true-value="'y'" ng-false-value="''">
</div>
</div>

Expand Down

0 comments on commit d112fe8

Please sign in to comment.