com.sage.orion.sdata.servlet
Class ServiceOperationHelper

java.lang.Object
  extended by com.sage.orion.sdata.servlet.ServiceOperationHelper

public final class ServiceOperationHelper
extends java.lang.Object

This class is designed to contain helper routines for the SData Service Operations.


Method Summary
static SDataResponseEntry createSDataResponseEntry(java.lang.String operationFullName, java.util.List<ServiceField> responseFields, boolean useRequestTag)
          Create an SDataResponseEntry from the list of response fields
static void generateServiceOperationSchema(org.w3c.dom.Element elemSchema, java.lang.String operationFullName, java.lang.String operationName, java.util.List<ServiceField> requestFields, java.util.List<ServiceField> responseFields, java.lang.String path)
          Generate the schema for a service operation, attaching it to the given schema element
static SDataResourceElement getRequestElement(SDataResourceElement payload)
          Get the request element from the SData payload
static SDataResourceElement getResourceKindElement(SDataResourceElement payload)
          Get the resourceKind portion of the payload from the input payload
static java.lang.String uppercaseFirstLetter(java.lang.String inStr)
          Make first letter upper case
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

generateServiceOperationSchema

public static void generateServiceOperationSchema(org.w3c.dom.Element elemSchema,
                                                  java.lang.String operationFullName,
                                                  java.lang.String operationName,
                                                  java.util.List<ServiceField> requestFields,
                                                  java.util.List<ServiceField> responseFields,
                                                  java.lang.String path)
Generate the schema for a service operation, attaching it to the given schema element

Parameters:
elemSchema - the schema element under which this schema will be added
operationFullName - the full name of operation
operationName - the name of operation
requestFields - The list of request fields
responseFields - The list of response fields
path - URL (relative to dataset segment) where the operation can be found. Typically this will consist of the resource name(s) followed by the $service keyword and the name of the operation, all separated by the URL separator.

uppercaseFirstLetter

public static java.lang.String uppercaseFirstLetter(java.lang.String inStr)
Make first letter upper case

Parameters:
inStr - The string passed in
Returns:
The string with the first letter capitalized

getRequestElement

public static SDataResourceElement getRequestElement(SDataResourceElement payload)
Get the request element from the SData payload

Parameters:
payload - the SData payload
Returns:
the request element

getResourceKindElement

public static SDataResourceElement getResourceKindElement(SDataResourceElement payload)
Get the resourceKind portion of the payload from the input payload

Parameters:
payload - the SData payload
Returns:
the resourceKind portion of the payload

createSDataResponseEntry

public static SDataResponseEntry createSDataResponseEntry(java.lang.String operationFullName,
                                                          java.util.List<ServiceField> responseFields,
                                                          boolean useRequestTag)
Create an SDataResponseEntry from the list of response fields

Parameters:
operationFullName - the full name of operation
responseFields - the list of response fields
useRequestTag - If true, the response will use request tag. Otherwise, use response tag
Returns:
the SDataResponseEntry


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