Skip to content

Instantly share code, notes, and snippets.

View donatasnicequestion's full-sized avatar

Donatas Valys donatasnicequestion

View GitHub Profile
@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 / 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 / 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 / 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 / ChatListener.java
Created July 28, 2012 12:09
Simple Chat listener model for the ADF active Chat sample * described in a blog @see http://donatas.nicequestion.com
package com.nicequestion.donatas.chat.model;
import java.beans.PropertyChangeListener;
public interface ChatListener extends PropertyChangeListener {
public void setUsername(String username);
public String getUsername();
public boolean isAlive();
public void setAlive(boolean alive);
}
@donatasnicequestion
donatasnicequestion / Chat.java
Created July 28, 2012 12:10
Simple Chat model definition for ADF active Chat sample * described in a blog @see http://donatas.nicequestion.com
package com.nicequestion.donatas.chat.model;
import java.util.List;
public interface Chat {
public void login(ChatListener listener);
public void logout(ChatListener listener);
public void addMessage(String message);
public List<String> getMessages();
public List<String> getUsers();
@donatasnicequestion
donatasnicequestion / ChatListenerBean.java
Created July 28, 2012 13:13
Chat listener implemented as view scoped JSF bean for the * sample ADF active Chat. Shows a usage of active data service * functionality to push the updates to the UI in Oracle ADF.
/**
* Chat listener implemented as view scoped JSF bean for the
* sample ADF active Chat. Shows a usage of active data service
* functionality to push the updates to the UI in Oracle ADF.
*
* @author Donatas Valys
*
*/
@ManagedBean
@ViewScoped
@donatasnicequestion
donatasnicequestion / ChatBean.java
Created July 28, 2012 13:18
Chat implemented as application scoped JSF bean for the * sample ADF active Chat. Shows a usage of active data service * functionality to push the updates to the UI in Oracle ADF.
/** Chat implemented as application scoped JSF bean for the
* sample ADF active Chat. Shows a usage of active data service
* functionality to push the updates to the UI in Oracle ADF.
*/
@ManagedBean
@ApplicationScoped
public class ChatBean implements Chat {
private List<String> messages = Collections.synchronizedList(new ArrayList<String>());
private List<String> users = Collections.synchronizedList(new ArrayList<String>());
@donatasnicequestion
donatasnicequestion / UtilityTaskFlowReference.java
Created August 23, 2012 16:04
UtilityTaskFlowReference Bean for the blog post Designing Modular Applications By Using Dynamic Task Flow Calls in Oracle ADF at http://donatas.nicequestion.com
package com.nicequestion.donatas;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.NoneScoped;
@ManagedBean(name = "utilityFlowReference")
@NoneScoped
public class UtilityTaskFlowReference {
public static final String FLOW_ID
<af:inputText label="Utility Task Flow Input Parameter" id="it1"
value="#{pageFlowScope.inputParameter}"/>
<af:commandButton text="back" id="cb1" action="back">
<af:setPropertyListener from="#{pageFlowScope.inputParameter}"
to="#{pageFlowScope.returnValue}"
type="action"/>
</af:commandButton>
<af:commandButton text="next" id="cb2" action="next">
<af:setPropertyListener from="#{pageFlowScope.inputParameter}"
to="#{pageFlowScope.returnValue}"