Pages - Menu

Sunday, September 15, 2013

Unified - General DML/Navigation Back Bean | Oracle ADF

Hi,
While Leading Oracle Fusion Discussion Group B Team - Saudi Arabia / Gulf Area, i decided to change & Enhance my General Mechanism for DML operations to be more simple, Unified & General for my ADF Applications.
today, i show a new way to make your DML operations/ Records Navigation  are easy to handle & Managed for all your team and make it more easy to be customizable by any of your Developers & for any purpose.
idea “is to make your Action Sources - Buttons or whatever you use to pass Iterators Names or Defined Page Definition Actions” with Action or Action Listeners methods”.
Benefits.
  • One Managed/Back Bean Easy to Handle (Request Scope).
  • Customizable for any special commit & RollBack Behavior.
  • General For any Iterator, Actions & for any page.
First of all, you have to build one small ADF/JSF application and in your task flow by adding it in Adfc-config.xml or faces-config.xml as you work.
  <managed-bean>
    <managed-bean-name>dml</managed-bean-name>
    <managed-bean-class>Beans.dml</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
  </managed-bean>


package Beans;

import WA.WABEAN;
import javax.faces.event.ActionEvent;
import oracle.adf.view.rich.component.rich.RichPopup;
import oracle.binding.OperationBinding;
import oracle.jbo.DMLException;
import oracle.jbo.Row;
import oracle.jbo.RowSetIterator;

public class dml {

    WABEAN mybean = new WABEAN();
    private String MethodNameorIteratorBinding = “”;
    private RichPopup p2;
    private RichPopup p3;

    public String CreateInsert() {
        if (getMethodNameorIteratorBinding() != null) {
            RowSetIterator Schedual =
           mybean.AccessIteratorBinding(getMethodNameorIteratorBinding()).getRowSetIterator();
            Row lastRow = Schedual.last();
            int lastRowIndex = Schedual.getRangeIndexOf(lastRow);
            Row newRow = Schedual.createRow();
            newRow.setNewRowState(Row.STATUS_INITIALIZED);
            Schedual.insertRowAtRangeIndex(lastRowIndex + 1, newRow);
            Schedual.setCurrentRow(newRow);
        }
        return null;
    }
    public String Delete() {
        if (getMethodNameorIteratorBinding() != null) {
            mybean.AccessOperation(getMethodNameorIteratorBinding()).execute();
        }
        return null;
    }
    public String Next() {
        if (getMethodNameorIteratorBinding() != null) {
            mybean.AccessOperation(getMethodNameorIteratorBinding()).execute();
        }
        return null;
    }
    public String Previous() {
        if (getMethodNameorIteratorBinding() != null) {
            mybean.AccessOperation(getMethodNameorIteratorBinding()).execute();
        }
        return null;
    }
    public void Commit(ActionEvent actionevent) {
        if (getMethodNameorIteratorBinding() != null) {
            try {
                OperationBinding commit = mybean.AccessOperation(getMethodNameorIteratorBinding());
                commit.execute();
                if (commit.getErrors().isEmpty()) {
                    mybean.ShowDialog(getP2(), actionevent);
                }
            } catch (DMLException e) {
                mybean.Validate(mybean.getFacesContext(), “Commit ..”, e.getErrorCode() + ” - ” + e.getBaseMessage(),
                                1);
            }
        }
    }
    public void Rollback(ActionEvent actionevent) {
        if (getMethodNameorIteratorBinding() != null) {
            try {
                OperationBinding rollback = mybean.AccessOperation(getMethodNameorIteratorBinding());
                rollback.execute();
                if (rollback.getErrors().isEmpty()) {
                    mybean.ShowDialog(getP3(), actionevent);
                }
            } catch (DMLException e) {
                mybean.Validate(mybean.getFacesContext(), “RollBack ..”, e.getErrorCode() + ” - ” + e.getBaseMessage(),
                                1);
            }
        }
    }
    public void setMethodNameorIteratorBinding(String MethodNameorIteratorBinding) {
        this.MethodNameorIteratorBinding = MethodNameorIteratorBinding;
    }
    public String getMethodNameorIteratorBinding() {
        return MethodNameorIteratorBinding;
    }
    public void setP2(RichPopup p2) {
        this.p2 = p2;
    }
    public RichPopup getP2() {
        return p2;
    }
    public void setP3(RichPopup p3) {
        this.p3 = p3;
    }
    public RichPopup getP3() {
        return p3;
    }
}
Before Continue, please Note,
  • Create Insert method insert record for next row index (Require Iterator Name) and no need for action.
  • Delete, Next & Previous (Required Actions Names Defined in Page Definitions).
  • Commit & Rollback Methods make it’s purposes and Handle Errors Expected and Show Feedback Dialogs as well.
  • MethodNameorIteratorBinding used to pass Iterator or Actions Names Required
