Package org.apache.abdera.model

Examples of org.apache.abdera.model.Collection


    } else if (!title.equals(other.title)) return false;
    return true;
  }
 
  public Collection asCollectionElement(RequestContext request) {
    Collection collection = request.getAbdera().getFactory().newCollection();
    collection.setHref(href);
    collection.setTitle(title);
    collection.setAccept(accepts);
    for (CategoriesInfo catsinfo : this.catinfos) {
      collection.addCategories(catsinfo.asCategoriesElement(request));
    }
    return collection;
  }
View Full Code Here


  private String[] getMethods(RequestContext request) {
    return ProviderHelper.getDefaultMethods(request);
  }

  public Collection asCollectionElement(RequestContext request) {
    Collection collection = request.getAbdera().getFactory().newCollection();
    collection.setHref(getHref(request));
    collection.setTitle(getTitle(request));
    collection.setAccept(getAccepts(request));
    for (CategoriesInfo catsinfo : getCategoriesInfo(request)) {
      collection.addCategories(catsinfo.asCategoriesElement(request));
    }
    return collection;
  }
View Full Code Here

    Document<Service> introspection =
      client.get(
        args[0]).getDocument();
    Service service =
      introspection.getRoot();
    Collection collection =
      service.getCollection(
        args[1],
        args[2]);
    report("The Collection Element", collection.toString());
   
    // Create the entry to post to the collection
    Entry entry = factory.newEntry();
    entry.setId("tag:example.org,2006:foo", false);
    entry.setTitle("This is the title");
    entry.setUpdated(new Date());
    entry.addAuthor("James");
    entry.setContent("This is the content");
    report("The Entry to Post", entry.toString());
   
    // Post the entry. Be sure to grab the resolved HREF of the collection
    Document<Entry> doc = client.post(
      collection.getResolvedHref().toString(),
      entry).getDocument();
   
    // In some implementations (such as Google's GData API, the entry URI is
    // distinct from it's edit URI.  To be safe, we should assume it may be
    // different
View Full Code Here

    return _getChildrenAsSet(COLLECTION);
  }

  public Collection getCollection(String title) {
    List<Collection> cols = getCollections();
    Collection col = null;
    for (Collection c : cols) {
      if (c.getTitle().equals(title)) {
        col = c;
        break;
      }
View Full Code Here

    addChild((OMElement)collection);
  }

  public Collection addCollection(String title, String href) throws IRISyntaxException {
    FOMFactory fomfactory = (FOMFactory) factory;
    Collection collection = fomfactory.newCollection(this);
    collection.setTitle(title);
    collection.setHref(href);
    return collection;
  }
View Full Code Here

        Text text = getTitleElement();
        return (text != null) ? text.getTextType() : null;
    }

    public Collection getCollection() {
        Collection coll = getFirstChild(COLLECTION);
        if (coll == null)
            coll = getFirstChild(PRE_RFC_COLLECTION);
        return coll;
    }
View Full Code Here

        workspace.setTitle(title);
        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

        }
        return col;
    }

    public Collection getCollectionThatAccepts(MimeType... types) {
        Collection collection = null;
        for (Workspace workspace : getWorkspaces()) {
            collection = workspace.getCollectionThatAccepts(types);
            if (collection != null)
                break;
        }
View Full Code Here

        }
        return collection;
    }

    public Collection getCollectionThatAccepts(String... types) {
        Collection collection = null;
        for (Workspace workspace : getWorkspaces()) {
            collection = workspace.getCollectionThatAccepts(types);
            if (collection != null)
                break;
        }
View Full Code Here

        return list;
    }

    public Collection getCollection(String title) {
        List<Collection> cols = getCollections();
        Collection col = null;
        for (Collection c : cols) {
            if (c.getTitle().equals(title)) {
                col = c;
                break;
            }
View Full Code Here

TOP

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

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.