com.sage.orion.sdata.servlet.swtservice
Class ApplicationContext

java.lang.Object
  extended by com.sage.orion.sdata.servlet.swtservice.ApplicationContext
All Implemented Interfaces:
SwtApplicationContext

public class ApplicationContext
extends java.lang.Object
implements SwtApplicationContext

Handles the swtservice specific context.


Constructor Summary
ApplicationContext(SDataServletContext sDataServletContext)
          Constructor
 
Method Summary
 java.lang.String getCustomUIDefinitionsBasePath(SDataRequest request)
          Gets the path the the user's custom UI Definitions directory under the shared folder.
protected static com.sage.accpac.sm.Program getProgramFromRequest(SDataRequest request)
           Gets the program information from the specified SData request.
 java.lang.String getResourceKindDBFormatPath()
          Gets the path to the directory where resource kind DB table structure files are stored
 java.lang.String getSchemaBasePath()
          Gets the file path the to the schema definitions directory.
 SDataServletContext getServletContext()
          Gets the SDataServletContext that hold information for the whole servlet
 java.lang.String getSwtServicesBasePath()
          Gets the path to the SwtServices directory under WEB-INF/configuration
 java.lang.String getTenantID(SDataRequest request)
          Gets the tenantID from the SDataRequest
 java.lang.String getUIContentBasePath()
          Gets the path to the UI content directory under ../swtServices
 java.lang.String getUIDefinitionsBasePath()
          Gets the path to the UI definitions directory under ../swtServices
 UserInfo getUserInfoFromRequest(SDataRequest request)
           Gets the signed-on user's information from the specified SData request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationContext

public ApplicationContext(SDataServletContext sDataServletContext)
Constructor

Parameters:
sDataServletContext - Sdata servlet context
Method Detail

getServletContext

public SDataServletContext getServletContext()
Gets the SDataServletContext that hold information for the whole servlet

Specified by:
getServletContext in interface SwtApplicationContext
Returns:
The SDataServletContext that hold information for the whole servlet

getResourceKindDBFormatPath

public java.lang.String getResourceKindDBFormatPath()
Gets the path to the directory where resource kind DB table structure files are stored

Returns:
The path to the directory where resource kind DB table structure files are stored

getSwtServicesBasePath

public java.lang.String getSwtServicesBasePath()
Description copied from interface: SwtApplicationContext
Gets the path to the SwtServices directory under WEB-INF/configuration

Specified by:
getSwtServicesBasePath in interface SwtApplicationContext
Returns:
The path to the SwtServices directory

getUIContentBasePath

public java.lang.String getUIContentBasePath()
Description copied from interface: SwtApplicationContext
Gets the path to the UI content directory under ../swtServices

Specified by:
getUIContentBasePath in interface SwtApplicationContext
Returns:
The path to the UI content directory

getUIDefinitionsBasePath

public java.lang.String getUIDefinitionsBasePath()
Description copied from interface: SwtApplicationContext
Gets the path to the UI definitions directory under ../swtServices

Specified by:
getUIDefinitionsBasePath in interface SwtApplicationContext
Returns:
The path to the UI definitions directory

getCustomUIDefinitionsBasePath

public java.lang.String getCustomUIDefinitionsBasePath(SDataRequest request)
Description copied from interface: SwtApplicationContext
Gets the path the the user's custom UI Definitions directory under the shared folder.

Specified by:
getCustomUIDefinitionsBasePath in interface SwtApplicationContext
Parameters:
request - the SDataRequest
Returns:
the path to the custom UI definitions directory

getSchemaBasePath

public java.lang.String getSchemaBasePath()
Description copied from interface: SwtApplicationContext
Gets the file path the to the schema definitions directory.

Specified by:
getSchemaBasePath in interface SwtApplicationContext
Returns:
the path to the schema definitions directory

getUserInfoFromRequest

public UserInfo getUserInfoFromRequest(SDataRequest request)

Gets the signed-on user's information from the specified SData request.

NOTE: This method never returns null - it throws an exception (most likely an "unauthorized" exception) if it encounters a problem. Also, the user information that it returns is non-null and non-empty and in a form that SWT services can use (in other words, the language code is lower cased).

Parameters:
request - The SDATA request.
Returns:
The information for the signed-on user who made the SDATA request.

getProgramFromRequest

protected static com.sage.accpac.sm.Program getProgramFromRequest(SDataRequest request)

Gets the program information from the specified SData request.

NOTE: This method never returns null - it throws an exception (most likely an "unauthorized" exception) if it encounters a problem. Also, the program that it returns is non-null.

Parameters:
request - The SDATA request.
Returns:
The Program for the signed-on user who made the SDATA request.

getTenantID

public java.lang.String getTenantID(SDataRequest request)
Gets the tenantID from the SDataRequest

Parameters:
request - the SDataRequest
Returns:
tenant ID or null if there is no tenant ID (not running in a hosted environment.


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