refactoring
This commit is contained in:
parent
bcbadeb107
commit
e902699afa
|
@ -29,15 +29,15 @@ public class QueryInformationSystem {
|
|||
"</community>";
|
||||
|
||||
private static final String XQUERY_CI = "for $x in collection('/db/DRIVER/ContextDSResources/ContextDSResourceType') "
|
||||
+
|
||||
" where $x//CONFIGURATION/context[./@type='community' or ./@type='ri'] " +
|
||||
" and $x//CONFIGURATION/context[./@id=%s] "
|
||||
+
|
||||
" return " +
|
||||
"<community> " +
|
||||
"{$x//CONFIGURATION/context/@id}" +
|
||||
"{$x//CONFIGURATION/context/@label}" +
|
||||
"</community>";
|
||||
+
|
||||
" where $x//CONFIGURATION/context[./@type='community' or ./@type='ri'] " +
|
||||
" and $x//CONFIGURATION/context[./@id=%s] "
|
||||
+
|
||||
" return " +
|
||||
"<community> " +
|
||||
"{$x//CONFIGURATION/context/@id}" +
|
||||
"{$x//CONFIGURATION/context/@label}" +
|
||||
"</community>";
|
||||
|
||||
public CommunityMap getCommunityMap(boolean singleCommunity, String community_id)
|
||||
throws ISLookUpException, DocumentException {
|
||||
|
|
|
@ -72,8 +72,10 @@ public class SaveCommunityMap implements Serializable {
|
|||
final String isLookUpUrl = parser.get("isLookUpUrl");
|
||||
log.info("isLookUpUrl: {}", isLookUpUrl);
|
||||
|
||||
final Boolean singleCommunity = Optional.ofNullable(parser.get("singleDeposition"))
|
||||
.map(Boolean::valueOf).orElse(false);
|
||||
final Boolean singleCommunity = Optional
|
||||
.ofNullable(parser.get("singleDeposition"))
|
||||
.map(Boolean::valueOf)
|
||||
.orElse(false);
|
||||
|
||||
final String community_id = Optional.ofNullable(parser.get("communityId")).orElse(null);
|
||||
|
||||
|
@ -83,8 +85,12 @@ public class SaveCommunityMap implements Serializable {
|
|||
|
||||
}
|
||||
|
||||
private void saveCommunityMap(boolean singleCommunity, String community_id) throws ISLookUpException, IOException, DocumentException {
|
||||
writer.write(Utils.OBJECT_MAPPER.writeValueAsString(queryInformationSystem.getCommunityMap(singleCommunity, community_id)));
|
||||
private void saveCommunityMap(boolean singleCommunity, String community_id)
|
||||
throws ISLookUpException, IOException, DocumentException {
|
||||
writer
|
||||
.write(
|
||||
Utils.OBJECT_MAPPER
|
||||
.writeValueAsString(queryInformationSystem.getCommunityMap(singleCommunity, community_id)));
|
||||
writer.close();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue