com.sage.orion.sdata.servlet.accpac
Class ResponseEntry

java.lang.Object
  extended by com.sage.orion.sdata.servlet.SDataResponseEntry
      extended by com.sage.orion.sdata.servlet.accpac.ResponseEntry

public class ResponseEntry
extends SDataResponseEntry

Adds the accpac requirements to the SDataResponseEntry


Field Summary
static java.lang.String AUTHOR_NAME
          A simple Author because the ATOM specification requires something.
protected static java.lang.String AUTHOR_TAG
           
protected static java.lang.String EDIT_RELATIONSHIP
           
protected static java.lang.String ENTRY_TAG
           
protected static java.lang.String FEED_TAG
           
protected static java.lang.String FIRST_RELATIONSHIP
           
protected static java.lang.String HREF_ATTRIBUTE
           
protected static java.lang.String ID_TAG
           
protected static java.lang.String LAST_RELATIONSHIP
           
protected static java.lang.String LINK_TAG
           
protected static java.lang.String MIME_ATOM_XML_ENTRY
           
protected static java.lang.String MIME_ATOM_XML_FEED
           
protected static java.lang.String MIME_XML_XSD
           
protected static java.lang.String NEXT_RELATIONSHIP
           
protected static java.lang.String PREV_RELATIONSHIP
           
protected static java.lang.String RELATIONSHIP_ATTRIBUTE
           
protected static java.lang.String SELF_RELATIONSHIP
           
protected static java.lang.String TITLE_ATTRIBUTE
           
protected static java.lang.String TITLE_EDIT
           
protected static java.lang.String TITLE_FIRST
           
protected static java.lang.String TITLE_LAST
           
protected static java.lang.String TITLE_NEXT
           
protected static java.lang.String TITLE_PREV
           
protected static java.lang.String TITLE_SELF
           
protected static java.lang.String TYPE_ATTRIBUTE
           
protected static java.lang.String UPDATED_TAG
           
 
Method Summary
protected  void addCategory(org.w3c.dom.Element atomElement)
          Add the category information to the given DOM element (feed or entry)
protected static void addNamespaces(org.w3c.dom.Element parent)
          Add the namespace attributes that are common to SDataEntry and SDataFeed
protected  void addSchemaEtcLinks(org.w3c.dom.Element parent, java.lang.String urlBase, boolean canPost, boolean hasService)
          Add the schema, post, service and template links to the given feed or entry element
protected static void appendIfNotNull(org.w3c.dom.Element entry, org.w3c.dom.Element child)
          Utility to append a child only if it is defined
protected  org.w3c.dom.Element createElement(org.w3c.dom.Document doc, boolean isDocumentElement, java.lang.String resourcesURL, java.util.List<SDataDiagnosis> errors)
          adds the accpac-specific additions to the element
protected  org.w3c.dom.Element createElement(org.w3c.dom.Document doc, boolean isDocumentElement, java.lang.String resourcesURL, java.util.List<SDataDiagnosis> errors, java.lang.String typeTag)
          Creates an atom element
protected  void createSchemaLink(java.lang.String urlBase, org.w3c.dom.Element atomElement)
          adds the schema link to the parent provided, complete with actual schema if any
protected static org.w3c.dom.Element getAtomLinkElement(org.w3c.dom.Document document, java.lang.String type, java.lang.String relationship, java.lang.String title, java.lang.String href)
          Create an Atom link element for the given link-relation entry
protected  java.lang.String getID(java.lang.String resourcesURL)
          Get the ID used for the ID, self and edit links
protected static org.w3c.dom.Element getLinkRelationElement(org.w3c.dom.Document document, java.lang.String relationship, java.lang.String type, java.lang.String title, java.lang.String href)
          Create an Atom link element for the given link-relation entry
 
Methods inherited from class com.sage.orion.sdata.servlet.SDataResponseEntry
getAtomEntryLinkElement, getEditLink, getKey, getPayload, newIntermediateEntry, setPayload
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TITLE_EDIT

protected static final java.lang.String TITLE_EDIT
See Also:
Constant Field Values

TITLE_SELF

protected static final java.lang.String TITLE_SELF
See Also:
Constant Field Values

TITLE_FIRST

protected static final java.lang.String TITLE_FIRST
See Also:
Constant Field Values

TITLE_LAST

protected static final java.lang.String TITLE_LAST
See Also:
Constant Field Values

TITLE_PREV

protected static final java.lang.String TITLE_PREV
See Also:
Constant Field Values

TITLE_NEXT

protected static final java.lang.String TITLE_NEXT
See Also:
Constant Field Values

MIME_XML_XSD

protected static final java.lang.String MIME_XML_XSD
See Also:
Constant Field Values

MIME_ATOM_XML_FEED

protected static final java.lang.String MIME_ATOM_XML_FEED
See Also:
Constant Field Values

MIME_ATOM_XML_ENTRY

protected static final java.lang.String MIME_ATOM_XML_ENTRY
See Also:
Constant Field Values

SELF_RELATIONSHIP

protected static final java.lang.String SELF_RELATIONSHIP
See Also:
Constant Field Values

EDIT_RELATIONSHIP

protected static final java.lang.String EDIT_RELATIONSHIP
See Also:
Constant Field Values

FIRST_RELATIONSHIP

protected static final java.lang.String FIRST_RELATIONSHIP
See Also:
Constant Field Values

LAST_RELATIONSHIP

protected static final java.lang.String LAST_RELATIONSHIP
See Also:
Constant Field Values

