com.frevvo.forms.client
Class SubmissionEntry

java.lang.Object
  extended by com.google.gdata.data.AbstractExtension
      extended by com.google.gdata.data.ExtensionPoint
          extended by com.google.gdata.data.BaseEntry<SubmissionEntry>
              extended by com.frevvo.forms.client.SubmissionEntry
All Implemented Interfaces:
Extension, IAtom, IEntry, Kind.Adaptable, Kind.Adaptor

public class SubmissionEntry
extends BaseEntry<SubmissionEntry>

This entry represents a single form submission.

This entry does not contain any owned/contained feeds.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gdata.data.BaseEntry
BaseEntry.AtomHandler, BaseEntry.EntryState
 
Nested classes/interfaces inherited from class com.google.gdata.data.ExtensionPoint
ExtensionPoint.CumulativeBlobHandler, ExtensionPoint.ExtensionHandler
 
Nested classes/interfaces inherited from class com.google.gdata.data.AbstractExtension
AbstractExtension.AttributesHandler
 
Field Summary
static String ERROR_ELEMENT
           
static String ERRORDESCRIPTION_ELEMENT
           
static String REL_PARENTSUBMISSION
           
static String REL_SNAPSHOT
           
static String REL_SUBMISSION
           
static String SUBMISSION_ENTRY_URL_FORMAT
           
static String VALUE_ATTRIBUTE
           
static String VERSION_ELEMENT
           
 
Fields inherited from class com.google.gdata.data.BaseEntry
state
 
Fields inherited from class com.google.gdata.data.ExtensionPoint
xmlBlob
 
Fields inherited from class com.google.gdata.data.AbstractExtension
localName, namespace
 
Constructor Summary
SubmissionEntry()
          Constructs a new Entry instance
 
Method Summary
 URL createFormInstance(Map<String,Object> linkParams, List<MediaSource> documents)
          Creates a new Form instance and returns the raw instance URL
 URL createFormInstanceEmbed(Map<String,Object> linkParams, List<MediaSource> documents)
          Creates a new Form instance and returns the embed instance URL
 void declareExtensions(ExtensionProfile extProfile)
           
 void generate(com.google.gdata.util.common.xml.XmlWriter w, ExtensionProfile extProfile)
           
 List<Link> getDocumentLinks()
          Get all the submission documents
 List<Link> getDocumentLinks(String contentType)
          Get the submission documents filtered by content type
static URL getEntryURL(URL baseUrl, String id)
          Gets an URL for accessing an FormType entry
 String getErrorDescription()
           
<T extends Extension>
T
getExtension(Class<T> extensionClass)
           
 Link getFormTypeEmbedLink(Map<String,Object> linkParams)
           Get the embed JS url for the FormType that can edit this submission
 Link getFormTypeLink(Map<String,Object> linkParams)
          Get the HTML link to this FormTypeEntry.
 Link getFormTypePopupLink(Map<String,Object> linkParams)
          Get a link to an HTML page that embeds this FormTypeEntry.
 XmlParser.ElementHandler getHandler(ExtensionProfile p, String namespace, String localName, Attributes attrs)
           
 KeysExtension getKeys()
          Get the keys associated with this submission
 String getKind()
          Get the kind of submission: either FLOW or FORM
 Link getSnapshotLink(String contentType)
          Get the snapshot link for the given content type
 List<Link> getSnapshotLinks()
          Get all available snapshot links for this entry
 String getState()
          Get the state for this submission: either SAVED, PENDING or SUBMITTED
 boolean isError()
           
 SubmissionEntry update()
           
 
Methods inherited from class com.google.gdata.data.BaseEntry
addAdaptor, addHtmlLink, addLink, addLink, delete, generateAtom, generateRss, getAdaptedEntry, getAdaptor, getAdaptors, getAuthors, getCanEdit, getCategories, getContent, getContentHandlerInfo, getContributors, getEdited, getEditLink, getEtag, getHtmlLink, getId, getLink, getLinks, getLinks, getMediaEditLink, getPlainTextContent, getPubControl, getPublished, getRights, getSelf, getSelfLink, getService, getSource, getSummary, getTextContent, getTitle, getUpdated, getVersionId, isDraft, parseAtom, parseAtom, parseAtom, readEntry, readEntry, removeLinks, removeLinks, setCanEdit, setContent, setContent, setDraft, setEdited, setEtag, setId, setKind, setPubControl, setPublished, setRights, setService, setSource, setSummary, setTitle, setUpdated, setVersionId, visitChildren
 
Methods inherited from class com.google.gdata.data.ExtensionPoint
addExtension, addExtension, addRepeatingExtension, addRepeatingExtension, checkRequiredExtensions, createExtensionInstance, generate, generateCumulativeXmlBlob, generateExtensions, generateStartElement, getExtensionDescription, getExtensionHandler, getExtensions, getManifest, getRepeatingExtension, getRepeatingExtensions, getXmlBlob, hasExtension, hasRepeatingExtension, initializeArbitraryXml, parseCumulativeXmlBlob, removeExtension, removeExtension, removeRepeatingExtension, setExtension, setXmlBlob, visit, visitChild
 
Methods inherited from class com.google.gdata.data.AbstractExtension
consumeAttributes, eq, generateAttributes, getExtensionLocalName, getExtensionNamespace, isImmutable, putAttributes, sameClassAs, setImmutable, throwExceptionForMissingAttribute, throwExceptionIfImmutable, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REL_SUBMISSION

