Package org.apache.abdera.model

Examples of org.apache.abdera.model.Collection


    System.out.println( title );
    System.out.println( indent + "id=" + feed.getId() );
    System.out.println( indent + "title=" + feed.getTitle() );
    System.out.println( indent + "updated=" + feed.getUpdated() );
    System.out.println( indent + "author=" + feed.getAuthor() );
    Collection collection = feed.getCollection();
    if ( collection == null ) {
      System.out.println( indent + "collection=null" );
    } else {
      System.out.println( indent + "collection=" + collection );
    }
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;
    }
    return collection;
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;
    }
    return collection;
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

  }

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

    collection.setHref(href);
    return collection;
  }
 
  public Collection getCollectionThatAccepts(MimeType... types) {
    Collection collection = null;
    for (Collection coll : getCollections()) {
      int matches = 0;
      for (MimeType type : types) if (coll.accepts(type)) matches++;
      if (matches == types.length) {
        collection = coll;
View Full Code Here

    }
    return collection;
  }

  public Collection getCollectionThatAccepts(String... types) {
    Collection collection = null;
    for (Collection coll : getCollections()) {
      int matches = 0;
      for (String type : types) if (coll.accepts(type)) matches++;
      if (matches == types.length) {
        collection = coll;
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

            } else {
                workspace.setTitle("workspace");
            }
            workspace.setBaseUri( new IRI( workspaceURL ));

            Collection collection = workspace.addCollection("collection", href );
            Feed feed = getFeed( request );
            if ( feed != null ) {
                String title = feed.getTitle();
                if ( title != null ) {
                    collection.setTitle(title);
                } else {
                    collection.setTitle("entries");
                }
                collection.addAccepts("application/atom+xml");
                collection.addAccepts("application/json");
                List<Category> categories = feed.getCategories();
                if ( categories != null ) {
                    collection.addCategories(categories, false, null);
                } else {
                    collection.addCategories().setFixed(false);
                }

            } else {
                collection.setTitle("entries");

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

            //FIXME add prettyPrint support
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.