Finally, build your jsf, jspx or jsff page and make toolbar containing the buttons of 6 dml operations (insert, delete, next record, previous record, commit & rollback) and add the “setPropertyListener” passing Iterators or Actions Required.
                <af:toolbar id=”t1”>
                  <af:button id=”b1” icon=”#{resource[‘images:add.png’]}” action=”#{dml.CreateInsert}”>
                    <af:setPropertyListener from=”Company1Iterator” to=”#{dml.methodNameorIteratorBinding}”
                                            type=”action”/>
                  </af:button>
                  <af:button id=”b2” action=”#{dml.Previous}” icon=”#{resource[‘images:back.png’]}”>
                    <af:setPropertyListener from=”CompanyPrevious” to=”#{dml.methodNameorIteratorBinding}”
                                            type=”action”/>
                  </af:button>
                  <af:button id=”b3” icon=”#{resource[‘images:next.png’]}” action=”#{dml.Next}”>
                    <af:setPropertyListener from=”CompanyNext” to=”#{dml.methodNameorIteratorBinding}”
                                            type=”action”/>
                  </af:button>
                  <af:button id=”b4” icon=”#{resource[‘images:remove.png’]}” action=”#{dml.Delete}”>
                    <af:setPropertyListener from=”CompanyDelete” to=”#{dml.methodNameorIteratorBinding}”
                                            type=”action”/>
                  </af:button>
                </af:toolbar>

Finally, you have one Back Bean responsible for handle all DML / Navigation operations in any Iterator or Page Defination Actions for all pages in your ADF Application.

af:table bad behavior in JDeveloper/ADF 12c | Oracle ADF

Hi,
Few Days ago, we faced one bad behavior while building IMS New ADF Application.
While Leading Oracle Fusion Discussion Group B Team - Saudi Arabia / Gulf Area, Main issue come from the default behavior of af:table component for 12c Latest ADF/JDeveloper .
Normal Behavior in ADF Project is a disaster in 12c (as before in old versions) but little bit different, in few steps i will show the bad behaviors and How to solve completely with one step.
  • create small table with insert statement as attached in SCRIPT.sql attached file in the project url and create it into your default hr schema.
  • Create ADF - JSF Fusion Application as usual. 
                     image
  • Build Business Component from table and drop it as Entity Object and View Object as well based on table created.
imageimage
  • Make View Object in No Rows Mode (VO always in Insert Mode Only).
image
  • Make Normal jsf page dropping VO as a af:table and createinsert method as a button in toolbar facet for panelgrouplayout container.
image
  • we have only one record in our table
image
  • Run the page, press createinsert button and you will face this Error Message !!
image
  • Insert Second Record
image
  • Run Page Again, and press same button, wow it works !!, but there is a another bad behavior, Data Duplicated !!
  • but wait, why Data Displayed !!, we created new row only and at same time, VO has no row property activated !!
image
  • sometimes if you have Master Detail Relation Ship and you have af:table for detail one, you will face another problems same as “Second Record is not visible !!” and sometimes Fire Validation Error for Required items however u didn’t leave the row !!
Finally, to Stop all bad behaviors from af:table, please change the Change Event Policy property of Iterator to be Non instead of ppr (in page Def base of page)
image
image
Now, you have perfect result ..

image

Oracle BDI - Oracle Base Development Infrastructure



Hi
Few Days Ago, i started to Build Oracle BDI - Base Development Infrastructure for Oracle Fusion Discussions Community with Cooperation with Apps Stuff Team and i published my Article about the Preparations,  Installations  & Configurations Parts.
I decided to share Knowledge in 4 Parts, Preparations, Installations, Configurations & Best Practice and so today i share the 4th part under name Best Practice

it is Part 4 of build Professional Base Development Infrastructure For JAVA / ADF Developers and using JDeveloper

Resources
  • Oracle Enterprise Linux 6.2
  • JDK 1.6 U 45
  • OTP 11.1.2.4.0
  • Oracle DB XE 11.2.0
  • Weblogic 10.3.6
  • ADR 11.1.1.6 (Patched to 11.1.2.4.0) - Optional
  • Jira 4.5
  • CollabNet Subversion Edge 3.3
  • JDeveloper 11.1.2.4.0 - latest

Oracle BDI - Oracle Base Development Infrastructure



Hi
Few Days Ago, i started to Build Oracle BDI - Base Development Infrastructure for Oracle Fusion Discussions Community with Cooperation with Apps Stuff Team and i published my Article about the Preparations & Installations Parts.
I decided to share Knowledge in 4 Parts, Preparations, Installations, Configurations & Best Practice and so today i share the 3rd part under name Preparations.

