Oracle Fusion Middleware extensions for Seed Data Framework
11g Release 1 (11.1.2)

E22564-02

oracle.apps.fnd.applseed.config.util
Class SDUtil

java.lang.Object
  extended by oracle.apps.fnd.applseed.config.util.SDUtil

public final class SDUtil
extends java.lang.Object

Utility class for Seed Data Configuration. Class contains a collection of static methods that are designtime specific.


Nested Class Summary
static class SDUtil.StringNumericComparator
          Static class to support sort of strings so that the numbers at the end of the string are given numeric weightage.
 
Method Summary
static boolean checkConnectionAvailability(oracle.jbo.dt.objects.JboApplication app)
          Check project defined connection validity.
static void createHint(java.lang.String key, java.lang.String value, oracle.jbo.dt.objects.JboNamedObject jbo)
          Method creates property on the JboNamedObject jbo with key and value.
static java.lang.String format(java.lang.Class cls, java.lang.String key, java.lang.Object[] args)
          Format the resource value that is returned for the key using the array of objects as parameters.
static java.lang.String format(java.lang.Class cls, java.lang.String key, java.lang.String param)
          Format the resource value that is returned for the key using param.
static java.lang.String getDecodedHint(java.lang.String key, oracle.jbo.dt.objects.JboNamedObject jbo)
          Method returns hint string from the named object for provided key.
static java.lang.StringBuilder getDefinition(oracle.jbo.dt.objects.JboBaseObject as)
          Method returns the xml file contexts of the definition file of the JboBaseObject with the dtd reference removed.
static java.lang.StringBuilder getDefinition(java.net.URL url)
          Method returns the xml file contexts of the definition file identified by the url with the dtd reference removed.
static java.lang.String getHint(java.lang.String key, oracle.jbo.dt.objects.JboNamedObject jbo)
          Method returns property value for the named object.
static java.util.List getHintKeysContaining(java.lang.String matchString, oracle.jbo.dt.objects.JboNamedObject jbo)
          Get list of property keys of the JboObject that have the given matchString.
static java.util.List getHintKeysWithPrefix(java.lang.String prefix, oracle.jbo.dt.objects.JboNamedObject jbo)
          Get list of property keys of the JboObject that have the given prefix.
static java.util.List getHintKeysWithValue(java.lang.String value, oracle.jbo.dt.objects.JboNamedObject jbo)
          Get list of property keys of the JboObject that have the given value.
static java.util.Map<java.lang.String,java.lang.String> getHintsMapWithKeyPrefix(java.lang.String prefix, oracle.jbo.dt.objects.JboNamedObject jbo)
          Get map of properties of the JboObject that have the given prefix.
static java.util.List getHintsWithKeyPrefix(java.lang.String prefix, oracle.jbo.dt.objects.JboNamedObject jbo)
          Get list of properties of the JboObject that have the given prefix.
static java.util.List getHintsWithKeyValue(java.lang.String value, oracle.jbo.dt.objects.JboNamedObject jbo)
          Get list of properties of the JboObject that have the given value.
static java.lang.String getIdentifierKey(java.lang.String keyBase, SDWizard wiz)
          Method returns key with driver view identifier embedded.
static java.lang.String getIdentifierKey(java.lang.String keyBase, java.lang.String ident)
          Method returns key with driver view identifier embedded.
static java.lang.String getKey(java.lang.String paramContext, java.lang.Object obj)
          Returns key based on the context and object.
static oracle.jbo.dt.objects.JboViewAttr getNewViewAttr(oracle.jbo.dt.objects.JboViewAttr inAttr, oracle.jbo.dt.objects.JboViewReference voRef)
          Method constructs a new attribute as a clone of passed attribute.
static org.w3c.dom.NodeList getNodesByTag(java.lang.StringBuilder buff, java.lang.String tag)
          Method retuns all xml nodes with the tag name, in the StringBuffer buff.
static java.util.List getPropertiesForKey(java.lang.String beginsWith, java.net.URL url)
          Deprecated. use BC4J classes to access properties
static java.lang.String getPropertyValue(java.lang.String key, java.net.URL url)
          Deprecated. use BC4J classes to access properties
static oracle.jbo.dt.objects.JboAppModule getReferenceAM(oracle.jbo.dt.objects.JboAppModule am, oracle.jbo.dt.objects.JboViewReference vRef)
          Method returns the Application module that contains the reference View Object.
static java.lang.String getResourceForString(java.lang.Class cls, java.lang.String key)
          Method returns string from the resource bundle belonging to class cls for the given key.
static java.util.List<java.lang.String> getSortedHintKeysWithPrefix(java.lang.String prefix, oracle.jbo.dt.objects.JboNamedObject jbo)
          Get sorted list of property keys of the JboObject that have the given prefix.
