Before You Begin
Purpose
This tutorial covers how to exchange custom objects within the ODI community via the Update Center. You can optionally add your own work to the library and download other people's contributions.
Time to Complete
Approximately 1 hour.
Background
As a developer, you should have an account at http://java.net for browsing and discussing Java development. Developers can share code via the exchange program. This is a moderated program (an Oracle administrator looks at your submitted code before they post anything you send up). ODI can browse and fetch new code (such as Knowledge Modules) or update existing code beyond what is supplied with the initial software release. All of this is optional, but certainly worth looking at.
Scenario
You just developed a very clever and exciting new Knowledge Module (KM) that you want to share with the ODI world, so you want to send it to the Upload Center via http://java.net. You also heard that someone else has developed another clever KM that sounds like just what you need for your current project. Rather than reinvent that second KM yourself, you decide to just download theirs, perhaps as a starting point for your modifications, or perhaps it is ready to go as-is.
What Do You Need?
The following is a list of software and hardware requirements used in this OBE:
- Software
- Oracle Enterprise Linux (OEL) 6.4 or higher
- Oracle Database 12c Release 1 Enterprise Edition (12.1.0.2) - including Oracle Big Data SQL-enabled external tables, Oracle Advanced Analytics, Oracle OLAP, Oracle Partitioning, Oracle Spatial and Graph, and more
- Oracle Data Integrator (ODI) 12.2.1 or higher
- Alternatively, the Oracle Data Integrator Getting Started Virtual Machine (the VM) contains all of the above pre-installed.
- Hardware
- At least 2 GB RAM for each target (database or ODI)
- At least 6 GB RAM for the VM (if you are using that)
Prerequisites
Before starting this tutorial, you should:
- Have at least 6 GB RAM available if you're using
the Oracle Data Integrator Getting Started VM
- Have access to or have installed the sample lab artifacts
- Have attended ODI 12c training, [D82167GC10] Oracle Data Integrator 12c: Integration and Administration, or equivalent experience.
Typographic Conventions
These are the conventions used throughout this practice to indicate who types what.
-
Filename
or/path/subdirectory/
. Often you can navigate to a destination without having to type it. - Command or value that you type, such as gedit .bashrc. Be mindful of periods at the end of sentences that are not part of the command.
- Click this such as or .
- Some variable or
<variable>
as something you replace. Often prefixed with "my" such as<myName>
or<myHost>
. - A Menu Item or dialog Field Prompt or Tab name. For example, "click the Designer tab and select Models > New Model".
- Generally a red rectangle in the graphics is not part of the original image, but added to draw your attention to an item.
1. Download Custom Objects
To download new objects, start ODI and check for updates.
1.1 Start ODI Studio
-
Double-click the ODI Studio icon on the Deskstop to start ODI Studio:
View ImageView ImageAlternatively, if there is a Desktop Launcher shortcut, click on that.
-
Click Connect to Repository. Login to ODI Getting Started repository.
View ImageView ImageThe User: SUPERVISOR and Password (welcome1) should be stored and pre-populated from the Wallet.
ODI is now started and ready to download new objects.
1.2 Download New Objects
-
Go to the main menu bar, and click Help > Check for Updates.
View Image -
Make sure Official Oracle Update Center and Customers and Partners Update Center are selected.
View ImageClick .
-
Search for Big Data. Key big in the search field and click Search (
).
View ImageSelect LKM Hive to Oracle (Big Data SQL).
View ImageReview the information provided on the right hand side and then select its checkbox to download this KM. Do not click Next yet...
-
Search for random and select the checkbox next to the
RANDOM
user function.View ImageClick to start downloading the custom objects.
Wait for the files to be downloaded and then click .
-
Wait for the objects to be imported and click to close the Import Report.
View Image -
Click to go back to ODI Studio.
View Image
The new objects were successfully identified and downloaded.
1.3 Verify Import of New Objects
-
In Designer, click Refresh (
). Expand (
) the Global Objects accordion.
View ImageExpand (
) Global User Functions to display the
RANDOM
user function.Expand (
) Global Knowledge Modules > Loading (LKM) to find LKM Hive to Oracle (Big Data SQL).
The new objects were successfully downloaded.
The new objects were successfully installed into the Global area of the repository.
2. Upload a Custom KM
For purposes of this exercise, the custom KM will be only a trivial change to an existing KM. To upload a custom KM, perform the following steps:
2.1 Create a Custom KM
-
In Designer, expand (
) Global Objects > Global Knowledge Modules > Loading (LKM) > LKM Hive to Oracle (Big Data SQL).
Right-click LKM Hive to Oracle (Big Data SQL) and select Duplicate Selection.
View ImageView ImageClick .
-
Double-click Copy of LKM Hive to Oracle (Big Data SQL) to open it.
In the Definition tab, rename the KM into <FIRST_NAME_LAST_INIT> LKM Hive to Oracle (Big Data SQL).
View Image -
Click Tasks tab. Select Create external table and click Add (
).
View Image -
In the Properties panel, under General, change the task Name to Custom Task and select Ignore Errors.
View ImageClick Save (
) to save the KM. Leave the tab open.
-
Click Target Command tab, set Technology: Jython, and set Command to raise '''My custom exception''' (that is three straight quotes in a row).
View ImageClick Save (
) again to save the KM. Close the LKM tab.
You have created a custom (albeit trivial) KM.
2.2 Bundle the KM as a Zip File
-
Right-click on your new custom LKM in the Loading (LKM) tree and select Export.
View Image -
Set Export to directory:
/home/oracle/Desktop
.View ImageClick to export the KM.
-
Click to close the Export Key warning.
View ImageClick to close the Export finished dialog.
-
Go to the Linux Desktop. Right-click on an empty space on the Desktop and select Create Folder to create a META-INF directory on the Desktop.
View ImageMake sure you use ALL CAPS, and a hyphen (not an underscore) in the name.
-
Open the OBE
_Files
directory and then open theODI Exchange
folder.View ImageRight-click on
bundle.xml
and select Copy. -
Open up the
META-INF
directory, right-click in it and select Paste.View Image -
Right-click on
bundle.xml
and select Open withgedit
.View ImageYou can use another text editor, such as
vi
if you wish. -
Replace
{KM NAME}
,{KM VERSION}
,{AUTHOR}
,{URL}
and{DESCRIPTION}
(including the curly braces) with new values of your choosing. Before editing:View XML<update-bundle version="1.0" xmlns="http://xmlns.oracle.com/jdeveloper/updatebundle"> <update id="{GLOBAL ID}" xmlns="http://xmlns.oracle.com/jdeveloper/update"> <name>{KM NAME}</name> <version>{KM VERSION}</version> <author>{AUTHOR}</author> <author-url>{URL}</author-url> <description>{DESCRIPTION}</description> </update> </update-bundle>
After editing, it should look similar to this (but with your name and email):
View XML<update-bundle version="1.0" xmlns="http://xmlns.oracle.com/jdeveloper/updatebundle"> <update id="{GLOBAL ID}" xmlns="http://xmlns.oracle.com/jdeveloper/update"> <name>myKM</name> <version>1.2.3</version> <author>Joe Programmer</author> <author-url>joe.programmer@example.com</author-url> <description>Does cool new things for the OBE!</description> </update> </update-bundle>
Leave the file open, do not close it yet.
-
Right-click on the KM export file and select Open with gedit.
View ImageLook around line 16.
-
Locate the GlobalId field in the <Object class=com.sunopsis.dwg.dbobj.SnpTrt node.
View KM XML<?xml version="1.0" encoding="ISO-8859-1"?> <SunopsisExport> <Admin RepositoryVersion="05.02.01.01" IsLegacyIdCompatible="false" /> <Encryption algorithm="AES" keyLength="128" exportKeyHash="/zaFSZVcVL9g85h5/zp4ove9BfYktdE50NNn8LXZkLM=" keyVect="6FEK5Lhjozxqa55Sw+ZMwA==" exportKeySalt="5796d8ac-1744-4f62-9f53-64979e4d6923" containsCipherText="false"/> <Object class="com.sunopsis.dwg.dbobj.SnpTrt"> <Field name="BaseKmType" type="java.lang.String">null</Field> <Field name="CleanupOnError" type="java.lang.String">null</Field> <Field name="CompType" type="java.lang.String">null</Field> <Field name="DelegateClass" type="java.lang.String">null</Field> <Field name="DelegateScript" type="java.lang.String">null</Field> <Field name="ExpectedAstClass" type="java.lang.String">null</Field> <Field name="ExtVersion" type="java.lang.String">null</Field> <Field name="FirstDate" type="java.sql.Timestamp"><![CDATA[2015-01-16 13:38:02.0]]></Field> <Field name="FirstUser" type="java.lang.String"><![CDATA[SUPERVISOR]]></Field> <Field name="GenType" type="java.lang.String">null</Field> <Field name="GlobalId" type="java.lang.String"><![CDATA[5db724b3-044c-4b6f-ae66-484a57bacb0a]]></Field> <Field name="IndChange" type="java.lang.String"><![CDATA[I]]></Field> <Field name="IndJrnMethod" type="java.lang.String"><![CDATA[S]]></Field> <Field name="IndSuppSetBased" type="java.lang.String">null</Field> <Field name="IntgType" type="java.lang.String">null</Field>
(...more lines not shown, omitted for clarity...)
-
Copy its hex value (CDATA[VALUE_TO_COPY]) and replace
{GLOBAL ID}
in thebundle.xml
file with it.View XML<update-bundle version="1.0" xmlns="http://xmlns.oracle.com/jdeveloper/updatebundle"> <update id="5db724b3-044c-4b6f-ae66-484a57bacb0a" xmlns="http://xmlns.oracle.com/jdeveloper/update"> <name>myKM</name> <version>1.2.3</version> <author>Joe Programmer</author> <author-url>joe.programmer@example.com</author-url> <description>Does cool new things for the Beta class!</description> </update> </update-bundle>
Your hex value may be different. Save
bundle.xml
file and closegedit
. -
Select both the custom KM file and its
META-INF
directory, then right-click one of them and select Compress.View ImageK
Enter a name for the zip file (should start with KM_LKM_ and end with yourname) and select .zip then click .
View Image
You should now have a zip file on the Desktop
with the bundle.xml
and the KM.xml
together.
2.3 Upload the New Object to the Web
On a production machine, you would have direct access to the web. On these lab machines, the firewalls prevent that direct access, so you will need to copy the files from the VM to the PC and then access the web from the PC (outside of the VM).
-
From the VM, open a Terminal session and navigate to the Desktop. As
root
, copy thebundle.xml
to the/shared
folder.View OS Commands[OS]$ cd /home/oracle/Desktop [OS]$ su - root [OS]# mount -t vboxsf shared /shared [OS]# exit [OS]$ cp KM_LKM_User.zip /shared [OS]$
Substitute User with your name.
-
On your Windows host, go to
C:\VMs
to access the file you created in the VM.View Image -
On your Windows host, open a web browser and go to https://home.java.net/.
View ImageCreate an account by clicking Join Now if you do not have one yet. Otherwise, click Login.
-
Log into Java.net.
View Image -
Go to https://java.net/projects/oracledi. Click on Join This Project.
View ImageClick Downloads in the Project Features menu on the left hand-side, or on the right-hand side, they both take you to the same place.
-
Navigate to ODI > Knowledge Modules > 12c .
View ImageClick Add File / Link for Download.
-
Specify the zip file to upload from
C:\VMs
, and enter a required title and description.View ImageClick to start the upload.
Make sure you get a Success message.
View ImageView ImageClick to complete the upload.
-
The Java.net administrator has been notified automatically and the Update Center will be updated in a couple of days. Your new KM should then show up on other people's VM since it is a new option for them, but on your VM, since you already have your KM, it will not display as an available update. To
fix
this, delete it from your VM and then it will appear as an available update. (You would not do this in real life.)View ImageView ImageClick to continue.
-
Back in Studio, on the main menu bar, click Help > Check for Updates and search for the object you just uploaded.
View ImageNotice that the description and title match what is in
bundle.xml
in step 2.2.8, not what you called it in thejava.net
upload in step 2.3.5.
You have just uploaded a new object to be shared on https://home.java.net.
You have just create and uploaded a new KM to be shared with the ODI community.
Want to Learn More?
In this tutorial, you learned to:
- Download custom objects from the Update Center
- Upload custom objects to the Update Center via java.net.
Resources
Conceptual or procedural Help topics relevant to the topic of this tutorial:
- ODI product home page
- Documentation on releases 12.2.1 and 12.1.3
- Training
- [D82167GC10] Oracle Data Integrator 12c: Integration and Administration. 5 days.
- [D87557GC10] Oracle Data Integrator 12c: Advanced Integration and Development. 3 days.
- ODI A-Team Blogs
- To learn more about ODI, refer to additional OBEs in the Oracle Learning Library, perhaps starting with this ODI 12c series.
Credits
As always, a team effort. This is a partial list of the team:
- Lead Curriculum Developer: Julien Testut
- Other Contributors: Steve Friedberg, Alex Kotopoulis, Ayush Ganeriwal