Class Document.DocumentID
java.lang.Object
se.conciliate.extensions.documents.Document.DocumentID
- Enclosing class:
- Document
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
DocumentID
-
-
Method Details
-
getSource
-
getId
-
encode
-
getXMLSafeId
This is needed because- When publishing, we create a JSONP "file" looking like
window.__jsonpCallbackFor__uuid_xml_html({"xml" : "xmlString"});
where the xmlString is an xml document. This document must be escaped in order to not break the JSON-object (can't contain row breaks, quotes and so on). While escaping, we could potentially escape a document ID if the ID contains, say, quotes. For example, a DocumentSource giving IDs like the string [I'm 120cm "tall"] would get escaped to [I\'m 120cm \"tall\"]. This id will be part of the xmlString above and thus correct JSON. However, when the xmlString is then parsed as XML in the browser, the browser will see [I'm 120cm "tall"] as an attribute-value for an xml-element, for example,<document id="I'm 120cm "tall""/>
. This is not valid XML.
- Returns:
- The id in a form that is safe to include in XML.
- When publishing, we create a JSONP "file" looking like
-
sourceAsFileName
-
idAsFileName
-
hashCode
public int hashCode() -
equals
-
toString
-