static java.util.List<java.lang.String> getSortedHintKeysWithValue(java.lang.String value, oracle.jbo.dt.objects.JboNamedObject jbo)
          Get sorted list of property keys of the JboObject that have the given value.
static java.lang.String getStackTrace(java.lang.Exception e)
          Method generates inforamtion on the exception.
static boolean isAssociationContained(oracle.jbo.dt.objects.JboViewLinkUsage vlu)
          The Entities participating in the ViewLink are examined for associations.
static boolean isSuperAttr(oracle.jbo.dt.objects.JboAppModule am, oracle.jbo.dt.objects.JboViewAttr attr)
          Is this attribute defined in super view.
static boolean isSuperAttr(oracle.jbo.dt.objects.JboView vo, oracle.jbo.dt.objects.JboViewAttr attr)
          Is this attribute defined in super view.
static boolean isViewEntityBased(oracle.jbo.dt.objects.JboViewReference voRef)
          Method tests for view object reference being entity based.
static oracle.jbo.dt.objects.JboViewAttr locateTreeViewAttribute(javax.swing.ListModel listModel, java.lang.String refName, java.lang.String attrName)
          Method returns the attribute of the View Object in the AM model for the given attribute name.
static void removeHintsContaining(java.lang.String matchString, oracle.jbo.dt.objects.JboNamedObject jbo)
          Remove properties of the jbo object that have a key with given match string.
static void removeHintsWithPrefix(java.lang.String prefix, oracle.jbo.dt.objects.JboNamedObject jbo)
          Remove properties of the jbo object that have a key with given prefix.
static void removeHintsWithValue(java.lang.String value, oracle.jbo.dt.objects.JboNamedObject jbo)
          Remove properties of the jbo object that have a key with given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getStackTrace

public static java.lang.String getStackTrace(java.lang.Exception e)
Method generates inforamtion on the exception.

Parameters:
e - Exception to generate information on
Returns:
Stirng with inforamtion on exception

createHint

public static void createHint(java.lang.String key,
                              java.lang.String value,
                              oracle.jbo.dt.objects.JboNamedObject jbo)
Method creates property on the JboNamedObject jbo with key and value.

Parameters:
key - key of the created property
value - value of the created property
jbo - JboNamedObject that will contain the property

getDecodedHint

public static java.lang.String getDecodedHint(java.lang.String key,
                                              oracle.jbo.dt.objects.JboNamedObject jbo)
Method returns hint string from the named object for provided key. The string is UTF-8 decoded.

Parameters:
key - key of the hint string
jbo - JboNamedObject that contains the Hint
Returns:
The decoded value or hint corresponding to the key

getHint

public static java.lang.String getHint(java.lang.String key,
                                       oracle.jbo.dt.objects.JboNamedObject jbo)
Method returns property value for the named object.

Parameters:
key - key of the property
jbo - JboNamedObject that contains the property
Returns:
returns value of the property

checkConnectionAvailability

public static boolean checkConnectionAvailability(oracle.jbo.dt.objects.JboApplication app)
Check project defined connection validity.

Parameters:
app - Application that will use the connection
Returns:
true if the connection is valid

removeHintsWithPrefix

public static void removeHintsWithPrefix(java.lang.String prefix,
                                         oracle.jbo.dt.objects.JboNamedObject jbo)
Remove properties of the jbo object that have a key with given prefix.

Parameters:
prefix - of keys that will be removed
jbo - object whose properties need to be removed

removeHintsWithValue

public static void removeHintsWithValue(java.lang.String value,
                                        oracle.jbo.dt.objects.JboNamedObject jbo)
Remove properties of the jbo object that have a key with given value. Done only for surrogate attributes.Refer to Bug No:8298804.

Parameters:
value - of keys that will be removed
jbo - object whose properties need to be removed

removeHintsContaining

public static void removeHintsContaining(java.lang.String matchString,
                                         oracle.jbo.dt.objects.JboNamedObject jbo)
Remove properties of the jbo object that have a key with given match string.

Parameters:
matchString - of keys that will be removed
jbo - object whose properties need to be removed

getHintKeysWithPrefix

public static java.util.List getHintKeysWithPrefix(java.lang.String prefix,
                                                   oracle.jbo.dt.objects.JboNamedObject jbo)
Get list of property keys of the JboObject that have the given prefix.

Parameters:
prefix - of property keys that will be returned
jbo - JboObject whose keys will be returned.
Returns:
List of property keys that have the give prefix

getHintKeysWithValue

public static java.util.List getHintKeysWithValue(java.lang.String value,
                                                  oracle.jbo.dt.objects.JboNamedObject jbo)
Get list of property keys of the JboObject that have the given value. Done only for surrogate attributes.Refer to Bug No:8298804.