it is Part 3 of build Professional Base Development Infrastructure For JAVA / ADF Developers and using JDeveloper

Resources
  • Oracle Enterprise Linux 6.2
  • JDK 1.6 U 45
  • OTP 11.1.2.4.0
  • Oracle DB XE 11.2.0
  • Weblogic 10.3.6
  • ADR 11.1.1.6 (Patched to 11.1.2.4.0) - Optional
  • Jira 4.5
  • CollabNet Subversion Edge 3.3
  • JDeveloper 11.1.2.4.0 - latest

Oracle BDI - Oracle Base Development Infrastructure



Hi
Few Days Ago, i started to Build Oracle BDI - Base Development Infrastructure for Oracle Fusion Discussions Community with Cooperation with Apps Stuff Team and i published my Article about the Preparations Part.
I decided to share Knowledge in 4 Parts, Preparations, Installations, Configurations & Best Practice and so today i share the 1st part under name Preparations.

it is Part 2 of build Professional Base Development Infrastructure For JAVA / ADF Developers and using JDeveloper

Resources
  • Oracle Enterprise Linux 6.2
  • JDK 1.6 U 45
  • OTP 11.1.2.4.0
  • Oracle DB XE 11.2.0
  • Weblogic 10.3.6
  • ADR 11.1.1.6 (Patched to 11.1.2.4.0) - Optional
  • Jira 4.5
  • CollabNet Subversion Edge 3.3
  • JDeveloper 11.1.2.4.0 - latest

Oracle BDI - Oracle Base Development Infrastructure



Hi
Few Days Ago, i started to Build Oracle BDI - Base Development Infrastructure for Oracle Fusion Discussions Community with Cooperation with Apps Stuff Team.
I decided to share Knowledge in 4 Parts, Preparations, Installations, Configurations & Best Practice and so today i share the 2nd part under name Preparations.

it is Part 1 of build Professional Base Development Infrastructure For JAVA / ADF Developers and using JDeveloper

Resources
  • Oracle Enterprise Linux 6.2
  • JDK 1.6 U 45
  • OTP 11.1.2.4.0
  • Oracle DB XE 11.2.0
  • Weblogic 10.3.6
  • ADR 11.1.1.6 (Patched to 11.1.2.4.0) - Optional
  • Jira 4.5
  • CollabNet Subversion Edge 3.3
  • JDeveloper 11.1.2.4.0 - latest

Dialogic Fax Solution / ActFax || Oracle ADF

Dialogic Fax Solution / ActFax || Oracle ADF
Hi
today i write my Article about amazing solution for Full Integration Cycle between Dialogic Fax Solution, ActFax &amp; Oracle ADF.
Fax Solutions considered one of the effective tools to manage documents between systems or between organizations.
Contents
Brooktrout Fax Card.
ActFax Solution.
Oracle Database
Oracle ADF Application
Advantages
Integration Not Only with ADF Applications, but also with any type of applications.
Oracle Database Integration.
Save files with tif,bmp,jpg or pdf formats.
Saving in Servers or IBM - FileNet Projects.
Easy For Followup and Maintenance
Multi Interface from ActFax &amp; Application itself.
Archiving System.
Amazing Enhanced System to unify and save time in sending and receiving.
Resolution Facilities.
with powerful advantages from Actfax Product
to know more about this amazing solution, please contact oracle_itself@hotmail.com
thanks&#160;?

Hi
today i write my Article about amazing solution for Full Integration Cycle between Dialogic Fax Solution, ActFax & Oracle ADF.
Fax Solutions considered one of the effective tools to manage documents between systems or between organizations.
Contents
Advantages
  1. Integration Not Only with ADF Applications, but also with any type of applications.
  2. Oracle Database Integration.
  3. Save files with tif,bmp,jpg or pdf formats.
  4. Saving in Servers or IBM - FileNet Projects.
  5. Easy For Followup and Maintenance
  6. Multi Interface from ActFax & Application itself.
  7. Archiving System.
  8. Amazing Enhanced System to unify and save time in sending and receiving.
  9. Resolution Facilities.
  10. with powerful advantages from Actfax Product
to know more about this amazing solution, please contact oracle_itself@hotmail.com

Servlet Read Database Blob Images || Oracle ADF

Today,
i let Script speak about itself !!, simple Servlet to get Image Files from Database based on parameters specified and using weblogic datasource created before and blob data types, to be used in Oracle ADF Applications and configured in Web.xml file.
  • Calling the Servlet
<af:activeImage shortDesc=”#{bindings.CompanyLogo.hints.tooltip}”
id=”it4”
inlineStyle=”height:190px; width:180px;”
source=”/imageservlet?id=#{bindings.CompanyId.inputValue}&amp;type=company”
binding=”#{ImageBean.companyLogo}”
partialTriggers=”ctb7 ctb8 ctb9 ctb6”/>
  • Configured in Web.xml file
<servlet>
        <servlet-name>ImageServlet</servlet-name>
        <servlet-class>Beans.ImageServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>ImageServlet</servlet-name>
        <url-pattern>/imageservlet</url-pattern>
    </servlet-mapping>
  • Finally Servlet Script
package Beans;

import java.io.IOException;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.OutputStream;
import java.sql.Blob;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.sql.DataSource;

public class ImageServlet extends HttpServlet {
    private static final String CONTENT_TYPE = “text/html; charset=UTF-8”;

    public void init(ServletConfig config) throws ServletException {
        super.init(config);
    }

    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType(CONTENT_TYPE);
        String imageId = request.getParameter(“id”);
        String type = request.getParameter(“type”);
        OutputStream os = response.getOutputStream();
        Connection conn = null;
        try {
            Context ctx = new InitialContext();
            //Datasource as defined in <res-ref-name> element of weblogic.xml
            DataSource ds = (DataSource)ctx.lookup(“cwc”);
            conn = ds.getConnection();

            String sql = null;
            String dec = null;
            if (type.equals(“company”) || type.contains(“company”)) {

                sql = “SELECT company_id, company_logo ” + “FROM company ” + “WHERE company_id = ?”;
                dec = “company_logo”;

            } else {

                sql = “SELECT user_id, logo ” + “FROM users ” + “WHERE user_id = ?”;
                dec = “logo”;
            }

            PreparedStatement statement = conn.prepareStatement(sql);

            statement.setString(1, imageId);
            ResultSet rs = statement.executeQuery();
            if (rs.next()) {
                Blob blob = rs.getBlob(dec);
                BufferedInputStream in = new BufferedInputStream(blob.getBinaryStream());
                int b;
                byte[] buffer = new byte[10240];
                while ((b = in.read(buffer, 0, 10240)) != -1) {
                    os.write(buffer, 0, b);
                }
                os.close();
            } else {

                ServletContext sc = getServletContext();
                String filename = “”;
                if (type.equals(“company”) || type.contains(“company”)) {

                    filename = sc.getRealPath(“/images/unknown.jpg”);

                } else {
                    filename = sc.getRealPath(“/images/user.png”);
                }
                String mimeType = sc.getMimeType(filename);
                response.setContentType(mimeType);
                File file = new File(filename);
                response.setContentLength((int)file.length());
                FileInputStream in = new FileInputStream(file);
                OutputStream out = response.getOutputStream();
                byte[] buf = new byte[1024];
                int count = 0;
                while ((count = in.read(buf)) >= 0) {
                    out.write(buf, 0, count);
                }
                in.close();
                out.close();
            }

        } catch (Exception e) {
           
            ServletContext sc = getServletContext();
            String filename = “”;
            if (type.equals(“company”) || type.contains(“company”)) {

                filename = sc.getRealPath(“/images/unknown.jpg”);

            } else {
                filename = sc.getRealPath(“/images/user.png”);
            }
            String mimeType = sc.getMimeType(filename);
            response.setContentType(mimeType);
            File file = new File(filename);
            response.setContentLength((int)file.length());
            FileInputStream in = new FileInputStream(file);
            OutputStream out = response.getOutputStream();
            byte[] buf = new byte[1024];
            int count = 0;
            while ((count = in.read(buf)) >= 0) {
                out.write(buf, 0, count);
            }
            in.close();
            out.close();
           
        } finally {
            try {
                if (conn != null) {
                    conn.close();
                }
            } catch (SQLException sqle) {
                System.out.println(“SQLException error”);
            }
        }
    }
   
    // Wael Abdeen
}

Oracle ADF / Excel Files Integration || Oracle ADF

Today,
i write this Article after many requests about “How to Integrate with Microsoft Excel Files" with read / write operations to manage Data transfer in Oracle ADF world.
Many Organizations contains many Integrations ways, and most of them still using such way to use Excel Files to Integrate between different projects.
in our case, we will handle only the Read Operation and we have to get help out of box !!, we have to cooperate with Apache project is named “Apache POI” , to integrate 
and now, let me give a complete solution for our challenge
  • First of all, try to understand the mechanism used in poi jars and how to use to take control of Data Cells.
  • include poi jars (poi-3.9-20121203,poi-examples-3.9-20121203,poi-excelant-3.9-20121203,poi-ooxml-3.9-20121203,poi-ooxml-schemas-3.9-20121203,poi-scratchpad-3.9-20121203) in your ADF, Interface project.
  • Build Back Bean Method to Make the operation of Data Transfer.
image
  • Finally, Build a Method to Make Insertion Process.
image
Download Text of Image Scripts ..

jasper reports & Oracle ADF, Different Ways || Oracle ADF

