Developer's Guide-HFM
Developer's Guide-HFM
Developer's Guide-HFM
Developer's Guide
Release 11.2.x
F81224-01
May 2023
Prerequisites
To develop custom pages for Oracle Hyperion Financial Management using the SDK,
users should be familiar with Java and J2EE technologies. Prerequisites:
1. Familiarity with Java and J2EE technology.
1
2. Oracle JDeveloper 12c (download from Oracle JDeveloper Software site). Apply
Patch 34944256, which you can download from Oracle Support. Alternate IDEs
can be used. Samples and examples are provided for JDeveloper only.
SDK Reference
The complete SDK reference is available on Oracle Help Center. See HFM Javadoc.
Note:
The SDK packages and classes also contain public classes and methods
defined for Oracle Hyperion Financial Management internal use. They are
documented accordingly in the reference guide. It is not advised to use these
APIs and they may not be supported in future versions.
2
High-level directories:
• .adf—Contains adf-config.xml inside META-INF directory
• Build—Contains build.xml (ant file to build the application)
• src—Contains weblogic-application.xml in META-INF directory
• Web—Directory with web application files
High-level directories in the web application:
– adfmsrc—Contains adfm.xml (config file for adf and DataBindings.cpx)
– build—build.xml (ant file for building the project)
– public_html—Web application content
– src—Java source code for beans and business logic layer
Shared Libraries
The Oracle Hyperion Financial Management SDK demo application requires that these
shared libraries be referenced:
1. epm-shared-libraries—Deployed by EPM System Configurator and targeted for all
HFM servers. Required for HFM.
2. epm-hfm-libraries—Deployed by EPM System Configurator and targeted for all
Financial Management servers. Required for accessing Financial Management.
Primary API that gives access to Financial Management.
3
3. epm-thrift-libraries - Deployed by EPM System Configurator and targeted for all
Financial Management servers. Required for accessing Financial Management.
Provides TCP/IP communication to Financial Management Servers.
Custom Pages
Related Topics
• Sample Application Structure
• Framework for Custom Pages
• Build Project
• Sample Application
• Installation and Deployment
• Steps for Custom Page Developers
4
High-level directories:
• .adf—Contains adf-config.xml inside META-INF directory
• Build—Contains build.xml (ant file to build the application)
• src—Contains weblogic-application.xml in META-INF directory
• Web—Directory with web application files
High-level directories in the web application:
– adfmsrc—Contains adfm.xml (config file for adf and DataBindings.cpx)
– build—build.xml (ant file for building the project)
– public_html—Web application content
– src—Java source code for beans and business logic layer
5
• POV Bar and member selector
• Displaying the POV Bar
• Message and Error Dialog Box
• Images
• Exceptions
• Cleanup
Links
Oracle Hyperion Financial Management Custom pages framework leverages Links in
Financial Management. Links can be displayed on a tab or in a browser window. The
Links module displays the user’s application in an inline frame. Financial Management
instantiates the frame and posts a request to the user’s external customized deployed
page.
In the post request, Financial Management determines the calling application name,
the server/cluster on which the application is run, the SSO token, the request type, and
the URL for callback to the External Member Selector. The request type indicates
whether users are initializing the application or closing the application (when the tab is
closed). The custom application uses the information inside the post request from
Financial Management and creates an application session with it. After the session is
established, users can make Web Service calls back to Financial Management using
the Financial Management Java Object Model.
Shared Libraries
Oracle Hyperion Financial Management Custom pages require that these shared
libraries be referenced:
1. adf.oracle.domain—Deployed by EPM System Configurator and targeted for all
Financial Management Servers. Required for common adf files.
2. epm-shared-libraries—Deployed by the EPM System Configurator and targeted for
all Financial Management Servers. Required for Financial Management.
3. epm-hfm-libraries—Deployed by the EPM System Configurator and targeted for all
Financial Management Servers. Required for accessing Financial Management.
Primary API that gives access to Financial Management.
4. epm-thrift-libraries - Deployed bythe EPM System Configurator and targeted for all
Financial Management Servers. Required for accessing Financial Management.
Provides TCP/IP communication to Financial Management Servers.
Library references are available in weblogic-application.xml in ear\META-
INF\weblogic-application.xml.
To run the custom web application in JDeveloper or integrated Weblogic Server, you
must specify an additional parameter –Depm.oracle.instance, which should be the
same as the env instance home. Typically this variable is:
C:\Oracle\Middleware\user_projects\epmsystem1.
6
Servlet Filters
The sample web application also has a BaseServletFilter implementation. This filter
caches the post parameters in the user session. This caching is required as the initial
requests are subjected to HTTP redirects while adding the window ID and control state
parameters to the URL. During this redirect, the POST parameters are lost.
Filters and mappings should be specified in web.xml.
<filter>
<filter-name>BaseServletFilter</filter-name>
<filter-class>
oracle.epm.fm.ui.customization.servlets.BaseServletFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>BaseServletFilter</filter-name>
<url-pattern>/faces/customization/*</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
Resources
Messages and captions can be displayed in the user language according to the
browser preferences. The Oracle Hyperion Financial Management custom UI can use
XLF files to handle resources. The locale is retrieved for the ADF Faces Context in
theADFUtil::getLocale method. To retrieve the correct message, users can access
the ADFUtil::getMessage(String msg, String... params)method. The msg
parameter is the name of the key to WebBundle_XX.xlf (where XX is the locale such
as es, en, and so on). A key in the file can be defined as follows:
<trans-unit id="ERROR_USER_PARAM">
<source>
There was an error getting the user parameter '{0}'.
Please inspect the logs for more details.
</source>
<target/>
</trans-unit>
7
It can be accessed on the client side jspx/jsff files as follows:
<c:set var="webBundle"
value="#{adfBundle
['oracle.epm.fm.ui.customization.resources.WebBundle']}"/>
<af:outputText id="ot1" value="#{webBundle.REQUESTED_APPLICATION}/>
If the key is not declared in the XLF of the bundle for the locale, the value defaults to
the English bundle. This behavior is stipulated in the Web.jpr project in the Resource
Bundle section.
Logging
The sample application leverages ODL logging. The following parameters must be
specified as startup parameters when the web application is started in JDeveloper (in
Integrated WebLogic Server):
-
Djava.util.logging.config.class=oracle.core.ojdl.logging.LoggingConfigura
tion
-Doracle.core.ojdl.logging.config.file=logging.xml
8
request to an inlineframe, the custom application is responsible for populating the post
request parameters expected by the HFM Member Selector.
Parameters required for the member selector:
• SSO Token
• Application name
• Cluster
• Slice string for currently selected members in the format A#Sales.S#Actual
• Dimension xml for controlling the behavior of the selections and visibility of
dimensions. The Dimension xml is in the format:
<Dimensions>
<Dimension
name=’Account’
type=’Account’
listSelectable=’false’
listSelected=’’/>
<Dimension
name=’Custom1’
type=’Custom’
listSelectable=’false’
listSelected=’’/>
</Dimensions>
The af:region, which is the ADF UI component for a taskflow, must be embedded in a
panelGroupLayout whose name is pgpov. This is required to do a partial page refresh
of the POVBar. You must rename the region regpov and create an associated
clientComponent. Define the bindings in the jspx page definition for POVBartaskflow1
as follows:
<taskFlow id="POVBartaskflow1"
taskFlowId="/WEB-INF/oracle/epm/fm/ui/customization/
taskflows/povbar/POVBar-
9
task-flow.xml#POVBar-task-flow"
activation="deferred"
xmlns="http://xmlns.oracle.com/adf/controller/binding">
<parameters>
<parameter id="CallbackBean" value="#{viewScope.SampleBean}"/>
</parameters>
</taskFlow>
10
The memberSelector jspx file initially makes a call to the MemberSelectorBean::init
method as part of the f:view beforePhase attribute. The MemberSelectorBean is
defined in the adfc-config xml as a request scope bean. The init method simply
extracts the POST parameter map from the Session using the UUID key specified on
the request parameter HFMCUSTKEY.
It then makes a call to the javascript to programmatically POST to the
ExternalMemberSelector with the POST parameters specified above, with an
additional parameter (extcaller=fcm) to indicate callbacks from the Member Selector
will be done through direct javascript back into an iframe. The member selector should
look as follows:
If the user clicks Cancel, HFM expects the parent frame to implement a javascript
method named memberSelectorCanceled. This method is implemented in POVBar.jsff.
An ADF event is queued in the javascript to ‘handleMemberSelectorCancel’ within the
popup. The popup implements an af:serverListener for this, which in turn calls into the
POVBarBean::handleMemberSelectorCancel() method. This method closes the
af:popup.
If the user clicks OK, HFM expects the parent iframe to implement a javascript method
named hfmSelectorReturn that takes a string XML as a parameter which contains the
new values inside the POVBar. The XML was defined above as follows:
<Dimensions>
<Dimension name=’Account’ val=’Expense;Margin’/>
<Dimension name=’Scenario’ val=’Actual’/>
11
<Dimension name=’Entity’ val=’Stamford’/>
</Dimensions>
This in turn calls the hfmSelectorReturn method in POVBar,jsff. The javascript method
queues an ADF event for ‘handleMemberSelectorOK’ on the af:popup and sets a client
attribute for the xml to memberSelectorXml. The af:popup implements an
af:serverListener for this, that in turn calls into the
POVBarBean::handleMemberSelectorOk. This method extracts the client attribute xml
and updates the POVBarData with it. The POVBarData::update method does this by
parsing the xml using the DOM parser. Then the POVBar is PPR’d, and the callback
BaseBean’s handleCallbackFromPOVBar method is called. Finally, the popup is
closed.
Images
Images are stored in the ADF default Web Content JDeveloper directory, in
Web\public_html\images directory. Thus, if an image must be displayed, it can be done
as follows:
<af:image id="imgscen"
source="/images/scenario.png"
shortDesc="Scenario Dimension"/>
Exceptions
All exceptions should derive from the HFMCustomizationException. This will
indicate that an exception was caught or is handled by the application. This will imply
that the exception has already been logged, because it is customary to log the
exception only once at the point of occurrence. However, at all root access points in a
Managed bean, checking for exceptions is required. If an exception is of the type
HFMCustomizationException, it will only be required to display an error dialog
box. Otherwise, if an unhandled exception occurs, it would be best to log the exception
first and then display the error dialog box.
As an example, if a Web Service call fails, the following should be done:
try {
// Code for business logic
} catch(HFMException ex) {
Log exception
12
Throw new HFMCustomizationException(ex);
}
And in the public methods of the Managed Bean, which are accessed in the client side
jspx/jsff files – this should occur:
try {
Code for business logic
} catch(HFMCustomizationException ex) {
Display error dialog
} catch (Throwable ex) {
Log the exception
Display error dialog
}
Cleanup
The Custom UI page is also responsible for cleanup of resources on the server related
to the session. When the Oracle Hyperion Financial Management tab that contains the
custom module is closed, an OnClose event is triggered from the browser.
The custom application is responsible for handling this event and cleanup of resources
both in the Java WebLogic as well as the session on the Financial Management App
server, including closing the created application session. If the application does not do
this, then the application session will be closed when it has timed out.
When the Financial Management tab in which the inlineFrame resides displaying the
custom application is closed, the custom application’s window.onunload event is
triggered. It would be required at this point, at the very least, to close the application
session. To catch the event, it would be required of the main jspx page of the custom
application to implement the window.onunload method. The common.js file has a
working implementation of this method. The jspx would need to include this file as
follows:
The javascript method makes an internal AJAX POST request to an internal URL
customization/cleanUp.jsp and passes the application session ID as a post parameter
to it. The way the application session is retrieved is that the javascript assumes that
there is a commandButton by the name clnbtn1, which has a client attribute called
appSessionId containing this information. Thus, it is the responsibility of the root jspx
page to include the following:
13
Since the SampleBean should derive from the BaseBean, the appSessionId should be
available, having been extracted from the Session Map where it was stored in the
Filter.
The AJAX POST request is made using the XmlHttpRequest object, which is
compatible with IE6+ and FireFox2+. The actual request is not handled by a
cleanUp.jsp file. Instead it is handled by CleanUpServlet.java, which derives from
HttpServlet. This is indicated in the web.xml file by indicating a servlet which handles a
request to that URL as follows:
<servlet>
<servlet-name>CleanUpServlet</servlet-name>
<servlet-
class>oracle.epm.fm.ui.customization.servlets.CleanUpServlet</servlet-
class>
</servlet>
<servlet-mapping>
<servlet-name>CleanUpServlet</servlet-name>
<url-pattern>/customization/cleanUp.jsp</url-pattern>
</servlet-mapping>
Build Project
The build project is used to compile the Customization Application code and create the
HFMCustomizationApplication.ear file in the root dist directory to deploy to Oracle
Hyperion Financial Management. The ear file uses OJDeploy to create the ear file
leveraging the deployment configuration inside the HFMCustomization.jws file. The
build_all.xml file is used to build the project. The following targets are available:
14
The build.xml file relies on two properties files to define all environment variables.
Sample Application
The Sample Application (sample.jspx) is used to demonstrate how the Custom
Application can be designed. It leverages showing a sample POV Bar and displays a
simple table of dimensions and their information. Developers of the Custom
Application can leverage the entire flow to start from for a new module. The following
is a snapshot of what to expect when running the sample.jspx. To see this, the user
must create a link to http://<hostname>:19000/hfmcustadf/faces/customization/
sample/sample.jspx.
15
After the application is deployed, users must indicate to the proxy web server (OHS/
IIS) that all URLs attempting to access the application must be routed through the web
server.
16
5. Open logging.xml in the build project and confirm that the location of the log is
correct. You can use the default location.
6. Create a new main jspx file that will be the entry point to your custom page. Use
the sample.jspx file as your guide. The file should be located within the
customization context directory. As an example, the sample.jspx file is located in
the customization/sample directory. You can create another directory underneath
the customization directory and put the jspx file there. Ensure that it is within the
customization directory, because the BaseServletFilter mapping in web.xml
handles all requests pertaining to /faces/customization/*. Otherwise, you must
create another mapping in web.xml and derive your own BaseServletFilter class
to handle the incoming requests to your discretion.
7. The jspx file probably requires an associated Managed bean in order to do
processing, such as making the Web Service calls. Create the Managed Bean
using a standard Java class file and have it derive from the BaseBean class. Try to
incorporate the bean under the oracle.epm.fm.customization.beans package by
creating a new package within it. Remember to incorporate this bean in the adfc-
config.xml file (which is the default unbounded taskflow). It is suggested to make
the bean view scope. You can use SampleBean as your guide.
8. On the java side, you can use the ADFUtil file to display error dialog boxes, get
messages from resource strings, and so on. If you need to add a string, you must
add it to WebBundle_XX.xlf files. You can leverage the
HFMCustomizationException class to throw valid exceptions.
9. In the root jspx file, include the correct cleanup code. By default, the application
session is removed. You do this by including the following:
This will include the common.js file which overwrites the default window.onunload
event. This implies that when the tab is closed in Financial Management, this
method gets called. The method then makes an AJAX call to the
CleanUpServlet.java, which will close the created application session that was
created in BaseServletFilter. In order for this AJAX POST request to happen, it will
require the following to be added to the root jspx as well:
The reason for this is that the JavaScript looks for a component named clnbtn1
and attempts to get the client attribute for the session. If it is desired to have a
more comprehensive cleanup code, it will first be required to create a new servlet
which will derive from the CleanUpServlet.java class. Users must then overwrite
17
the doPost method. This class must be registered as a servlet in web.xml similarly
to how the CleanUpServlet is done. This is done by adding the following:
<servlet>
<servlet-name>CleanUpServlet</servlet-name>
<servlet-
class>oracle.epm.fm.ui.customization.servlets.CleanUpServlet</
servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>CleanUpServlet</servlet-name>
<url-pattern>/customization/cleanUp.jsp</url-pattern>
</servlet-mapping>
The servlet-mapping indicates the relative URL to which the AJAX call should be
made, in order to redirect to the servlet. Thus, the user will need to tweak the
window.onunload method to route calls to the new jsp. If there is more information
it wishes to post to the request jsp, then that information must be incorporated as
an addition clientAttribute on the clnbtn1. The information must be a clientAttribute
because by the time the onunload method gets called, the ADF context has been
destroyed, and there would be no way to access the information in the bean.
10. If the entry/root jspx requires the ability to display the POVBar and have the ability
to change members using the member selector, then the user will be required to
incorporate the POVBar task flow into their page as follows:
First include the following in the jspx page:
In the jspx pageDef file, the binding for POVBartaskflow1 should be defined as
follows:
<taskFlow id="POVBartaskflow1"
taskFlowId="/WEB-INF/oracle/epm/fm/ui/customization/taskflows/
povbar/POVBar-
task-flow.xml#POVBar-task-flow" activation="deferred"
xmlns="http://xmlns.oracle.com/adf/controller/binding">
<parameters>
<parameter id="CallbackBean" value="#{viewScope.SampleBean}"/>
</parameters>
</taskFlow>
18
the taskflow. This parameter should be called POVBarData, and it describes the
contents of the POVBar using a POVBarData type. The POVBarData type can
limit which dimensions to display, as well as stipulate their initial values. If this is
not specified, the POVBar taskflow will by default be set to the user’s background
POV. The parameter can be added in the jspx pageDef file as follows:
<parameter id="POVBarData"
value="#{viewScope.SampleBean.povBarData}"/>
<LocationMatch ^/hfmcustadf/>
SetHandler weblogic-handler
WeblogicCluster hostname:7363
</LocationMatch>
19
iii. Rename the new directory to match the context name (for example,
hfmcustadf).
iv. In the directory, edit iisproxy.ini and modify these properties:
14. From the HFM Document Manager Module, create a link and select the Custom
Link option. By default, this selects that the Link opens within the same page, and
includes the SSO token option. For the link, use a relative path, such as: /
hfmcustadf /faces/customization/newsampledir/MyNewSample.jspx. You may
choose to use an absolute path, however, that may lead to browser security
checks and the page may not be displayed inline. To use an absolute URL,
deselect the option to open the link inline.
15. After you double-click the application, the inline frame should display your
application.
Note:
Because inline frames are used, the security to the URL should not be
restricted in the browser.
Useful References
1. Oracle® Fusion Middleware Fusion Developer's Guide for Oracle
2. JDeveloper and ADF Tutorials
3. Javadoc - Oracle Hyperion Financial Management Java Object Model
This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws.
Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit,
perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for
interoperability, is prohibited.
20
The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.
If this is software, software documentation, data (as defined in the Federal Acquisition Regulation), or related documentation that is delivered to the U.S. Government or anyone
licensing it on behalf of the U.S. Government, then the following notice is applicable:
U.S. GOVERNMENT END USERS: Oracle programs (including any operating system, integrated software, any programs embedded, installed, or activated on delivered
hardware, and modifications of such programs) and Oracle computer documentation or other Oracle data delivered to or accessed by U.S. Government end users are
"commercial computer software," "commercial computer software documentation," or "limited rights data" pursuant to the applicable Federal Acquisition Regulation and agency-
specific supplemental regulations. As such, the use, reproduction, duplication, release, display, disclosure, modification, preparation of derivative works, and/or adaptation of i)
Oracle programs (including any operating system, integrated software, any programs embedded, installed, or activated on delivered hardware, and modifications of such
programs), ii) Oracle computer documentation and/or iii) other Oracle data, is subject to the rights and limitations specified in the license contained in the applicable contract.
The terms governing the U.S. Government's use of Oracle cloud services are defined by the applicable contract for such services. No other rights are granted to the U.S.
Government.
This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous
applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take
all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by
use of this software or hardware in dangerous applications.
Oracle®, Java, and MySQL are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Intel and Intel Inside are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks
of SPARC International, Inc. AMD, Epyc, and the AMD logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open
Group.
This software or hardware and documentation may provide access to or information about content, products, and services from third parties. Oracle Corporation and its affiliates
are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise set forth in an applicable
agreement between you and Oracle. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-
party content, products, or services, except as set forth in an applicable agreement between you and Oracle.
For information about Oracle's commitment to accessibility, visit the Oracle Accessibility Program website at http://www.oracle.com/pls/topic/lookup?
ctx=acc&id=docacc.
Oracle customers that have purchased support have access to electronic support through My Oracle Support. For information, visit http://www.oracle.com/pls/topic/
lookup?ctx=acc&id=info or visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=trs if you are hearing impaired.
To provide feedback on this documentation, click the feedback button at the bottom of the page in any Oracle Help Center topic. You can also send email to
[email protected].
21