com.orchestranetworks.ui
Class UIHttpManagerComponent

java.lang.Object
  extended bycom.orchestranetworks.ui.UIHttpManagerComponent

public abstract class UIHttpManagerComponent
extends Object

This class is a utility for calling EBX.Manager as a user interface component.

A general introduction to EBX.Manager component is available here.

User authentication

The authentication process is the following:

  1. If the call is made from an existing EBX.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
 void compareSelectionWithEntity(HomeKey homeOnRightKey, AdaptationName instanceOnRight, String tableOrOccurrenceOnRight)
          Specifies the activation of the comparison service.
static UIHttpManagerComponent createOnServiceContext(ServiceContext aContext)
          Creates an instance of this class for calling EBX.Manager from a ServiceContext, but in a separate user session.
static UIHttpManagerComponent createOnUIBeanContext(UIResponseContext aContext)
          Creates an instance of this class for calling EBX.Manager from a UI component context, but in a separate user session.
static UIHttpManagerComponent createWithBaseURI(String baseURI)
          Creates an instance of this class for calling EBX.Manager from an external application.
static UIHttpManagerComponent createWithBaseURI(String baseURI, AdaptationName aManagerReference)
          Creates an instance of this class for calling EBX.Manager from an external application.
 HomeKey getHomeKey()
           
 HomeKey getHomeKeyToCompareWith()
           
 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()
           
 AdaptationReference getInstanceReferenceToCompareWith()
           
 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 EBX.Manager session.
 ServiceKey getService()
          Returns the service to be activated, null if no specific service has been set.
 String getTrackingInfo()
          Returns the tracking info for the new user session, null if no specific tracking info has been set.
abstract  String getURIWithoutParameters()
          This function returns the URI to EBX.Manager, without specific parameters.
 String getURIWithParameters()
          This function returns the URI to EBX.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()
           
 String getXPathStringToCompareWith()
           
 void initFromHttpRequest(HttpServletRequest request)
          Initializes this instance with the specified incoming request.
 void select(HomeKey aHomeKey, AdaptationName anInstanceReference, Path aPath)
          Selects the node in the specified instance.
 void select(HomeKey aHomeKey, AdaptationName anInstanceReference, String aXPathExpression)
          Specifies a selection onto a Master Data entity.
 void selectHome(AdaptationHome aHome)
          Selects the specified home (branch or version).
 void selectHome(HomeKey aHomeKey)
          Selects the specified home (branch or version).
 void selectInstance(HomeKey aHomeKey, AdaptationName anInstanceReference)
          Selects the specified instance.
 void selectInstanceOrOccurrence(Adaptation anAdaptation)
          Selects the specified entity, an instance or an occurrence.
 void selectInstanceOrOccurrenceWithPredicate(Adaptation anAdaptation, String predicate)
          Selects the specified entity, an instance or an occurrence with the predicate restriction
 void selectNode(Adaptation anAdaptation, Path aNode)
          Selects the specified node.
 void selectNode(Adaptation anAdaptation, Path aNode, String predicate)
          Selects the specified node 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 EBX.Manager session.
 void setService(ServiceKey aServiceKey)
          Specifies the service to be activated.
 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 EBX.Manager from an external application.

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

createWithBaseURI

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

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

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

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

/ebx/

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

Parameters:
baseURI - Base URI to EBX.Platform web application (see examples above).
aManagerReference - Identifier of EBX.Manager adaptation (for example, ebxmanager-1.0).

createOnServiceContext

public static UIHttpManagerComponent createOnServiceContext(ServiceContext aContext)
Creates an instance of this class for calling EBX.Manager from a ServiceContext, but in a separate user session.


createOnUIBeanContext

public static UIHttpManagerComponent createOnUIBeanContext(UIResponseContext aContext)
Creates an instance of this class for calling EBX.Manager from a UI component context, but in a separate user session.


getURIWithoutParameters

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

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

getURIWithParameters

public String getURIWithParameters()
This function returns the URI to EBX.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 the 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 specified incoming request.

This method can be used to "forward" Manager Component parameters to an other 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 specified home (branch or version).

Throws:
IllegalArgumentException - if aHomeKey is null.

selectInstance

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

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 specified instance.

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 - identifies a branch or a version in the repository.
anInstanceReference - identifies an instance in the home. If null, this method is the same as selectHome(HomeKey).
aXPathExpression - XPath expression specifying a selection in the instance. If null and instance not null, this method is the 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 specified home (branch or version).

Throws:
IllegalArgumentException - if aHome is null.
See Also:
UIResponseContext.getURLForSelection(AdaptationHome), ServiceContext.getURLForSelection(AdaptationHome)

selectInstanceOrOccurrence

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

Throws:
IllegalArgumentException - if anAdaptation is null.
See Also:
UIResponseContext.getURLForSelection(Adaptation), ServiceContext.getURLForSelection(Adaptation)

selectInstanceOrOccurrenceWithPredicate

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

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

selectNode

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

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

selectNode

public void selectNode(Adaptation anAdaptation,
                       Path aNode,
                       String predicate)
Selects the specified node 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 the same as selectInstanceOrOccurrence(Adaptation).
predicate - the predicate which defines the selection
Throws:
IllegalArgumentException - if anAdaptation is null.
See Also:
XPath supported syntax.

getService

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


setService

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

If no service is defined, the entity specified by means of select... methods is simply selected.

If a service is specified, it may require the selection of some entities (and additional parameters for specific services). Built-in services are documented in class ServiceKey), specific services should be documented in their own declaration.

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 EBX.Manager session.


setRedirectionURI

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

The URI can 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 specific 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()

compareSelectionWithEntity

public void compareSelectionWithEntity(HomeKey homeOnRightKey,
                                       AdaptationName instanceOnRight,
                                       String tableOrOccurrenceOnRight)
Specifies the activation of the comparison service.

The user is directed to the comparison interface:

Entities that can be compared are: two homes, two instances, two tables or two table occurrences.

Parameters:
homeOnRightKey - identifies a branch or a version in the repository.
instanceOnRight - identifies an instance in the home above, null if homes are to be compared. The reference to an instance is obtained by invoking the method Adaptation.getAdaptationName().
tableOrOccurrenceOnRight - XPath expression specifying either a unique table occurrence in the above instance, or a table, or null if instances or homes are to be compared. The XPath expression that uniquely identifies a unique table occurrence is directly obtained by invoking the method Adaptation.toXPathExpression().
See Also:
select(HomeKey, AdaptationName, String)

getHomeKeyToCompareWith

public HomeKey getHomeKeyToCompareWith()
See Also:
compareSelectionWithEntity(HomeKey, AdaptationName, String)

getInstanceReferenceToCompareWith

public AdaptationReference getInstanceReferenceToCompareWith()
See Also:
compareSelectionWithEntity(HomeKey, AdaptationName, String)

getXPathStringToCompareWith

public String getXPathStringToCompareWith()
See Also:
compareSelectionWithEntity(HomeKey, AdaptationName, String)


(report a bug)
EBX.Platform 4.8.4 [0722]
Copyright Orchestra Networks 2000-2010. All rights reserved.