Parameters:
value - of property keys that will be returned
jbo - JboObject whose keys will be returned.
Returns:
List of property keys that have the give value

getHintKeysContaining

public static java.util.List getHintKeysContaining(java.lang.String matchString,
                                                   oracle.jbo.dt.objects.JboNamedObject jbo)
Get list of property keys of the JboObject that have the given matchString.

Parameters:
matchString - of property keys that will be returned
jbo - JboObject whose keys will be returned.
Returns:
List of property keys that have the given matching string

getSortedHintKeysWithPrefix

public static java.util.List<java.lang.String> getSortedHintKeysWithPrefix(java.lang.String prefix,
                                                                           oracle.jbo.dt.objects.JboNamedObject jbo)
Get sorted list of property keys of the JboObject that have the given prefix.

Parameters:
prefix - of property keys that will be returned
jbo - JboObject whose keys will be returned.
Returns:
Sorted list of property keys that have the give prefix

getSortedHintKeysWithValue

public static java.util.List<java.lang.String> getSortedHintKeysWithValue(java.lang.String value,
                                                                          oracle.jbo.dt.objects.JboNamedObject jbo)
Get sorted list of property keys of the JboObject that have the given value. Done only for surrogate attributes.Refer to Bug No:8298804.

Parameters:
value - of property keys that will be returned
jbo - JboObject whose keys will be returned.
Returns:
Sorted list of property keys that have the give value

getHintsMapWithKeyPrefix

public static java.util.Map<java.lang.String,java.lang.String> getHintsMapWithKeyPrefix(java.lang.String prefix,
                                                                                        oracle.jbo.dt.objects.JboNamedObject jbo)
Get map of properties of the JboObject that have the given prefix.

Parameters:
prefix - of properties that will be returned
jbo - JboObject whose properties will be returned.
Returns:
Map of properties that have keys with the give prefix

getHintsWithKeyPrefix

public static java.util.List getHintsWithKeyPrefix(java.lang.String prefix,
                                                   oracle.jbo.dt.objects.JboNamedObject jbo)
Get list of properties of the JboObject that have the given prefix.

Parameters:
prefix - of properties that will be returned
jbo - JboObject whose properties will be returned.
Returns:
List of properties that have keys with the give prefix

getHintsWithKeyValue

public static java.util.List getHintsWithKeyValue(java.lang.String value,
                                                  oracle.jbo.dt.objects.JboNamedObject jbo)
Get list of properties of the JboObject that have the given value. Done only for surrogate attributes.Refer to Bug No:8298804.

Parameters:
value - of properties that will be returned
jbo - JboObject whose properties will be returned.
Returns:
List of properties that have keys with the give value

getDefinition

public static java.lang.StringBuilder getDefinition(java.net.URL url)
                                             throws java.lang.Exception
Method returns the xml file contexts of the definition file identified by the url with the dtd reference removed.

Parameters:
url - Url of the definition file
Returns:
StringBuffer containing the metadata
Throws:
java.lang.Exception - throws exceptions that happen in the method

getIdentifierKey

public static java.lang.String getIdentifierKey(java.lang.String keyBase,
                                                java.lang.String ident)
Method returns key with driver view identifier embedded.

Parameters:
keyBase - base key
ident - identifier
Returns:
reconstructed key

getIdentifierKey

public static java.lang.String getIdentifierKey(java.lang.String keyBase,
                                                SDWizard wiz)
Method returns key with driver view identifier embedded. The wizard provides the identifier fragment.

Parameters:
keyBase - base key
wiz - wizard
Returns:
reconstructed key

getDefinition

public static java.lang.StringBuilder getDefinition(oracle.jbo.dt.objects.JboBaseObject as)
                                             throws java.lang.Exception
Method returns the xml file contexts of the definition file of the JboBaseObject with the dtd reference removed.

Parameters:
as - JboObject whose metadata is required
Returns:
StringBuffer containing the metadata
Throws:
java.lang.Exception - throws exceptions that are generated during definition

getNodesByTag

public static org.w3c.dom.NodeList getNodesByTag(java.lang.StringBuilder buff,
                                                 java.lang.String tag)
                                          throws java.lang.Exception
Method retuns all xml nodes with the tag name, in the StringBuffer buff.

Parameters:
buff - StringBuffer that contains the xml fragment
tag - name of the nodes that need to be returned
Returns:
NodeList containing the required xml nodes
Throws:
java.lang.Exception - Exception throws exceptions that are generated during node discovery

getPropertyValue

public static java.lang.String getPropertyValue(java.lang.String key,
                                                java.net.URL url)
Deprecated. use BC4J classes to access properties

Method returns property value from the xml file urls. The property is is expected in a Property node with attributes Name and Value.

