コード例 #1
0
  /** Writes an Atom collection. */
  public void writeCollection(String href, String collectionType, String text, String... accept)
      throws XMLStreamException {
    XMLStreamWriter xsw = getWriter();

    xsw.writeStartElement(XMLConstants.PREFIX_APP, "collection", XMLConstants.NAMESPACE_APP);
    xsw.writeAttribute("href", href);

    if (collectionType != null) {
      XMLUtils.write(
          xsw,
          XMLConstants.PREFIX_RESTATOM,
          XMLConstants.NAMESPACE_RESTATOM,
          "collectionType",
          collectionType);
    }

    xsw.writeStartElement(XMLConstants.PREFIX_ATOM, "title", XMLConstants.NAMESPACE_ATOM);
    xsw.writeAttribute("type", "text");
    xsw.writeCharacters(text);
    xsw.writeEndElement();

    for (String ct : accept) {
      XMLUtils.write(xsw, XMLConstants.PREFIX_APP, XMLConstants.NAMESPACE_APP, "accept", ct);
    }

    xsw.writeEndElement();
  }
コード例 #2
0
 /** Writes an Atom updated tag. */
 public void writeUpdated(long updated) throws XMLStreamException {
   String updatedStr = DateTimeHelper.formatHttpDateTime(updated);
   XMLUtils.write(
       getWriter(), XMLConstants.PREFIX_APP, XMLConstants.NAMESPACE_APP, "edited", updatedStr);
   XMLUtils.write(
       getWriter(), XMLConstants.PREFIX_ATOM, XMLConstants.NAMESPACE_ATOM, "updated", updatedStr);
 }
コード例 #3
0
  /** Writes an Atom author tag. */
  public void writeAuthor(String author) throws XMLStreamException {
    XMLStreamWriter xsw = getWriter();

    xsw.writeStartElement(XMLConstants.PREFIX_ATOM, "author", XMLConstants.NAMESPACE_ATOM);
    XMLUtils.write(xsw, XMLConstants.PREFIX_ATOM, XMLConstants.NAMESPACE_ATOM, "name", author);
    xsw.writeEndElement();
  }
コード例 #4
0
 /** Writes an Atom published tag. */
 public void writePublished(long published) throws XMLStreamException {
   XMLUtils.write(
       getWriter(),
       XMLConstants.PREFIX_ATOM,
       XMLConstants.NAMESPACE_ATOM,
       "published",
       DateTimeHelper.formatHttpDateTime(published));
 }
コード例 #5
0
 /** Writes a CMIS relativePathSegment tag. */
 public void writeRelativePathSegment(String relativePathSegment) throws XMLStreamException {
   XMLUtils.write(
       getWriter(),
       XMLConstants.PREFIX_RESTATOM,
       XMLConstants.NAMESPACE_RESTATOM,
       "relativePathSegment",
       relativePathSegment);
 }
コード例 #6
0
 /** Writes an Atom published tag. */
 public void writePublished(GregorianCalendar published) throws XMLStreamException {
   XMLUtils.write(
       getWriter(), XMLConstants.PREFIX_ATOM, XMLConstants.NAMESPACE_ATOM, "published", published);
 }
コード例 #7
0
 /** Writes an Atom updated tag. */
 public void writeUpdated(GregorianCalendar updated) throws XMLStreamException {
   XMLUtils.write(
       getWriter(), XMLConstants.PREFIX_APP, XMLConstants.NAMESPACE_APP, "edited", updated);
   XMLUtils.write(
       getWriter(), XMLConstants.PREFIX_ATOM, XMLConstants.NAMESPACE_ATOM, "updated", updated);
 }
コード例 #8
0
 /** Writes an Atom title tag. */
 public void writeTitle(String title) throws XMLStreamException {
   XMLUtils.write(
       getWriter(), XMLConstants.PREFIX_ATOM, XMLConstants.NAMESPACE_ATOM, "title", title);
 }
コード例 #9
0
 /** Writes an Atom id tag. */
 public void writeId(String id) throws XMLStreamException {
   XMLUtils.write(getWriter(), XMLConstants.PREFIX_ATOM, XMLConstants.NAMESPACE_ATOM, "id", id);
 }