Showing posts with label SVN. Show all posts
Showing posts with label SVN. Show all posts

Monday, 2 October 2017

ANT : Common adf-config.xml to deploy SOA composites to different environments.

When you are using ANT for SOA deployment, It will look for the .adf defined in the scac.application.home location that you have passed to the ant-sca-package file.
By default for ANT it is the \SCA-INF\classes folder under each project.

However, the common adf-config.xml file can be used to deploy all the composites instead of using the adf-config file from the individual composite applications.

By below approach, we can reduce the maintenance of individual adf-config files also by using the same adf-config file the composites can be deployed to different environments.

Steps:

1. Copy.adf folder from any of the composite application to the common location.
2. Change the contents of the adf-config.xml like below (change the file according to your requirement.)

<?xml version="1.0" encoding="windows-1252" ?>
<adf-config xmlns="http://xmlns.oracle.com/adf/config" xmlns:adf="http://xmlns.oracle.com/adf/config/properties"
            xmlns:sec="http://xmlns.oracle.com/adf/security/config">
  <sec:adf-security-child xmlns="http://xmlns.oracle.com/adf/security/config">
    <CredentialStoreContext credentialStoreClass="oracle.adf.share.security.providers.jps.CSFCredentialStore"
                            credentialStoreLocation="../../src/META-INF/jps-config.xml"/>
  </sec:adf-security-child>
  <adf-mds-config xmlns="http://xmlns.oracle.com/adf/mds/config">
    <mds-config xmlns="http://xmlns.oracle.com/mds/config">
      <persistence-config>
        <metadata-namespaces>
          <namespace path="/apps" metadata-store-usage="mstore-usage_1"/>
          <namespace path="/soa/shared" metadata-store-usage="mstore-usage_2"/>
        </metadata-namespaces>
        <metadata-store-usages>
          <metadata-store-usage id="mstore-usage_1">
           <metadata-store class-name="oracle.mds.persistence.stores.db.DBMetadataStore">
            <property
name="jdbc-userid" value="DEV_MDS"/>
            <property
name="jdbc-password" value="devmds"/>
            <property
name="jdbc-url" value="jdbc:oracle:thin:@//localhost:1521/XE"/>
            <property
name="partition-name" value="soa-infra"/>
           </metadata-store>
            </metadata-store-usage>
            <metadata-store-usage id="mstore-usage_2">
           <metadata-store class-name="oracle.mds.persistence.stores.db.DBMetadataStore">
            <property
name="jdbc-userid" value="DEV_MDS"/>
            <property
name="jdbc-password" value="devmds"/>
            <property
name="jdbc-url" value="jdbc:oracle:thin:@//localhost:1521/XE"/>
            <property name="partition-name"
value="soa-infra"/>
           </metadata-store>
          </metadata-store-usage>
        </metadata-store-usages>
      </persistence-config>
    </mds-config>
  </adf-mds-config>
</adf-config>



3. Set the scac.application.home to the common location in step1 path during the deployment of the composites.The common adf-config.xml file will be used to deploy all the composites.

We are using DB-based MDS here.
You can also use the File-based connection, but make sure to change the metadata-path to the physical path of the MDS folder.

Example:
<metadata-store-usage id="mstore-usage_2">
      <metadata-store class-name="oracle.mds.persistence.stores.file.FileMetadataStore">
      <property name="partition-name" value="seed"/>
      <property
name="metadata-path" value="E:/Oracle/Middleware/Oracle_Home/soa/integration"/>
      </metadata-store

</metadata-store-usage>


Helpful? Please Comment.

Happy Learning!!

Friday, 29 September 2017

ANT : Get File Directory and File Name from Path

This is what you should do if you are trying to get ANT to get;

1. File name with directory path from a location

Use the below code snippet in your build.xml

                      <path id="filewithpath">
                            <fileset dir="${location}">
                                <include name="*_myfile_*.xml"/>
                            </fileset>
                        </path>

${filewithpath} should evaluate as the file name with full directory path.

2. Only File name from a location

                      <path id="filewithpath">
                            <fileset dir="${location}">
                                <include name="*_myfile_*.xml"/>
                            </fileset>
                        </path>

                  <pathconvert property="filename" refid="filewithpath"/>

${filename} should evaluate as the file name.


Helpful? Please comment.

Happy Learning!!





Sunday, 24 September 2017

ANT : SVN checkout

Steps on how to setup and checkout SVN code using Ant

1. Create a folder AntCheckout
2. Inside it create a folder lib
3. Download the below list of jars and place them in the lib folder




4. Inside Ant folder create build.properties file which should look like below:

svn.url=http://svn.test.com/svn/repos/myproject
svn.revision=HEAD
svn.uname=test

svn.password=test
svn.checkout.dir=myrepo

5. Update the property values accordingly with your SVN details.

6. Inside Ant folder create build.xml which should look like below:

<?xml version="1.0" encoding="iso-8859-1"?>
<project name="svncheckout" default="checkout">

    <!-- Antcontrib path -->
    <path id="antcontrib.path">
      <pathelement path="lib/ant-contrib-1.0b3.jar" />
    </path>
    <taskdef classpathref="antcontrib.path" resource="net/sf/antcontrib/antcontrib.properties"/>
    <taskdef classpathref="antcontrib.path" resource="net/sf/antcontrib/antlib.xml"/>
   
    <!-- SVNANT path -->
    <path id="svn.ant.classpath">
        <fileset dir="lib">
        <include name="**/*.jar"/>
        </fileset>
    </path>      
    <taskdef classpathref="svn.ant.classpath" resource="org/tigris/subversion/svnant/svnantlib.xml"/>

    <!-- SVN Checkout -->
    <svnSetting svnkit="true" javahl="false"  id="svn.settings"/>
    <target name="checkout" description="Pulls code from Subversion into the directory" depends="init">
            <echo>SVN URL: ${svn.url}</echo>
            <echo>Revision: ${svn.revision}</echo>
            <echo>Target Dir: ${svn.checkout.dir}</echo>
            <svn refid="svn.settings" username="${svn.uname}" password="${svn.password}" >
              <checkout url="${svn.url}" destPath="${basedir}/${svn.checkout.dir}" revision="${svn.revision}"/>
            </svn>  

             <!-- Remove unwanted .svn folders --> 
            <delete includeEmptyDirs="true">
                <fileset dir="${svn.checkout.dir}" includes="**/.svn/" defaultexcludes="false"/>
            </delete>
    </target>

    <!-- Clean folder before checkout -->
    <target name="init">
    <echo>Cleaning checkout folder: svn</echo>
        <delete includeemptydirs="true">
            <fileset dir="svn" includes="**/*"/>
        </delete>
        <mkdir dir="${svn.checkout.dir}"/>
    </target>
</project>

     <!-- Check if build.properties is available -->
    <available file="build.properties" property="file.exists" value="true" />
    <fail unless="file.exists" message="ERROR: Filename 'build.properties' does not exist." />
    <property file="build.properties"/>
 

7. Save All
8. Open command-prompt/ putty and set your ANT HOME
9. Run command ant checkout
10. The required artifacts will be checked-out in the myrepo folder.


Helpful? Please Comment.

Happy Learning!!

OSB 12c : Dynamic Routing to Business/Proxy Service

Dynamic routing is a kind of  Content-based Routing pattern, which is used when the BusinessService/ProxyService path is required to be de...