package devguide.advanced.customprops;

import devguide.advanced.customprops.common.Products;

import java.io.Serializable;

import oracle.jbo.AttributeDef;
import oracle.jbo.server.AttributeDefImpl;
import oracle.jbo.server.ViewObjectImpl;
// ---------------------------------------------------------------------
// ---    File generated by Oracle ADF Business Components Design Time.
// ---    Custom code may be added to this class.
// ---    Warning: Do not modify method signatures of generated methods.
// ---------------------------------------------------------------------
public class ProductsImpl extends ViewObjectImpl implements Products {
    /**
     * Expose the ability for a client to set a view object
     * custom property at runtime. This method is on the 
     * view object's client interface.
     * @param name the property name
     * @param value the property value
     */ 
    public void setViewObjectCustomProperty(String name, Serializable value) {
     getViewDef().setProperty(name,value);
    }
    /**
    * Expose the ability for a client to set a view object
    * attribute's custom property at runtime. This method is
    * on the view object's client interface.
    * @param attrName the attribute name
    * @param propName the property name
    * @param value the property value
    */ 
    public void setViewObjectAttrCustomProperty(String attrName,
                                               String propName,
                                               Serializable value) {
    AttributeDef attrDef = findAttributeDef(attrName);
    if (attrDef != null) {
      ((AttributeDefImpl)attrDef).setProperty(propName,value);
    }
    }
    /**This is the default constructor (do not remove)
    */
    public ProductsImpl() {
    }
    protected void create() {
     super.create();
     setProperty("ViewObjectCustomProperty",
                 "ViewObjectCustomPropertyValue");
     AttributeDef attrDef = findAttributeDef("ProductStatus");
     ((AttributeDefImpl)attrDef).setProperty("ProductStatusAttrCustomProperty",
                                             "ProductStatusAttrCustomPropertyValue");
    }
}
