
Custom metadata
This is what the most of the metadata is. All new fields you will be creating will also be Custom metadata. Let's take look.
Lab 4: Exploring custom metadata
Once again, there is no way you can tell Custom metadata from Standard metadata — just by looking at the Content Information screen. Just as we did before — let's look at its database.
Custom metadata in the database
Go to your favorite database tool and check the list of columns in the table called DocMeta
(as shown in the following screenshot):
The column names in DocMeta
are the custom metadata fields.
Note
Notice that Custom or Extended fields have an "x" prefix, not a "d" prefix, like Standard fields.
Here's a list of the fields you will be using most often:
- dID: Unique ID of the document revision. Note that this field was also used in the
Revisions
table. This is how you can link standard and extended metadata of one content item. - xComments: The Comments text box from your check-in form.
- xCollectionID: Unique numeric ID or a virtual folder where the item is residing. If an item is not assigned to any folder, its xCollectionID is zero.
Now run select * from DocMeta
; and see the values for Custom meta fields for items in your repository.
And here's how to add new fields.
How to add new fields
It's easy to add a new metadata fields. Let me walk you though. Let's begin with a simple text field.
Text fields
- Bring up Configuration Manager Administrative Applet. (Expand the Administration Tray and follow the Admin Applets link to bring up a page with Admin Applets. See Chapter 3 if you need a refresher.)
- Click on Add.
- Give it a name and change field properties as you see fit (as shown in the following screenshot):
Click on Update Database Design to commit your changes.
Note
How to make sure your recent changes reflect on the Check In form:
Note
Every time you change meta fields, make sure you publish the schema by selecting Publish Schema from the Options menu in Configuration Manager (as shown in the previous screenshot).
And now let me show you how to add option lists.
Option lists
What if you want to add a drop-down box that displays a list of values to pick from? Here's how you do it. Let's add a dropdown to our newly created text field:
- Bring up Configuration Manager and click on Edit.
- Check the Option List box. Click on Configure to open the Configure Option List dialog (as shown in the following screenshot):
- Click on Edit.
- Type in or paste the values.
- OK the dialogs.
- Publish the schema.
Click on New Check In on the top left.
Voila! The Vendor field now has a dropdown (as shown in the following screenshot):
And what if you need user's to pick a contract for a specific vendor? How can you make a list of contracts refresh every time you pick a new vendor? Let's see this in the following section.
How to add fields that depend on each other
This is a little tricky. Not hard, but it takes a few minutes of preparation. Let me walk you through it. You'll like the result!
We have a Vendors list. Let's add a list of their contract engagements. Oracle UCM calls it Dependent Choice Lists. You can make any number of lists depend on each other. As soon as we get these two connected, you'll see how to add more.
First, we need to create database tables to store the values for both vendors and contracts. It's actually very simple. Begin with creating the database tables.
Creating database tables
To create the database tables carry out the following steps:
- Bring up Configuration Manager.
- Go to the Tables tab and click on Create Table.
- Give the table name and description (as shown in the following screenshot):
- Add these two columns:
Id, int, primary key Name, varchar 100
- Now click on Add Recommended. This adds timestamp fields, needed for replication.
- Click on OK to save the changes.
Create another table for Contracts:
- Call it VendorContracts.
- Add the following columns:
id, int, Primary key
Vendor Id, int
(this will be a link to the Vendors table, a foreign key)Description, varchar 100
- Click on Add Recommended and then on OK to close the dialog and create your table (as shown in the following screenshot):
Note
This is another big advantage of the Content Server. Your super-user Content Server admin is able to safely create tables, views, and database structures for the content server WITHOUT A DBA! It is safe and easy for them to do so, and the interface helps to protect users from making dangerous mistakes.
We're done creating tables! Now you need to link them. How? By creating Views.
Creating Views
- In Configuration Manager select the Views tab and click on the Add button to open the Add View dialog (as shown in the following screenshot):
- Select the Vendors table and click on Next.
- Place checkmarks against id and Name so you can use them for your metadata values. Then click on Finish to proceed (see the following screenshot):
- Name it VendorsView and add a description.
- Pick id as Internal Column and Name as Visible Column. This way you will be storing Vendor ID in the database as a metadata value while your users will see vendor name.
- OK the dialog. Your view is now created (as shown in the following screenshot):
- Repeat steps one to four to create another view for the
Contracts
table. Call itVendorContractsView
. Make sure you make all three columns visible —id, vendorId
, andDescription
.
Congratulations! Your views are now created. You're almost ready to put your dependent fields on the form. The last preparation is defining the relationships.
Defining relationships
This one will only take a few seconds. In Configuration Manager, go to the Relationships tab and click on Add.
Give it a name and pick Parent and Child views and fields (as shown in the following screenshot):
Now you're ready to create drop-down fields. I'll also show you another neat, brand-new way of doing it with Content Server 10G R3 — tree views.
Populating option lists
Wait! What good will these fields do to us if they have no values to display? Let's put the values in real quick.
My personal favorite is the batch edit feature. It allows you to put in hundreds of values at once, even paste from Excel. Here's how you do it.
In Configuration Manager select the view where you need to add or edit values. Click on Edit Values... on the bottom right (as shown in the following screenshot):
Click on Edit Batch on the bottom right. A simple text box comes up (as shown in the following screenshot):
Just type in or paste your values. They need to be separated by a pipe character, the one above the back slash on most keyboards. It's that simple. If you need to put Oracle with ID of 1 then simply type:
1|Oracle
The header row shows you an example. Just paste your value below it and OK the dialogs. Ready?
Now put in the values for VendorContractsView
. You can add spaces and tabs if you like so it's easier to edit (as shown in the following screenshot):
Done! Let's put the fields on the form now. Seriously!
Putting the fields on the form
We already have a Vendor field. Let's just edit it so it uses the VendorsView:
- In Configuration Manager go to Information Fields and select Vendor.
- Click on Edit.
- Check the Enable Option List box and click on the Configure button next to it.
- Select Use View and pick VendorsView.
- OK the dialogs to complete the edit.
Now let's add a field for vendor contracts.
- In configuration Manager, click on Add. Type Contract for the field name.
- Check the Enable Option List box and click on the Configure button next to it.
- Select Use view and pick VendorContractsView.
- In the bottom portion of the form check the Dependent field box.
- Pick xVendor for Depends on field.
- Pick Vendors_Contracts for the relationship (as shown in the following screenshot):
- You're done! OK the dialogs to complete.
Update Database Design. Publish the schema. Bring up your check-in form. Notice how the options in your Contract field change when you change the selection in the Vendor box (as shown in the following screenshot):
And here's how to handle multiple selections.
Multiple selections
Sometimes you need to select more than one value. For instance, you may engage Oracle on more than one project. So how would you enable that?
Really simple! Just edit the Contracts field in Configuration Manager and change the Option List Type to Multiselect List. That's it! Just publish the schema when you're done (see the following screenshot):
Every time you make a selection from a contract list, a new value is added to the right. The red X next to a value allows users to delete it (see the following screenshot):
And I left the best for the last. Check out how you can create tree views.
Tree views
It's the cool new addition in 10g R3. Instead of two fields for vendors and contracts you can have only one, and still allow multiple selections:
How to enable that?
Just pick Use Tree on the Configure Option List dialog and click on Edit Definition.
All you need to do is pick your first-level view, a relationship, and a second-level view. That's it! And yes, you can still have Option List Type set to Multiselect List.
Perfect! We have defined new metadata fields. Now what?
Well, first of all, you will see them on the Check In screen. Once you check in a new item you will see your new fields and values on the Content Info screen. And you can also use your new fields to find your content.
In the following section I'll show you how to find content quickly.