|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ptc.windchill.repairtools.multiplePrimaries.PrimaryFix
Utilities that are run from inside of wt.load.LoadFromFile to cleanup a data corruption issue where multiple primaries have been associated with one document. This can happen when the multipl iterations/versions of a document are created using the loader in 6.2.6 DSU 6 and 7.0 (before the general patch) or in customizations prior to that. A patch went into both 6.2.6 DSU 7 and the 7.0 general patch that should stop this condition from happening anymore, however existing customizations that have this problem and are not corrected could continue to create multiple primaries if they are not corrected.
The instructions for using this tool are in com.ptc.windchill.repairtools.multiplePrimaries.RunPrimaryFix. RunPrimaryFix bundles together and automates the methods in this class.
The load methods use a wt.load.StandardLoadService cache to cache document masters and file output writers to improve performance. This class and methods are only supported for the purpose defined in this javadoc, it will not be part the regular codebase in any release.
StandardLoadService
Nested Class Summary | |
private class |
PrimaryFix.DocIteration
Used to record the information about one iteration of a document. |
private class |
PrimaryFix.FileEntry
Record information about one file, used with DocIteration to record all of the information about one document. |
Field Summary | |
private HashMap |
allDocs
|
private static String |
DATA
|
private StringBuffer |
deleteString
|
private static String |
EMPTY
|
private static String |
ERROR
|
private boolean |
errorFlag
|
private static String |
PRIMARYFIX_CSVDELETEFILEOUTPUTSTREAM
|
private static String |
PRIMARYFIX_ERRORFILEOUTPUTSTREAM
|
private static String |
PRIMARYFIX_NICEFILEOUTPUTSTREAM
|
private static String |
PRIMARYFIX_OLDMASTER
|
private static ResourceBundle |
rb
Resource bundle object for localizing message text |
private static String |
RESOURCE
|
private int |
size
|
static boolean |
VERBOSE
Flag to control verbose debugging output during document loading. |
Constructor Summary | |
(package private) |
PrimaryFix(int size)
|
Method Summary | |
private void |
addDoc(WTDocument doc,
WTDocumentMaster master)
Creates a DocIteration instance for a document and populates the primary file entries for that document. |
private void |
addErrorDoc(WTDocument doc,
WTDocumentMaster master,
String check_message)
Creates a DocIteration instance for a document and populates the error field for that document. |
private void |
appendDeleteString(StringBuffer delete_str)
|
static boolean |
cleanupPrimaries(Hashtable nv,
Hashtable cmd_line,
Vector return_objects)
Analyzes one document and determines which primary files of that document are extras. |
static boolean |
closeOutputFiles(Hashtable nv,
Hashtable cmd_line,
Vector return_objects)
Use this method at the end of the file for cleanupPrimaries to close the output files. |
static boolean |
deleteExtraPrimaries(Hashtable nv,
Hashtable cmd_line,
Vector return_objects)
Reads in a csv file that has the oid of the document and the oids of the files split out for keeping and deleteing, and then deletes the files that in the delete list. |
private String |
getDeleteString()
|
private boolean |
getErrorFlag()
|
private int |
getSize()
|
private Vector |
markDuplicates(PrimaryFix.DocIteration docIter,
Vector primaries)
Loop through the documents file information and mark the files that have been seen before. |
static boolean |
openOutputFiles(Hashtable nv,
Hashtable cmd_line,
Vector return_objects)
Use this method at the begining of the file for cleanupPrimaries to open up the output files. |
private void |
outputDocuments()
Output the documents and the information that we have gathered about their primary files. |
private static String |
outputQuery(PrintWriter outputCsv,
QueryResult qr,
String csvMethod,
String reportFirstLine)
Output for new csv file from results. |
private static PrimaryFix |
putIterationsInOrder(WTDocument doc,
WTDocumentMaster master,
PrimaryFix fix_set)
|
private static PrimaryFix |
putVersionsInOrder(WTDocumentMaster master,
WTDocument doc)
|
private static int |
query(Iterated iteration)
|
private static String |
queryApplicationDataPrimaries(PrintWriter outputCsv,
String reportFirstLine)
Query for multiple primary files. |
private static WTDocument |
queryDocument(String number,
String oid)
Get a document given it's oid. |
private static String |
queryURLDataPrimaries(PrintWriter outputCsv,
String reportFirstLine)
Query for multiple primary URLs. |
private void |
removeDocs()
|
static boolean |
reportMultiplePrimaries(Hashtable nv,
Hashtable cmd_line,
Vector return_objects)
Create report that replaces the manual sql query to generate the second set of reports. |
private void |
setErrorFlag()
|
private void |
setSize(int size)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static String RESOURCE
private static ResourceBundle rb
private static final String PRIMARYFIX_NICEFILEOUTPUTSTREAM
private static final String PRIMARYFIX_ERRORFILEOUTPUTSTREAM
private static final String PRIMARYFIX_CSVDELETEFILEOUTPUTSTREAM
private static final String PRIMARYFIX_OLDMASTER
public static boolean VERBOSE
wt.properties
file entry
wt.doc.load.verbose
The default value is false
.
private HashMap allDocs
private int size
private boolean errorFlag
private StringBuffer deleteString
private static String ERROR
private static String EMPTY
private static String DATA
Constructor Detail |
PrimaryFix(int size)
Method Detail |
private void setSize(int size)
private int getSize()
private boolean getErrorFlag()
private void setErrorFlag()
private String getDeleteString()
private void appendDeleteString(StringBuffer delete_str)
private void addDoc(WTDocument doc, WTDocumentMaster master) throws WTException, WTPropertyVetoException
WTException
WTPropertyVetoException
private void addErrorDoc(WTDocument doc, WTDocumentMaster master, String check_message) throws WTException
WTException
private void removeDocs()
public static boolean reportMultiplePrimaries(Hashtable nv, Hashtable cmd_line, Vector return_objects)
private static String queryApplicationDataPrimaries(PrintWriter outputCsv, String reportFirstLine)
private static String outputQuery(PrintWriter outputCsv, QueryResult qr, String csvMethod, String reportFirstLine)
private static String queryURLDataPrimaries(PrintWriter outputCsv, String reportFirstLine)
public static boolean cleanupPrimaries(Hashtable nv, Hashtable cmd_line, Vector return_objects)
OpenOutputFiles,C:\Windchill\loadFiles\run.output,C:\Windchill\loadFiles\outputDelete.csv
And the following line at the end of the csv file to close the output files defined on the first line.
CloseOutputFiles
See the javadoc for this class for more explanation about these files and how to run this method.
private static PrimaryFix putIterationsInOrder(WTDocument doc, WTDocumentMaster master, PrimaryFix fix_set) throws WTException, WTPropertyVetoException, VersionControlException
WTException
WTPropertyVetoException
VersionControlException
private static PrimaryFix putVersionsInOrder(WTDocumentMaster master, WTDocument doc) throws WTException, VersionControlException, WTPropertyVetoException
WTException
VersionControlException
WTPropertyVetoException
private static int query(Iterated iteration) throws WTException
WTException
private void outputDocuments() throws WTException, IOException, WTPropertyVetoException
WTException
IOException
WTPropertyVetoException
private Vector markDuplicates(PrimaryFix.DocIteration docIter, Vector primaries) throws WTPropertyVetoException, WTException
WTPropertyVetoException
WTException
private static WTDocument queryDocument(String number, String oid)
public static boolean deleteExtraPrimaries(Hashtable nv, Hashtable cmd_line, Vector return_objects)
public static boolean openOutputFiles(Hashtable nv, Hashtable cmd_line, Vector return_objects)
csvmapfile entry for this method: OpenOutputFiles~create~com.ptc.windchill.repairtools.multiplePrimaries.PrimaryFix.openOutputFile~infofilename~csvdeletefilename
Example csv file entry to call this method: OpenOutputFiles,C:\Temp\infooutput.html,C:\Temp\deleteprimaries.csv
public static boolean closeOutputFiles(Hashtable nv, Hashtable cmd_line, Vector return_objects)
csvmapfile entry for this method: CloseOutputFiles~create~com.ptc.windchill.repairtools.multiplePrimaries.PrimaryFix.closeOutputFiles
Example csv file entry to call this method: CloseOutputFiles
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |