Examples of addWorkspace()


Examples of org.apache.abdera.model.Service.addWorkspace()

            RequestContext request);

    protected Service getServiceElement(RequestContext request) {
        Service service = abdera.newService();
        for (WorkspaceInfo wi : getWorkspaceManager(request).getWorkspaces(request)) {
            service.addWorkspace(wi.asWorkspaceElement(request));
        }
        return service;
    }

    public void setFilters(List<Filter> filters) {
View Full Code Here

Examples of org.apache.abdera.model.Service.addWorkspace()

                collection.addAccepts("application/atom+xml; type=entry");
                collection.addAccepts("application/json;type=entry");
                collection.addCategories().setFixed(false);           
            }
            workspace.addCollection(collection);
            service.addWorkspace(workspace);

            //FIXME add prettyPrint support
            try {
                service.getDocument().writeTo(response.getOutputStream());
            } catch (IOException ioe) {
View Full Code Here

Examples of org.apache.abdera.model.Service.addWorkspace()

                collection.addAccepts("application/atom+xml; type=entry");
                collection.addAccepts("application/json;type=entry");
                collection.addCategories().setFixed(false);           
            }
            workspace.addCollection(collection);
            service.addWorkspace(workspace);

            //FIXME add prettyPrint support
            try {
                service.getDocument().writeTo(response.getOutputStream());
            } catch (IOException ioe) {
View Full Code Here

Examples of org.apache.abdera.model.Service.addWorkspace()

                collection.addAccepts("application/atom+xml; type=entry");
                collection.addAccepts("application/json;type=entry");
                collection.addCategories().setFixed(false);           
            }
            workspace.addCollection(collection);
            service.addWorkspace(workspace);

            //FIXME add prettyPrint support
            try {
                service.getDocument().writeTo(response.getOutputStream());
            } catch (IOException ioe) {
View Full Code Here

Examples of org.apache.abdera.model.Service.addWorkspace()

                collection.addAccepts("application/atom+xml");
                collection.addAccepts("application/json");
                collection.addCategories().setFixed(false);
            }
            workspace.addCollection(collection);
            service.addWorkspace(workspace);

            //FIXME add prettyPrint support
            try {
                service.getDocument().writeTo(response.getOutputStream());
            } catch (IOException ioe) {
View Full Code Here

Examples of org.apache.abdera.model.Service.addWorkspace()

            collection.setAccept("entry");
            collection.addCategories().setFixed(false);
           
            workspace.addCollection(collection);

            service.addWorkspace(workspace);

            //FIXME add prettyPrint support
            try {
                service.getDocument().writeTo(response.getOutputStream());
            } catch (IOException ioe) {
View Full Code Here

Examples of org.apache.abdera.model.Service.addWorkspace()

  @Test
    public void testCollectionAccepts() throws Exception {
        Abdera abdera = new Abdera();
        Factory factory = abdera.getFactory();
        Service svc = factory.newService();
        Workspace ws = svc.addWorkspace("test-ws");
        Collection coll = ws.addCollection("test-coll", ws.getTitle() + "/test-coll");
        coll.setAcceptsEntry();
        assertTrue("Collection does not accept entries.", coll.acceptsEntry());
        coll.addAccepts("application/apples");
        assertTrue("Collection does not accept apples.", coll.accepts("application/apples"));
View Full Code Here

Examples of org.apache.abdera.model.Service.addWorkspace()

  @Test
  public void testCollectionAcceptsMultipart() throws Exception {
      Abdera abdera = new Abdera();
      Factory factory = abdera.getFactory();
      Service svc = factory.newService();
      Workspace ws = svc.addWorkspace("test-ws");
      FOMMultipartCollection coll = (FOMMultipartCollection) ws.addMultipartCollection("test multipart coll", "/test-coll");  
      coll.setAcceptsEntry();
      coll.addAccepts("image/*", "multipart-related");           
     
      assertTrue("Collection does not accept entries.", coll.acceptsEntry());
View Full Code Here

Examples of org.apache.abdera.model.Service.addWorkspace()

  }
 
  private Document<Service> init_service_doc(Abdera abdera) {
    Factory factory = abdera.getFactory();
    Service service = factory.newService();
    Workspace workspace = service.addWorkspace("Simple");
    try {
      Collection collection = workspace.addCollection("Simple", "atom/feed");
      collection.setAccept("entry");
      collection.addCategories().setFixed(false);
    } catch (Exception e) {}
View Full Code Here

Examples of org.apache.abdera.model.Service.addWorkspace()

  public static void main(String... args) throws Exception {
   
    Abdera abdera = new Abdera();
    Service service = abdera.newService();
    Workspace workspace = service.addWorkspace("My workspace");
    Collection collection = workspace.addCollection("My collection", "foo");
   
    // Specify which features are supported by the collection
    FeaturesHelper.addFeature(collection, FeaturesHelper.FEATURE_DRAFTS);
    FeaturesHelper.addFeature(collection, FeaturesHelper.FEATURE_TEXT_TITLE, Feature.Status.REQUIRED);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.