Package org.apache.abdera.protocol.server.context

Examples of org.apache.abdera.protocol.server.context.StreamWriterResponseContext


*/
public class MultipartRelatedServiceRequestProcessor extends ServiceRequestProcessor {

  @Override 
  protected ResponseContext getServiceDocument(final RequestContext request, final WorkspaceManager workspaceManager) {
        return new StreamWriterResponseContext(request.getAbdera()) {

            protected void writeTo(StreamWriter sw) throws IOException {
                sw.startDocument().startService();
                for (WorkspaceInfo wi : workspaceManager.getWorkspaces(request)) {
                    sw.startWorkspace().writeTitle(wi.getTitle(request));
View Full Code Here


    return buf.toString();
  }
 
  private ResponseContext getOpenSearchDescription(
    RequestContext request) {
      return new StreamWriterResponseContext(request.getAbdera()) {
        protected void writeTo(
          StreamWriter sw)
            throws IOException {
          sw.startDocument()
            .startElement("OpenSearchDescription", OSDNS, "")
View Full Code Here

    Abdera abdera,
    final int code,
    final String message,
    final Throwable t) {
      AbstractResponseContext rc =
        new StreamWriterResponseContext(abdera) {
          protected void writeTo(StreamWriter sw)
            throws IOException {
            Error.create(sw, code, message, t);
          }
        };
      rc.setStatus(code);
      rc.setStatusText(message);
      return rc;
  }
View Full Code Here

            return null;
        }
    }

    protected ResponseContext getServiceDocument(final RequestContext request, final WorkspaceManager workspaceManager) {
        return new StreamWriterResponseContext(request.getAbdera()) {

            protected void writeTo(
                    StreamWriter sw)
                    throws IOException {
                sw.startDocument().startService();
View Full Code Here

        String[] segments = request.getUri().toString().split("/");
        return UrlEncoding.decode(segments[segments.length - 1]);
    }

    public ResponseContext getCategories(RequestContext request) {
        return new StreamWriterResponseContext(request.getAbdera()) {
            protected void writeTo(StreamWriter sw) throws IOException {
                sw.startDocument().startCategories(false).writeCategory("foo").writeCategory("bar")
                    .writeCategory("baz").endCategories().endDocument();
            }
        }.setStatus(200).setContentType(Constants.CAT_MEDIA_TYPE);
View Full Code Here

        String[] segments = request.getUri().toString().split("/");
        return UrlEncoding.decode(segments[segments.length - 1]);
    }

    public ResponseContext getCategories(RequestContext request) {
        return new StreamWriterResponseContext(request.getAbdera()) {
            protected void writeTo(StreamWriter sw) throws IOException {
                sw.startDocument().startCategories(false).writeCategory("foo").writeCategory("bar")
                    .writeCategory("baz").endCategories().endDocument();
            }
        }.setStatus(200).setContentType(Constants.CAT_MEDIA_TYPE);
View Full Code Here

        }
        return buf.toString();
    }

    private ResponseContext getOpenSearchDescription(RequestContext request) {
        return new StreamWriterResponseContext(request.getAbdera()) {
            protected void writeTo(StreamWriter sw) throws IOException {
                sw.startDocument().startElement("OpenSearchDescription", OSDNS, "")
                    .startElement("ShortName", OSDNS, "").writeElementText(getShortName()).endElement()
                    .startElement("Description", OSDNS, "").writeElementText(getDescription()).endElement()
                    .startElement("Tags", OSDNS, "").writeElementText(combineTags()).endElement()
View Full Code Here

        String[] segments = request.getUri().toString().split("/");
        return UrlEncoding.decode(segments[segments.length - 1]);
    }

    public ResponseContext getCategories(RequestContext request) {
        return new StreamWriterResponseContext(request.getAbdera()) {
            protected void writeTo(StreamWriter sw) throws IOException {
                sw.startDocument().startCategories(false).writeCategory("foo").writeCategory("bar")
                    .writeCategory("baz").endCategories().endDocument();
            }
        }.setStatus(200).setContentType(Constants.CAT_MEDIA_TYPE);
View Full Code Here

            return null;
        }
    }

    protected ResponseContext getServiceDocument(final RequestContext request, final WorkspaceManager workspaceManager) {
        return new StreamWriterResponseContext(request.getAbdera()) {

            protected void writeTo(StreamWriter sw) throws IOException {
                sw.startDocument().startService();
                for (WorkspaceInfo wi : workspaceManager.getWorkspaces(request)) {
                    sw.startWorkspace().writeTitle(wi.getTitle(request));
View Full Code Here

*/
public class MultipartRelatedServiceRequestProcessor extends ServiceRequestProcessor {

    @Override
    protected ResponseContext getServiceDocument(final RequestContext request, final WorkspaceManager workspaceManager) {
        return new StreamWriterResponseContext(request.getAbdera()) {

            protected void writeTo(StreamWriter sw) throws IOException {
                sw.startDocument().startService();
                for (WorkspaceInfo wi : workspaceManager.getWorkspaces(request)) {
                    sw.startWorkspace().writeTitle(wi.getTitle(request));
View Full Code Here

TOP

Related Classes of org.apache.abdera.protocol.server.context.StreamWriterResponseContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.