|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.orchestranetworks.service.ServiceContext
This class provides the necessary context and navigation functions for integrating UI services into EBX.Manager. For general information, see UI Services.
A UI service must be declared as a complex type definition:
<xs:complexType name="MyService">
<xs:annotation>
<xs:appinfo>
<osd: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>
where 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 EBX.Platform 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 |
specifies where the service is available. The list of paths is white-space delimited.
Each path must be the absolute XPath notation of the node. For osd: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 EBX.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 aResourcePath)
Returns the URL string for the resource specified. |
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. |
abstract boolean |
isCalledOnHome()
Returns true if the current service is called from a home menu. |
abstract boolean |
isCalledOnInstance()
Returns true if the current service is called from an instance menu. |
abstract boolean |
isCalledOnOccurrencePage()
Returns true if the current service is called from an occurrence page. |
abstract boolean |
isCalledOnTable()
Returns true if the current service is called from the "Services on table" menu category. |
abstract boolean |
isCalledOnTableSelection()
Returns true if the current service is called from the "Services on selected records" menu category. |
| 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 ProcedureResult execute(Procedure aProcedure)
Procedure.execute(ProcedureContext).
public abstract AdaptationHome getCurrentHome()
public abstract Adaptation getCurrentAdaptation()
throws IllegalStateException
This method returns an adaptation instance if :
isCalledOnInstance() ) ;isCalledOnTable() ) ;isCalledOnTableSelection() );This method returns an adaptation occurrence if:
isCalledOnTableSelection() );isCalledOnOccurrencePage() ).
IllegalStateException - if the current service is running from a home menu (branch or version, see isCalledOnHome()).getSelectedOccurrences()public abstract Request getCurrentRequest()
null if this service is called ouside a table context.
isCalledOnTable()public abstract List getSelectedOccurrences()
Adaptation that correspond to the occurrences selected in
the Manager, or an empty list if the service is being executed on an adaptation
instance.isCalledOnTableSelection(),
getCurrentAdaptation()public abstract SchemaNode getCurrentNode()
public abstract Path getCurrentPathInAdaptation()
public abstract Locale getLocale()
Session.getLocale()public abstract Session getSession()
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 void addMessage(UserMessage aMessage)
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 String getURLForResource(String aResourcePath)
The resource must be in the same web application as the service.
aResourcePath - must begin with a "/" and is interpreted as relative to the module (web
application) root.
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 String getURLForSelection(Adaptation anAdaptation)
public abstract String getURLForSelection(Adaptation anAdaptation,
Path aPath)
public abstract boolean isCalledOnHome()
Returns true if the current service is called from a home menu.
getCurrentHome()public abstract boolean isCalledOnInstance()
Returns true if the current service is called from an instance menu.
getCurrentAdaptation()public abstract boolean isCalledOnTable()
Returns true if the current service is called from the "Services on table" menu category.
In this case, it is generally expected that the service will apply on the whole table or on the filtered table.
getCurrentRequest()public abstract boolean isCalledOnTableSelection()
Returns true if the current service is called from the "Services on selected records" menu category.
In this case, it is generally expected that the service will apply on the selected occurrences.
getSelectedOccurrences()public abstract boolean isCalledOnOccurrencePage()
Returns true if the current service is called from an occurrence page.
In this case, it is generally expected that the service will apply on the current occurrence.
getCurrentAdaptation()
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
(report a bug)
EBX.Platform 4.5.2 [0601:0004]
Copyright Orchestra Networks 2000-2008. All rights reserved.