wt.iba.value.service
Class LoadValue

java.lang.Object
  extended bywt.iba.value.service.LoadValue

public class LoadValue
extends Object


Field Summary
private static String CURRENT_IBA_CONTAINER
           
private static String CURRENT_IBA_CONTAINER_BASE_NAME
           
private static String CURRENT_IBA_CONTAINER_DEPENDENCIES
           
private static String CURRENT_IBA_CONTAINER_NAME
           
private static String CURRENT_IBA_CONTAINER_STATUS
           
private static String CURRENT_IBAHOLDER
           
private static String CURRENT_IBAHOLDER_REFVALUES
           
private static String CURRENT_IBAHOLDER_STATUS
           
private static IBAValueDBServiceInterface dbService
           
private static String DEFAULT_IBA_CONTAINER
           
private static Hashtable REFERENCEABLE_CACHE
           
private static String SERVICE_NAME
           
private static Boolean STATUS_FAILED
           
private static Boolean STATUS_OKAY
           
private static String THREAD_DEFINITION_CACHE
           
private static boolean VERBOSE
           
 
Constructor Summary
LoadValue()
           
 
Method Summary
private static boolean addReferenceToCache(String dependency_id, ReferenceValueDefaultView reference)
           
private static boolean addReferenceToCache(String definition, String locator, String identifier, ReferenceValueDefaultView reference)
           
static IBAHolder applySoftAttributes(IBAHolder ibaholder)
           
private static IBAHolder applyTypeAttributeDefaults(IBAHolder ibaholder)
           
static boolean beginIBAContainer()
          Programmatic equivalent to BeginIBAContainer load file line.
