com.softwareag.mdm.ui
Class UIHttpManagerComponent

java.lang.Object
  extended bycom.softwareag.mdm.ui.UIHttpManagerComponent

public abstract class UIHttpManagerComponent
extends Object

This class is a utility for calling webMethods Master Data Manager through a HTTP request.

A general introduction to webMethods Master Data Manager component is available here.

User authentication

The authentication process is the following:

  1. If the call is made from an existing webMethods Master Data Manager session (through methods createOnServiceContext(ServiceContext) or createOnUIBeanContext(UIResponseContext)) the authentication is automatic and the new Session inherits its features from the calling session.
  2. If parameters login and password are specified through method setUserLoginPassword(String, String), the method Directory.authenticateUserFromLoginPassword(String, String) is called. If user is not authenticated, an access denied page is returned.
  3. Else the method Directory.authenticateUserFromHttpRequest(HttpServletRequest) is called (it is up to the specific directory to implement this method). If the method throws an exception, an access denied page is returned. If the method returns null (default implementation), the request is considered as not specifying authentication, so the next step is performed.
  4. The login/password page is returned to the user. When this page is submitted, the method Directory.authenticateUserFromLoginPassword(String, String) will be called.


Method Summary
static UIHttpManagerComponent createOnServiceContext(ServiceContext aContext)
          Creates an instance of this class for calling webMethods Master Data Manager from a ServiceContext.
static UIHttpManagerComponent createOnUIBeanContext(UIResponseContext aContext)
          Creates an instance of this class for calling webMethods Master Data Manager from a UI component context.
static UIHttpManagerComponent createWithBaseURI(String baseURI)
          Creates an instance of this class for calling webMethods Master Data Manager from an external application.
static UIHttpManagerComponent createWithBaseURI(String baseURI, AdaptationName aManagerReference)
          Creates an instance of this class for calling webMethods Master Data Manager from an external application.
 HomeKey getHomeKey()
           
 List getHttpParameterNames()
          Returns the names of the HTTP parameters that are specified by this instance.
 String getHttpParameterValue(String aParameterName)
          Returns a String object as the value of the parameter, null if parameter is not defined.
 AdaptationReference getInstanceReference()
           
 Locale getLocale()
          Returns the locale specified for the new user session, null if no specific locale has been set.
 String getRedirectionURI()
          Returns the URI that will be used to redirect user after closing webMethods Master Data Manager session.
 ServiceKey getService()
          Returns the service to activate, null if no specific service has been set.
 String getTrackingInfo()
          Returns the tracking info for the new user session, null if no specifi tracking info has been set.
abstract  String getURIWithoutParameters()
          This function returns the URI to webMethods Master Data Manager, without specific parameters.
 String getURIWithParameters()
          This function returns the URI to webMethods Master Data Manager, including parameters specified by this instance.
 String getUserLogin()
          Returns the user login, null if no login/password is specified.
 String getUserPassword()
          Returns the user password, null if no login/password is specified.
 String getXPathString()
           
 void initFromHttpRequest(HttpServletRequest request)
          Initializes this instance with the incoming request specified.
 void select(HomeKey aHomeKey, AdaptationName anInstanceReference, Path aPath)
          Selects the node in the instance specified.
 void select(HomeKey aHomeKey, AdaptationName anInstanceReference, String aXPathExpression)
          Specifies a selection onto a Master Data entity.
 void selectHome(AdaptationHome aHome)
          Selects the home (branch or version) specified.
 void selectHome(HomeKey aHomeKey)
          Selects the home (branch or version) specified.
 void selectInstance(HomeKey aHomeKey, AdaptationName anInstanceReference)
          Selects the instance specified.
 void selectInstanceOrOccurrence(Adaptation anAdaptation)
          Selects the entity specified, an instance or an occurrence.
 void selectInstanceOrOccurrenceWithPredicate(Adaptation anAdaptation, String predicate)
          Selects the entity specified, an instance or an occurrence with the predicate restriction
 void selectNode(Adaptation anAdaptation, Path aNode)
          Selects the node specified.
 void selectNode(Adaptation anAdaptation, Path aNode, String predicate)
          Selects the node specified with the predicate restriction
 void setLocale(Locale locale)
          Specifies the locale for the new user session.
 void setRedirectionURI(String redirectionUrl)
          Specifies the URI that will be used to redirect user after closing webMethods Master Data Manager session.
 void setService(ServiceKey aServiceKey)
          Specifies the service to activate.
 void setTrackingInfo(String trackingInfo)
          Specifies the tracking info for the new user session.
 void setUserLoginPassword(String userLogin, String userPassword)
          Specifies the login and password for authenticating the user.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createWithBaseURI