Hi
Many days ago, i received many questions about Jasper Reports and how to make it more efficient tool in Oracle ADF world as reporting and Integration purpose ..
from my point of view, we have different goals to use Jasper Reports in Oracle ADF
Examples ..
  • Reporting Tool
  • Generate Reports for integration purpose with other systems specially Faxing Solutions.
  • Generate pdf, xls or any other format with direct / indirect output in front of end user.
so, today i give a complete Back Bean Method with high flexibility to manage different ways of Jasper in ADF.
package Servlets;

import cwcbean.CWCBEAN;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import java.sql.Connection;
import java.sql.SQLException;

import java.util.HashMap;
import java.util.Map;

import javax.naming.InitialContext;
import javax.naming.NamingException;

import javax.sql.DataSource;

import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.design.JasperDesign;
import net.sf.jasperreports.engine.xml.JRXmlLoader;

public class PrintReport {

    CWCBEAN cwc = new CWCBEAN();

    public String printReport(String RepPathNamewithoutextension, String WriteFilePathWithouExtension,
                              Boolean tprint) throws FileNotFoundException, JRException, NamingException, SQLException,
                                                     IOException {

        if (RepPathNamewithoutextension != null && WriteFilePathWithouExtension != null && tprint != null) {

            InputStream input = new FileInputStream(new File(RepPathNamewithoutextension + “.jrxml”));
            JasperDesign design = JRXmlLoader.load(input);
            JasperReport report = JasperCompileManager.compileReport(design);
            Map parameters = new HashMap();

            // parameters.put(“jasperParamenterName”, “ParameterValue”);

            InitialContext initialContext = new InitialContext();
            DataSource ds = (DataSource)initialContext.lookup(“PM-Data-Source”);
            Connection conn = ds.getConnection();
            JasperPrint print = JasperFillManager.fillReport(report, parameters, conn);

            if (WriteFilePathWithouExtension == null) {
                WriteFilePathWithouExtension = RepPathNamewithoutextension;
            }

            OutputStream ouputStream = new FileOutputStream(new File(WriteFilePathWithouExtension + “.pdf”)); // my pdf
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            JasperExportManager.exportReportToPdfStream(print, byteArrayOutputStream);

            ouputStream.write(byteArrayOutputStream.toByteArray()); // Copy pdf to directory u decided in second parameter — Wael Abdeen
            ouputStream.flush(); // Release
            ouputStream.close(); // Close Output

            if (tprint.equals(true)) {
                Runtime.getRuntime().exec(“rundll32 url.dll,FileProtocolHandler ” + WriteFilePathWithouExtension +
                                          “.pdf”); // Only if u want to print the report ..
            }

        } else {

            cwc.Validate(cwc.getFacesContext(),
                         cwc.AccessBundleItemValue(“CS.view.CS-InterfaceBundle”, “ValidatorMessageHeader13”),
                         cwc.AccessBundleItemValue(“CS.view.CS-InterfaceBundle”, “ValidatorMessageFooter13”), 3);
        }
        return null;

        // Wael Abdeen ..
    }
}

and now, we can call the report like this
    public String test() {
        String x;
        try {
            x = print.printReport(“d:/report1”, “d:/report1”, Boolean.TRUE);
        } catch (FileNotFoundException e) {
            cwc.Validate(cwc.getFacesContext(),
                         cwc.AccessBundleItemValue(“CS.view.CS-InterfaceBundle”, “ValidatorMessageHeader4”),
                         cwc.AccessBundleItemValue(“CS.view.CS-InterfaceBundle”, “ValidatorMessageFooter4”), 2);
        } catch (JRException e) {
            cwc.Validate(cwc.getFacesContext(),
                         cwc.AccessBundleItemValue(“CS.view.CS-InterfaceBundle”, “ValidatorMessageHeader4”),
                         cwc.AccessBundleItemValue(“CS.view.CS-InterfaceBundle”, “ValidatorMessageFooter4”), 2);
        } catch (NamingException e) {
            cwc.Validate(cwc.getFacesContext(),
                         cwc.AccessBundleItemValue(“CS.view.CS-InterfaceBundle”, “ValidatorMessageHeader4”),
                         cwc.AccessBundleItemValue(“CS.view.CS-InterfaceBundle”, “ValidatorMessageFooter4”), 2);
        } catch (SQLException e) {
            cwc.Validate(cwc.getFacesContext(),
                         cwc.AccessBundleItemValue(“CS.view.CS-InterfaceBundle”, “ValidatorMessageHeader4”),
                         cwc.AccessBundleItemValue(“CS.view.CS-InterfaceBundle”, “ValidatorMessageFooter4”), 2);
        } catch (IOException e) {
            cwc.Validate(cwc.getFacesContext(),
                         cwc.AccessBundleItemValue(“CS.view.CS-InterfaceBundle”, “ValidatorMessageHeader4”),
                         cwc.AccessBundleItemValue(“CS.view.CS-InterfaceBundle”, “ValidatorMessageFooter4”), 2);
        }
        return null;
    }
