/** 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(); }
/** 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); }
/** 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(); }
/** 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)); }
/** Writes a CMIS relativePathSegment tag. */ public void writeRelativePathSegment(String relativePathSegment) throws XMLStreamException { XMLUtils.write( getWriter(), XMLConstants.PREFIX_RESTATOM, XMLConstants.NAMESPACE_RESTATOM, "relativePathSegment", relativePathSegment); }
/** Writes an Atom published tag. */ public void writePublished(GregorianCalendar published) throws XMLStreamException { XMLUtils.write( getWriter(), XMLConstants.PREFIX_ATOM, XMLConstants.NAMESPACE_ATOM, "published", published); }
/** 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); }
/** Writes an Atom title tag. */ public void writeTitle(String title) throws XMLStreamException { XMLUtils.write( getWriter(), XMLConstants.PREFIX_ATOM, XMLConstants.NAMESPACE_ATOM, "title", title); }
/** Writes an Atom id tag. */ public void writeId(String id) throws XMLStreamException { XMLUtils.write(getWriter(), XMLConstants.PREFIX_ATOM, XMLConstants.NAMESPACE_ATOM, "id", id); }