Skip Headers
Oracle® Fusion Middleware Integration Guide for Oracle Enterprise Repository
11g Release 1 (

Part Number E15754-13
Go to Documentation Home
Go to Book List
Book List
Go to Table of Contents
Go to Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Go to next page
PDF · Mobi · ePub

18 CMF Entry Type API

This chapter provides a use case for the CMF Entry Type API and describes how to add a new CMF entry type to Oracle Enterprise Repository and assign an existing CMF entry type to an asset.

This chapter includes the following sections:

18.1 Overview

CMF Entry Types describe metadata that may be attached to assets. CMF Entry Types are identified by an ID and a single name string.

Validation - When saving a CMF Entry Type, Oracle Enterprise Repository currently validates that:

Related Subsystems

A CMF Entry is linked to an asset from the perspective of the asset. CMF Entry Types define parameters for these entries.

Additional Import(s) Required

import com.flashline.registry.openapi.entity.MetadataEntryTypeSummary;
import com.flashline.registry.openapi.query.MetadataEntryTypeCriteria;

18.2 Use Case

This section describes the use case using the CMF Entry Type API. It contains the following topics:

18.2.1 Use Case: Manipulating CMF Entry Types


  • Adding a new CMF Entry Type to Oracle Enterprise Repository.

  • Assigning an existing CMF Entry Type to an asset.

Sample Code

Example 18-1 Use Case: Manipulate CMF Entry Types

package com.flashline.sample.metadataentrytypeapi;
import java.rmi.RemoteException;
import javax.xml.rpc.ServiceException;
import com.flashline.registry.openapi.base.OpenAPIException;
import com.flashline.registry.openapi.entity.AuthToken;
import com.flashline.registry.openapi.entity.MetadataEntryTypeSummary;
import com.flashline.registry.openapi.query.MetadataEntryTypeCriteria;
import com.flashline.registry.openapi.service.v300.FlashlineRegistry;
public class MetadataEntryTypes {
  public static void main(String pArgs[]) throws OpenAPIException,
      ServiceException {
    try {
      // Connect to Oracle Enterprise Repository
      URL lURL = null;
      lURL = new URL(pArgs[0]);
      FlashlineRegistry repository = new
      // //////////////////////////////
      // Authenticate with OER
      // //////////////////////////////
      AuthToken authToken = repository.authTokenCreate(pArgs[1],pArgs[2]);
      // -----------------------------------------
      // Create a new CMF Entry Type
      String newMetadataEntryTypeName = "Sample MetadataEntryType";
      MetadataEntryTypeSummary newMetadataEntryType =
 repository.metadataEntryTypeCreate(authToken, newMetadataEntryTypeName);
      System.out.println("The new MetadataEntryType id =\"" +
 newMetadataEntryType.getID() + "\"");
      // -----------------------------------------
      // Find a CMF Entry Type
      MetadataEntryTypeCriteria criteria = new MetadataEntryTypeCriteria();
      MetadataEntryTypeSummary[] metadataEntryTypes =
 repository.metadataEntryTypeQuery(authToken, criteria);
      long myMetadataEntryTypeID = metadataEntryTypes[0].getID();
      // -----------------------------------------
      // Read a CMF Entry Type
      MetadataEntryTypeSummary readMetadataEntryType =
 repository.metadataEntryTypeRead(authToken, myMetadataEntryTypeID);
      System.out.println("The MetadataEntryType name =\"" +
 readMetadataEntryType.getName() + "\"");
      // -----------------------------------------
      // Delete a CMF Entry Type
      repository.metadataEntryTypeDelete(authToken, myMetadataEntryTypeID);
    } catch (OpenAPIException lEx) {
      System.out.println("ServerCode = " + lEx.getServerErrorCode());
      System.out.println("Message    = " + lEx.getMessage());
    } catch (RemoteException lEx) {
    } catch (ServiceException lEx) {
    } catch (MalformedURLException lEx) {