|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.doc.LoadDoc
Creates and persists documents objects based on input from a comma seperated value (csv) file. Method names and parameters are defined in csvmapfile.txt.
The load methods use a wt.load.StandardLoadService cache to cache
document masters and document version objects to improve performance of creating
structures and updating attrbiutes.
Supported API: true
Extendable: false
StandardLoadService
,
wt.part.loadPart
Field Summary | |
private static String |
CURRENT_CONTENT_HOLDER
|
private static String |
CURRENT_DOCUMENT
|
private static String |
DOCUMENT_CACHE_KEY
|
private static String |
DOCUMENT_NEW_VERSION
|
private static String |
DOCUMENT_PREVIOUS_USER
|
private static ResourceBundle |
rb
Resource bundle object for localizing message text |
private static String |
RESOURCE
|
static boolean |
VERBOSE
Flag to control vervbose debugging output during document loading. |
Constructor Summary | |
LoadDoc()
|
Method Summary | |
static boolean |
addDocumentDependency(Hashtable nv,
Hashtable cmd_line,
Vector return_objects)
Add documents to a dependency link. |
static boolean |
addToDocumentStructure(Hashtable nv,
Hashtable cmd_line,
Vector return_objects)
Add document to a structured document. |
private static WTDocument |
applyConstructionTimeAttributes(WTDocument document,
Hashtable nv,
Hashtable cmd_line)
|
private static WTDocument |
applyHardAttributes(WTDocument document,
Hashtable nv,
Hashtable cmd_line)
|
static boolean |
beginCreateWTDocument(Hashtable nv,
Hashtable cmd_line,
Vector return_objects)
Processes "BeginWTDocument" lines from a csv load file. |
static boolean |
beginCreateWTDocumentRetainContent(Hashtable nv,
Hashtable cmd_line,
Vector return_objects)
WARNING DO NOT USE THIS OPTION UNLESS YOU ARE HANDLING THE ISSUE OF MULTIPLE SECONDARY CONTENT ITEMS ON NEW ITERATIONS/VERSIONS. |
private static WTDocument |
cacheDocument(WTDocument document)
|
private static WTDocument |
clearContent(WTDocument document)
|
private static WTDocument |
constructDocument(Hashtable nv,
Hashtable cmd_line)
|
private static boolean |
createDocumentObject(Hashtable nv,
Hashtable cmd_line,
Vector return_objects)
|
private static boolean |
createDocumentObject(Hashtable nv,
Hashtable cmd_line,
Vector return_objects,
boolean removeContent)
|
static boolean |
createDocumentRetainContent(Hashtable nv,
Hashtable cmd_line,
Vector return_objects)
WARNING DO NOT USE THIS OPTION UNLESS YOU ARE HANDLING THE ISSUE OF MULTIPLE SECONDARY CONTENT ITEMS ON NEW ITERATIONS/VERSIONS. |
static boolean |
createGeneral(Hashtable nv,
Hashtable cmd_line,
Vector return_objects)
Processes the "General" or "Document" directive in the csv load file. |
static boolean |
createReq(Hashtable nv,
Hashtable cmd_line,
Vector return_objects)
Processes the "Requirements" directive in the csv load file. |
static boolean |
createSpec(Hashtable nv,
Hashtable cmd_line,
Vector return_objects)
Processes the "Specification" directive in the csv load file. |
static boolean |
endCreateWTDocument(Hashtable nv,
Hashtable cmd_line,
Vector return_objects)
Processes "EndWTDocument" lines from a csv load file. |
static boolean |
endCreateWTDocumentRetainContent(Hashtable nv,
Hashtable cmd_line,
Vector return_objects)
Processes "EndWTDocumentRetainContent" lines from a csv load file. |
private static WTDocument |
getCachedDocument()
|
private static WTDocument |
getCachedDocument(String number)
|
private static WTDocument |
getCachedDocument(String number,
String version)
|
private static WTDocument |
getCachedDocument(String number,
String version,
String iteration)
|
private static String |
getDisplayInfo(Hashtable nv,
Hashtable cmd_line)
|
static WTDocument |
getDocument()
RETRIEVE DOCUMENT MOST RECENTLY ADDED TO THE CACHE Supported API: false |
static WTDocument |
getDocument(String number)
RETRIEVE A DOCUMENT BASED ON DOCUMENT NUMBER (CACHED) IF number IS null, RETURNS DOCUMENT MOST RECENTLY ADDED TO THE CACHE |
static WTDocument |
getDocument(String number,
String version)
RETRIEVE A DOCUMENT BASED ON DOCUMENT NUMBER AND VERSION (CACHED) IF number IS null, RETURNS DOCUMENT MOST RECENTLY ADDED TO THE CACHE IF version IS null, RETURNS DOCUMENT BASED ON DOCUMENT NUMBER ONLY |
static WTDocument |
getDocument(String number,
String version,
String iteration)
RETRIEVE A DOCUMENT BASED ON DOCUMENT NUMBER, VERSION, AND ITERATION (CACHED) IF number IS null, RETURNS DOCUMENT MOST RECENTLY ADDED TO THE CACHE IF version IS null, RETURNS DOCUMENT BASED ON DOCUMENT NUMBER ONLY IF iteration IS null, RETURNS DOCUMENT BASED ON DOCUMENT NUMBER AND VERSION ONLY |
private static String |
getDocumentCacheKey(String number,
String version,
String iteration)
|
private static String |
getValue(String name,
Hashtable nv,
Hashtable cmd_line,
boolean required)
|
private static boolean |
isNewVersion(WTDocument document,
String version)
|
private static void |
resetUser()
|
private static void |
setContainer(WTContained the_contained,
WTContainerRef containerRef)
|
private static void |
setDepartment(WTDocument the_document,
String department)
|
private static void |
setDescription(WTDocument the_document,
String description)
|
private static void |
setDocType(WTDocument the_document,
String type)
|
private static void |
setFolder(WTContainerRef containerRef,
FolderEntry the_folder_entry,
String folderpath)
|
private static void |
setIteration(Iterated the_iterated,
String iteration)
|
private static void |
setLifeCycle(WTContainerRef containerRef,
LifeCycleManaged the_lifecycle_managed,
String lctemplate)
|
private static void |
setName(WTDocument the_document,
String name)
|
private static void |
setNumber(WTDocument the_document,
String number)
|
private static WTDocument |
setPrimaryContent(WTDocument document,
Hashtable nv,
Hashtable cmd_line,
Vector return_objects)
|
private static void |
setState(LifeCycleManaged the_lifecycle_managed,
String state)
|
private static void |
setTeamTemplate(WTContainerRef containerRef,
TeamManaged the_team_managed,
String teamTemplate,
String domain)
|
private static void |
setTitle(WTDocument the_document,
String title)
|
private static void |
setType(Typed the_typed,
String subtypedef)
|
private static void |
setUser(Hashtable nv,
Hashtable cmd_line)
|
private static void |
setVersion(Versioned the_versioned,
String version)
|
private static boolean |
updateDocumentObject(Hashtable nv,
Hashtable cmd_line,
Vector return_objects)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static String CURRENT_CONTENT_HOLDER
private static final String DOCUMENT_CACHE_KEY
private static final String DOCUMENT_PREVIOUS_USER
private static final String DOCUMENT_NEW_VERSION
private static String CURRENT_DOCUMENT
private static String RESOURCE
private static ResourceBundle rb
public static boolean VERBOSE
wt.properties
file entry
wt.doc.load.verbose
The default value is false
.
Constructor Detail |
public LoadDoc()
Method Detail |
public static boolean createGeneral(Hashtable nv, Hashtable cmd_line, Vector return_objects)
Subsequent IBAValue
load file lines may be used to associate
soft attribute values with the document. These values will not
be persisted until a "EndWTDocument" load file line is processed.
Establishes the document as the CURRENT_CONTENT_HOLDER for use by "ContentFile" lines.
Supports versioning which allows a document to be created at a specified version and iteration. Multiple document versions imply an "order". I.E. subsequent bulk load runs can "fill in the gaps", but it does so by attaching to the latest iteration of the previous version. If a newer iteration is added to the previous version, the new version will attached to the new latest iteration. For example: Load set 1 (E.1, A.1, C.2) will result in (A.1, C.2, E.1). The predecssors of: C.2 is A.1, E.1 is C.2. Load set 2 (B.1, A.2., C.1, C.3) will result in (A.1, A.2, B.1, C.1, C.2, C.3, E.1). The predecessors of: B.1 is A.2, C.1 is B.1, E.1 is C.3. Any new version/iterations added will continue to change the predessor links to the new latest iteration of the previous version.
Versioning does support gaps in the ordering.
Examples of valid versioning are: (A.1,A.3,B.2,B.5,E.4,E.5)
WARNING: By default on loading iterations/versions of a document all of the content is removed from the document on the new iteration/version creation. This is to stop excess content from accumulating on the document from iteration to iteration. So any new content both primary or secondary will be the only content. The previous iteratin/version is not touched, only the content on the new document that is created. If you want to load documents that retain their secondary content from the previous iteration/version and then replace any of the old files with the new files of the same name use either DocumentRetainContent or BeginWTDocumentRetainContent/EndWTDocumentRetainContent with ReplaceContentFile.
nv
- Name/value pairs of meta data to set on the general document.
The attributes are as follows: (arguments in <> are optional)
cmd_line
- command line argument that can be substituted into the load data.return_objects
- Object(s) created by this method used by
wt.load.StandardLoadService
for user feedback messages.
public static boolean createDocumentRetainContent(Hashtable nv, Hashtable cmd_line, Vector return_objects)
Creates a document object, persists it in the database, checks it out, applies the default attribute values associated with the specified type definition, persists the document, checks it back in, and caches it in the loader's memory.
Subsequent IBAValue
load file lines may be used to associate
soft attribute values with the document. These values will not
be persisted until a "EndWTDocument" load file line is processed.
Establishes the document as the CURRENT_CONTENT_HOLDER for use by "ContentFile" lines.
Supports versioning which allows a document to be created at a specified version and iteration. Multiple document versions imply an "order". I.E. subsequent bulk load runs can "fill in the gaps", but it does so by attaching to the latest iteration of the previous version. If a newer iteration is added to the previous version, the new version will attached to the new latest iteration. For example: Load set 1 (E.1, A.1, C.2) will result in (A.1, C.2, E.1). The predecssors of: C.2 is A.1, E.1 is C.2. Load set 2 (B.1, A.2., C.1, C.3) will result in (A.1, A.2, B.1, C.1, C.2, C.3, E.1). The predecessors of: B.1 is A.2, C.1 is B.1, E.1 is C.3. Any new version/iterations added will continue to change the predessor links to the new latest iteration of the previous version.
Versioning does support gaps in the ordering.
Examples of valid versioning are: (A.1,A.3,B.2,B.5,E.4,E.5)
nv
- Name/value pairs of meta data to set on the general document.
The attributes are as follows: (arguments in <> are optional)
cmd_line
- command line argument that can be substituted into the load data.return_objects
- Object(s) created by this method used by
wt.load.StandardLoadService
for user feedback messages.
public static boolean createReq(Hashtable nv, Hashtable cmd_line, Vector return_objects)
Subsequent IBAValue
load file lines may be used to associate
soft attribute values with the document. These values will not
be persisted until a "EndWTDocument" load file line is processed.
Establishes the document as the CURRENT_CONTENT_HOLDER for use by "ContentFile" lines.
Supports versioning which allows a document to be created at a specified version and iteration. Multiple document versions imply an "order". I.E. subsequent bulk load runs can "fill in the gaps", but it does so by attaching to the latest iteration of the previous version. If a newer iteration is added to the previous version, the new version will attached to the new latest iteration. For example: Load set 1 (E.1, A.1, C.2) will result in (A.1, C.2, E.1). The predecssors of: C.2 is A.1, E.1 is C.2. Load set 2 (B.1, A.2., C.1, C.3) will result in (A.1, A.2, B.1, C.1, C.2, C.3, E.1). The predecessors of: B.1 is A.2, C.1 is B.1, E.1 is C.3. Any new version/iterations added will continue to change the predessor links to the new latest iteration of the previous version.
Versioning does support gaps in the ordering.
Examples of valid versioning are: (A.1,A.3,B.2,B.5,E.4,E.5)
WARNING: By default on loading iterations/versions of a document all of the content is removed from the document on the new iteration/version creation. This is to stop excess content from accumulating on the document from iteration to iteration. So any new content both primary or secondary will be the only content. The previous iteratin/version is not touched, only the content on the new document that is created. If you want to load documents that retain their secondary content from the previous iteration/version and then replace any of the old files with the new files of the same name use either DocumentRetainContent or BeginWTDocumentRetainContent/EndWTDocumentRetainContent with ReplaceContentFile.
nv
- Name/value pairs of meta data to set on the general document.
The attributes are as follows: (arguments in <> are optional)
cmd_line
- command line argument that can be substituted into the load data.return_objects
- Object(s) created by this method used by
wt.load.StandardLoadService
for user feedback messages.
public static boolean createSpec(Hashtable nv, Hashtable cmd_line, Vector return_objects)
Subsequent IBAValue
load file lines may be used to associate
soft attribute values with the document. These values will not
be persisted until a "EndWTDocument" load file line is processed.
Establishes the document as the CURRENT_CONTENT_HOLDER for use by "ContentFile" lines.
Supports versioning which allows a document to be created at a specified version and iteration. Multiple document versions imply an "order". I.E. subsequent bulk load runs can "fill in the gaps", but it does so by attaching to the latest iteration of the previous version. If a newer iteration is added to the previous version, the new version will attached to the new latest iteration. For example: Load set 1 (E.1, A.1, C.2) will result in (A.1, C.2, E.1). The predecssors of: C.2 is A.1, E.1 is C.2. Load set 2 (B.1, A.2., C.1, C.3) will result in (A.1, A.2, B.1, C.1, C.2, C.3, E.1). The predecessors of: B.1 is A.2, C.1 is B.1, E.1 is C.3. Any new version/iterations added will continue to change the predessor links to the new latest iteration of the previous version.
Versioning does support gaps in the ordering.
Examples of valid versioning are: (A.1,A.3,B.2,B.5,E.4,E.5)
WARNING: By default on loading iterations/versions of a document all of the content is removed from the document on the new iteration/version creation. This is to stop excess content from accumulating on the document from iteration to iteration. So any new content both primary or secondary will be the only content. The previous iteratin/version is not touched, only the content on the new document that is created. If you want to load documents that retain their secondary content from the previous iteration/version and then replace any of the old files with the new files of the same name use either DocumentRetainContent or BeginWTDocumentRetainContent/EndWTDocumentRetainContent with ReplaceContentFile.
nv
- Name/value pairs of meta data to set on the general document.
The attributes are as follows: (arguments in <> are optional)
cmd_line
- command line argument that can be substituted into the load data.return_objects
- Object(s) created by this method used by
wt.load.StandardLoadService
for user feedback messages.
public static boolean beginCreateWTDocument(Hashtable nv, Hashtable cmd_line, Vector return_objects)
Subsequent IBAValue
load file lines may be used to associate
soft attribute values with the document. These values will not
be persisted until a "EndWTDocument" load file line is processed.
Establishes the document as the CURRENT_CONTENT_HOLDER for use by "ContentFile" lines.
A typical sequence using this directive might be
BeginWTDocument,name,number,...
IBAValue,definition1,value1,...
IBAValue,definition2,value2,...
EndWTDocument
ContentFile,...
Supports versioning which allows a document to be created at a specified version and iteration. Multiple document versions imply an "order". I.E. subsequent bulk load runs can "fill in the gaps", but it does so by attaching to the latest iteration of the previous version. If a newer iteration is added to the previous version, the new version will attached to the new latest iteration. For example: Load set 1 (E.1, A.1, C.2) will result in (A.1, C.2, E.1). The predecssors of: C.2 is A.1, E.1 is C.2. Load set 2 (B.1, A.2., C.1, C.3) will result in (A.1, A.2, B.1, C.1, C.2, C.3, E.1). The predecessors of: B.1 is A.2, C.1 is B.1, E.1 is C.3. Any new version/iterations added will continue to change the predessor links to the new latest iteration of the previous version.
Versioning does support gaps in the ordering.
Examples of valid versioning are: (A.1,A.3,B.2,B.5,E.4,E.5)
WARNING: By default on loading iterations/versions of a document all of the content is removed from the document on the new iteration/version creation. This is to stop excess content from accumulating on the document from iteration to iteration. So any new content both primary or secondary will be the only content. The previous iteratin/version is not touched, only the content on the new document that is created. If you want to load documents that retain their secondary content from the previous iteration/version and then replace any of the old files with the new files of the same name use BeginWTDocumentRetainContent/EndWTDocumentRetainContent with ReplaceContentFile.
nv
- Name/Value pairs of document attributes.
The attributes are as follows: (arguments in <> are optional)
cmd_line
- command line argument that can contain supplemental load datareturn_objects
- Vector
of the object(s) created by this method.
Used by wt.load.StandardLoadService
for accurate user feedback messages.endCreateWTDocument(java.util.Hashtable, java.util.Hashtable, java.util.Vector)
public static boolean endCreateWTDocument(Hashtable nv, Hashtable cmd_line, Vector return_objects)
IBAValue
load file lines with the document, applies the default attribute values
associated with the specified type definition, persists the document, checks it back in,
and caches it in the loader's memory.
Establishes the document as the CURRENT_CONTENT_HOLDER for use by "ContentFile" lines.
nv
- Name/Value pairs of document attributes.
The attributes are as follows: (arguments in <> are optional)
cmd_line
- command line argument that can contain supplemental load datareturn_objects
- Vector
of the object(s) created by this method.
Used by wt.load.StandardLoadService
for accurate user feedback messages.beginCreateWTDocument(java.util.Hashtable, java.util.Hashtable, java.util.Vector)
public static boolean beginCreateWTDocumentRetainContent(Hashtable nv, Hashtable cmd_line, Vector return_objects)
Processes "BeginWTDocumentRetainContent" lines from a csv load file. Creates a document object, persists it in the database, and caches it in the loader's memory.
Subsequent IBAValue
load file lines may be used to associate
soft attribute values with the document. These values will not
be persisted until a "EndWTDocumentRetainContent" load file line is processed.
Establishes the document as the CURRENT_CONTENT_HOLDER for use by "ContentFile" lines.
A typical sequence using this directive might be
BeginWTDocument,name,number,...
IBAValue,definition1,value1,...
IBAValue,definition2,value2,...
EndWTDocument
ContentFile,...
Supports versioning which allows a document to be created at a specified version and iteration. Multiple document versions imply an "order". I.E. subsequent bulk load runs can not "fill in the gaps". Versioning does support gaps in the ordering.
Examples of valid versioning are: (A.1,A.3,B.2,B.5,E.4,E.5)
nv
- Name/Value pairs of document attributes.
The attributes are as follows: (arguments in <> are optional)
cmd_line
- command line argument that can contain supplemental load datareturn_objects
- Vector
of the object(s) created by this method.
Used by wt.load.StandardLoadService
for accurate user feedback messages.endCreateWTDocumentRetainContent(java.util.Hashtable, java.util.Hashtable, java.util.Vector)
public static boolean endCreateWTDocumentRetainContent(Hashtable nv, Hashtable cmd_line, Vector return_objects)
IBAValue
load file lines with the document, applies the default attribute values
associated with the specified type definition, persists the document, checks it back in,
and caches it in the loader's memory.
Establishes the document as the CURRENT_CONTENT_HOLDER for use by "ContentFile" lines.
nv
- Name/Value pairs of document attributes.
The attributes are as follows: (arguments in <> are optional)
cmd_line
- command line argument that can contain supplemental load datareturn_objects
- Vector
of the object(s) created by this method.
Used by wt.load.StandardLoadService
for accurate user feedback messages.beginCreateWTDocumentRetainContent(java.util.Hashtable, java.util.Hashtable, java.util.Vector)
public static boolean addToDocumentStructure(Hashtable nv, Hashtable cmd_line, Vector return_objects)
nv
- Name/value pairs to identify documents for the relationship.cmd_line
- command line argument that can be substituted into the load data.return_objects
- Object(s) created by this method used by
wt.load.StandardLoadService
for user feedback messages.
public static boolean addDocumentDependency(Hashtable nv, Hashtable cmd_line, Vector return_objects)
nv
- Name/value pairs to identify documents for the relationship.cmd_line
- command line argument that can be substituted into the load data.return_objects
- Object(s) created by this method used by
wt.load.StandardLoadService
for user feedback messages.
public static WTDocument getDocument() throws WTException
WTException
public static WTDocument getDocument(String number) throws WTException
number
- Document number.
WTException
public static WTDocument getDocument(String number, String version) throws WTException
number
- Document number.version
- Document version.
WTException
public static WTDocument getDocument(String number, String version, String iteration) throws WTException
number
- Document number.version
- Document version.iteration
- Document iteration.
WTException
private static boolean createDocumentObject(Hashtable nv, Hashtable cmd_line, Vector return_objects)
private static boolean createDocumentObject(Hashtable nv, Hashtable cmd_line, Vector return_objects, boolean removeContent)
private static String getDisplayInfo(Hashtable nv, Hashtable cmd_line)
private static boolean updateDocumentObject(Hashtable nv, Hashtable cmd_line, Vector return_objects)
private static WTDocument constructDocument(Hashtable nv, Hashtable cmd_line) throws WTException
WTException
private static boolean isNewVersion(WTDocument document, String version) throws WTException
WTException
private static WTDocument getCachedDocument() throws WTException
WTException
private static WTDocument getCachedDocument(String number) throws WTException
WTException
private static WTDocument getCachedDocument(String number, String version) throws WTException
WTException
private static WTDocument getCachedDocument(String number, String version, String iteration) throws WTException
WTException
private static String getDocumentCacheKey(String number, String version, String iteration) throws WTException
WTException
private static WTDocument cacheDocument(WTDocument document) throws WTException
WTException
private static WTDocument applyHardAttributes(WTDocument document, Hashtable nv, Hashtable cmd_line) throws WTException
WTException
private static WTDocument applyConstructionTimeAttributes(WTDocument document, Hashtable nv, Hashtable cmd_line) throws WTException
WTException
private static void setName(WTDocument the_document, String name) throws WTException
WTException
private static void setNumber(WTDocument the_document, String number) throws WTException
WTException
private static void setDocType(WTDocument the_document, String type) throws WTException
WTException
private static void setTitle(WTDocument the_document, String title) throws WTException
WTException
private static void setDescription(WTDocument the_document, String description) throws WTException
WTException
private static void setDepartment(WTDocument the_document, String department) throws WTException
WTException
private static WTDocument setPrimaryContent(WTDocument document, Hashtable nv, Hashtable cmd_line, Vector return_objects) throws WTException
WTException
private static void setUser(Hashtable nv, Hashtable cmd_line) throws WTException
WTException
private static void resetUser() throws WTException
WTException
private static String getValue(String name, Hashtable nv, Hashtable cmd_line, boolean required) throws WTException
WTException
private static void setContainer(WTContained the_contained, WTContainerRef containerRef) throws WTException
WTException
private static void setType(Typed the_typed, String subtypedef) throws WTException
WTException
private static void setVersion(Versioned the_versioned, String version) throws WTException
WTException
private static void setIteration(Iterated the_iterated, String iteration) throws WTException
WTException
private static void setFolder(WTContainerRef containerRef, FolderEntry the_folder_entry, String folderpath) throws WTException
WTException
private static void setLifeCycle(WTContainerRef containerRef, LifeCycleManaged the_lifecycle_managed, String lctemplate) throws WTException
WTException
private static void setState(LifeCycleManaged the_lifecycle_managed, String state) throws WTException
WTException
private static void setTeamTemplate(WTContainerRef containerRef, TeamManaged the_team_managed, String teamTemplate, String domain) throws WTException
WTException
private static WTDocument clearContent(WTDocument document) throws WTException
WTException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |