HPA.Interop
Deprecated since HP Anywhere 10.02; use HPA.Framework.
Interoperability API - used for interacting with the HPA framework.
Usage Example:
var ctxObj = HPA.Framework.createContextObject( "QCCR1123", "ALM CR", "button doesn't work...");
HPA.Framework.openEntryPoint("DefectManager", "open", [ ctxObj ]);
Methods
addContextObjectToActivity
-
context
Adds a context object or objects to an activity. If only one parameter is given, prompts the user to add the object/s to either the current activity or to a new one. If a second parameter is given (see below for valid values), adds the object/s without prompting the user. Use this method to add a context object to an activity as a result of user interaction with the app. For example, when a user submits a defect in a defect management app, you can use this method to add a context object to the activity representing that defect.
Parameters:
-
context
Object | ArrayA valid context object or an array of valid context objects. Create valid context objects using the createContextObject factory method. Test existing context objects for validity using the isValidContextObject method. For an invalid object, obtain detailed information using the validateContextObject method.
createContextObject
-
objectId
-
dataType
-
displayName
-
[metaData]
Create a valid context object based on the arguments provided. After the object is created, it is validated by calling isValidContextObject.
A context object represents a business entity that is provided to the HP Anywhere framework by apps. For details, see the User Guide and Events Sample App Cookbook.
Parameters:
-
objectId
StringID of the context object; globally unique identifier.
-
dataType
StringType of data of this context object.
-
displayName
StringName of the context object. Maximum length: 100 characters.
-
[metaData]
String optionalAn arbitrary string containing extra information. Maximum length: 2000 characters.
Returns:
createEntryPointObject
-
appId
-
entryPointId
-
displayName
Create a valid entry point object based on the arguments provided.
An entry point object represents a specific app page that is provided to the HP Anywhere framework by apps. For details, see the User Guide and Events Sample App Cookbook.
Parameters:
Returns:
isAppAvailable
-
targetAppId
Ask the HP Anywhere framework whether or not a specific app is available for interaction.
Parameters:
-
targetAppId
StringID of the required app. The ID of the app containing the entry point (app specific page).
Returns:
isValidContextObject
-
contextObject
Validate that the context object is in the correct structure. This method returns a boolean value; for an invalid object, obtain detailed information using the validateContextObject method.
Parameters:
-
contextObject
ObjectContext object to be tested for validity.
Returns:
openEntryPoint
-
targetAppId
-
entryPoint
-
[contextObjects]
-
[callback]
-
[scope]
-
[reuse]
Invoke an entry point of a specific app with optional context objects.
Important: This method is different from the global openEntryPoint() method.
Important: Ajax server requests are asynchronous, and this call will return before the response has been received. Process any returned data in a callback function.
Parameters:
-
targetAppId
StringTarget app ID.
-
entryPoint
StringEntry point ID.
-
[contextObjects]
Array optionalAn array of context objects. An array of valid context objects. Create valid context objects using the createContextObject factory method; test existing context objects for validity using the isValidContextObject method; for an invalid object, obtain detailed information using the validateContextObject method.
-
[callback]
Function optionalCallback function to be called when the entry point is loaded.
-
[scope]
Object optionalThe scope ('this' reference) in which the callback function is executed.
-
[reuse]
Boolean optional[Desktop Edition] Whether to reuse the existing app instance.
Usage Example:
var ctxObj = HPA.Framework.createContextObject( "QCCR1123", "ALM CR", "Login failure"); HPA.Framework.openEntryPoint("DefectManager", "defect", [ ctxObj ]);
where DefectManager is the targetAppId parameter, defect is the entryPoint parameter, and ctxObj is the contextObjects parameter.
openInnerPoint
-
displayName
-
callback
-
scope
-
[params]
-
[validationCallback]
-
[removeCallback]
[Desktop Edition]
Mark the user state of the current app as an internal navigation point, so that the end-user can return to this point via the drop-down navigation menu.
Important: Ajax server requests are asynchronous, and this call will return before the response has been received. Process any returned data in a callback function.
Parameters:
-
displayName
StringName to be displayed in the drop-down navigation menu.
-
callback
FunctionCallback function to be called when the navigation point is selected, if the validation callback did not return False.
-
scope
ObjectThe scope ('this' reference) in which the callback functions are executed.
-
[params]
Object optionalParameters to be passed as arguments when the callbacks are called.
-
[validationCallback]
Function optionalCallback function to be called just before switching to this page. If the function returns False, navigation to this page is canceled.
-
[removeCallback]
Function optional[since HP Anywhere 10.01] Callback function to be called after this page is removed.
saveState
-
state
Persist an object representing the current app state. There is no restriction on the object format; maximum size is 100kB (102,400 bytes). The state is saved per user, per activity, per app instance. When the user enters the app in the activity again, the last saved state is provided to the app, via its openEntryPoint method, params argument.
Parameters:
-
state
AnyAn object in arbitrary format.
setActions
-
hideActions
Hide or show the actions bar.
Parameters:
-
hideActions
BooleanTrue to hide the actions bar, false to show it.
setCurrentContext
-
[context]
-
[entryPointObject]
Notify the HP Anywhere framework of the current context of the app. If the user adds a post in the timeline, objects in the current context that are not in the current activity are automatically added to the activity (no objects are deleted or updated).
Parameters:
-
[context]
Object | Array optionalA valid context object or an array of valid context objects. Create valid context objects using the factory method. Test existing context objects for validity using the isValidContextObject method. For an invalid object, obtain detailed information using the validateContextObject method.
-
[entryPointObject]
Object optionalA valid entry point object. Create valid entry point objects using the createEntryPointObject factory method.
setReady
-
readyState
Notify the HPA framework that the app is ready to accept entry point requests.
This method must be called by the app developer whenever the app is loaded.
Parameters:
-
readyState
Boolean | ObjectEither an object with the properties listed below, describing the relevant app capabilities, or simply the boolean True.
-
[hasDefaultAction]
Boolean optional[Smartphone Edition] Show an integrated default Action button in the Actions bar. The app needs to handle the DefaultAction entry point.
-
[moreActions]
Array optional[Smartphone Edition] Show integrated menu items in the More menu. The app needs to handle the MoreActions entry point.
-
[hasAutoContext]
Boolean optionalSupport auto-injection of context objects. The app needs to handle the GetContextObjects entry point.
-
validateContextObject
-
contextObject
Validate that the given context object is in the correct structure, otherwise returns detailed information. Note that returned messages aren't localized (are always in English).
Parameters:
-
contextObject
ObjectContext object to be tested for validity.