Class Document.DocumentID

java.lang.Object
se.conciliate.extensions.documents.Document.DocumentID
Enclosing class:
Document

public static final class Document.DocumentID extends Object
  • Constructor Details

  • Method Details

    • getSource

      public String getSource()
    • getId

      public String getId()
    • encode

      public String encode()
    • getXMLSafeId

      public String getXMLSafeId()
      This is needed because
      1. 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.
    • sourceAsFileName

      public String sourceAsFileName()
    • idAsFileName

      public String idAsFileName()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object