Skip to content

Instantly share code, notes, and snippets.

View donatasnicequestion's full-sized avatar

Donatas Valys donatasnicequestion

View GitHub Profile
@donatasnicequestion
donatasnicequestion / ADFBeanValidator.java
Created June 7, 2014 20:55
ADF Bean Validator for JSF303 integration with Oracle ADF
package com.nicequestion.donatas.adf.validate;
import javax.el.ValueExpression;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.BeanValidator;
import javax.faces.validator.FacesValidator;
import javax.faces.validator.ValidatorException;
@donatasnicequestion
donatasnicequestion / TaskFlowParametersProvider.java
Created January 19, 2013 18:46
** Provider interface for a consuming * ADF Task Flow controller to provide an * input parameter and receive a return value * * @param <T> task flow input parameter type * @param <R> task flow return value type * * @author Donatas Valys *
package com.nicequestion.donatas.adf.commons;
import java.io.Serializable;
/** Provider interface for a consuming
* ADF Task Flow controller to provide an
* input parameter and receive a return value
*
* @param <T> task flow input parameter type
* @param <R> task flow return value type
@donatasnicequestion
donatasnicequestion / TaskFlowCall.java
Created January 19, 2013 17:15
/** Utility bean, decleared and configured in a task-flow-template.xml * as a request scoped bean to suport a parameter passing * between ADF task flows * * @param <T> task flow input parameter type * @param <R> task flow return value type * * @author Donatas Valys */
package com.nicequestion.donatas.adf.commons;
/** Utility bean, decleared and configured in a task-flow-template.xml
* as a request scoped bean to suport a parameter passing
* between ADF task flows
*
* @param <T> task flow input parameter type
* @param <R> task flow return value type
*
* @author Donatas Valys
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:key name="gis" match="*" use="name()"/>
<xsl:template match="/">
<table>
<xsl:apply-templates/>
<xsl:message>done reading</xsl:message>
<xsl:for-each select="//*[generate-id(.)=generate-id(key('gis',name(.))[1])]">
<xsl:sort select="name()"/>
<tr>
<td><xsl:value-of select="name(.)"/></td>
<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}"
@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
@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 / 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 / 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 / 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);
}