Thursday, February 21, 2013

Oracle SOA 11.1.1.6 Create RMA (Return Merchandise Authorization) using Oracle SOA B2B on AS2 Part 1

Oracle SOA 11.1.1.6: Create  RMA (Return Merchandise Authorization) using Oracle SOA B2B on AS2 (Part 1)

A return merchandise authorization (RMA) or return goods authorization (RGA) is the process of having a product repaired or replaced in order to receive a refund or credit for another product from the same retailer or corporation. This thread discusses creation of X12 180 ECS file Version 4010 using Oracle B2B Document Editor Tool version 7.0.5.




  • Using the B2B document Editor Shortcut, start the B2B document Editor. Click File->New




  • Choose X12 option under EDI, Choose Version 4010, Choose 180-Return Merchandise Authorization and Notification. Click Next.

  • Click Finish

  • Create an XSD so that we can configure B2B on Oracle SOA 11.1.1.6 stack. 
  • Click File. Choose Export.

  • In the Export Wizard, choose Oracle 2.0. Press Next.

  • Choose the folder where you want the XSD file to be created and Press Next.

  • Click Finish.

The ECS File and XSD file is ready. We we use these files in configuring the SOA - B2B using B2b Console in my next post.



OIM 11.1.1.5 : User Management


User Management

The OIM 11gR1 Java APIs support searching, creating, reading, updating and deleting of Users. This thread demonstrates cover how to use the OIM 11gR1 Java APIs to perform these operations.


Required server files

You will need to obtain the following files from the OIM 11gR1 server:
  • The OIM 11gR1 Java API classes are packaged as a jar file called oimclient.jar. This jar file is packaged within the oimclient.zip file. The oimclient.zip file is located in the OIM_ORACLE_HOME/server/client folder, on the OIM 11gR1 server.
  • Copy oimclient.zip from the OIM 11gR1 server:
    scp user@oimserver:/OIM_ORACLE_HOME/server/client/oimclient.zip .
  • Expand the oimclient.zip file:
    unzip oimclient.zip
  • Access the Weblogic Server system
    ssh user@wlserver
  • Change directories to the server/lib directory.
    cd WL_HOME/server/lib
  • Use the following command to create the wlfullclient.jar file in the server/libdirectory:
    java -jar wljarbuilder.jar
  • Copy the wlfullclient.jar file.

Create A User In OIM using OIM API.

package com.mindtelligent.oim.user.client;

import java.util.HashMap;

import oracle.iam.identity.usermgmt.api.UserManager;
import oracle.iam.identity.usermgmt.vo.User;
import oracle.iam.identity.usermgmt.vo.UserManagerResult;



public class UserCreate extends ClientUser
{
   public UserCreate() throws Exception
   {
      super();
      return;
   }
   public static void main(String[] args) throws Exception
   {

      UserCreate test = new UserCreate();

      try
      {
         test.execute();
      }
      catch (Exception ex)
      {
         test.log("EXCEPTION: " + ex.getMessage());
      }

      return;
   }
   protected void execute() throws Exception
   {
      long i = 1;
      String accountId = "hsaluja";
      String first = "Harvinder";
      String last = "Saluja";
      HashMap<String, Object> mapAttrs = null;
      UserManager umgr = null;         // OIMClient API
      UserManagerResult result = null; // OIMClient API
      User user = null;                // OIMClient API

      this.log("__BEGIN__");

      umgr = this.getUserManager();

      mapAttrs = new HashMap<String, Object>();
      mapAttrs.put("User Login", accountId);
      mapAttrs.put("First Name", first);
      mapAttrs.put("Last Name", last);
      mapAttrs.put("usr_password", "Passw0rd");
      mapAttrs.put("Email", first + "." + last + "@MindTelligent.com");
      mapAttrs.put("act_key", new Long(i));
      mapAttrs.put("Xellerate Type", "End-User");
      mapAttrs.put("Role", "Full-Time");  // User Type

   
      user = new User(accountId, mapAttrs);

      this.log("User object created: '" + accountId + "'");

      /*
       * Create the user
       */

      result = umgr.create(user);

      this.log("Creation status: '" + result.getStatus() + "'");

      this.log("__END__");

      return;
   }
}

Oracle SOA 11.1.1.6/ Weblogic 10.3.6: WLST Scripts to List Composites by Partions

Oracle SOA 11.1.1.6/ Weblogic 10.3.6: WLST Scripts to List Composites by Partions


sca_listCompositesInPartition is an online script taht can be used to display the composites in a partition. This script needs to be run from  $FW_Middleware\Oracle_SOA1\common\bin\wlst.cmd.

The script is supported by a properties file and the .py file (The script file).

The properties file looks has the following properties.


userName=weblogic
passWord=password
wlsHost=localhost
adminServerListenPort=7001
partitionsToBeChecked=default,partion1,partition2,partition3

The script itself is:

from java.io import FileInputStream
import re
import tempfile
propInputStream = FileInputStream("MonitorCompositesState.properties")
configProps = Properties()
configProps.load(propInputStream)