public static UIHttpManagerComponent createWithBaseURI(String baseURI)
Creates an instance of this class for calling webMethods Master Data Manager from an external application.

Parameters:
baseURI - Base URI to webMethods MDM web application.
See Also:
createWithBaseURI(String, AdaptationName)

createWithBaseURI

public static UIHttpManagerComponent createWithBaseURI(String baseURI,
                                                       AdaptationName aManagerReference)
Creates an instance of this class for calling webMethods Master Data Manager from an external application.

The default deployment requires a URL base that has the following form:

http://<host>[:<port>]/mdm/

Or, if the Java application is running on the same application server:

/mdm/

Note: More formally, the URI base must refer to the servlet named com.softwareag.mdm.front.FrontServlet defined in the Web application mdm.war (see file /WEB-INF/web.xml in mdm.war).

Parameters:
baseURI - Base URI to webMethods MDM web application (see examples above).
aManagerReference - Identifier of webMethods Master Data Manager adaptation (for example, mdManager).

createOnServiceContext

public static UIHttpManagerComponent createOnServiceContext(ServiceContext aContext)
Creates an instance of this class for calling webMethods Master Data Manager from a ServiceContext.


createOnUIBeanContext

public static UIHttpManagerComponent createOnUIBeanContext(UIResponseContext aContext)
Creates an instance of this class for calling webMethods Master Data Manager from a UI component context.


getURIWithoutParameters

public abstract String getURIWithoutParameters()
This function returns the URI to webMethods Master Data Manager, without specific parameters.

See Also:
getURIWithParameters(), getHttpParameterNames(), getHttpParameterValue(String)

getURIWithParameters

public String getURIWithParameters()
This function returns the URI to webMethods Master Data Manager, including parameters specified by this instance.

Warning: this method may return a String whose length is not supported by the browser or the Servlet Container.

User authentication parameters have to be added according to current user directory implementation.

See Also:
Directory.authenticateUserFromHttpRequest(HttpServletRequest)

getHttpParameterNames

public List getHttpParameterNames()
Returns the names of the HTTP parameters that are specified by this instance.

Since method getURIWithParameters() may lead to a too long URI, this method may be used for building a POST request .

See Also:
getHttpParameterValue(String)

getHttpParameterValue

public String getHttpParameterValue(String aParameterName)
Returns a String object as the value of the parameter, null if parameter is not defined.

See Also:
getHttpParameterNames()

initFromHttpRequest

public void initFromHttpRequest(HttpServletRequest request)
                         throws IllegalArgumentException
Initializes this instance with the incoming request specified.

This method can be used to "forward" Manager Component parameters to another page so that it is able to perform the actual call.

Throws:
IllegalArgumentException

getUserLogin

public String getUserLogin()
Returns the user login, null if no login/password is specified.

See Also:
setUserLoginPassword(String, String)

getUserPassword

public String getUserPassword()
Returns the user password, null if no login/password is specified.

See Also:
setUserLoginPassword(String, String)

setUserLoginPassword

public void setUserLoginPassword(String userLogin,
                                 String userPassword)
Specifies the login and password for authenticating the user.

The authentication process is detailled in this class comment.


getHomeKey

public HomeKey getHomeKey()

getInstanceReference

public AdaptationReference getInstanceReference()

getXPathString

public String getXPathString()

selectHome

public void selectHome(HomeKey aHomeKey)
Selects the home (branch or version) specified.

Throws:
IllegalArgumentException - if aHomeKey is null.

selectInstance

public void selectInstance(HomeKey aHomeKey,
                           AdaptationName anInstanceReference)
Selects the instance specified.

