Skip to content

Instantly share code, notes, and snippets.

View donatasnicequestion's full-sized avatar

Donatas Valys donatasnicequestion

View GitHub Profile
@donatasnicequestion
donatasnicequestion / chatExcerpt.xml
Created July 27, 2012 16:03
A excerpt with essential parts to show a usage of af:activeOutputText in conjunction with af:ajax tag
<!-- Data push --> <!-- anonymous javascript function onevent does nothing -->
<f:ajax event="propertyChange" onevent="function(e) {}" render="t1 t2 ot1">
<af:activeOutputText value="#{chatListenerBean.message}" id="aot1">
<f:ajax/> <!-- this tag does nothing -->
</af:activeOutputText>
</f:ajax>
<!-- Output text Alive:true -->
<af:outputText id="ot1"
value=" Alive:#{chatListenerBean.pong}"
clientComponent="true"/>
@donatasnicequestion
donatasnicequestion / Person.java
Created July 4, 2012 00:23
Snippet of Person.java domain object for the CRUD sample
public class Person {
private Integer number;
private String firstName;
private String lastName;
private Date birthday;
public Person() {
super();
}
@donatasnicequestion
donatasnicequestion / CRUDPersonsTaskFlowController.java
Created July 4, 2012 00:00
Snippet of CRUDPersonsTaskFlowController.java
public class CRUDPersonsTaskFlowController {
private List<Person> personList;
.. getter and setter omitted..
/** Copy person by using copy constructor
*
* @param person person to copy
*/
@donatasnicequestion
donatasnicequestion / web.xml
Created June 16, 2012 20:24
Oracle ADF frame busting context param in web.xml for the blog http://donatas.nicequestion.com
<context-param>
<description>Security precaution to prevent clickjacking: bust frames
if the ancestor window domain(protocol, host, and port) and the frame
domain are different. Another options for this parameter are always and never.
</description>
<param-name>org.apache.myfaces.trinidad.security.FRAME_BUSTING</param-name>
<param-value>never</param-value>
</context-param>
@donatasnicequestion
donatasnicequestion / iframe.html
Created June 16, 2012 15:57
ADF sample embedded as IFRAME in the blog http://donatas.nicequestion.com
<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>
@donatasnicequestion
donatasnicequestion / web.xml
Created June 16, 2012 15:47
Context param for web.xml oracle.adf.view.rich.prettyUrl.OPTIONS
<context-param>
<param-name>oracle.adf.view.rich.prettyUrl.OPTIONS</param-name>
<param-value>off</param-value>
</context-param>
@donatasnicequestion
donatasnicequestion / SampleFlowController.java
Created May 28, 2012 15:24
Sample implementation of ADF flow controller
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);
@donatasnicequestion
donatasnicequestion / FlowScopedDataControlBase.java
Created May 28, 2012 15:11
Base generic implementation of ADF flow scoped bean data control.
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.
*
@donatasnicequestion
donatasnicequestion / SampleFlowDataControl.java
Created May 28, 2012 15:08
Implementation of specific ADF flow scoped bean data control.
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
@donatasnicequestion
donatasnicequestion / CallADFMethodBidingInJavaAndRetreveTheResult.java
Created May 13, 2012 17:53
Call ADF URL Data control Method Biding In Java And get a The Result
// 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;