print '=============================================='
print '  COMPOSITE STATES WITH RESPECT TO PARTITIONS '
print '=============================================='
connect(configProps.get("userName"),configProps.get("passWord"),'t3://'+configProps.get("wlsHost")+':'+configProps.get("adminServerListenPort"))
splits=String(configProps.get("partitionsToBeChecked")).split(",")
for splitPartitionName in splits:
    print 'All the composites in partition:',splitPartitionName
    listcompos=sca_listCompositesInPartition(configProps.get("wlsHost"), configProps.get("adminServerListenPort"), configProps.get("userName"),configProps.get("passWord"),splitPartitionName) 
print '=============================================='
print''


Tuesday, February 5, 2013

Oracle SOA 11.1.1.6: WLST Scripts to Monitor Data Sources


This BLOG thread details the steps involved in creating WLST scripts to help to monitor the Data Sources on Weblogic Server with Admin Server or SOA  Server targets.

The scripts take advantage of a properties file which includes the server information. A file  CheckDataSourcesState.properties


userName=weblogic
passWord=password
wlsHost=localhost
adminServerListenPort=8001
dataSourcesToBeChecked=DataSourceDS1,DataSourceDS2



The WLST script can be created in an another file CheckDataSourcesState.py


import os
propInputStream = FileInputStream("CheckDataSourcesState.properties")
configProps = Properties()
configProps.load(propInputStream)
connect(configProps.get("userName"),configProps.get("passWord"),'t3://'+configProps.get("wlsHost")+':'+configProps.get("adminServerListenPort"))
serverRuntime()
dsMBeans = cmo.getJDBCServiceRuntime().getJDBCDataSourceRuntimeMBeans()
splits=String(configProps.get("dataSourcesToBeChecked")).split(",")
for ds in dsMBeans:
    for splitDSName in splits:
        if (splitDSName == ds.getName()):
              print 'DS name is: '+ds.getName()
              print 'State is ' +ds.getState()
              print ds.testPool()

Thursday, January 31, 2013

Talend ESB 5.3.X : Deployment on Talend Job Conductor using TAC

Talend ESB 5.3.X : Deployment on Talend Job Conductor using TAC


  • Talend Administration Center is a web-based application delivered with the Job Conductor and ESB Conductor modules. These modules allow you, from a single console, to:

  • Configure the remote physical execution servers and group them in virtual servers
  • Schedule time-based Jobs and create execution plans.  
  • Set up Service deployment and execution. For more information

Job Compilation

To compile all the jobs  using Talend Studio by doing the following steps

  Right click on the job that needs to be deployed à Press Export and following screen is displayed.


  •        Choose Autonomous Job
  •          Choose All the options as shown above.
  •          Click Finish..
  •          Compile all the jobs one-by-one.

Connect to TAC (Talend Administration Center)



  • Click Login
  • Click on Job Conductor as shown in the following figure.


  • Click Add on Job Conductor Page





  •   On the Right Hand Side of the screen, enter the details of the Job that needs to be deployed













  •          Once the job is uploaded, it needs to be deployed by pressing the Deploy icon.
  •      Once the job is deployed the status will be shown as “Ready To Run”






Sunday, December 30, 2012

OFM 10.3.6: Java code to view the contents of a Java Key Store (JKS)

OFM 10.3.6: Java code to view the contents of a Java Key Store (JKS)

package mindtelligent.custom.jks;

import java.io.File;
import java.io.FileInputStream;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

import java.security.KeyStore;

import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;

import java.security.cert.Certificate;

import java.util.Enumeration;

public class ViewJKSAlias {

    private static InputStream is = null;

