Designing and Implementing Composite Applications : webMethods CAF and OpenCAF Development Help : Working with Facelets : Java Annotations in CAF and OpenCAF Applications : CAF Extended Managed Bean Annotations
CAF Extended Managed Bean Annotations
These annotations provide additional CAF-specific metadata for managed beans defined using the JSF managed bean annotations:
*@ExpireWithPageFlow. If this annotation is found on a session-scoped managed bean class, then the managed bean will be stored in the page flow storage instead of as a session attribute, and will expire with the page flow storage object.
*@DTManagedBean. If this annotation is found on a managed bean class, then the additional design-time metadata is loaded for Designer to use in the Bindings view and other places.
Pertinent code is highlighted in bold.
Example:
package caf.war.testapp1.test1;
 
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import com.webmethods.caf.faces.annotations.ExpireWithPageFlow;
import com.webmethods.caf.faces.annotations.DTManagedBean;
import com.webmethods.caf.faces.annotations.BeanType;
 
/**
 * Sample demonstrating the usage of the extended CAF managed
 * bean annotations
 */
@ManagedBean(name = "Test1DefaultviewView")
@SessionScoped

@ExpireWithPageFlow

@DTManagedBean(displayName = "Test1/default", beanType = BeanType.PAGE)
public class Test1DefaultviewView extends
        com.webmethods.caf.faces.bean.BasePageBean {
    private static final long serialVersionUID = 1L;
 
    private static final String[][] INITIALIZE_PROPERTY_BINDINGS = new
        String[][] {
    };
    private transient caf.war.testapp1.test1.Test1 test1 = null;
 
    /**
     * Initialize page
     */
    public String initialize() {
        try {
            resolveDataBinding(INITIALIZE_PROPERTY_BINDINGS, null, "initialize",
                true, false);
        } catch (Exception e) {
            error(e);
            log(e);
    }
    return null;
}
 
    public caf.war.testapp1.test1.Test1 getTest1() {
        if (test1 == null) {
            test1 = (caf.war.testapp1.test1.Test1)resolveExpression("#{Test1}");
        }
    return test1;
    }
 
}
Copyright © 2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback