In this blog-posting, I will give an example project that is capable of importing and exporting CPAs to and from Oracle FMW 11g B2B.
Setup the build project
In JDeveloper, create an empty project and name it fmw-build for example. Create the following *.properties
- env.properties
- dev.jndi.properties
- dev.cpacpp.properties
The b2bmanagement.properties files contains all the enviroment specific properties and I used the following contents:
- deployment.plan.environment=dev
- #dev deployment server weblogic
- dev.serverURL=http://localhost:8001
- dev.overwrite=true
- dev.user=weblogic
- dev.password=welcome1
- dev.forceDefault=true
- # global
- wn.bea.home=/home/tomhofte/oracle/fmw11gr2
- oracle_home=${wn.bea.home}/Oracle_SOA1
- java.passed.home=/home/tomhofte/java/jdk1.6.0_17
- wl_home=${wn.bea.home}/wlserver_10.3
- libs=/home/tomhofte/libs
- path.to.antcontrib.lib=${libs}/ant-contrib/ant-contrib-1.0b3.jar
- dev.JAVA_HOME=/home/tomhofte/java/jdk1.6.0_17
- #Empty home is enough to let it work
- dev.ANT_HOME=
The dev.jndi.properties file contains the jndi properties of my local development environment. I used the following contents:
- java.naming.provider.url=t3://localhost:8001
- java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
- java.naming.security.principal=weblogic
- java.naming.security.credentials=welcome1
The dev.cpacpp.properties contains the cpa/cpp import/export properties for my local development environment. Please have a look here for more information about this part. Please note that for importing exporting a CPA you first have to export the design repository and specify the resulting zip file as the input for the CPA/CPP export utility. The contents I used are:
- # CPP/A Output files
- oracle.tip.b2b.ebms.OutputFolder=b2b-tmp/output/
- # Oracle B2B Metadata File in case of CPA Export
- oracle.tip.b2b.ebms.Document=b2b-tmp/output/Paris.zip
- # ebXML CPA File incase of CPA Import
- #oracle.tip.b2b.ebms.Document=/tmp/input/cpa-example-2_0.xml
- # Host Name
- oracle.tip.b2b.ebms.Host=Berlin
- # Host endPoint Details
- oracle.tip.b2b.ebms.HostEndPoint=http://localhost:8001/b2b/transportServlet
- # Host Certificate Alias
- oracle.tip.b2b.ebms.HostCertificateAlias=Berlin
- # Trading Partner Certificate Alias
- oracle.tip.b2b.ebms.TPCertificateAlias=Paris
- # BPSS Export
- oracle.tip.b2b.ebms.BPSSExport=false
- #Log config
- oracle.tip.b2b.ebms.LogFolder=b2b-tmp/output/log/
- # DEBUG|INFO|ERROR
- oracle.tip.b2b.ebms.LogLevel=DEBUG
- # text|xml
- oracle.tip.b2b.ebms.LogType=text
Now that all required property files are in place, I use an Ant wrapper script to call the tasks in the ant-b2b-util.xml file and provide the necessary properties. Just as is done in this posting. Here are the contents of my b2b-management.xml file:
(Note: for layout purposes I had to use explicit XML end tags..:()
- <project name="b2bManagement" default="exportCPA">
- <property file="env.properties"></property>
- <property environment="env"></property>
- <property name="env.JAVA_HOME" value="${deployment.plan.environment}.JAVA_HOME"></property>
- <property name="env.ANT_HOME" value="${deployment.plan.environment}.ANT_HOME"></property>
- <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${path.to.antcontrib.lib}"></taskdef>
- <!-- Override the JNDI location -->
- <property name="jndi.properties" value="${deployment.plan.environment}.jndi.properties"></property>
- <dirname property="jndi.prop.folder" file="${jndi.properties}"></dirname>
- <import file="${basedir}/ant-b2b-util.xml"></import>
- <target name="importCPA">
- <antcall target="b2bcpaimport" inheritall="true" inheritrefs="false">
- <param name="propfile" value="${deployment.plan.environment}.cpacpp.properties">
- </antcall>
- </target>
- <target name="exportCPA">
- <antcall target="b2bcpaexport" inheritall="true" inheritrefs="false">
- <param name="propfile" value="${deployment.plan.environment}.cpacpp.properties">
- </antcall>
- </target>
- </project>
Note: In the ant-b2b-util.xml I had to replace the oracle.home property with a oracle_home named property to be able to use my own oracle home property. At least, this is the case when I execute the script from JDeveloper 11g. Apparently, the oracle.home property file is predefined by JDeveloper, because I get an "Override ignored" message.. I think it won't matter when you execute the script from the command line..
More info about the usage of the tasks defined in the ant-b2b-util.xml can be found here:
http://download.oracle.com/docs/cd/E15523_01/integration.1111/e10229/scrpt_imp_exp_dep.htm#CEGBDIDB
2 comments:
A few years ago a pair of young advertising executives (Dave and Alex) rated 200 B2B print ads: only 5% were rated as excellent; one-fifth as mediocre and the large majority (79%) as poor. Dave is still around and is currently paired with someone called Eddy (of the Dave and Eddy show) but the evidence shows that B2B advertising has matured substantially in just a few short years.
I don’t have much knowledge about this topic. I am a beginner so this is new for me. I find the code quite difficult and seem it will take time to learn all this but I want to say that all your information is very useful and please post if there is any easy way to do the same.
Post a Comment