Oracle
 sql >> база данни >  >> RDS >> Oracle

Интеграция на ADF с EBS

Получих решение за това как да интегрирам ADF страница с EBS, а също и Управление на сесии.

Тази връзка по-долу е полезна за мен.

http://mistech.pixnet.net/blog/post/365709524-adf-%E6%95%B4%E5%90%88%E6%96%BC -%28-integrate-%29-oracle-ebs-r12

Или направете стъпката по-долу за повече описание.

Стъпка 01: Създайте java класове. Java клас:ConnectionProvide, EBizUti, EBSWrapperFilter,Java Bean:UserInfo

1. ConnectionProvider.java

package com.oracle.view;

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

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.sql.DataSource;

public class ConnectionProvider {
    private static DataSource ebsDS = null;
    static {
        try {
            Context ctx = new InitialContext();
            ebsDS = (DataSource) ctx.lookup("jdbc/TEST32");

            // your datasource jndi name as defined during configuration
            if (ctx != null)
                ctx.close();

        } catch (Exception e) {
            throw new RuntimeException(e);
            // means jndi setup is not correct or doesn't exist
        }
    }

    private ConnectionProvider() {
        super();
    }

    public static Connection getConnection() throws SQLException {
        if (ebsDS == null)
            throw new IllegalStateException(
                    "AppsDatasource is not properly initialized or available");
        return ebsDS.getConnection();
    }
}

PS:В режим jdbc на средата на EBS, за да получите връзка с базата данни, можете да влезете в изгледа weblogic Services-> Data Sources, като например:EBSDataSource JNDI:jdbc / TEST32, и можете да се научите да разгръщате на този един хост:oacore_cluster

2. EBizUtil.java

package com.oracle.view;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.apps.fnd.ext.common.EBiz;


public class EBizUtil {
    public EBizUtil() {
        super();
    }
    private static final Logger logger = Logger.getLogger(EBizUtil.class.getName());
    private static EBiz INSTANCE = null;
    static {
        Connection connection = null;
        try {
            connection = ConnectionProvider.getConnection();
            // DO NOT hard code applServerID for a real application
            // Get applServerID as CONTEXT-PARAM from web.xml or elsewhere
            INSTANCE = new EBiz(connection, "F1CB87199593E5F4E0431F030A0AD0AB31310251131793525291714692481335");
        } catch (SQLException e) {
            logger.log(Level.SEVERE, "SQLException while creating EBiz instance", e);
            throw new RuntimeException(e);
        } catch (Exception e) {
            logger.log(Level.SEVERE, "Exception while creating EBiz instance", e);
            throw new RuntimeException(e);
        } finally {
            if (connection != null) {
                try {
                    connection.close();
                } catch (SQLException e) {
                    throw new RuntimeException(e);
                }
            }
        }
    }

    public static EBiz getEBizInstance() {
        return INSTANCE;
    }    
}

PS:APPL_SERVER_ID може да бъде получен под $ INST_TOP / appl / fnd / 12.0.0 / secure / TEST32.dbc EBS APP Server pathServer ID:APPL_SERVER_ID =F1CB87199593E5F4E0431F030A0AD0AB31310251131793525291714335248

3. EBSWrapperFilter.java

package com.oracle.view;

import java.io.IOException;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import oracle.apps.fnd.ext.common.AppsRequestWrapper;
import oracle.apps.fnd.ext.common.AppsRequestWrapper.WrapperException;

public class EBSWrapperFilter implements Filter {
    public EBSWrapperFilter() {
        super();
    }


    private static final Logger logger = Logger.getLogger(EBSWrapperFilter.class.getName());

    public void init(FilterConfig filterConfig) {
        logger.info("Filter initialized ");
    }

