Oracle Fusion Middleware Java API Reference for Oracle ADF Controller
11g Release 2 (11.1.2.0.0)

E17480-01

oracle.adf.controller.metadata
Class MetadataService

java.lang.Object
  extended by oracle.adf.controller.metadata.MetadataService

public abstract class MetadataService
extends java.lang.Object

An interface to the ADFc metadata service.. There may be different sources of metadata. To support this different MetadataResourceProviders may be pluged into this service the provide metadata from different sources.

The default MetadataResourceProviders uses MDS. A different metadata resource provider can be configured by setting the system property oracle.adfinternal.controller.metadata_provider to the fully qualified class name of a class that extends this class.

Metadata is initially loaded from a collection of ADF metadata resources. This collection of ADFc resources is constructed using the following search rules:

Once the ADFc resources are loaded they may contain references to metadata objects that reside in other resources. ADFc metadata resources are used to construct a model for unnbounded task flow. Metadata for bounded task flows is loaded on demand.


Constructor Summary
MetadataService()
           
 
Method Summary
abstract  boolean addAdfcConfig(org.w3c.dom.Document document)
          Adds top level adfc-config element to the existing DOM document.
abstract  Activity getActivity(ActivityId id)
          Get an activity with a given ID.
abstract  java.util.List<java.lang.String> getAdfcResourceNames()
          Returns a list of all the names of loaded ADFc unbounded task flow definition files.
abstract  PageFlow getAdfPageFlow()
          Get the unbounded ADF page flow.
static MetadataService getInstance()
           
static MetadataService getInstance(MetadataResourceProvider provider, AdfcResourceNameProvider resourceNameProvider)
          Metadata service based on a specific providers.
abstract  MetadataResource getMutableMetadataResource(java.lang.String resourceName, boolean useCustomizations, boolean skipIntegrityValidation)
          Returns a metadata resource that can be mutated.
abstract  TaskFlowDefinition getTaskFlowDefinition(TaskFlowId id)
          Get a task flow definition.
abstract  TaskFlowDefinition getTaskFlowTemplate(TaskFlowId id)
          Get a task flow template.
abstract  void reinitialize(java.util.List<java.lang.String> resources)
           
static void setFactory(MetadataServiceFactory metadataServiceFactory)
          Specifies a MetadataServiceFactory to be used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetadataService

public MetadataService()
Method Detail

addAdfcConfig

public abstract boolean addAdfcConfig(org.w3c.dom.Document document)
Adds top level adfc-config element to the existing DOM document. adfc-config element must be present before any DT@RT operations are performed.

Parameters:
document - a DOM document
Returns:
true, if adfc-config element was successfully added, false otherwise.

getInstance

public static MetadataService getInstance()
Returns:
a singleton MetadataService instance for this application.

getInstance

public static MetadataService getInstance(MetadataResourceProvider provider,
                                          AdfcResourceNameProvider resourceNameProvider)
Metadata service based on a specific providers.

Parameters:
provider - metadata resource provider
resourceNameProvider - adfc resource name provider
Returns:
a singleton MetadataService instance for this application.

setFactory

public static void setFactory(MetadataServiceFactory metadataServiceFactory)
Specifies a MetadataServiceFactory to be used. Must be called before any usage of getInstance method.

Parameters:
metadataServiceFactory - an instance of MetadataServiceFactory

getActivity

public abstract Activity getActivity(ActivityId id)
Get an activity with a given ID.

Parameters:
id - activity ID
Returns:
the requested activity or null if it could not be found.

getAdfPageFlow

public abstract PageFlow getAdfPageFlow()
Get the unbounded ADF page flow. This is the page flow that exists outside of all task flows.

Returns:
the ADF page flow.

getTaskFlowDefinition

public abstract TaskFlowDefinition getTaskFlowDefinition(TaskFlowId id)
Get a task flow definition.

Parameters:
id - the ID of the task flow definition.
Returns:
the requested task flow definition or null if it could not be found.

getTaskFlowTemplate

public abstract TaskFlowDefinition getTaskFlowTemplate(TaskFlowId id)
Get a task flow template.

Parameters:
id - the ID of the task flow template.
Returns:
the requested task flow template definition or null if it could not be found.

getMutableMetadataResource

public abstract MetadataResource getMutableMetadataResource(java.lang.String resourceName,
                                                            boolean useCustomizations,
                                                            boolean skipIntegrityValidation)
Returns a metadata resource that can be mutated. Any changes to ADFc metadata should be done using this resource. The changes are not going to be visible to ADFc runtime until they are commited, on the next request. If the MetadataResourceProvider does not support updating, returns null.

Parameters:
resourceName - the name of XML document that represents the metadata, for example, "/WEB-INF/adfc-config.xml".
useCustomizations - a boolean flag that indicates whether customizations should be loaded with the base document, and whether changes to the metadata resource should be saved as a customization.
skipIntegrityValidation - if true, the Controller will not attempt to validate whether modifications to this resource preseve its integrity. For example, if integratity validation is skipped, it is possible to add a control flow rule for which the source or target activities do not exists. All validations are peformed against the document model that existed at the beginning of the request. This flag should be used so that multiple artifacts can be added to ADFc model in a single request, such as a view activity and a corresponding control flow rule. This flag does not disable all of the validation logic, however, only the logic that depends on the current document context.
Returns:
mutable metadata resource or null, if resource corresponding to this name cannot be found or the metadata provider does not support update.

reinitialize

public abstract void reinitialize(java.util.List<java.lang.String> resources)
Parameters:
resources - a list of bootstrap metadata resource files

getAdfcResourceNames

public abstract java.util.List<java.lang.String> getAdfcResourceNames()
Returns a list of all the names of loaded ADFc unbounded task flow definition files. These are sometimes referred to as bootstrap configuration files. Some of the file names may correspond to a resource that occurrs multiple times. For example, /META-INF/adfc-config.xml.

Returns:
a list of bootstrap configuration files

Oracle Fusion Middleware Java API Reference for Oracle ADF Controller
11g Release 2 (11.1.2.0.0)

E17480-01

Copyright © 1997, 2011, Oracle. All rights reserved.