com.sun.syndication.propono.atom.common
Class Workspace

java.lang.Object
  extended by com.sun.syndication.propono.atom.common.Workspace
Direct Known Subclasses:
ClientWorkspace, FileBasedWorkspace

public class Workspace
extends Object

Models an Atom workspace.


Constructor Summary
Workspace(String title, String titleType)
          Collection MUST have title.
 
Method Summary
 void addCollection(Collection col)
          Add new collection to workspace
static Workspace elementToWorkspace(org.jdom.Element element)
          Deserialize a Atom workspace XML element into an object
 Collection findCollection(String title, String contentType)
          Find collection by title and/or content-type.
 List getCollections()
          Iterate over collections in workspace
 String getTitle()
          DefaultWorkspace must have a human readable title
 String getTitleType()
          Get title type ("text", "html", "xhtml" or MIME content-type)
 void setTitle(String title)
          Set title of workspace.
 void setTitleType(String titleType)
          Set title type ("text", "html", "xhtml" or MIME content-type)
static org.jdom.Element workspaceToElement(Workspace space)
          Serialize an AtomService.DefaultWorkspace object into an XML element
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Workspace

public Workspace(String title,
                 String titleType)
Collection MUST have title.

Parameters:
title - Title for collection
titleType - Content type of title (null for plain text)
Method Detail

getCollections

public List getCollections()
Iterate over collections in workspace


addCollection

public void addCollection(Collection col)
Add new collection to workspace


getTitle

public String getTitle()
DefaultWorkspace must have a human readable title


setTitle

public void setTitle(String title)
Set title of workspace.


getTitleType

public String getTitleType()
Get title type ("text", "html", "xhtml" or MIME content-type)


setTitleType

public void setTitleType(String titleType)
Set title type ("text", "html", "xhtml" or MIME content-type)


findCollection

public Collection findCollection(String title,
                                 String contentType)
Find collection by title and/or content-type.

Parameters:
title - Title or null to match all titles.
contentType - Content-type or null to match all content-types.
Returns:
First Collection that matches title and/or content-type.

elementToWorkspace

public static Workspace elementToWorkspace(org.jdom.Element element)
Deserialize a Atom workspace XML element into an object


workspaceToElement

public static org.jdom.Element workspaceToElement(Workspace space)
Serialize an AtomService.DefaultWorkspace object into an XML element