org.oclc.da.gdfr.registryprototype.atom
Class IWSACollectionBasedCollection

java.lang.Object
  extended by org.oclc.da.gdfr.registryprototype.atom.IWSACollectionBasedCollection

public class IWSACollectionBasedCollection
extends java.lang.Object

File based Atom collectionName implementation. This is the heart of the file-based Atom service implementation. It provides methods for adding, getting updating and deleting Atom entries and media entries.


Field Summary
 java.lang.String APP_PREFIX
           
 java.lang.String HOST_PREFIX
           
 
Constructor Summary
IWSACollectionBasedCollection(java.lang.String collectionName, Collection collection, java.lang.String collectionAdminData, java.lang.String identifierType, java.lang.String entryXSL, java.lang.String feedXSL, java.lang.String depositXSL)
          Construct by providing title (plain text, no HTML), a workspace handle, a plural collectionName name (e.g.
 
Method Summary
 DataObject addEntry(DataObject entry, java.lang.String authenticatedUser)
          Add entry to collectionName.
 void deleteEntry(java.lang.String item)
          Delete an entry and any associated media file.
 DataObject getEntry(java.lang.String item)
          Get an entry from the collectionName.
 DataObject getFeedDocument()
          Get feed document representing collectionName.
 DataObject updateEntry(DataObject entry, java.lang.String item, java.lang.String authenticatedUser)
          Update an entry in the collectionName.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HOST_PREFIX

public final java.lang.String HOST_PREFIX

APP_PREFIX

public final java.lang.String APP_PREFIX
See Also:
Constant Field Values
Constructor Detail

IWSACollectionBasedCollection

public IWSACollectionBasedCollection(java.lang.String collectionName,
                                     Collection collection,
                                     java.lang.String collectionAdminData,
                                     java.lang.String identifierType,
                                     java.lang.String entryXSL,
                                     java.lang.String feedXSL,
                                     java.lang.String depositXSL)
Construct by providing title (plain text, no HTML), a workspace handle, a plural collectionName name (e.g. entries), a singular collectionName name (e.g. entry), the base directory for file storage, the content-type range accepted by the collectionName and the root Atom protocol URI for the service.

Parameters:
title - Title of collectionName (plain text, no HTML)
collectionName - Collection name
collection - Collection class reference
identifierType - Type of identifier supported by this collection
appuri - URI of Atom protocol service
Method Detail

getFeedDocument

public DataObject getFeedDocument()
                           throws RegistryException
Get feed document representing collectionName.

Returns:
Atom Feed representing collectionName.
Throws:
com.sun.syndication.propono.atom.server.RegistryException - On error retrieving feed file.
RegistryException

addEntry

public DataObject addEntry(DataObject entry,
                           java.lang.String authenticatedUser)
                    throws RegistryException
Add entry to collectionName.

Parameters:
entry - Entry to be added to collectionName. Entry will be saved to disk in a directory under the collectionName's directory and the path will follow the pattern [collectionName-plural]/[entryid]/entry.xml. The entry will be added to the collectionName's feed in [collectionName-plural]/feed.xml.
Returns:
Entry as it exists on the server.
Throws:
java.lang.Exception - On error.
RegistryException

getEntry

public DataObject getEntry(java.lang.String item)
                    throws RegistryException
Get an entry from the collectionName. The content should be decoded if one of the supported inline text types: 1.xml media types (from rfc 3023 http://www.ietf.org/rfc/rfc3023.txt) text/xml, application/xml, text/xml-external-parsed-entity, application/xml-external-parsed-entity, and application/xml-dtd or ends with "+xml" or "/xml" 2.pre-defined types text, html, xhtml, or begins with text/ 3.all other should be encoded.

Parameters:
item - Internal ID of entry to be returned
Returns:
Entry specified by /
Throws:
RegistryException - On error

updateEntry

public DataObject updateEntry(DataObject entry,
                              java.lang.String item,
                              java.lang.String authenticatedUser)
                       throws RegistryException
Update an entry in the collectionName.

Parameters:
entry - Updated entry to be stored
fileName - Internal ID of entry
Returns:
Updated entry as it exists on server
Throws:
java.lang.Exception - On error
RegistryException

deleteEntry

public void deleteEntry(java.lang.String item)
                 throws RegistryException
Delete an entry and any associated media file.

Parameters:
fileName - Internal ID of entry
Throws:
RegistryException - On error


Copyright © 2008 OCLC Online Computer Library Center, Inc.. All Rights Reserved.