Skip to main content

Posts

IN clause in adf view criteria

You can use below programmatic approach to solve this problem.Create a view criteria progarametically and set attribute value as bind variable.                          ViewObjectImpl view = this.getNsSentenceGroupVO();                 ViewCriteria vc = view.createViewCriteria();             vc.setName("INCriteria");             String inClause = "IN "+groupNames;             ViewCriteriaRow criteriaRow = vc.createViewCriteriaRow();             criteriaRow.setAttribute(" GroupName", inClause);             vc.ad...

Get modified rows from Entitiy Cache

To get the modified rows from entity cache we have getEntityState() method at EntityImpl class. Refer to my previous blog  Accessing EO impl methods from VO impl  where i am overriding the getEntityState() in EOimpl and calling it in VOImpl. We can use methods written or overridden in VOImpl class to AMImpl class. There are different states associated with an entity object. STATUS_UNMODIFIED STATUS_MODIFIED STATUS_NEW STATUS_DELETED STATUS_DEAD We have to check the state or row in our AmImpl class by using the VOImpl method and through this we can distinguish the rows present at vo. Add below code in AMImpl class along with my previous post. public void geCachedRowsCount(){         JobsVOImpl jobsVo = (JobsVOImpl)this.getJobsVO();         RowSetIterator iter = jobsVo.createRowSetIterator(null);             while(iter.hasNext()){             Row row = iter....

Accessing EOImpl methods from VOImpl

When you have a requirement to access EOImpl level overridden methods or any custom method from VOImpl follow below steps. 1.Create/Override method in your EOImpl class In above example i have overridden the getEntityState method to print the state of my current entity row. 2. To access this method in VOImpl class Create VOImpl and VORowImpl classes for your view object. See the code written in below VOImpl class to access the EOImpl methods. 3. Now you can expose this method to client tier through VO/AM Client Interface. As per your requirement you can use the client interface and achieve the functionality.

Customize ADF Entity Object

Like most business components, individual entity objects are partially defined by XML files. These files specify: 1. Simple metadata about the datasource, such as the table name and attribute definitions and 2. Simple business logic, such as the business logic that represents most column constraints and simple validation and security logic. In addition to XML files, entity object definitions comprise up to three Java classes: a) The entity object class - an instance of this class (an entity object instance) represents a single row from the datasource ( oracle.jbo.server.EntityImpl ) b) The entity collection class - an instance of this class represents the collection of rows currently in memory for a single user( oracle.jbo.server.EntityCache ) c) The entity definition class - the singleton instance of this class represents the entire datasource object( oracle.jbo.server.EntityDefImpl ) To access an entity row, you use a related object called the entity definition. At run...

Localization/Internationalization in oracle adf

Internationalization and Localization are means of adapting aplication to different languages, regional differences and technical requirements of a target market. Internationalization is the process of designing a software application so that it can potentially be adapted to various languages and regions without engineering changes. Localization is the process of adapting internationalized software for aspecific region or language by adding locale-specific components and translating text. Follow below steps for doing localization. 1. Create .properties files as per the locales required in your application. For demo purpose i created german and english locale properties file, one main file is required which will congtain all labelsSo total 3 properties files are there. For property file creation ViewController->New->General->File InterBundle.properties file is the main properties file and for the same labels 2 different files are created one is for english and a...

ADF Servlet Filter

This blog is to guide you how you can filter the requests and add your custom checks in ADF application. Follow below steps to create/configure a Servlet Filter in your ADF/Webcenter application. 1. From new wizard select Servlet and select Servlet Filter 2. Click on next 3. Enter the name of Servlet filter and package 4. Map to Servlet or JSP radio button should be selected and it is default selection. 5. Click on finish and you will get a servlet filter created. This is the class generated after you click finish, it is having init, destroy and doFilter methods.  We will write our logic in doFilter method. This will be called whenever a Servlet or jsp page request arrive to application.    As we created servlet filter with ADF steps so it has added our filter entry in web.xml file which is a mandate to work our filter.  We can create other filters also but we must register it in web.xml file. W...

Read data from ADF property file using java

package propertyfile; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.PropertyResourceBundle; import java.util.ResourceBundle; public class ReadPropertyFile {     public ReadPropertyFile() {         super();     }       public static void main(String args []){         try {             File file = new File("/opt/oracle/urls/test.properties");             FileInputStream fileInputStream = new FileInputStream(file);             ResourceBundle bundle =new PropertyResourceBundle(fileInputStream);             String appURL = bundle.getString("googleRedirectURL");             System.out.println(appURL);             fileInputStream.clo...