Throws:
IllegalArgumentException - if aHomeKey is null or anInstanceReference is null.

select

public void select(HomeKey aHomeKey,
                   AdaptationName anInstanceReference,
                   Path aPath)
Selects the node in the instance specified.

Throws:
IllegalArgumentException - if aHomeKey is null.

select

public void select(HomeKey aHomeKey,
                   AdaptationName anInstanceReference,
                   String aXPathExpression)
            throws IllegalArgumentException
Specifies a selection onto a Master Data entity.

This method is the most general one for doing an entity selection.

Parameters:
aHomeKey - branch or version.
anInstanceReference - reference to an instance in the home. If null, this method is same as selectHome(HomeKey).
aXPathExpression - XPath expression that specifies a selection in the instance. If null and instance not null, this method is same as selectInstance(HomeKey, AdaptationName).
Throws:
IllegalArgumentException - if aHomeKey is null, or anInstanceReference is null but not aXPathExpression.

selectHome

public void selectHome(AdaptationHome aHome)
Selects the home (branch or version) specified.

Throws:
IllegalArgumentException - if aHome is null.

selectInstanceOrOccurrence

public void selectInstanceOrOccurrence(Adaptation anAdaptation)
Selects the entity specified, an instance or an occurrence.

Throws:
IllegalArgumentException - if anAdaptation is null.

selectInstanceOrOccurrenceWithPredicate

public void selectInstanceOrOccurrenceWithPredicate(Adaptation anAdaptation,
                                                    String predicate)
Selects the entity specified, an instance or an occurrence with the predicate restriction

Parameters:
predicate - the predicate which precise the selection
Throws:
IllegalArgumentException - if anAdaptation is null.
See Also:
XPath supported syntax.

selectNode

public void selectNode(Adaptation anAdaptation,
                       Path aNode)
Selects the node specified.

Parameters:
anAdaptation - an instance or an occurrence.
aNode - a path to a node in the adaptation; if null this method is same as selectInstanceOrOccurrence(Adaptation).
Throws:
IllegalArgumentException - if anAdaptation is null.

selectNode

public void selectNode(Adaptation anAdaptation,
                       Path aNode,
                       String predicate)
Selects the node specified with the predicate restriction

Parameters:
anAdaptation - an instance or an occurrence.
aNode - a path to a node in the adaptation; if null this method is same as selectInstanceOrOccurrence(Adaptation).
predicate - the predicate which precise the selection
Throws:
IllegalArgumentException - if anAdaptation is null.
See Also:
XPath supported syntax.

getService

public ServiceKey getService()
Returns the service to activate, null if no specific service has been set.


setService

public void setService(ServiceKey aServiceKey)
Specifies the service to activate.

The built-in service ServiceKey.VALIDATION can be activated on a home.

The built-in service ServiceKey.CREATE can be activated only if a table node is selected.

Parameters:
aServiceKey - The service that must be activated when Manager Component is called, null if no specific service has to be activated.

getRedirectionURI

public String getRedirectionURI()
Returns the URI that will be used to redirect user after closing webMethods Master Data Manager session.


setRedirectionURI

public void setRedirectionURI(String redirectionUrl)
Specifies the URI that will be used to redirect user after closing webMethods Master Data Manager session.

The URI will have an additional HTTP parameter that specifies a return code. The application that receives the URI can extract it by means of method UIHttpManagerComponentHelper.getReturnCodeFromHttpRequest(HttpServletRequest).

See Also:
UIHttpManagerComponentReturnCode

getTrackingInfo

public String getTrackingInfo()
Returns the tracking info for the new user session, null if no specifi tracking info has been set.

See Also:
Session.getTrackingInfo()

setTrackingInfo

public void setTrackingInfo(String trackingInfo)
Specifies the tracking info for the new user session.

See Also:
Session.getTrackingInfo()

getLocale

public Locale getLocale()
Returns the locale specified for the new user session, null if no specific locale has been set.

See Also:
Session.getLocale()

setLocale

public void setLocale(Locale locale)
Specifies the locale for the new user session.

See Also:
Session.getLocale()


(report a bug)
webMethods MDM 4.2.8 [0558]
Copyright Software AG 2000-2007. All rights reserved.