|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.projmgmt.msproject.DefaultSAXContentHandler
wt.projmgmt.msproject.ChildContentHandler
wt.projmgmt.msproject.mppobject.MPPObjectBuilder
wt.projmgmt.msproject.mppobject.MPPPlanBuilder
A ContentHandler
that builds a
MPPPlan
from the data
contained in a section of the document it is parsing.
Field Summary | |
private static int |
MAP_INIT_CAPACITY
|
private static String |
RESOURCE
|
Fields inherited from class wt.projmgmt.msproject.mppobject.MPPObjectBuilder |
|
Fields inherited from class wt.projmgmt.msproject.ChildContentHandler |
|
Constructor Summary | |
MPPPlanBuilder(ContentHandler parent)
Create a handler that builds a MPPPlan
from a particular portion of the document being scanned. |
Method Summary | |
private static void |
addToStack(MPPTask task,
Stack taskStack)
This method is a utility method used by the #setParents method. |
private static void |
assignResources(MPPPlan plan,
Map asgnmts,
Map tasks,
Map resources)
Add the specified assignments to the plan. |
protected MPPObject |
createObject()
Create the MPPObject
that should be populated by this builder. |
private static MPPExecutionObject |
getInScopeParent(MPPTask task,
TaskScope scope)
Get the in scope parent for the specified task. |
private static Map |
getInScopePredecessors(MPPTask task,
Map tasks,
TaskScope scope)
Find the in scope predecessors for the specified task. |
private static Map |
getInScopeTasks(Map tasks,
TaskScope scope)
Return the tasks in the specified Map
that are in scope based on the import info. |
MPPPlan |
getPlan()
|
private static boolean |
isInScope(MPPTask task,
TaskScope scope)
Return true if the specified task is in
scope (based on the import info). |
protected boolean |
isScopeEnd(String namespaceURL,
String localName,
String qName)
Returns true when the specified element indicates the end of this handler's scope |
protected boolean |
isUnsupported(String namespaceURL,
String localName,
String qName)
Returns true if the specified element contains data that should be ignored by this builder. |
private void |
processTask0(MPPTask task0)
Copy the attributes from Task 0 to this builder's
plan. |
void |
setAssignments(Map asgnmts)
Add the valid resource assignments to their tasks. |
private static void |
setParent(Collection tasks,
MPPPlan plan)
Build the parent/child relationships between the tasks. |
private void |
setPlan(Collection collection)
Set the plan on each of the objects in the specified Collection . |
void |
setResources(Map resources)
Set the resources on this builder's project plan object. |
void |
setTasks(Map tasks)
Set the tasks on this builder's project plan object. |
Methods inherited from class wt.projmgmt.msproject.mppobject.MPPObjectBuilder |
characters, endElement, getObject, isObjectValid, reset, setScope, startElement |
Methods inherited from class wt.projmgmt.msproject.ChildContentHandler |
getDocumentLocator, getImportInfo, getParent, getReader, setDocumentLocator, setParent |
Methods inherited from class wt.projmgmt.msproject.DefaultSAXContentHandler |
endDocument, endPrefixMapping, ignorableWhitespace, outputEndElement, outputStartElement, processingInstruction, skippedEntity, startDocument, startPrefixMapping |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.xml.sax.ContentHandler |
endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, skippedEntity, startDocument, startPrefixMapping |
Field Detail |
private static final int MAP_INIT_CAPACITY
private static final String RESOURCE
Constructor Detail |
public MPPPlanBuilder(ContentHandler parent)
MPPPlan
from a particular portion of the document being scanned.
When the end tag for the specified scope
element
is encontered, control is passed back to the parent handler.
parent
- the parent handlerMethod Detail |
protected MPPObject createObject()
MPPObjectBuilder
MPPObject
that should be populated by this builder.
createObject
in class MPPObjectBuilder
public final MPPPlan getPlan()
protected boolean isUnsupported(String namespaceURL, String localName, String qName)
MPPObjectBuilder
IgnoreContentHandler
until the element is complete.
isUnsupported
in class MPPObjectBuilder
protected boolean isScopeEnd(String namespaceURL, String localName, String qName)
MPPObjectBuilder
isScopeEnd
in class MPPObjectBuilder
public final void setTasks(Map tasks)
tasks
- a mapping from task UIDs to task objectspublic final void setResources(Map resources)
public final void setAssignments(Map asgnmts)
valid
resource assignments to their tasks.
A valid assignment is one for which the following is true:
setTasks(java.util.Map)
and setResources(java.util.Map)
).
asgnmts
- a mapping from assignment UIDs to assignment objectsprivate final void setPlan(Collection collection)
Collection
.
private final void processTask0(MPPTask task0)
Task 0
to this builder's
plan.
private static final void setParent(Collection tasks, MPPPlan plan)
tasks
- a map of the tasksplan
- parent of tasks whose outline level equals 1private static final void addToStack(MPPTask task, Stack taskStack)
#setParents
method.
private static final Map getInScopeTasks(Map tasks, TaskScope scope)
Map
that are in scope based on the import info. Also,
make sure that the parent and predecessors of each task
are in scope.
private static final MPPExecutionObject getInScopeParent(MPPTask task, TaskScope scope)
private static final Map getInScopePredecessors(MPPTask task, Map tasks, TaskScope scope)
Map
is returned where the keys are the
MS Project UID
of the predecessors and the values
are the ProjectLinkType
s. If no
in scope predecessors exist then an empty map is returned.
private static final boolean isInScope(MPPTask task, TaskScope scope)
true
if the specified task is in
scope (based on the import info). Otherwise, return
false.
Blank line tasks are never in scope. These tasks have an outline level equal to zero and an ID number not equal to zero. The plan summary task (task 0) has an outline level equal to zero and an ID equal to zero. This tasks is Ok.
private static final void assignResources(MPPPlan plan, Map asgnmts, Map tasks, Map resources)
invalid
assignments.
An assignment is valid
if both its task and its resource
are available in the plan and its task is an activity.
Microsoft Project
supports creating assignments
with more task types than ProjectLink
. This
method filters out the assignments that are not supported
by ProjectLink
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |