Skip to content

Commit

Permalink
Merge pull request #292 from ndinakar/v6-dev
Browse files Browse the repository at this point in the history
changes for ncip request
  • Loading branch information
srinduri04 authored Nov 16, 2022
2 parents 577005c + 6171ccb commit 55b948c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
9 changes: 9 additions & 0 deletions src/main/java/org/recap/ScsbConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -460,5 +460,14 @@ public static List<String> getRequestTypeList() {
public static final String ILS_SOURCE_FOR_ITEM = "ils.source.for.item.";
public static final String SOLR_SEARCH_ERROR = "Solr Search Error";

public static final String REPLACE_STRING = "NfOBQ0";
public static final String REGEX_VERSION = "ns"+"[0-9]"+":version";
public static final String REGEX_SCHEME = "ns"+"[0-9]"+":Scheme";
public static final String REGEX_XMLNS = "xmlns:ns"+"[0-9]";

public static final String VERSION = "ns1:version";
public static final String SCHEME = "ns1:Scheme";
public static final String XMLNS = "xmlns:ns1";


}
10 changes: 5 additions & 5 deletions src/main/java/org/recap/util/CommonUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,12 @@ private String replaceStringCharacters(String text){
}

public String formatRequest(String requestBody){
String tempRequest = requestBody.replaceAll("</", "RECAP_123");
String tempRequest = requestBody.replaceAll("</", ScsbConstants.REPLACE_STRING);
tempRequest = replaceStringCharacters(tempRequest);
tempRequest = tempRequest.replaceAll("RECAP_123", "</ns1:");
tempRequest = tempRequest.replaceAll("xmlns:ns2","xmlns:ns1");
tempRequest = tempRequest.replaceAll("ns2:version","ns1:version");
tempRequest = tempRequest.replaceAll("ns2:Scheme","ns1:Scheme");
tempRequest = tempRequest.replaceAll(ScsbConstants.REPLACE_STRING, "</ns1:");
tempRequest = tempRequest.replaceAll(ScsbConstants.REGEX_VERSION,ScsbConstants.VERSION);
tempRequest = tempRequest.replaceAll(ScsbConstants.REGEX_SCHEME,ScsbConstants.SCHEME);
tempRequest = tempRequest.replaceAll(ScsbConstants.REGEX_XMLNS,ScsbConstants.XMLNS);
return tempRequest;
}

Expand Down

0 comments on commit 55b948c

Please sign in to comment.