Friday, 29 December 2017

What Is adf-config.xml file In SOA

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.

The adf-config file configurations can be changed at runtime through ant script to deploy the composites to different environments.

By this 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.

How To Get ADf.Config.xml file :

1) Go to any bel project,referred from mds.

2) Navigate to --> projectname -->sca_inf--> classes-->meta-inf--> adf-config(xml file)

3)Typical Adf-Config.xml file :

<?xml version='1.0' encoding='windows-1252'?>
<adf-config xmlns="http://xmlns.oracle.com/adf/config" xmlns:config="http://xmlns.oracle.com/bc4j/configuration" xmlns:adf="http://xmlns.oracle.com/adf/config/properties" xmlns:sec="http://xmlns.oracle.com/adf/security/config">
   <adf-adfm-config xmlns="http://xmlns.oracle.com/adfm/config">
      <defaults useBindVarsForViewCriteriaLiterals="true" useBindValuesInFindByKey="true" executeEmptyOnException="true"/>
      <startup>
         <amconfig-overrides>
            <config:Database jbo.locking.mode="optimistic"/>
         </amconfig-overrides>
      </startup>
   </adf-adfm-config>
   <adf:adf-properties-child xmlns="http://xmlns.oracle.com/adf/config/properties">
         </adf:adf-properties-child>
   <sec:adf-security-child xmlns="http://xmlns.oracle.com/adf/security/config">
      <CredentialStoreContext credentialStoreClass="oracle.adf.share.security.providers.jps.CSFCredentialStore" />
   </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/abcd" metadata-store-usage="mstore"/>
            </metadata-namespaces>
            <metadata-store-usages>
               <metadata-store-usage id="mstore-usage_2">
                  <metadata-store class-name="oracle.mds.persistence.stores.db.DBMetadataStore">
                     <property name="jdbc-userid" value="@username"/>
                     <property name="jdbc-url" value="@dburl"/>
                     <property name="partition-name" value="@soapartition"/>
                  </metadata-store>
               </metadata-store-usage>
            </metadata-store-usages>
         </persistence-config>
      </mds-config>
   </adf-mds-config>
</adf-config>

4)Create a Build.properties file for each environment and specify the MDS details as mentioned below.
Build.properties
        oa.partition=soa-infra
        db.user=SOA_MDS
        db.password=xxxx

5)Replace the tokens with the environment actual value during deployment in adf-config.xml file. 

The below Ant script can be used to replace the tokens.
 adfconfigbasedir should be changed to the parent folder where the .adf folder is copied.
<loadproperties srcFile="build.properties"/>
<replace dir="${ adfconfigbasedir }/ .adf/ META-INF" token="@db.user@" value="${db.user}">
<include name="adf-config.xml"/>
</replace> 
<replace dir="${ adfconfigbasedir }/ .adf/META-INF" token="@db.password@" value="${db.password}">
<include name="adf-config.xml"/>
</replace> 
<replace dir="${ adfconfigbasedir }/ .adf/META-INF" token="@db.url@" value="${db.url}">
<include name="adf-config.xml"/>
</replace> 
<replace dir="${adfconfigbasedir}/ .adf/META-INF" token="@partition@" value="${soa. partition }">
<include name="adf-config.xml"/>
</replace>

No comments:

Post a Comment