Parameters:
key - Key of the property to be extracted
url - URL of the xml file that contains the Property node.
Returns:
Value of the property

getPropertiesForKey

public static java.util.List getPropertiesForKey(java.lang.String beginsWith,
                                                 java.net.URL url)
Deprecated. use BC4J classes to access properties

Method returns ArrayList containing values for keys that start with beginsWith. The properties are expected to be in Property node with attributes Name and Value.

Parameters:
beginsWith - key initial part
url - URL of the xml file that contains the Property node.
Returns:
ArrayList containing the String values of the properties.

getReferenceAM

public static oracle.jbo.dt.objects.JboAppModule getReferenceAM(oracle.jbo.dt.objects.JboAppModule am,
                                                                oracle.jbo.dt.objects.JboViewReference vRef)
Method returns the Application module that contains the reference View Object.

Parameters:
am - Seed Application Module.
vRef - reference view object
Returns:
Application Module that contains the reference view object.

isAssociationContained

public static boolean isAssociationContained(oracle.jbo.dt.objects.JboViewLinkUsage vlu)
The Entities participating in the ViewLink are examined for associations. If the association is contained, true is removed.

Parameters:
vlu - ViewLinkUsage that will be examined for containment
Returns:
true if association between the entities is contained

getKey

public static java.lang.String getKey(java.lang.String paramContext,
                                      java.lang.Object obj)
Returns key based on the context and object. If the object is null, the method returns null. If the object is an instance of JboViewLinkUsage, The destination ViewReference name is appended to the context to form the key. Else, if the object is a NamedObject, the name of the NamedObject is appended to the context. Else, the toString result of the object is appended to the context.

Parameters:
paramContext - the key context
obj - for which the key should be constructed
Returns:
key that is constructed based on context and object

locateTreeViewAttribute

public static oracle.jbo.dt.objects.JboViewAttr locateTreeViewAttribute(javax.swing.ListModel listModel,
                                                                        java.lang.String refName,
                                                                        java.lang.String attrName)
Method returns the attribute of the View Object in the AM model for the given attribute name.

Parameters:
listModel - List Model containing the list of attributes
refName - Attribute name qualified by the View Object name
attrName - Attribute name
Returns:
returns ViewAttribute corresponding to attribute name

getNewViewAttr

public static oracle.jbo.dt.objects.JboViewAttr getNewViewAttr(oracle.jbo.dt.objects.JboViewAttr inAttr,
                                                               oracle.jbo.dt.objects.JboViewReference voRef)
Method constructs a new attribute as a clone of passed attribute.

Parameters:
inAttr - Attribute to be cloned
voRef - View Object containing the attribute
Returns:
returns cloned attribute

isViewEntityBased

public static boolean isViewEntityBased(oracle.jbo.dt.objects.JboViewReference voRef)
Method tests for view object reference being entity based.

Parameters:
voRef - ViewObjectReference to be checked
Returns:
returns true if the object is based on Entity Object

getResourceForString

public static java.lang.String getResourceForString(java.lang.Class cls,
                                                    java.lang.String key)
Method returns string from the resource bundle belonging to class cls for the given key. This method is an adaptor method to handle resources of type ListResourceBundle as well ArrayResourceBundle.

Parameters:
cls - Class of the ResourceBundle
key - Resource key
Returns:
Resource value

format

public static java.lang.String format(java.lang.Class cls,
                                      java.lang.String key,
                                      java.lang.Object[] args)
Format the resource value that is returned for the key using the array of objects as parameters. MessageFormat class is used to perform the format.

Parameters:
cls - ResourceBundle class
key - Resource key
args - parameters used to format the resource value
Returns:
formatted resource value

format

public static java.lang.String format(java.lang.Class cls,
                                      java.lang.String key,
                                      java.lang.String param)
Format the resource value that is returned for the key using param. MessageFormat class is used to perform the format.

Parameters:
cls - ResourceBundle class
key - Resource key
param - parameter used to format the resource value
Returns:
formatted resource value

isSuperAttr

public static boolean isSuperAttr(oracle.jbo.dt.objects.JboView vo,
                                  oracle.jbo.dt.objects.JboViewAttr attr)
Is this attribute defined in super view.

Parameters:
vo - view object
attr - attribute
Returns:
true if attribute is super attribute

isSuperAttr

public static boolean isSuperAttr(oracle.jbo.dt.objects.JboAppModule am,
                                  oracle.jbo.dt.objects.JboViewAttr attr)
Is this attribute defined in super view.

Parameters:
am - application module
attr - attribute
Returns:
true if attribute is super attribute

Oracle Fusion Middleware extensions for Seed Data Framework
11g Release 1 (11.1.2)

E22564-02

Copyright © 2011 Oracle. All Rights Reserved.