Note : we need to include all jars required from jasper source to our project based on version you are using from jasper.

Oracle ADF / Forms SDS - Scan Document System.

Hi,
at last and after long time, i am happy to announce for a complete solution for scan system, with full compatibility and integration with java, ADF, Forms Applications based on Java &amp; JTawin Solutions.
Solution provides a complete solution to make all java products specially ADF / Oracle Forms products full integrated with all types of scanners and cams and full integration with DB and Easy to work with IBM - FileNet Projects.
Advantages
Java Based.
Easy to Customize.
Full Integration with all types of scanners and cams.
Easy to Build and Deploy.
Web &amp; Client Ways.
Multi Processing.
Note&#160;: Solution Excluding License
For More Details about it, contact&#160;: oracle_itself@hotmail.com
thanks&#160;?
Hi,
at last and after long time, i am happy to announce for a complete solution for scan system, with full compatibility and integration with java, ADF, Forms Applications based on Java & JTawin Solutions.
Solution provides a complete solution to make all java products specially ADF / Oracle Forms products full integrated with all types of scanners and cams and full integration with DB and Easy to work with IBM - FileNet Projects.
Advantages
  • Java Based.
  • Easy to Customize.
  • Full Integration with all types of scanners and cams.
  • Easy to Build and Deploy.
  • Web & Client Ways.
  • Multi Processing.
Note : Solution Excluding License
For More Details about it, contact : oracle_itself@hotmail.com

Oracle PL SQL || Oracle ADF

Hi
Many Oracle developers possess high capabilities in the world of PL SQL, try to find solutions of Business using Oracle PL SQL in the form of Stored Procedures, Functions, Packages or may be PL SQL Blocks..
in a word , Oracle Developers consider PL SQL a Corner Stone !!
today i give 2 simple examples to show how to use Oracle PL SQL in the Form of Stored Procedure and PL SQL Normal Block.
Notes
please use the below sequence and hints to build successfully PL SQL Block in ADF
  • use CallableStatement to initiate your block.
  • user question marks instead of all in-out parameters.
  • Register our parameter using Types class to show completable data type.
  • use set Datatype to pass values.
  • user get DataType to Retrieve Data after Execution.
Example 1 :
    public Number GetAdvertiseSeq(String ProjectID, Number ContractID, Number Typ) {
        Number _result = new Number(0);

        CallableStatement MyAuthMethod =
            getDBTransaction().createCallableStatement(“begin select nvl(max(advertise_no),0) + 1 into ? from prj_advertising_master where project_id = ? and contract_id = ? and advertise_type = ?; end;”,
                                                       getDBTransaction().DEFAULT);


        try {
            MyAuthMethod.registerOutParameter(1, Types.NUMERIC);
            MyAuthMethod.setString(2, ProjectID.toString());
            MyAuthMethod.setString(3, ContractID.toString());
            MyAuthMethod.setString(4, Typ.toString());
            MyAuthMethod.executeQuery();
            _result = new Number(MyAuthMethod.getInt(1));

        } catch (SQLException e) {
            _result = new Number(0);
        }

        return _result;
    }
Example 2 :
    public String ValidateBeforeAdvertiseorInvitation(String Project, Number Contract) {

        String _result = null;

        CallableStatement MyValidationMethod =
            getDBTransaction().createCallableStatement(“begin pm.VALIDATE_BEFORE_ADV_INV(?,?,?); end;”,
                                                       getDBTransaction().DEFAULT);
        try {
            MyValidationMethod.setString(1, Project);
            MyValidationMethod.setLong(2, Contract.longValue());
            MyValidationMethod.registerOutParameter(3, Types.VARCHAR);

            MyValidationMethod.executeQuery();
            _result = MyValidationMethod.getString(3);

        } catch (SQLException e) {
            _result = null;
        }
        return _result;
    }
}
Good Luck

in Abu Dhabi - UAE For Business Travel

in Abu Dhabi - UAE For Business Travel
i am planning for a fast business travel, Visiting Abu Dahbi starting from 05-12-2012 until 08-12-2012, hoping to meet all my friends in my vacation time.
Bye Bye&#160;!!

in Abu Dhabi - UAE For Business Travel
i am planning for a fast business travel, Visiting Abu Dahbi starting from 05-12-2012 until 08-12-2012, hoping to meet all my friends in my vacation time.
Bye Bye !!

Regular Expressions || Oracle ADF

