Skip to content

Commit

Permalink
Merge pull request #90 from diging/hotfix/v2.0.2
Browse files Browse the repository at this point in the history
[CCP-139] updated Apache commons-lang to 3.4 and used new escape method
  • Loading branch information
jdamerow committed Mar 31, 2016
2 parents be131d6 + 09c014f commit fd29ae0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Conceptpower+Spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.1</version>
<version>3.4</version>
</dependency>

<!-- Jackson JSON Mapper -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public String getEntry(ConceptEntry entry, ConceptType type) {
// lemma
sb.append("<" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.LEMMA + ">");
sb.append(StringEscapeUtils.escapeXml(entry.getWord()));
sb.append(StringEscapeUtils.escapeXml10(entry.getWord()));
sb.append("</" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.LEMMA + ">");

Expand All @@ -70,53 +70,53 @@ public String getEntry(ConceptEntry entry, ConceptType type) {
// description
sb.append("<" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.DESCRIPTION + ">");
sb.append(StringEscapeUtils.escapeXml(entry.getDescription()));
sb.append(StringEscapeUtils.escapeXml10(entry.getDescription()));
sb.append("</" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.DESCRIPTION + ">");

// concept list
sb.append("<" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.CONCEPT_LIST + ">");
sb.append(StringEscapeUtils.escapeXml(entry.getConceptList()));
sb.append(StringEscapeUtils.escapeXml10(entry.getConceptList()));
sb.append("</" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.CONCEPT_LIST + ">");

// creator id
sb.append("<" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.CREATOR_ID + ">");
sb.append(StringEscapeUtils.escapeXml(entry.getCreatorId() != null ? entry
sb.append(StringEscapeUtils.escapeXml10(entry.getCreatorId() != null ? entry
.getCreatorId().trim() : ""));
sb.append("</" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.CREATOR_ID + ">");

// equal to
sb.append("<" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.EQUAL_TO + ">");
sb.append(StringEscapeUtils.escapeXml(entry.getEqualTo() != null ? entry
sb.append(StringEscapeUtils.escapeXml10(entry.getEqualTo() != null ? entry
.getEqualTo().trim() : ""));
sb.append("</" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.EQUAL_TO + ">");

// modified by
sb.append("<" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.MODIFIED_BY + ">");
sb.append(StringEscapeUtils.escapeXml(entry.getModified() != null ? entry
sb.append(StringEscapeUtils.escapeXml10(entry.getModified() != null ? entry
.getModified().trim() : ""));
sb.append("</" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.MODIFIED_BY + ">");

// similar to
sb.append("<" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.SIMILAR_TO + ">");
sb.append(StringEscapeUtils.escapeXml(entry.getSimilarTo() != null ? entry
sb.append(StringEscapeUtils.escapeXml10(entry.getSimilarTo() != null ? entry
.getSimilarTo().trim() : ""));
sb.append("</" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.SIMILAR_TO + ">");

// synonym ids
sb.append("<" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.SYNONYM_IDS + ">");
sb.append(StringEscapeUtils.escapeXml(entry.getSynonymIds() != null ? entry
sb.append(StringEscapeUtils.escapeXml10(entry.getSynonymIds() != null ? entry
.getSynonymIds().trim() : ""));
sb.append("</" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.SYNONYM_IDS + ">");
Expand All @@ -132,7 +132,7 @@ public String getEntry(ConceptEntry entry, ConceptType type) {
}
sb.append(">");
if (type != null)
sb.append(StringEscapeUtils.escapeXml(type.getTypeName()));
sb.append(StringEscapeUtils.escapeXml10(type.getTypeName()));
sb.append("</" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.TYPE + ">");

Expand All @@ -146,7 +146,7 @@ public String getEntry(ConceptEntry entry, ConceptType type) {
// wordnet id
sb.append("<" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.WORDNET_ID + ">");
sb.append(StringEscapeUtils.escapeXml(entry.getWordnetId() != null ? entry
sb.append(StringEscapeUtils.escapeXml10(entry.getWordnetId() != null ? entry
.getWordnetId().trim() : ""));
sb.append("</" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.WORDNET_ID + ">");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,37 +43,37 @@ public List<String> appendEntry(ConceptType type, ConceptType supertype) {
}
sb.append(">");
if (type != null)
sb.append(StringEscapeUtils.escapeXml(type.getTypeName()));
sb.append(StringEscapeUtils.escapeXml10(type.getTypeName()));
sb.append("</" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.TYPE + ">");

// type description
sb.append("<" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.DESCRIPTION + ">");
sb.append(StringEscapeUtils.escapeXml(type.getDescription()));
sb.append(StringEscapeUtils.escapeXml10(type.getDescription()));
sb.append("</" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.DESCRIPTION + ">");

// creator id
sb.append("<" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.CREATOR_ID + ">");
sb.append(StringEscapeUtils.escapeXml(type.getCreatorId() != null ? type
sb.append(StringEscapeUtils.escapeXml10(type.getCreatorId() != null ? type
.getCreatorId().trim() : ""));
sb.append("</" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.CREATOR_ID + ">");

// matches
sb.append("<" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.MATCHES + ">");
sb.append(StringEscapeUtils.escapeXml(type.getMatches() != null ? type
sb.append(StringEscapeUtils.escapeXml10(type.getMatches() != null ? type
.getMatches().trim() : ""));
sb.append("</" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.MATCHES + ">");

// modified by
sb.append("<" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.MODIFIED_BY + ">");
sb.append(StringEscapeUtils.escapeXml(type.getModified() != null ? type
sb.append(StringEscapeUtils.escapeXml10(type.getModified() != null ? type
.getModified().trim() : ""));
sb.append("</" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.MODIFIED_BY + ">");
Expand All @@ -89,7 +89,7 @@ public List<String> appendEntry(ConceptType type, ConceptType supertype) {
+ uriCreator.getTypeURI(supertype) + "\"");

sb.append(">");
sb.append(StringEscapeUtils.escapeXml(supertype.getTypeName()));
sb.append(StringEscapeUtils.escapeXml10(supertype.getTypeName()));
sb.append("</" + XMLConstants.NAMESPACE_PREFIX + ":"
+ XMLConstants.SUPERTYPE + ">");
}
Expand Down

0 comments on commit fd29ae0

Please sign in to comment.