PREV_RELATIONSHIP

protected static final java.lang.String PREV_RELATIONSHIP
See Also:
Constant Field Values

NEXT_RELATIONSHIP

protected static final java.lang.String NEXT_RELATIONSHIP
See Also:
Constant Field Values

LINK_TAG

protected static final java.lang.String LINK_TAG
See Also:
Constant Field Values

RELATIONSHIP_ATTRIBUTE

protected static final java.lang.String RELATIONSHIP_ATTRIBUTE
See Also:
Constant Field Values

TITLE_ATTRIBUTE

protected static final java.lang.String TITLE_ATTRIBUTE
See Also:
Constant Field Values

TYPE_ATTRIBUTE

protected static final java.lang.String TYPE_ATTRIBUTE
See Also:
Constant Field Values

HREF_ATTRIBUTE

protected static final java.lang.String HREF_ATTRIBUTE
See Also:
Constant Field Values

ENTRY_TAG

protected static final java.lang.String ENTRY_TAG
See Also:
Constant Field Values

FEED_TAG

protected static final java.lang.String FEED_TAG
See Also:
Constant Field Values

ID_TAG

protected static final java.lang.String ID_TAG
See Also:
Constant Field Values

AUTHOR_TAG

protected static final java.lang.String AUTHOR_TAG
See Also:
Constant Field Values

UPDATED_TAG

protected static final java.lang.String UPDATED_TAG
See Also:
Constant Field Values

AUTHOR_NAME

public static final java.lang.String AUTHOR_NAME
A simple Author because the ATOM specification requires something.

See Also:
Constant Field Values
Method Detail

getID

protected java.lang.String getID(java.lang.String resourcesURL)
Get the ID used for the ID, self and edit links

Overrides:
getID in class SDataResponseEntry
Parameters:
resourcesURL - the base resources URL, already encoded for transport

createElement

protected org.w3c.dom.Element createElement(org.w3c.dom.Document doc,
                                            boolean isDocumentElement,
                                            java.lang.String resourcesURL,
                                            java.util.List<SDataDiagnosis> errors)
adds the accpac-specific additions to the element

Overrides:
createElement in class SDataResponseEntry
Parameters:
doc - the Document in which to create the element
isDocumentElement - true if this element is the document top level element, in which case it will have the namespace attributes. If false then the namespace attributes should be added to the feed above this element.
resourcesURL - The base URL to be used in creating links, ids etc. This includes all elements up to and including the resource kind but does not include subresources etc.
errors - The list of errors
Returns:
the newly created element

appendIfNotNull

protected static void appendIfNotNull(org.w3c.dom.Element entry,
                                      org.w3c.dom.Element child)
Utility to append a child only if it is defined

Parameters:
entry - entry
child - child

getLinkRelationElement

protected static org.w3c.dom.Element getLinkRelationElement(org.w3c.dom.Document document,
                                                            java.lang.String relationship,
                                                            java.lang.String type,
                                                            java.lang.String title,
                                                            java.lang.String href)
Create an Atom link element for the given link-relation entry

Parameters:
document - the document which will own the entry
relationship - the relationship; one of schema, template, post and service
type - the type of the result? depends on relationship
title - title
href - href
Returns:
atom link element

getAtomLinkElement

protected static org.w3c.dom.Element getAtomLinkElement(org.w3c.dom.Document document,
                                                        java.lang.String type,
                                                        java.lang.String relationship,
                                                        java.lang.String title,
                                                        java.lang.String href)
Create an Atom link element for the given link-relation entry

Parameters:
document - the document which will own the entry
relationship - the relationship; one of schema, template, post and service
type - the type of the result? depends on relationship
title - title
href - href
Returns:
atom link element

addSchemaEtcLinks

protected void addSchemaEtcLinks(org.w3c.dom.Element parent,
                                 java.lang.String urlBase,
                                 boolean canPost,
                                 boolean hasService)
Add the schema, post, service and template links to the given feed or entry element

Parameters:
parent - the entry or feed element to which the links are attached
urlBase - the URL that is used as the base text for the links. It should already be in RFC3987 IRI format.
canPost - true if and only if the entry or feed supports post (and so the post and template links are included)
hasService - true if and only if the entry or feed has services (and so the service link is included)

createSchemaLink

protected final void createSchemaLink(java.lang.String urlBase,
                                      org.w3c.dom.Element atomElement)
adds the schema link to the parent provided, complete with actual schema if any

Parameters:
urlBase - the base string to use in forming the href
atomElement - the parent element that is the feed or entry

createElement

protected org.w3c.dom.Element createElement(org.w3c.dom.Document doc,
                                            boolean isDocumentElement,
                                            java.lang.String resourcesURL,
                                            java.util.List<SDataDiagnosis> errors,
                                            java.lang.String typeTag)
Creates an atom element

Parameters:
doc - document
isDocumentElement - whether document is document element
resourcesURL - resources URL
errors - errors
typeTag - type tag ( i.e. feed or entry)
Returns:
atom element of specified type

addNamespaces

protected static final void addNamespaces(org.w3c.dom.Element parent)
Add the namespace attributes that are common to SDataEntry and SDataFeed

Parameters:
parent - the element to which to add the attributes

addCategory

protected final void addCategory(org.w3c.dom.Element atomElement)
Add the category information to the given DOM element (feed or entry)

Parameters:
atomElement - the parent element that is the feed or entry


Copyright © 2011 Sage Software, Inc. All rights reserved.