org.kuali.rice.krad.maintainablexml
Class FileConverter

java.lang.Object
  extended by org.kuali.rice.krad.maintainablexml.FileConverter

public class FileConverter
extends Object

Used to upgrade the maintenance document xml stored in krns_maint_doc_t.doc_cntnt to be able to still open and use any maintenance documents that were enroute at the time of an upgrade to Rice 2.0.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Constructor Summary
FileConverter()
           
 
Method Summary
static DataSource getDataSource(HashMap settingsMap)
          Creates the data source from the settings map
 void processDocumentRow(String docId, String docCntnt, EncryptionService encryptServ, String runMode)
          Called for each row in the processRow method of the spring query.
 void runFileConversion(HashMap settingsMap, String runMode, String fromRange, String toRange, boolean hasRangeParameters)
          Selects all the encrypted xml documents from krns_maint_doc_t, decrypts them, runs the rules to upgrade them, encrypt them and update krns_maint_doc_t with the upgraded xml.
 void setRuleMaps()
          Reads the rule xml and sets up the rule maps that will be used to transform the xml
 String upgradeXML(String oldXML)
          Upgrades the xml using the rule maps executing the following actions : 1.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileConverter

public FileConverter()
Method Detail

runFileConversion

public void runFileConversion(HashMap settingsMap,
                              String runMode,
                              String fromRange,
                              String toRange,
                              boolean hasRangeParameters)
                       throws Exception
Selects all the encrypted xml documents from krns_maint_doc_t, decrypts them, runs the rules to upgrade them, encrypt them and update krns_maint_doc_t with the upgraded xml.

Parameters:
settingsMap - - the settings
Throws:
Exception

getDataSource

public static DataSource getDataSource(HashMap settingsMap)
Creates the data source from the settings map

Parameters:
settingsMap - - the settingMap containing the db connection settings
Returns:
the DataSource object

processDocumentRow

public void processDocumentRow(String docId,
                               String docCntnt,
                               EncryptionService encryptServ,
                               String runMode)
Called for each row in the processRow method of the spring query. Upgrades the xml and update the krns_maint_doc_t table.

Parameters:
docId - - the document id string
docCntnt - - the old xml string
encryptServ - - the encryption service used to encrypt/decrypt the xml

upgradeXML

public String upgradeXML(String oldXML)
                  throws Exception
Upgrades the xml using the rule maps executing the following actions : 1. Replace class names from rules. 2. Upgrade BO notes 3. Update class property names from rules 4. Set MaintainableImplClass name from rules.

Parameters:
oldXML - - the old xml that must be upgraded
Returns:
the upgraded xml string
Throws:
Exception

setRuleMaps

public void setRuleMaps()
Reads the rule xml and sets up the rule maps that will be used to transform the xml



Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.