Hi
today i give a short Article about effect of Regular Expressions in Oracle ADF World..
regular Expression provides a concise and flexible means to “match" Strings of text, and we can say it is the art of "How to work with Strings" ..
Why we need regular expression ?
Answer : Match & Validation of Strings, as many times, Developers find a challenge to Validate or Search in Strings and using normal Programming Concepts using a method to make the operation is a big false with bad performance and big efforts from Developers and so we are hear to speak about Regular Expressions.
Example : many of Projects contains a notifications with type SMS & Emails and sometime Faxes, so we have to be sure from theses keys used to send theses types of notifications, so Regular Expressions is the best way here.
Now i give some Regular Expressions to use in Validating E Mails, FAX,Mobile No & Phone No
Note : i work with Saudi Arabia Service Providers ..
- Saudi Service Providers - Mobily,STC & ZAIN
  • Mobily : [+966]{4}+[54 or 56]{2}+[0-9]{7}
  • STC      : [+966]{4}+[50 or 55]{2}+[0-9]{7}
  • ZAIN    : [+966]{4}+[58 or 59]{2}+[0-9]{7}
  • Land Line : [+966]{4}+[1 or 2]{1}+[0-9]{7}   — Riyadh & Jeddah City
  • FAX           : [+966]{4}+[1 or 2]{1}+[0-9]{7}   — Riyadh & Jeddah City
  • EMAIL       : [A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,4}
and Now, you can see a a magic in your ADF application, as you can make a declarative Validation in Entity Objects with type Regular Expression and use above simple scripts to validate your Attributes of type Email, FAX, Phone & Mobile

E Channel !!

Hi
i am happy to announce for My new E Channel for following Oracle Technologies SOA,BPM,ADF,Weblogic, SQL &amp; PL SQL.
Here
Good Luck ..
Hi
i am happy to announce for My new E Channel for following Oracle Technologies SOA,BPM,ADF,Weblogic, SQL & PL SQL.
Here
Good Luck ..

WebLogic Production Infrastructure || Oracle ADF


  • as per many Requests From Many Developers & Technical Specialists, today i show High Technical Steps to build Real Production Infrastructure to work with Real Oracle JAVA & ADF Application using Wls 10.3.6, ADR 11.1.1.6 Patched up to 11.1.2.3.0 - latest, JDK 7U9, Oracle ADF Test Application 11.1.2.3.0, Windows 2008 Server Data Center & Finally JDeveloper 11.1.2.3.0 ..
  • in My New Lecture, i show all Technical Steps, many points needed to build professional Env.
  • Note: Lecture in Arabic Language as per request of one of My Friends.

Version Control - E Applications || Oracle ADF



Hi
Many of JAVA & ADF Developers asking about how to integrate and make All Software Engineers, Developers & DBA Groups cooperate in Same Application in Development, Testing & Deployment Complete Cycle to build Enterprise Application.
today i talk about small solution to use only Subversion Version Control System to Integrate with JDeveloper 11.1.2.3.0 latest with Oracle ADF Application.
Note : Solution should be ready in Version Server - HW with Real Public IP to make All Developers Ready to work from everywhere.
thanks ..

Back Bean Validation Methods || Oracle ADF

Hi
today, i write a small article to show how to create General Validation Methods to be used in ADF Applications - JSF Interface.
there are 2 types of Validations, in Attribute & Entity Level or general Validation based on business rules.
from technical point of view, in ADF Applications JSF/Interface, we use Faces Messages to control validations with 4 Categories of Errors until info Messages (FATAL,ERROR,WARN,INFO) and finally you add the Faces Message to Null for general Error Message or Component ID for Attribute Validation Message.
  • Examples
    public void ValidateItem(UIComponent MyComponent, FacesContext MyContext, String Header, String Footer,
                             int Level) { // Force Validation
        FacesMessage MyMessage = new FacesMessage();
        if (Level == 1) {
            MyMessage = new FacesMessage(MyMessage.SEVERITY_FATAL, Header, Footer);
        } else if (Level == 2) {
            MyMessage = new FacesMessage(MyMessage.SEVERITY_ERROR, Header, Footer);
        } else if (Level == 3) {
            MyMessage = new FacesMessage(MyMessage.SEVERITY_WARN, Header, Footer);
        } else if (Level == 4) {
            MyMessage = new FacesMessage(MyMessage.SEVERITY_INFO, Header, Footer);
        }

        if (MyComponent instanceof RichInputText) {
            ((RichInputText)MyComponent).setValid(false);
        } else if (MyComponent instanceof RichSelectOneChoice) {
            ((RichSelectOneChoice)MyComponent).setValid(false);
        }

        MyContext.addMessage(MyComponent.getClientId(MyContext), MyMessage);
    }
    public void Validate(FacesContext MyContext, String Header, String Footer,
                             int Level) { // Force Validation
        FacesMessage MyMessage = new FacesMessage();
        if (Level == 1) {
            MyMessage = new FacesMessage(MyMessage.SEVERITY_FATAL, Header, Footer);
        } else if (Level == 2) {
            MyMessage = new FacesMessage(MyMessage.SEVERITY_ERROR, Header, Footer);
        } else if (Level == 3) {
            MyMessage = new FacesMessage(MyMessage.SEVERITY_WARN, Header, Footer);
        } else if (Level == 4) {
            MyMessage = new FacesMessage(MyMessage.SEVERITY_INFO, Header, Footer);
        }

        MyContext.addMessage(null, MyMessage);

    }
