wt.ixb.handlers.netmarkets
Class NMHandler

java.lang.Object
  extended bywt.ixb.handlers.netmarkets.NMHandler
All Implemented Interfaces:
ApplicationExpImportHandler, ApplicationImportHandler
Direct Known Subclasses:
ContainerTemplateHandler, ImportHandler

public class NMHandler
extends Object
implements ApplicationImportHandler

Title NMHandler NMHandler is a class that is used to import xml files from a local file system into a netmarkets system. The design intent is to allow for the loading of administrative objects. It assumes that all content files are located in a path relative to $(wt.home)/loadXMLFiles/content It is designed for working with JSPFeedback. If important events happen during import it checks the MethodContext variable IX_PROJECT_LOG_LEVEL. If the importance of the method is greater than the log_level it will update the MethodContext variable IX_PROJECT_LOAD_STATUS with a WTMessage object.


Field Summary
private static String _rb
           
private  String _tmpId
           
static String IX_PROJECT_LOAD_STATUS
           
private  Map localIdToOIDMap
           
private static NMProjectConstants.ObjectIDInfo objIdTags
           
private  Map realRuleNameMap
           
 
Fields inherited from interface wt.ixb.publicforapps.ApplicationExpImportHandler
IMPORTANCE_LEVEL_DEFAULT
 
Constructor Summary
NMHandler()
           
 
Method Summary
 void finalizeHandler()
           
 void finalizeImportObjectNotification(Object object)
          Notifies application about objects after being persisted.
 ApplicationData getContentAsApplicationData(String aString)
          Returns ApplicationData representing input information for import process.
 InputStream getContentAsInputStream(String contentId)
          All loaded content files must be relative to the specified content path.
 Streamed getContentAsStreamed(String contentId)
           
 String getObjectIdentifier(String key)
          This method gets a stored object reference string.
 String getRuleName(String xmlRuleName)
           
 void importObjectNotification(Object obj, boolean created, IxbElement fileXML)
          Notifies application about objects, that are created in import process.
private  boolean keyOnNotify(Object obj)
           
 void setObjectIdentifier(String localId, String oid)
          Store a ReferenceString of an object.
 void setRuleName(String xmlRuleName, String realRuleName)
           
 void setTmpId(String tmpId)
           
 void storeLogMessage(String resourceBundle, String messageKey, Object[] textInserts)
           
 void storeLogMessage(String rb, String key, Object[] inserts, int level)
          Supplies the localized log message for the application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

localIdToOIDMap

private Map localIdToOIDMap

realRuleNameMap

private Map realRuleNameMap

IX_PROJECT_LOAD_STATUS

public static String IX_PROJECT_LOAD_STATUS

objIdTags

private static final NMProjectConstants.ObjectIDInfo objIdTags

_tmpId

private String _tmpId

_rb

private static final String _rb
See Also:
Constant Field Values
Constructor Detail

NMHandler

public NMHandler()
Method Detail

finalizeHandler

public void finalizeHandler()

keyOnNotify

private boolean keyOnNotify(Object obj)

getObjectIdentifier

public String getObjectIdentifier(String key)
This method gets a stored object reference string. This is so an object can be used during the same process it was created.


setObjectIdentifier

public void setObjectIdentifier(String localId,
                                String oid)
Store a ReferenceString of an object.


setTmpId

public void setTmpId(String tmpId)
              throws WTException
Throws:
WTException

setRuleName

public void setRuleName(String xmlRuleName,
                        String realRuleName)

getRuleName

public String getRuleName(String xmlRuleName)

getContentAsInputStream

public InputStream getContentAsInputStream(String contentId)
                                    throws WTException
All loaded content files must be relative to the specified content path. By default this content path is $(wt.home)/loadXMLFiles/content This method is called by the IX framework when it wishes to load the content for a content holder object.

Specified by:
getContentAsInputStream in interface ApplicationImportHandler
Parameters:
contentId - The unique id to identify the content data, such as the file name (including the path) in a jar file.
Returns:
InputStream
Throws:
WTException

getContentAsStreamed

public Streamed getContentAsStreamed(String contentId)
                              throws WTException
Throws:
WTException

importObjectNotification

public void importObjectNotification(Object obj,
                                     boolean created,
                                     IxbElement fileXML)
                              throws WTException
Description copied from interface: ApplicationImportHandler
Notifies application about objects, that are created in import process.

Supported API: true

Specified by:
importObjectNotification in interface ApplicationImportHandler
Parameters:
obj -
created - "true" if import process creates new object and "false" otherwise.
fileXML -
Throws:
WTException

storeLogMessage

public void storeLogMessage(String resourceBundle,
                            String messageKey,
                            Object[] textInserts)
                     throws WTException
Throws:
WTException

storeLogMessage

public void storeLogMessage(String rb,
                            String key,
                            Object[] inserts,
                            int level)
                     throws WTException
Description copied from interface: ApplicationExpImportHandler
Supplies the localized log message for the application.

Supported API: true

Specified by:
storeLogMessage in interface ApplicationExpImportHandler
Parameters:
rb -
key -
inserts -
level -
Throws:
WTException

getContentAsApplicationData

public ApplicationData getContentAsApplicationData(String aString)
Description copied from interface: ApplicationImportHandler
Returns ApplicationData representing input information for import process. Import application does not have really implement this method. It can simple return null.

Supported API: true

Specified by:
getContentAsApplicationData in interface ApplicationImportHandler
Parameters:
aString - The unique id to identify the content data, such as the file name (including the path) in a jar file.
Returns:
ApplicationData

finalizeImportObjectNotification

public void finalizeImportObjectNotification(Object object)
                                      throws WTException
Description copied from interface: ApplicationImportHandler
Notifies application about objects after being persisted.

Supported API: true

Specified by:
finalizeImportObjectNotification in interface ApplicationImportHandler
Parameters:
object -
Throws:
WTException