static boolean beginIBAContainer(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Processes "BeginIBAContainer" lines from a csv load file.
static boolean beginIBAContainer(String name)
          Programmatic equivalent to BeginIBAContainer load file line.
private static void clearCachedContainerValues(String name)
           
private static void clearCachedHolderValues()
           
static AbstractValueView cloneAbstractValueView(AbstractValueView fromAVV, AbstractValueView toAVV)
          Copies the value from fromAVV to toAVV
static boolean createIBAValue(Hashtable nv, Hashtable cmd_line, Vector return_objects)
           
static void createOrUpdateAttributeValueInContainer(DefaultAttributeContainer container, AbstractValueView newAVV)
           
static boolean createOrUpdateIBAValue(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Create or Update IBA Value of a IBAHolder (such as WTPart) If the specified IBA value in the csv load file does not already exist in the IBAHolder, a new IBA value would be created for that IBAHolder.
private static String decodeComma(String str)
           
private static void dumpCache()
           
static boolean endIBAContainer()
          Programmatic access equivalent to EndIBAContainer load file line.
static boolean endIBAContainer(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Processes "EndIBAContainer" lines from a csv load file.
static boolean endIBAHolder(Hashtable nv, Hashtable cmd_line, Vector return_objects)
          Processes "endIBAHolder" lines from a csv load file.
private static boolean establishCachedContainer(String name)
           
static boolean establishCurrentIBAHolder(IBAHolder holder)
           
private static boolean exposeCachedContainer()
           
static AttributeContainer extractDefaultIBAContainer()
          Extract the default IBA AttributeContainer from the cache.
static AttributeContainer extractIBAContainer(String name)
          Extract the an IBA AttributeContainer from the loaders method context cache.
static AbstractAttributeDefinizerView getCachedAttributeDefinition(String definition_path)
           
private static IBAHolder getCachedHolder()
           
private static Boolean getCachedHolderStatus()
           
static ReferenceValueDefaultView getCachedReferenceValue(String dependency_id)
           
static ReferenceValueDefaultView getCachedReferenceValue(String dependent_definition, String dependent_locator, String dependent_identifier)
           
private static Object getCacheValue(String key)
           
private static Hashtable getContextCache()
           
private static AttributeContainer getCurrentCachedContainer()
           
private static String getCurrentCachedContainerName()
           
private static Boolean getCurrentCachedContainerStatus()
           
static IBAHolder getCurrentIBAHolder()
           
static IBAReferenceable getIBAReferenceable(String locator_name, String identifier)
           
private static void initTypeDefinitions()
           
private static AbstractValueView internalCreateValue(AbstractAttributeDefinizerView def, String value1, String value2)
           
static AbstractValueView newBooleanValue(AbstractAttributeDefinizerView def, String s_value)
           
static AbstractValueView newFloatValue(AbstractAttributeDefinizerView def, String s_value, String s_precision)
           
static AbstractValueView newIntegerValue(AbstractAttributeDefinizerView def, String svalue)
           
static AbstractValueView newRatioValue(AbstractAttributeDefinizerView def, String s_value, String s_denominator)
           
static AbstractValueView newReferenceValue(AbstractAttributeDefinizerView def, String s_class, String s_identifier)
           
static AbstractValueView newStringValue(AbstractAttributeDefinizerView def, String svalue)
           
static AbstractValueView newTimestampValue(AbstractAttributeDefinizerView def, String s_value)
           
static AbstractValueView newUnitValue(AbstractAttributeDefinizerView def, String s_value, String s_precision)
           
static AbstractValueView newURLValue(AbstractAttributeDefinizerView def, String s_value, String description)
           
static boolean oldCreateIBAValue(Hashtable nv, Hashtable cmd_line, Vector return_objects)
           
private static String publicContainerKey(String name)
           
private static IBAHolder refreshSoftAttributes(IBAHolder ibaholder)
           
static boolean saveCurrentIBAHolder()
           
private static boolean setCachedContainerStatus(Boolean status)
           
private static boolean setCachedHolderStatus(Boolean status)
           
static boolean setCurrentCachedContainer(AttributeContainer a_container)
           
static void setType(Typed the_typed, String subtypedef)
           
private static IBAHolder storeSoftAttributes(IBAHolder ibaholder)
           
private static boolean updateIBAHolder(IBAHolder holder)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_IBA_CONTAINER

private static final String DEFAULT_IBA_CONTAINER
See Also:
Constant Field Values

CURRENT_IBA_CONTAINER

private static final String CURRENT_IBA_CONTAINER
See Also:
Constant Field Values

CURRENT_IBA_CONTAINER_STATUS

private static final String CURRENT_IBA_CONTAINER_STATUS
See Also:
Constant Field Values

CURRENT_IBA_CONTAINER_NAME

private static final String CURRENT_IBA_CONTAINER_NAME
See Also:
Constant Field Values

CURRENT_IBA_CONTAINER_DEPENDENCIES

private static final String CURRENT_IBA_CONTAINER_DEPENDENCIES
See Also:
Constant Field Values

CURRENT_IBA_CONTAINER_BASE_NAME

private static final String CURRENT_IBA_CONTAINER_BASE_NAME
See Also:
Constant Field Values

THREAD_DEFINITION_CACHE

private static final String THREAD_DEFINITION_CACHE
See Also:
Constant Field Values

CURRENT_IBAHOLDER

private static final String CURRENT_IBAHOLDER
See Also:
Constant Field Values

CURRENT_IBAHOLDER_STATUS

private static final String CURRENT_IBAHOLDER_STATUS
See Also:
Constant Field Values

STATUS_FAILED

private static final Boolean STATUS_FAILED

STATUS_OKAY

private static final Boolean STATUS_OKAY

SERVICE_NAME

private static final String SERVICE_NAME
See Also:
Constant Field Values

REFERENCEABLE_CACHE

private static Hashtable REFERENCEABLE_CACHE

CURRENT_IBAHOLDER_REFVALUES

private static final String CURRENT_IBAHOLDER_REFVALUES
See Also:
Constant Field Values

VERBOSE

private static final boolean VERBOSE

dbService

private static IBAValueDBServiceInterface dbService
Constructor Detail

LoadValue

public LoadValue()
Method Detail

endIBAHolder

public static boolean endIBAHolder(Hashtable nv,
                                   Hashtable cmd_line,
                                   Vector return_objects)
Processes "endIBAHolder" lines from a csv load file. Causes the IBAHolder that's been built up in memory to be stored in the database. All values for the current IBAHolder in the loaders memory are stored at the same time.

Parameters:
nv - Name/Value pair containing the part master name/numberk
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector of the object(s) created by this method. Used by wt.load.StandardLoadService for accurate user feedback messages.

beginIBAContainer

public static boolean beginIBAContainer(Hashtable nv,
                                        Hashtable cmd_line,
                                        Vector return_objects)
Processes "BeginIBAContainer" lines from a csv load file. Establishes a new IBA Container object in the method context cache for use in the load. Also establishes new caches for dependency identifiers for IBAValue lines. The container may optionally be given a name which is used as it's key in the cache. Particular business objects may require particular keys. The default key for the container is "IBAContainer". All following IBAValue lines will be added to this container. This line is expected to be preceded by a line which establishes a business object (IBAHolder). This line is expected to be followed by one or more IBAValue lines. This container should be "terminated" by an EndIBAContainer line. The container is expected to be saved in the database by some other line in the load file that "ends" the gathering of IBA's for the business object.

Parameters:
nv - Name/Value pair containing the part master name/numberk
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector of the object(s) created by this method. Used by wt.load.StandardLoadService for accurate user feedback messages.

beginIBAContainer

public static boolean beginIBAContainer()
Programmatic equivalent to BeginIBAContainer load file line.


beginIBAContainer

public static boolean beginIBAContainer(String name)
Programmatic equivalent to BeginIBAContainer load file line.


setCurrentCachedContainer

public static boolean setCurrentCachedContainer(AttributeContainer a_container)

endIBAContainer

public static boolean endIBAContainer(Hashtable nv,
                                      Hashtable cmd_line,
                                      Vector return_objects)
Processes "EndIBAContainer" lines from a csv load file. Causes the current IBA Container in the method cache to be completed and made available to other load methods operating in the current thread. Clears the context of the current container. (All IBAValue lines must have some container established in the cache.) It's the responsibility of some other load method to cause the IBAContainer to be associated with an IBAHolder and saved in the database.

Parameters:
nv - Name/Value pair containing the part master name/numberk
cmd_line - command line argument that can contain supplemental load data
return_objects - Vector of the object(s) created by this method. Used by wt.load.StandardLoadService for accurate user feedback messages.

endIBAContainer

public static boolean endIBAContainer()
Programmatic access equivalent to EndIBAContainer load file line.


extractDefaultIBAContainer

public static AttributeContainer extractDefaultIBAContainer()
Extract the default IBA AttributeContainer from the cache. See extractIBAContainer().


extractIBAContainer

public static AttributeContainer extractIBAContainer(String name)
Extract the an IBA AttributeContainer from the loaders method context cache. Removes the container from the cache. This method would be called by an EndBusinessObject type load file method.


establishCachedContainer

private static boolean establishCachedContainer(String name)

exposeCachedContainer

private static boolean exposeCachedContainer()

updateIBAHolder

private static boolean updateIBAHolder(IBAHolder holder)

establishCurrentIBAHolder

public static boolean establishCurrentIBAHolder(IBAHolder holder)

getCurrentIBAHolder

public static IBAHolder getCurrentIBAHolder()

saveCurrentIBAHolder

public static boolean saveCurrentIBAHolder()

getCachedHolder

private static IBAHolder getCachedHolder()

getCachedHolderStatus

private static Boolean getCachedHolderStatus()

clearCachedHolderValues

private static void clearCachedHolderValues()

clearCachedContainerValues

private static void clearCachedContainerValues(String name)

publicContainerKey

private static String publicContainerKey(String name)

getCurrentCachedContainer

private static AttributeContainer getCurrentCachedContainer()

getCurrentCachedContainerName

private static String getCurrentCachedContainerName()

getCurrentCachedContainerStatus

private static Boolean getCurrentCachedContainerStatus()

getCacheValue

private static Object getCacheValue(String key)

addReferenceToCache

private static boolean addReferenceToCache(String definition,
                                           String locator,
                                           String identifier,
                                           ReferenceValueDefaultView reference)

addReferenceToCache

private static boolean addReferenceToCache(String dependency_id,
                                           ReferenceValueDefaultView reference)

setCachedHolderStatus

private static boolean setCachedHolderStatus(Boolean status)

setCachedContainerStatus

private static boolean setCachedContainerStatus(Boolean status)

getCachedAttributeDefinition

public static AbstractAttributeDefinizerView getCachedAttributeDefinition(String definition_path)

getCachedReferenceValue

public static ReferenceValueDefaultView getCachedReferenceValue(String dependency_id)

getCachedReferenceValue

public static ReferenceValueDefaultView getCachedReferenceValue(String dependent_definition,
                                                                String dependent_locator,
                                                                String dependent_identifier)

oldCreateIBAValue

public static boolean oldCreateIBAValue(Hashtable nv,
                                        Hashtable cmd_line,
                                        Vector return_objects)

createIBAValue

public static boolean createIBAValue(Hashtable nv,
                                     Hashtable cmd_line,
                                     Vector return_objects)

createOrUpdateIBAValue

public static boolean createOrUpdateIBAValue(Hashtable nv,
                                             Hashtable cmd_line,
                                             Vector return_objects)
Create or Update IBA Value of a IBAHolder (such as WTPart) If the specified IBA value in the csv load file does not already exist in the IBAHolder, a new IBA value would be created for that IBAHolder. If the specified IBA value in the csv load file already exists, the following would occur: If only one instance of the specified IBA value definition exists in the attribute container, that instance would be replaced. If more than one instance of the specified IBA value definition exists in the attribute container, that specified IBA value would be added. NOTE: I am only changing one line here (copy and pasted from createIBAValue)

Parameters:
nv - Hashtable containing tokens parsed from the csv load file
cmd_line - Hashtable containing tokens parsed from the cmd line (e.g. java -xxx xxx wt.load.LoadFromFile *.csv)
return_objects - vector to be returned to the calling class (e.g. StandardLoadService.load)
Returns:
boolean successful(true) or not (false)
See Also:
wt.part.LoadPart.beginCreateOrUpdateWTPart

createOrUpdateAttributeValueInContainer

public static void createOrUpdateAttributeValueInContainer(DefaultAttributeContainer container,
                                                           AbstractValueView newAVV)
                                                    throws WTException
Parameters:
container - the AttributeContainer in which newAVV would be either created or updated
newAVV - newAVV would be either created or updated in container
Throws:
WTException
See Also:
wt.part.LoadPart.beginCreateOrUpdateWTPart

cloneAbstractValueView

public static AbstractValueView cloneAbstractValueView(AbstractValueView fromAVV,
                                                       AbstractValueView toAVV)
                                                throws IBAValueException
Copies the value from fromAVV to toAVV

Parameters:
fromAVV - the AVV to copy from
toAVV - the AVV to copy to
Returns:
AbstractValueView same as toAVV, for convenience.
Throws:
IBAValueException

internalCreateValue

private static AbstractValueView internalCreateValue(AbstractAttributeDefinizerView def,
                                                     String value1,
                                                     String value2)

newFloatValue

public static AbstractValueView newFloatValue(AbstractAttributeDefinizerView def,
                                              String s_value,
                                              String s_precision)

newUnitValue

public static AbstractValueView newUnitValue(AbstractAttributeDefinizerView def,
                                             String s_value,
                                             String s_precision)

newRatioValue

public static AbstractValueView newRatioValue(AbstractAttributeDefinizerView def,
                                              String s_value,
                                              String s_denominator)

newReferenceValue

public static AbstractValueView newReferenceValue(AbstractAttributeDefinizerView def,
                                                  String s_class,
                                                  String s_identifier)

getIBAReferenceable

public static IBAReferenceable getIBAReferenceable(String locator_name,
                                                   String identifier)

newStringValue

public static AbstractValueView newStringValue(AbstractAttributeDefinizerView def,
                                               String svalue)

newTimestampValue

public static AbstractValueView newTimestampValue(AbstractAttributeDefinizerView def,
                                                  String s_value)

newBooleanValue

public static AbstractValueView newBooleanValue(AbstractAttributeDefinizerView def,
                                                String s_value)

newURLValue

public static AbstractValueView newURLValue(AbstractAttributeDefinizerView def,
                                            String s_value,
                                            String description)

newIntegerValue

public static AbstractValueView newIntegerValue(AbstractAttributeDefinizerView def,
                                                String svalue)

dumpCache

private static void dumpCache()

getContextCache

private static Hashtable getContextCache()
                                  throws WTException
Throws:
WTException

decodeComma

private static String decodeComma(String str)

setType

public static void setType(Typed the_typed,
                           String subtypedef)
                    throws WTException
Throws:
WTException

applySoftAttributes

public static IBAHolder applySoftAttributes(IBAHolder ibaholder)
                                     throws WTException
Throws:
WTException

applyTypeAttributeDefaults

private static IBAHolder applyTypeAttributeDefaults(IBAHolder ibaholder)
                                             throws WTException
Throws:
WTException

initTypeDefinitions

private static void initTypeDefinitions()
                                 throws WTException
Throws:
WTException

refreshSoftAttributes

private static IBAHolder refreshSoftAttributes(IBAHolder ibaholder)
                                        throws WTException
Throws:
WTException

storeSoftAttributes

private static IBAHolder storeSoftAttributes(IBAHolder ibaholder)
                                      throws WTException
Throws:
WTException