uk.ac.soton.itinnovation.grid.utils
Class AtomUtils

java.lang.Object
  extended by uk.ac.soton.itinnovation.grid.utils.AtomUtils

public class AtomUtils
extends Object


Field Summary
static String ATOM_NS
           
static String GRID_NS
           
static String XHTML_NS
           
 
Constructor Summary
AtomUtils()
           
 
Method Summary
static void addEntry(Document doc, String id, Date updated, String title, Element xhtmlDiv)
          Add a new entry to this feed.
static void addEntry(Document doc, String id, Date updated, String title, String content)
          Add a new text entry to this feed.
static void appendSimpleChild(Element node, String namespaceURI, String qName, String content)
           
static Element createAnchor(Document doc, String href, String text)
           
static Element divFromXML(Document doc, String xml)
           
static Iterator entryIterator(Document doc)
           
static Element getChildElementNS(Element parent, String uri, String name)
           
static Date getDate(Element entry)
           
static Document getEmptyAtomFeed(String title, String author, String endpoint, String homePage)
           
static Document getEmptyAtomFeed(String title, String version, String author, String endpoint, String homePage)
           
static String getLink(Element entry)
           
static String getTime(Date time)
           
static String getTitle(Element entry)
           
static void markSelected(Document doc, String id)
          Find the entry with ID 'id' and add a grid:selected attribute.
static void mergeFeed(Document main, Document subFeed)
          Add the entries in subFeed to main.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GRID_NS

public static final String GRID_NS
See Also:
Constant Field Values

ATOM_NS

public static final String ATOM_NS
See Also:
Constant Field Values

XHTML_NS

public static final String XHTML_NS
See Also:
Constant Field Values
Constructor Detail

AtomUtils

public AtomUtils()
Method Detail

appendSimpleChild

public static void appendSimpleChild(Element node,
                                     String namespaceURI,
                                     String qName,
                                     String content)

getTime

public static String getTime(Date time)

getEmptyAtomFeed

public static Document getEmptyAtomFeed(String title,
                                        String author,
                                        String endpoint,
                                        String homePage)

getEmptyAtomFeed

public static Document getEmptyAtomFeed(String title,
                                        String version,
                                        String author,
                                        String endpoint,
                                        String homePage)

addEntry

public static void addEntry(Document doc,
                            String id,
                            Date updated,
                            String title,
                            String content)
Add a new text entry to this feed. This version of addEntry adds an entry with a single paragraph of simple text.


addEntry

public static void addEntry(Document doc,
                            String id,
                            Date updated,
                            String title,
                            Element xhtmlDiv)
Add a new entry to this feed.

Parameters:
doc - the feed to add it to
id - a globally unique URI for this entry
updated - when this entry was created / last updated
title - a short summary
xhtmlDiv - an XHTML div element with the content

mergeFeed

public static void mergeFeed(Document main,
                             Document subFeed)
Add the entries in subFeed to main.


createAnchor

public static Element createAnchor(Document doc,
                                   String href,
                                   String text)

getTitle

public static String getTitle(Element entry)

getDate

public static Date getDate(Element entry)

getLink

public static String getLink(Element entry)

entryIterator

public static Iterator entryIterator(Document doc)

divFromXML

public static Element divFromXML(Document doc,
                                 String xml)

markSelected

public static void markSelected(Document doc,
                                String id)
Find the entry with ID 'id' and add a grid:selected attribute. The style-sheet uses this to highlight the entry.


getChildElementNS

public static Element getChildElementNS(Element parent,
                                        String uri,
                                        String name)


Copyright © 2001-2007 University of Southampton IT Innovation Centre. All Rights Reserved.