Tuesday, April 29, 2014

Make, Rebuild and Make all option in JDeveloper

Make : Make operation compiles only the source files that have been changed since they were last compiled, or have dependencies that have been changed.

Rebuild : It compiles the source files unconditionally.

Make is done on individual source files, on working sets or on containers such as packages, projects, and workspaces.

Clean All: Cleans all the projects

Make all : Compiles not only the working project but all the projects.

Monday, April 28, 2014

Groovy Expression Usage in ADF, JDeveloper

Different points where Goovy code can be dropped:
1. Values for View and Entity objects attributes.
2. Validation rules on Entity object attributes.
3. Expressions for error messages.
4. Values for view object bind variables.
5. View object transient attribute validations.
Some of the properties of groovy scripting language

- Groovy is a scripting language having java like syntax
- Groovy is executed at run time
-  
Can be used in Entity and View objects in attribute validators(Entity Objects),attribute default values( Entity and View),bind variable default values ( View) place holder for error messages (EO validation rules)
- Define script expression validator or Compare validator 
- Error message tokens can be defined for handling validation failures 
- Conditional execution of validatiors are possible 
- Default value of bind variable in view object can be defined using groovy expression 
- Default value of view criteria 
- Default value and optional re-calculation condition for EO
- Value of transient for EO and VO 

Referencing Buisiness components objects in Groovy expression
Top level object is "adf" . Accessible ADF objects throgh groovy are 
- adf.context - Reference to ADFContext 
- adf.object - Equivalent to this operator in java.
- Entity Objects attributes - Reference methods and attributes of EntityImpl class.
- Entity Objects script validator rules - Attributes and method of ViewImpl class.
- View Object attributes 
- Bind Variable in view Object 
- Bind variable in view accessors 
- Transient attributes 
- adf.error 
- adf.userSession 
- adf.currentDate 
- adf.currentDateTime 
- Referencing custom buisiness components methods and attributes 
eg. Sal*12 - annualsalary .
PromotionDate>HireDate 

Method of entity class in validation rule.For validators use source keyword
eg. source.getDefaultSalaryForGrade()

- newValue - Attribute value being set 
-oldValue - current value of attribute being set 

if(Job=’SALESMAN’)
{
 return newValue<source.getMaxSalaryForGrade(Job)
}

Manipulating business component attribute values in a groovy expression
RowSet Objects
-          rowSetAttr.sum(GroovyExpr)
-          rowSetAttr.count(GroovyExpr)
-          rowSetAttr.avg(GroovyExpr)
-          rowSetAttr.min(GroovyExpr)
-          rowSetAttr.max(GroovyExpr)
EmployeesInDept.sum(“Sal+adf.object.getBenefitsValue(Job)”)


Thursday, April 10, 2014

Increase log level in ADF

In the ViewController -> Project Properties

set this value in the Run/Debug/Profile

-Dmock=true -Djbo.debugoutput=console


Sample expression in Instyle ADF :

Example 1 : color a column conditionally in a table
#{(row.TotalWeighed!=null)? (row.GreenOrRed=='Green'? 'background-color:Green;color:White;' : 'background-color:Red;color:White'):''}

Example 2: Load an image based on the logged in user:
#{sessionScope.loggedInUser=='InternalUser'? 'background-image:url("Image/internalfacing.png")' : 'background-image:url("Image/ds_facing.png")'}