public static final String REL_SUBMISSION
See Also:
Constant Field Values

REL_PARENTSUBMISSION

public static final String REL_PARENTSUBMISSION
See Also:
Constant Field Values

SUBMISSION_ENTRY_URL_FORMAT

public static final String SUBMISSION_ENTRY_URL_FORMAT
See Also:
Constant Field Values

VERSION_ELEMENT

public static final String VERSION_ELEMENT
See Also:
Constant Field Values

ERROR_ELEMENT

public static final String ERROR_ELEMENT
See Also:
Constant Field Values

ERRORDESCRIPTION_ELEMENT

public static final String ERRORDESCRIPTION_ELEMENT
See Also:
Constant Field Values

VALUE_ATTRIBUTE

public static final String VALUE_ATTRIBUTE
See Also:
Constant Field Values

REL_SNAPSHOT

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

SubmissionEntry

public SubmissionEntry()
Constructs a new Entry instance

Method Detail

getEntryURL

public static URL getEntryURL(URL baseUrl,
                              String id)
                       throws MalformedURLException
Gets an URL for accessing an FormType entry

Parameters:
id - the theme entry id
Returns:
The entry URL
Throws:
MalformedURLException

isError

public boolean isError()

getErrorDescription

public String getErrorDescription()

declareExtensions

public void declareExtensions(ExtensionProfile extProfile)
Specified by:
declareExtensions in interface Kind.Adaptor
Overrides:
declareExtensions in class ExtensionPoint

getKind

public String getKind()
Get the kind of submission: either FLOW or FORM

Specified by:
getKind in interface IAtom
Overrides:
getKind in class BaseEntry<SubmissionEntry>
Returns:
The submission kind

getState

public String getState()
Get the state for this submission: either SAVED, PENDING or SUBMITTED

Returns:
The submission state

update

public SubmissionEntry update()
                       throws IOException,
                              ServiceException
Overrides:
update in class BaseEntry<SubmissionEntry>
Throws:
IOException
ServiceException

getKeys

public KeysExtension getKeys()
Get the keys associated with this submission

Returns:
The Keys for this submission

getDocumentLinks

public List<Link> getDocumentLinks()
Get all the submission documents

Returns:
The list of document links

getDocumentLinks

public List<Link> getDocumentLinks(String contentType)
Get the submission documents filtered by content type

Parameters:
contentTypeFilter - An optional contentType used to filter the list of documents
Returns:
The list of document links

getFormTypeLink

public Link getFormTypeLink(Map<String,Object> linkParams)
                     throws ServiceException
Get the HTML link to this FormTypeEntry.

Parameters:
linkParams - The parameters used to customize the link to the form
Returns:
The Link to this FormTypeEntry's form
Throws:
ServiceException

getFormTypePopupLink

public Link getFormTypePopupLink(Map<String,Object> linkParams)
                          throws ServiceException
Get a link to an HTML page that embeds this FormTypeEntry.

Parameters:
linkParams - The parameters used to customize the link to the form
Returns:
The Link to this FormTypeEntry's form
Throws:
ServiceException

getFormTypeEmbedLink

public Link getFormTypeEmbedLink(Map<String,Object> linkParams)

Get the embed JS url for the FormType that can edit this submission

Next is an example of how this link href should be used in an html page:

        <script language="JavaScript" type="text/javascript" src="{EMBEDLINK}"/>
 

Parameters:
linkParams - The parameters used to customize the embed url (see FormTypeEntry.EMBED_*_PARAMETERS constants)
Returns:
The embed JS url

getSnapshotLinks

public List<Link> getSnapshotLinks()
Get all available snapshot links for this entry

Returns:
The list of snaphost links

getSnapshotLink

public Link getSnapshotLink(String contentType)
Get the snapshot link for the given content type

Parameters:
contentType - The type of snapshot
Returns:
The link to the snapshot

createFormInstance

public URL createFormInstance(Map<String,Object> linkParams,
                              List<MediaSource> documents)
                       throws ServiceException
Creates a new Form instance and returns the raw instance URL

Parameters:
linkParams - The parameters that can be used to initialize the form instance
documents - A list of XML documents that can be used to initialize the form
Returns:
The form instance raw url to the HTML representation of the form
Throws:
ServiceException

createFormInstanceEmbed

public URL createFormInstanceEmbed(Map<String,Object> linkParams,
                                   List<MediaSource> documents)
                            throws ServiceException
Creates a new Form instance and returns the embed instance URL

Parameters:
linkParams - The parametes that can be used to initialize the form instance
documents - The list of XML documents that can be used to initialize the form
Returns:
The URL to the Form instance embed Javascript
Throws:
ServiceException

getExtension

public <T extends Extension> T getExtension(Class<T> extensionClass)
Overrides:
getExtension in class ExtensionPoint

generate

public void generate(com.google.gdata.util.common.xml.XmlWriter w,
                     ExtensionProfile extProfile)
              throws IOException
Specified by:
generate in interface Extension
Overrides:
generate in class BaseEntry<SubmissionEntry>
Throws:
IOException

getHandler

public XmlParser.ElementHandler getHandler(ExtensionProfile p,
                                           String namespace,
                                           String localName,
                                           Attributes attrs)
Specified by:
getHandler in interface Extension
Overrides:
getHandler in class BaseEntry<SubmissionEntry>


Copyright © 2006-2011 frevvo Inc. All Rights Reserved.