This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- adfExt facelets taglib contains Set Initial Focus tag --> | |
<context-param> | |
<param-name>javax.faces.FACELETS_LIBRARIES</param-name> | |
<param-value>/WEB-INF/resources/adfExt.taglib.xml</param-value> | |
</context-param> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@FacesBehavior("donatas.nicequestion.com.adf.extensions.initialFocus") | |
public class SetInitialFocusBehavior extends ClientBehaviorBase { | |
/** (ADF) Faces component attributes to handle special cases | |
* where setting the initial focus doesn't make sense | |
*/ | |
private static final String ATTR_READ_ONLY = "readOnly"; | |
private static final String ATTR_VISIBLE = "visible"; | |
private static final String ATTR_DISABLED = "disabled"; | |
/** Custom marker attribute. | |
* Marks initial focus as already set to handle special cases: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="windows-1252"?> | |
<faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee"> | |
<factory> | |
<exception-handler-factory>com.nicequestion.donatas.adf.CustomExceptionHandlerFactory</exception-handler-factory> | |
</factory> | |
</faces-config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Get an instance of method binding named loadData1 (feeling analyzer service) | |
* of current binding container | |
* The implementation is therefore COUPLED with a page definition | |
*/ | |
BindingContext context = BindingContext.getCurrent(); | |
BindingContainer bindings = context.getCurrentBindingsEntry(); | |
OperationBinding operation = bindings.getOperationBinding("loadData1"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Put the text as an input parameter value for feelings service | |
operation.getParamsMap().put("Text", tweet.getMessage()); | |
// Call feeling analyzer method binding | |
operation.execute(); | |
Object operationResult = operation.getResult(); | |
if (operationResult != null) { | |
// operationResult is an instance of anonymous inner class | |
// which (fortunatly) implements an Iterator interface | |
Iterator result = (Iterator)operationResult; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nicequestion.donatas.adf; | |
import com.nicequestion.donatas.controller.SampleFlowController; | |
/** Implementation of specific ADF flow scoped bean data control. | |
* | |
* (Used to "Right-Click->Create Data Control" in JDeveloper :) | |
* | |
* SampleFlowDataControl as parameterized type is used to | |
* provide type information for the ADF data control facility |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nicequestion.donatas.adf; | |
import oracle.adf.view.rich.context.AdfFacesContext; | |
/** Base generic implementation of ADF flow scoped bean data control. | |
* | |
* Note: specific design and naming convention is applied: | |
* the type T must be defined as managed bean (name flowController, scope pageFlow) | |
* in a bounded task flow definition. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SampleFlowController { | |
private String sampleValue; | |
/* The method is aimed to show, that the same instance | |
* of controller is used, regardless of a way it gets consumed - | |
* as a data control or managed bean. | |
* */ | |
public void doSomethingUseful() { | |
sampleValue = sampleValue.toUpperCase(); | |
System.out.println("Something useful performed on testSampleValue:" + sampleValue); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<context-param> | |
<param-name>oracle.adf.view.rich.prettyUrl.OPTIONS</param-name> | |
<param-value>off</param-value> | |
</context-param> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<iframe frameborder="0" height="110" width="90%" | |
name="ADF Task Flow sample running in Java cloud" | |
src="http://cloud.nicequestion.com/faces/home.jsf"> | |
</iframe> |
OlderNewer