public class CustConfig
extends java.lang.Object
CustConfig holds configuration information for customizations.
Specifically it maintains two lookup tables, one for customization classes
and another one for customization settings. See the declarative
configuration example below to get an overview of these lookup tables.
The ordered list of customization classes are keyed by three parameters:
The ordered list of customization settings is keyed by one parameter:
Both lists are honored in the order they are declared. For eg: if there are configurations for "/myproduct/package1/" and "/myproduct/" configured in that order, then configurations in "/myproduct/package1/" will overrride any configurations specified in "/myproduct/".
Configuring Customization Classes
Customization class layers should be configured in the order that the
application wants it to be applied. For eg: if Site and User customization
classes are configured in that order for package "/myproduct/" then,
when a document "/myproduct/page1.xml" is fetched from MDS, MDS will
first apply Site level customization followed by User level customization
to construct the full customized document and return the same.
The last layer of customization class is treated as Tip layer. What this means is, when a document "/myproduct/page1.xml" is modified and saved into MDS, MDS will save the modification or customization as User (and not as Site) layer customization because User is the tip layer in the above configuration example.
Enabling Customization
By default customizations are disabled for MDS Objects. Customization can be
enabled at a package level using CustSettings.
See CustomizationPolicyProvider
to understand how enabling customization at package level works
in conjunction with FileTypeConfig and other mechanisms
that are available in MDS for enabling customization.
Enabling Layered Customization
MDS supports fine grained customization of metadata objects for which
content type is configured as ContentType.XML_STRUCTURED or
ContentType.XML_STREAM. This does not require any special
configuration other than enabling customization.
For MDS Objects configured as ContentType.BINARY_STREAM, a special
type of customization called layered customization will be supported if
CustType is specified as 'extension'
in CustSettings.
Note that customization is not supported for
ContentType.TEXT_STREAM.
A typical declarative configuration will be as shown below
<cust-config>
<!-- Ordered list of customization classes -->
<match path="/">
<!-- Configure customization layers in the order they should be
applied. Last one is treated as the tip layer. Any changes to metadata
matching the condition will be saved as customizations at the tip
layer -->
<customization-class name="myproduct.SiteCC"/>
<customization-class name="myproduct.UserCC"/>
</match>
<!-- Ordered list of customization settings -->
<cust-settings path="/myproduct/">
<customization-restrictions customizationAllowed="true"
customizationAllowedBy="admin"/>
<!-- The only supported values for the customization-type attribute
are 'extension' and 'full-replace' although 'full-replace' has been
deprecated in favour of 'extension'. If 'extension' is specified then
the streamBuilder attribute should also be supplied.
customization-type applies only to MDS objects with content type
configured as BINARY_STREAM. For metadata objects with all other
content types customization-type configuration will be ignored. -->
<customization-options customization-type="extension"
streamBuilder="oracle.apps.StreamBuilder"/>
</cust-settings>
</cust-config>
CustomizationClass,
CustClassList,
CustSettings,
MDSConfig| Modifier and Type | Field and Description |
|---|---|
static CustConfig |
NO_CUSTOMIZATIONS |
| Constructor and Description |
|---|
CustConfig(CustClassListMapping[] custClassListMappings)
Create a customization configuration object with programmatically created
configuration information.
|
CustConfig(CustClassListMapping[] custClassListMappings,
oracle.mds.config.CustSettingsMapping[] custSettingsMappings)
Create a customization configuration object with programmatically created
configuration information.
|
CustConfig(oracle.mds.config.CustSettingsMapping[] custSettingsMappings)
Create a customization configuration object with programmatically created
configuration information.
|
CustConfig(org.w3c.dom.Element configXML)
Create a customization configuration object based on the MDS XML
customization configuration information contained in the
given DOM XML Element.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Returns true if passed a CustConfig with equivalent
mappings to this one.
|
oracle.mds.config.CustSettings |
findCustSettings(java.lang.String path)
Find a CustSettings mapping entry which matches the given criteria.
|
CustClassList |
findMapping(java.lang.String path,
java.lang.String namespace,
java.lang.String localName)
Find a CustClassList mapping entry which matches the given criteria.
|
CustClassListMapping[] |
getMappings()
Returns all the customization class list mappings for this configuration.
|
int |
hashCode() |
public static final CustConfig NO_CUSTOMIZATIONS
public CustConfig(CustClassListMapping[] custClassListMappings) throws oracle.mds.config.MDSConfigurationException
custClassListMappings - A list of mappings which will be applied
in order to determine which customization class list is
used to work out the customization layers to apply.oracle.mds.config.MDSConfigurationException - if an invalid mapping is found or the list has
duplicate keyspublic CustConfig(oracle.mds.config.CustSettingsMapping[] custSettingsMappings)
throws oracle.mds.config.MDSConfigurationException
custSettingsMappings - A list of CustSettingsMapping
objects.oracle.mds.config.MDSConfigurationException - if an invalid mapping is found or the list has
duplicate keyspublic CustConfig(CustClassListMapping[] custClassListMappings, oracle.mds.config.CustSettingsMapping[] custSettingsMappings) throws oracle.mds.config.MDSConfigurationException
custClassListMappings - A list of mappings which will be applied
in order to determine which customization class list is
used to work out the customization layers to apply.custSettingsMappings - A list of CustSettingsMapping
objects.oracle.mds.config.MDSConfigurationException - if an invalid mapping is found or the list has
duplicate keyspublic CustConfig(org.w3c.dom.Element configXML)
throws oracle.mds.config.MDSConfigurationException
configXML - - an element containing customization configuration
information. Must have a value.oracle.mds.config.MDSConfigurationException - If an invalid Customization configuration
is specified.public boolean equals(java.lang.Object obj)
NO_CUSTOMIZATIONS then the other
must also be a NO_CUSTOMIZATIONS
for them to be considered equivalent.
Otherwise two CustConfigs are considered equal if their
CustClassListMapping arrays are equal. Two
CustClassListMapping arrays are deemed equal if both arrays
contain the same number of mappings, and all corresponding
pairs of mappings in the two arrays are equal - so the mappings
in the arrays must be in the same order. If both arrays
are null they are also considered equal.
In other words, two mappings m1 and m2 are equal
if (m1==null ? m2==null : m1.equals(m2)). The equality of
corresponding CustClassListMappings between two arrays is determined by
CustClassListMapping.equals(Object).equals in class java.lang.Objectobj - Object with which to compare this onepublic CustClassList findMapping(java.lang.String path, java.lang.String namespace, java.lang.String localName)
A null parameter is assumed to match anything. A non-null namespace or local name will have to match exactly, or will match an entry with a null value. Path keys will match null values or a mapping which matches exactly or matches any parent package.
path - - an MDS package name or MDS object namenamespace - - the XML namespace (optional)localName - - the local name of the top level element (optional)public CustClassListMapping[] getMappings()
public oracle.mds.config.CustSettings findCustSettings(java.lang.String path)
A null parameter is assumed to match anything. Path keys will match null values or a mapping which matches exactly or matches any parent package.
path - - an MDS package name or MDS object namepublic int hashCode()
hashCode in class java.lang.Object