Now , in your Back Beans, you can call Validations as below
       cwc.Validate(FacesContext.getCurrentInstance(),
                         “Error Message Header”,
                         “Error Message Footer”, 2);
or
       cwc.ValidateItem(uIComponent, FacesContext.getCurrentInstance(),
                                 “Error Message Header”,
                                 “Error Message Footer”,
                                 2);

Handle Unique Values Programmatically || Oracle ADF

Hi
Few Days ago, i faced new situation to handle some of Unique Constrains but in this time, we have to use Programmatically way ..
Many of people will ask, why ? as we can do it in the Custom Message bundle for Model Layer using Constrain Name or Jbo Error Code ..
My answer, as in last releases of 11.1.2.*, we face a problem between LOV for PK/FK Attributes , and normal way to handle Unique Message is not working in this time !!
so, in our new Situation, and the only working way, is to reset from Managed/Back Bean to UI Component describing the LOV item.
My Example, uses 1st Method to Check and 2nd to handle the exception.
  • in AM, we have to make a Method to check before commit.
    public Boolean CheckUniqueUserRoles(String UserId, String RoleId) {

        Boolean result = false;
        ViewObject userrole = getDBTransaction().findViewObject(“UserRolesLookup1”);
        Row[] _result = userrole.findByKey(new Key(new Object[] { UserId, RoleId }), 1);

        if (_result.length > 0) {
            result = true;
        } else {
            result = false;
        }
        userrole.setWhereClause(null);
        userrole.reset();
        return result;
    }
  • in Managed Bean in Back Bean Scope, you can use the following Method to Handle using above method ..
    public void HandleUserRolesUQ(ValueChangeEvent vce) {

        OperationBinding CheckUQ = (OperationBinding)cwc.AccessOperation(“CheckUniqueUserRoles”);
        CheckUQ.getParamsMap().put(“UserId”,
                                   cwc.AccessIteratorBinding(“UserRoles2Iterator”).getCurrentRow().getAttribute(“UserId”));
        CheckUQ.getParamsMap().put(“RoleId”, getRoleId().getValue());
        Object MyResult = CheckUQ.execute();

        if (((Boolean)MyResult).compareTo(true) == 0) {
            getRoleId().resetValue();
            cwc.Validate(cwc.getFacesContext(),
                         cwc.AccessBundleItemValue(“CS.view.CS-InterfaceBundle”, “ValidatorMessageHeader4”),
                         cwc.AccessBundleItemValue(“CS.view.CS-InterfaceBundle”, “ValidatorMessageFooter4”), 2);
        }

    }
Notes ..
- First Method should be included as a client Interface for AM in Model Layer.
  • Reference of cwc.AccessOperation
    public OperationBinding AccessOperation(String OperationName) { // Access OperationBinding
        return (OperationBinding)getBindings().getOperationBinding(OperationName);
    }
  • Reference of cwc.AccessIteratorBinding
    public DCIteratorBinding AccessIteratorBinding(String IteratorName) { // Access IteratorBinding
        return (DCIteratorBinding)getBindings().get(IteratorName);
    }
  • Reference of cwc.Validate
    public void Validate(FacesContext MyContext, String Header, String Footer,
                             int Level) { // Force Validation
        FacesMessage MyMessage = new FacesMessage();
        if (Level == 1) {
            MyMessage = new FacesMessage(MyMessage.SEVERITY_FATAL, Header, Footer);
        } else if (Level == 2) {
            MyMessage = new FacesMessage(MyMessage.SEVERITY_ERROR, Header, Footer);
        } else if (Level == 3) {
            MyMessage = new FacesMessage(MyMessage.SEVERITY_WARN, Header, Footer);
        } else if (Level == 4) {
            MyMessage = new FacesMessage(MyMessage.SEVERITY_INFO, Header, Footer);
        }

        MyContext.addMessage(null, MyMessage);

    }
  • Reference of cwc.AccessBundleItemValue
    public String AccessBundleItemValue (String BundleName , String BundleNameItem){
        ResourceBundle bundle =   BundleFactory.getBundle(BundleName);
        return bundle.getString(BundleNameItem);
    }