Package org.apache.abdera.model

Examples of org.apache.abdera.model.Workspace


    return _getChildrenAsSet(WORKSPACE);
  }

  public Workspace getWorkspace(String title) {
    List<Workspace> workspaces = getWorkspaces();
    Workspace workspace = null;
    for (Workspace w : workspaces) {
      if (w.getTitle().equals(title)) {
        workspace = w;
        break;
      }
View Full Code Here


    addChild((OMElement) workspace);
  }
 
  public Workspace addWorkspace(String title) {
    FOMFactory fomfactory = (FOMFactory) factory;
    Workspace workspace = fomfactory.newWorkspace(this);
    workspace.setTitle(title);
    return workspace;
  }
View Full Code Here

    return workspace;
  }

  public Collection getCollection(String workspace, String collection) {
    Collection col = null;
    Workspace w = getWorkspace(workspace);
    if (w != null) {
      col = w.getCollection(collection);
    }
    return col;
  }
View Full Code Here

    iri.setValue("http://example.org/foo");
    assertEquals(iri.getValue().toString(), "http://example.org/foo");
    iri = factory.newUri();
    iri.setValue("http://example.org/foo");
    assertEquals(iri.getValue().toString(), "http://example.org/foo");
    Workspace workspace = factory.newWorkspace();
    assertNotNull(workspace);
    div = factory.newDiv();
    content = factory.newContent(Content.Type.XHTML);
    content.setValueElement(div);
    assertNotNull(content);
View Full Code Here

  private static AppTest INSTANCE = null;
 
  private static Document<Service> init_service_document(String base) {
    try {
      Service service = getFactory().newService();
      Workspace workspace = service.addWorkspace("Test");
      workspace.addCollection("Entries", base + "/collections/entries").setAccept("entry");
      workspace.addCollection("Other", base + "/collections/other").setAccept("text/plain");
      Document<Service> doc = service.getDocument();
      return doc;
    } catch (Exception e) {}
    return null;
  }
View Full Code Here

      Document<Service> service_doc = response.getDocument();
      assertNotNull(service_doc);
      assertEquals(1, service_doc.getRoot().getWorkspaces().size());

      Workspace workspace = service_doc.getRoot().getWorkspace("Test");
      assertNotNull(workspace);

      for (Collection c: workspace.getCollections()) {
        assertNotNull(c.getTitle());
        assertNotNull(c.getHref());
      }
   
      col_uri = getBase() + "/collections/entries";
View Full Code Here

            response.setContentType("application/atomsvc+xml; charset=utf-8");
           
            Service service = abderaFactory.newService();
            //service.setText("service");
           
            Workspace workspace = abderaFactory.newWorkspace();
            workspace.setTitle("resource");

            String href = request.getRequestURL().toString();
            href = href.substring(0, href.length() - "/atomsvc".length());
           
            Collection collection = workspace.addCollection("collection", "atom/feed");
            collection.setTitle("entries");
            collection.setAttributeValue("href", href);
            collection.setAccept("entry");
            collection.addCategories().setFixed(false);
           
            workspace.addCollection(collection);

            service.addWorkspace(workspace);

            //FIXME add prettyPrint support
            try {
View Full Code Here

  private static AppTest INSTANCE = null;
 
  private static Document<Service> init_service_document(String base) {
    try {
      Service service = getFactory().newService();
      Workspace workspace = service.addWorkspace("Test");
      workspace.addCollection("Entries", base + "/collections/entries").setAccept("entry");
      workspace.addCollection("Other", base + "/collections/other").setAccept("text/plain");
      Document<Service> doc = service.getDocument();
      return doc;
    } catch (Exception e) {}
    return null;
  }
View Full Code Here

      Document<Service> service_doc = response.getDocument();
      assertNotNull(service_doc);
      assertEquals(1, service_doc.getRoot().getWorkspaces().size());

      Workspace workspace = service_doc.getRoot().getWorkspace("Test");
      assertNotNull(workspace);

      for (Collection c: workspace.getCollections()) {
        assertNotNull(c.getTitle());
        assertNotNull(c.getHref());
      }
   
      col_uri = getBase() + "/collections/entries";
View Full Code Here

    return _getChildrenAsSet(WORKSPACE);
  }

  public Workspace getWorkspace(String title) {
    List<Workspace> workspaces = getWorkspaces();
    Workspace workspace = null;
    for (Workspace w : workspaces) {
      if (w.getTitle().equals(title)) {
        workspace = w;
        break;
      }
View Full Code Here

TOP

Related Classes of org.apache.abdera.model.Workspace

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.