    public void doFilter(ServletRequest request, ServletResponse response,  FilterChain chain) throws IOException,ServletException {
        AppsRequestWrapper wrapper = null;
        logger.info("-current URI =" + ((HttpServletRequest)request).getRequestURI());

        try {

            wrapper = new AppsRequestWrapper((HttpServletRequest)request, (HttpServletResponse)response, ConnectionProvider.getConnection(), EBizUtil.getEBizInstance());

        } catch (WrapperException e2) {
            logger.log(Level.SEVERE, "WrapperException error encountered ", e2);
            throw new ServletException(e2);
        } catch (SQLException e2) {
            logger.log(Level.SEVERE, "SQLException error encountered ", e2);
            throw new ServletException(e2);
        }
        try {
            logger.info("Created AppsRequestWrapper object." + " Continuing the filter chain.");
            chain.doFilter(wrapper, response);
            logger.info("- the filter chain ends");
        } finally {
            //AppsRequestWrapper caches a connection internally.
            //AppsRequestWrapper.getConnection()--returns this connection this connection can be used in doGet()/doPost() service layer
            //whenever our application requires a connection in order to service the current request.
            //When AppsRequestWrapper instance is in use, this connection should not be closed by other code.
            //At this point, we are done using AppsRequestWrapper instance so, as good practice, we are going to close (release) this connection now.
            if (wrapper != null) {
                try {
                    logger.info("- releasing the connection attached to the" + " current AppsRequestWrapper instance ");
                    wrapper.getConnection().close();
                } catch (SQLException e3) {
                    logger.log(Level.WARNING, "SQLException error while closing connection--", e3);
                    throw new ServletException(e3);
                }
            }
            wrapper = null;
        }
    }

    public void destroy() {
        logger.info("Filter destroyed ");
    }
}

4. UserInfo.java

package com.oracle.bean;

import java.util.Map;
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseEvent;
import oracle.apps.fnd.ext.common.AppsRequestWrapper;
import oracle.apps.fnd.ext.common.Session;

public class UserInfo {
    private String user;
    private String userInfo;

    public UserInfo() {
        super();
    }


    public void setUser(String user) {
        this.user = user;
    }

    public String getUser() {
        return user;
    }


    public void beforePhase(PhaseEvent phaseEvent) {
        // Add event code here...
        AppsRequestWrapper wrappedRequest =
            (AppsRequestWrapper)FacesContext.getCurrentInstance().getExternalContext().getRequest();

        Session session = wrappedRequest.getAppsSession();

        setUser(session.getUserName());

        Map columns = session.getInfo();
        StringBuffer temp = new StringBuffer();
        temp.append("<table>");
        for (Object key : columns.keySet()) {
            temp.append("<tr>");
            temp.append("<td>");
            temp.append(key);
            temp.append("</td>");
            temp.append("<td>");
            temp.append(columns.get(key));
            temp.append("</td>");
            temp.append("</tr>");
        }
        temp.append("</table>");

        setUserInfo(temp.toString());

    }

    public void setUserInfo(String userInfo) {
        this.userInfo = userInfo;
    }

    public String getUserInfo() {
        return userInfo;
    }
}

Стъпка 02: Създайте изглед:userInfo.jspx в adfc-config.xml и задайте управлявани Beans

Layout: PageGroupLayout: layout = vertical
       OutPutText: value = "Hello # {pageFlowScope.userInfoBean.user} !!"
InlineStyle = "font-size: medium; color: Red;"
       Separator
     OutPutText: value = "# User Info: <br> # {pageFlowScope.userInfoBean.userInfo}"
Escape = "false" inlineStyle = "font-size: medium;"

Настройки на Oracle EBS:

Стъпка 01: Задайте функция:Меню:Responsibiliey:Function WEI_ADFLAB_USERINFOProperties-Type External ADF ApplicationWebHTML-HTML Call GWY.jsp?targetPage=faces/userInfo

Стъпка 02: Отговорност:Функционални настройки на администратора. Основни услуги → Профили → Код:FND_EXTERNAL_ADF_URL → Gob. След това щракнете върху URL адреса на приложението за външен ADF и натиснете Дефиниране на стойности на профил

а. Щракнете върху Дефиниране на стойности на профила → Отговорностb. Изберете Responsibility &Valuec. Стойност:гост програма в пътя на weblogic, като например:http://lnxap104:7214/ LAB_EBS-ViewController-context-root/ д. Натиснете Актуализиране



  1. Database
  2.   
  3. Mysql
  4.   
  5. Oracle
  6.   
  7. Sqlserver
  8.   
  9. PostgreSQL
  10.   
  11. Access
  12.   
  13. SQLite
  14.   
  15. MariaDB
  1. Как да добавяте и премахвате xml тагове на съществуващи данни в колона xmltype в oracle

  2. Oracle 11g репликация - Използване на опресняване при извършване с отдалечена база данни (връзки към база данни)

  3. Ред с последна стойност по клиент и месец

  4. SQL Developer не показва XML

  5. Oracle OSM - XQuery не зацикля