Using a Large CSV Source File

4-210 Oracle Fusion Middleware Users Guide for Technology Adapters ■ TargetSchemaRoot: The root element in the target schema. ■ TargetType: The type of data. The other possible type is XML. ■ Xsl: Relative path to the Xsl file.

4.5.11.5 Moving a File from One Remote Directory to Another Remote Directory on the Same FTP Server

The IO use cases for the Oracle FTP Adapter are very similar to those for Oracle File Adapter. However, there are a few nuances that need attention. In this use case you will move a file within the same directory, which is similar to a rename operation on the same server. Most FTP servers support the RNFRRNTO FTP commands that let you rename a file on the FTP server. However, even if the RNFRRNTO commands are not supported, moving a file within the same directory is still possible because of a binding property, UseNativeRenameOperation. By default, this property is set to TRUE, and in this case the Oracle FTP Adapter uses the native RNFRRNTO commands. However, if this property is set to FALSE, then the Oracle FTP Adapter uses the Get and Put commands followed by a Delete command to emulate a move operation. You can model only a part of this procedure by using the wizard because the corresponding Adapter Configuration Wizard is not available. You must complete the remaining procedure by manually configuring the generated JCA file. You must perform the following steps to move a file from a remote directory to another remote directory on the same FTP server: 1. Create an empty BPEL process. 2. Drag and drop FTP Adapter from the Component Palette to the External References swim lane. The Adapter Configuration Wizard Welcome page is displayed.

3. Click Next. The Service Name page is displayed.

4. Enter a service name in the Service Name field.

5. Click Next. The Adapter Interface page is displayed.

6. Click Next. The FTP Server Connection page is displayed.

7. Enter the JNDI name for the FTP server, and click Next. The Operation page is

displayed.

8. Select Synchronous Get File, enter FTPMove in the Operation Name field, and

then click Next. The File Directories page is displayed. 9. Enter a dummy physical path for the directory for incoming files, and then click Next . The File name page is displayed. Note: You have selected Synchronous Get File as the operation because the WSDL file that is generated as a result of this operation is similar to the one required for the file IO operation. Note: The dummy directory is not used. You must manually change the directory in a later step. Oracle JCA Adapter for FilesFTP 4-211

10. Enter a dummy file name, and then click Next. The File Name page is displayed.

11. Click Next. The Messages page is displayed.

12. Select Native format translation is not required Schema is opaque, and then

click Next. The Finish page is displayed. 13. Click Finish. The outbound Oracle File Adapter is now configured. 14. Drag the small triangle in the BPEL process in the Components area to the drop zone that appears as a green triangle in FTPMove in the External References area. The BPEL component is connected to the Oracle FTP Adapter outbound service.

15. Click File, Save All.

16. Create an invoke activity for the FTPMove service that you just created. The next step is to modify the generated WSDL file for FTPMove service and configure it with the new interaction specification for the move operation. 17. Open the FTPMove_ftp.jca file and modify the interaction-spec, as shown in the following example. You must configure the JCA file with the source and target directory and file details. You can either hardcode the source and target directory and file details in the JCA file or use header variables to populate them. In this example, header variables are used. adapter-config name=FTPMove adapter=Ftp Adapter xmlns=http:platform.integration.oracleblocksadapterfwmetadata connection-factory location=eisFtpFtpAdapter adapterRef= endpoint-interaction portType=FTPMove_ptt operation=FTPMove interaction-spec className=oracle.tip.adapter.ftp.outbound.FTPIoInteractionSpec property name=SourcePhysicalDirectory value=foo1 property name=SourceFileName value=bar1 property name=TargetPhysicalDirectory value=foo2 property name=TargetFileName value=bar2 property name=Type value=MOVE interaction-spec endpoint-interaction adapter-config Note: The dummy file name you enter is not used. You must manually change the file name in a later step. Note: You have modified the className attribute, and added SourcePhysicalDirectory, SourceFileName, TargetPhysicalDirectory, TargetFileName, and Type. Currently, the values for the source and target details are dummy. You must populate them at run-time. You can also hardcode them to specific directories or file names. The Type attributes decides the type of operation. Apart from MOVE, the other acceptable values for the Type attribute are COPY and DELETE.