org.rometools.propono.atom.common
Class Workspace

java.lang.Object
  extended by org.rometools.propono.atom.common.Workspace
Direct Known Subclasses:
ClientWorkspace, FileBasedWorkspace

public class Workspace
extends Object

Models an Atom workspace.


Constructor Summary
Workspace(org.jdom.Element elem)
           
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)
protected  void parseWorkspaceElement(org.jdom.Element element)
          Deserialize a Atom workspace XML element into an object
 void setTitle(String title)
          Set title of workspace.
 void setTitleType(String titleType)
          Set title type ("text", "html", "xhtml" or MIME content-type)
 org.jdom.Element workspaceToElement()
          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)

Workspace

public Workspace(org.jdom.Element elem)
          throws ProponoException
Throws:
ProponoException
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)
                                    throws ProponoException
Deserialize a Atom workspace XML element into an object

Throws:
ProponoException

workspaceToElement

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


parseWorkspaceElement

protected void parseWorkspaceElement(org.jdom.Element element)
                              throws ProponoException
Deserialize a Atom workspace XML element into an object

Throws:
ProponoException


Copyright © 2007-2013 ROME Project. All Rights Reserved.