|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.softwareag.mdm.service.ServiceContext
This class provides the necessary context and navigation functions for integrating UI services into webMethods Master Data Manager. For general information, see UI Services.
A UI service must be declared as a complex type definition:
where<xs:complexType name="MyService"> <xs:annotation> <xs:appinfo> <mdm:service resourcePath="/myFirstPage.jsp" activatedForPaths="/a/b /a/c" /> </xs:appinfo> <xs:documentation> My Service Label. My Service description. </xs:documentation> </xs:annotation> </xs:complexType>
MyService
is the name that identifies the service,
/myFirstPage.jsp
is a resource existing in the module (Web application)
and /a/b
, /a/c
specifies two elements in the schema instances.
Attribute | Description | Required |
resourcePath |
identifies the resource to call in the web application (that is, the webMethods MDM module
attached to the schema).
The path must begin with a "/" and is interpreted as relative to the web application root.
See ServletContext.getRequestDispatcher(String) . |
Yes. |
activatedForPaths |
nodes on which the service is activated. The list of paths is white-space delimited.
Each path must be the absolute XPath notation of the node. For mdm:table ,
an additional syntax allows to specify whether the service is activated on the table globally
or on occurrence(s) selection. If the path to the table is /root/myTable :
|
No. Default will activate as a global service not attached to a particular node. |
class |
specifies a Java class that implements
ServicePermission . |
No. If not defined, service has no permission restriction. |
First of all, the JSP or the Servlet gets the current context by calling:
ServiceContext.getServiceContext(HttpServletRequest)
For inserting URLs that will be interpreted by the Manager, the JSP/Servlet must call one the methods:
ServiceContext.getURL...(...)
For updating the repository, for importing or exporting data, the JSP/Servlet must call the method:
ServiceContext.execute(Procedure)
See Tutorial.
ServicePermission
Method Summary | |
abstract void |
addMessage(UserMessage aMessage)
Adds a message. |
abstract ProcedureResult |
execute(Procedure aProcedure)
Executes the procedure specified. |
abstract Adaptation |
getCurrentAdaptation()
Returns the adaptation currently selected in Manager. |
abstract AdaptationHome |
getCurrentHome()
Returns the home currently selected in Manager. |
abstract SchemaNode |
getCurrentNode()
Returns the schema node currently selected in Manager. |
abstract Path |
getCurrentPathInAdaptation()
Returns the node path currently selected in Manager. |
abstract Request |
getCurrentRequest()
Returns the request for the current table selected in webMethods Master Data Manager. |
abstract Locale |
getLocale()
Returns the current Locale of Manager session. |
abstract List |
getSelectedOccurrences()
Returns the occurrences currently selected in Manager. |
static ServiceContext |
getServiceContext(HttpServletRequest aRequest)
Retrieves context instance from HTTP request attributes. |
abstract String |
getServiceDescription()
Returns the description of the service, localized in session's current locale. |
abstract String |
getServiceLabel()
Returns the label of the service, localized in session's current locale. |
abstract Session |
getSession()
Returns the current session context. |
abstract String |
getURLForEndingService()
Returns a Manager URL indicating that the execution of this service is finished. |
abstract String |
getURLForIncludingResource(String aResourcePath)
Returns a Manager URL indicating that this service execution continues to the resource specified. |
abstract String |
getURLForResource(ResourceType aResourceType,
String aResourceName)
Returns the URL of the Web resource specified, in the current module and for the current session locale. |
abstract String |
getURLForResource(ResourceType aResourceType,
String aResourceName,
Locale aLocale)
Returns the URL of the Web resource specified, in the current module (that is, the module of the current adaptation). |
abstract String |
getURLForResource(String aModuleAliasOrName,
ResourceType aResourceType,
String aResourceName,
Locale aLocale)
Returns the URL of the Web resource specified. |
abstract String |
getURLForSelection(Adaptation anAdaptation)
Returns a Manager URL indicating that it must select the adaptation (instance or occurrence) specified. |
abstract String |
getURLForSelection(Adaptation anAdaptation,
Path aPath)
Returns a Manager URL indicating that it must select the adaptation (instance or occurrence) and the node specified. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static ServiceContext getServiceContext(HttpServletRequest aRequest)
null
only if we are in the context of a service execution (this means that
Manager is performing a server-side include).
public abstract SchemaNode getCurrentNode()
public abstract Path getCurrentPathInAdaptation()
public abstract Adaptation getCurrentAdaptation() throws IllegalStateException
IllegalStateException
- if service is activated in the context of a multiple occurrences selection
(in this case only method getSelectedOccurrences()
must be called).getSelectedOccurrences()
public abstract List getSelectedOccurrences()
Adaptation
that correspond to the occurrences selected in
the Manager, or null
if the service is being executed on an adaptation
instance.public abstract AdaptationHome getCurrentHome()
public abstract Locale getLocale()
Session.getLocale()
public abstract Session getSession()
public abstract String getURLForSelection(Adaptation anAdaptation)
public abstract String getURLForSelection(Adaptation anAdaptation, Path aPath)
public abstract void addMessage(UserMessage aMessage)
public abstract String getServiceLabel()
The label of the service is specified in the schema document, under the node
xs:annotation/xs:documentation
.
public abstract String getServiceDescription()
The description of the service is specified in the schema document, under the node
xs:annotation/xs:documentation
.
public abstract String getURLForIncludingResource(String aResourcePath)
The resource must be in the same web application as the service.
aResourcePath
- path of the resource in its web application (it must not contain web application's
specific path).public abstract String getURLForEndingService()
public abstract ProcedureResult execute(Procedure aProcedure)
Procedure.execute(ProcedureContext)
.
public abstract String getURLForResource(ResourceType aResourceType, String aResourceName)
getURLForResource(ResourceType, String, Locale)
,
getLocale()
public abstract String getURLForResource(ResourceType aResourceType, String aResourceName, Locale aLocale)
UnsupportedOperationException
- if the resource type is internal (not accessible from HTTP).public abstract String getURLForResource(String aModuleAliasOrName, ResourceType aResourceType, String aResourceName, Locale aLocale) throws ModuleNotFoundException
UnsupportedOperationException
- if the resource type is internal (not accessible from HTTP).
ModuleNotFoundException
- if the alias or name specified does not correspond to a module.public abstract Request getCurrentRequest()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
(report a bug)
webMethods MDM 4.2.8 [0558]
Copyright Software AG 2000-2007. All rights reserved.