    public static void main(String[] args) {
        try {

            File file =
                new File("C:\\MindTelligent\\JavaKeyStore\\MindTelligentKeyStore.jks");
            is = new FileInputStream(file);
            KeyStore keystore =
                KeyStore.getInstance(KeyStore.getDefaultType());
            String password = "weblogic01";
            keystore.load(is, password.toCharArray());


            Enumeration enumeration = keystore.aliases();
            while (enumeration.hasMoreElements()) {
                String alias = (String)enumeration.nextElement();
                System.out.println("alias name: " + alias);
                Certificate certificate = keystore.getCertificate(alias);
                System.out.println(certificate.toString());

            }

        } catch (java.security.cert.CertificateException e) {
            e.printStackTrace();
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (KeyStoreException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (null != is)
                try {
                    is.close();
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
        }
    }
}

Sunday, November 11, 2012

Oracle SOA 11.1.1.6 Technology Adapters: Enabling High Availability for Oracle File and FTP Adapters

Oracle SOA 11.1.1.6 Technology Adapters: Enabling High Availability for Oracle File and FTP Adapters

The Oracle File and FTP Adapters enable a BPEL process or an Oracle Mediator to read and write files on local file systems and on remote file systems through FTP (File Transfer Protocol). These adapters support high availability for an active-active topology with Oracle BPEL Process Manager and Oracle Mediator service engines for both inbound and outbound operations. To make Oracle File and FTP Adapters highly available for outbound operations, use the database mutex locking 


Note:
The File Adapter picks up a file from the inbound directory, processes it, and then outputs a file to the output directory. Because the File Adapter is non-transactional, files can be processed twice. As a result, it is possible to get duplicate files when there is failover in the RAC backend or in the SOA managed servers.

Using the Database Mutex Locking Operation

Make an outbound Oracle File or FTP Adapter service highly available using database table as a coordinator.
The steps and configuration options for the FTP adapter are exactly the same as the options for the file adapter. The connection factory to be used for FTP HA configuration iseis/Ftp/HAFtpAdapter which appears under the Outbound Connection Pools for the FTPAdapter deployment.


To make outbound Oracle File or FTP Adapters highly available, modify Oracle File Adapter deployment descriptor for the connection-instance corresponding to eis/HAFileAdapter from the Oracle WebLogic Server console:
  1. Log into your Oracle WebLogic Server console. To access the console navigate to the following URL:
    http://servername:portnumber/console
    
  2. Click Deployments in the left pane for Domain Structure.
  3. Click FileAdapter under Summary of Deployments on the right pane.
  4. Click the Configuration tab.
  5. Click the Outbound Connection Pools tab, and expand javax.resource.cci.ConnectionFactory to see the configured connection factories.
  6. Click on Lock & Edit.

    After this, the property value column becomes editable (you can click on any of the rows under "Property Value" and modify its value).
    The new parameters in connection factory for Oracle File and FTP Adapters are as follows:
    controlDir: Set it to the directory structure where you want the control files to be stored. You must set it to a shared location if multiple WebLogic Server instances run in a cluster. Structure the directory for shared storage as follows:
    ORACLE_BASE/admin/domain_name/cluster_name/fadapter
    
    inboundDataSource: Set the value to jdbc/SOADataSource. This is the data source, where the schemas corresponding to high availability are pre-created. The pre-created schemas can be found in the following directory:
    ORACLE_HOME/rcu/integration/soainfra/sql/adapter/createschema_adapter_oracle.sql
    
    If you want to create the schemas elsewhere, use this script. You must set the inboundDataSource property accordingly if you choose a different schema.
    outboundDataSource: Set the value to jdbc/SOADataSource. This is the data source where the schemas corresponding to high availability are pre-created. The pre-created schemas are located in the following directory:
    ORACLE_HOME/rcu/integration/soainfra/sql/adapter/createschema_adapter_oracle.sql
    
    If you want to create the schemas elsewhere, use this script. You must set the outboundDataSource property if you choose to do so.
    outboundDataSourceLocal: Set the value to jdbc/SOALocalTxDataSource. This is the datasource where the schemas corresponding to high availability are pre-created.
    outboundLockTypeForWrite: Set the value to oracle if you are using Oracle Database. By default the Oracle File and FTP Adapters use an in-memory mutex to lock outbound write operations. You must choose from the following values for synchronizing write operations:
    memory: The Oracle File and FTP Adapters use an in-memory mutex to synchronize access to the file system.
    oracle: The adapter uses Oracle Database sequence.
    db: The adapter uses a pre-created database table (FILEADAPTER_MUTEX) as the locking mechanism. You must use this option only if you are using a schema other than the Oracle Database schema.
    user-defined: The adapter uses a user-defined mutex. To configure the user-defined mutex, you must implement the mutex interface: "oracle.tip.adapter.file.Mutex" and then configure a new binding-property with the name"oracle.tip.adapter.file.mutex" and value as the fully qualified class name for the mutex for the outbound reference.
  7. Click Save after you update the properties. The Save Deployment Plan page appears.
  8. Enter a shared storage location for the deployment plan. The directory structure is as follows:
    ORACLE_BASE/admin/domain_name/cluster_name/dp/Plan.xml
    
  9. Click Save and Activate.
  10. Once the new deployment plan has been saved and activated, activate the FileAdapter deployment (the deployment remains in Prepared state if not started). To activate the FileAdapter deployment plan:
    In the Administration Console, click Deployments in the left pane for Domain Structure.
    Select the FileAdapter under Summary of Deployments on the right pane and Select Start, and then Servicing All Requests.
  11. Configure BPEL Process or Mediator Scenario to use the connection factory as shown in the following example (in the jca file included in the composite for the binding component):
    <adapter-config name="FlatStructureOut" adapter="File Adapter" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
      <connection-factory location="eis/HAFileAdapter" adapterRef=""/>
      <endpoint-interaction portType="Write_ptt" operation="Write">
    <interaction-spec className="oracle.tip.adapter.file.outbound.FileInteractionSpec">
          <property../>
          <property../>
        </interaction-spec>
      </endpoint-interaction>
    </adapter-config>
  12. Click eis/HAFileAdapter. The Outbound Connection Properties for the connection factory corresponding to high availability is displayed.






How IdP Groups Are Tied to Databricks Groups (Unity Catalog)

  🔗 How IdP Groups Are Tied to Databricks Groups (Unity Catalog) 🔑 Key Principle (Read This First) Databricks does NOT “map” IdP groups...