|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.projmgmt.msproject.Exporter
wt.projmgmt.msproject.MPPXMLExporter
This class exports a ProjectPlan
of (@link wt.projmgmt.execution.SummaryActivity}
in Microsoft Project XML
format.
Field Summary | |
private Timestamp |
now
|
private int |
resourceCounter
This is used to produce an ID for each resource. |
private int |
taskCounter
This is used to produce an ID for each task. |
private static Currency |
ZERO_CURRENCY
|
private static Work |
ZERO_WORK
|
Fields inherited from class wt.projmgmt.msproject.Exporter |
|
Constructor Summary | |
MPPXMLExporter(OutputStream ostream,
ExportInfo info)
|
Method Summary | |
void |
export(WfContainer c)
Export the specified ProjectPlan
or SummaryActivity in
Microsoft Project XML format. |
Currency |
exportActualCost(ProjectResource resource,
String tag)
Export the actual cost of work performed by the specified ProjectResource . |
Currency |
exportActualCost(ResourceAssignmentLink link,
String tag)
Export the actual cost of work performed for the specified ResourceAssignmentLink . |
void |
exportActualFinish(ResourceAssignmentLink link,
String tag)
Export the actual finish of the ResourceAssignmentLink . |
void |
exportActualStart(ResourceAssignmentLink link,
String tag)
Export the actual start of the ResourceAssignmentLink . |
Work |
exportActualWork(ExecutionObject obj,
String tag)
Export the actual amount of work performed for the specified ExecutionObject . |
Work |
exportActualWork(ProjectResource resource,
String tag)
Export the actual amount of work performed by the specified ProjectResource . |
Work |
exportActualWork(ResourceAssignmentLink link,
String tag)
Export the actual amount of work performed for the specified ResourceAssignmentLink . |
void |
exportAssignment(ResourceAssignmentLink link)
Export the specified ResourceAssignmentLink
in Microsoft Project XML format. |
private void |
exportAssignments(WfContainer c)
|
void |
exportConfirmed(ProjectResource resource,
String tag)
Export whether or not the resource has confirmed its assignments. |
void |
exportConstraint(ExecutionObject obj)
Export a constraint for the specified ExecutionObject if required. |
Currency |
exportCost(ProjectResource resource,
String tag)
Export the total cost of work allocated to the specified ProjectResource . |
Currency |
exportCost(ResourceAssignmentLink link,
String tag)
Export the total cost of work allocated to the specified ResourceAssignmentLink . |
void |
exportDeliverables(ExecutionObject exObj)
Export the PTC.DELIVERABLES extended attribute. |
void |
exportEaEstimatedDuration(ExecutionObject obj)
|
void |
exportEaEstimatedFinish(ExecutionObject obj)
|
void |
exportEaEstimatedStart(ExecutionObject obj)
|
void |
exportEmailAddress(ProjectResource resource)
Export the email address of the specified ProjectResource . |
void |
exportExtendedAttribute(Persistable p,
long ea_uid,
EnumeratedType enum,
String ea_fieldId)
Export a value for an ExtendedAttribute . |
void |
exportExtendedAttribute(Persistable p,
long ea_uid,
long ea_value,
String ea_fieldId)
Export a value for an ExtendedAttribute . |
void |
exportExtendedAttribute(Persistable p,
long ea_uid,
String ea_value,
String ea_fieldId)
Export a value for an ExtendedAttribute . |
void |
exportExtendedAttributeDef(long uid,
String fieldId,
int type,
String alias)
Export the specified ExtendedAttribute definition. |
private void |
exportExtendedAttributeDefs()
|
void |
exportExtendedAttributeType(int type,
String tag)
Export the type for an extended attribute. |
void |
exportFinishDate(ExecutionObject obj,
String tag)
Export the FinishDate of the specified
ExecutionObject . |
void |
exportInitials(ProjectResource resource)
Export the initials of the specified ProjectResource . |
void |
exportMaxUnits(ProjectResource resource)
Export the max units of the specified ProjectResource . |
void |
exportMiscFields(ExecutionObject exObj)
Export the combined string (Notebook-Executionconfiguration) that is stored |
void |
exportName(ProjectResource resource,
String tag)
Export the name of the specified ProjectResource . |
void |
exportOID(Persistable p,
boolean isTask0)
Export the PTC.ID and PTC.CLASS
extended attributes. |
void |
exportOrgContainer(ExecutionObject exObj,
String tag)
Export the OrgContainer
that this ExecutionObject lives in. |
void |
exportPercentComplete(ResourceAssignmentLink link,
String tag)
Export the planned start of the ResourceAssignmentLink . |
private void |
exportPlanAttributes(ExecutionObject exObj)
|
TimeToElapse |
exportPlannedDuration(ExecutionObject obj,
String tag)
Export the PlannedDuration of the specified
ExecutionObject . |
Timestamp |
exportPlannedFinish(ExecutionObject obj,
String tag)
Export the PlannedFinish of the specified
ExecutionObject . |
void |
exportPlannedFinish(ResourceAssignmentLink link,
String tag)
Export the estimated finish of the ResourceAssignmentLink . |
Timestamp |
exportPlannedStart(ExecutionObject obj,
String tag)
Export the PlannedStart of the specified
ExecutionObject . |
void |
exportPlannedStart(ResourceAssignmentLink link,
String tag)
Export the planned start of the ResourceAssignmentLink . |
void |
exportPredecessorLink(ProjectNode pred,
ProjectNode succ)
Export the PredecessorLink for the specified
predecessor and sucessor nodes. |
void |
exportPredecessors(ProjectNode node)
Export the Predecessors of the specified
ProjectNode . |
void |
exportPriority(ExecutionObject obj)
Export the priority of the specified ExecutionObject . |
void |
exportProjectLinkType(ProjectLinkType type,
String tag)
Export the ProjectLinkType . |
void |
exportPTCOwner(ExecutionObject exObj,
boolean isTask0)
Export the PTC.OWNER extended attribute. |
void |
exportRemainingCost(Currency total,
Currency actual,
String tag)
Export the RemainingCost given the
total cost and the actual cost. |
void |
exportRemainingDuration(TimeToElapse total,
TimeToElapse actual,
String tag)
Export the RemainingDuration given the
total duration and the actual duration. |
Work |
exportRemainingWork(ExecutionObject obj,
String tag)
Export the amount of work allocated to the specified ExecutionObject . |
void |
exportRemainingWork(Work total,
Work actual,
String tag)
Export the RemainingWork given the total
work and the actual work. |
private void |
exportResource(ProjectResource resource)
Export the specified ProjectResource
in Microsoft Project XML format. |
private void |
exportResources(WfContainer c)
|
void |
exportResourceUnits(ProjectResource resource,
int units,
String tag)
Export the number of resources for the specified resource using the correct data format (percent or integer). |
void |
exportResponsePending(ProjectResource resource,
String tag)
Export whether or not the resource has been sent an invitation to the team but has not yet confirmed participation. |
void |
exportServerInfo(Persistable p,
boolean isTask0)
Export the following extended attributes: PTC.CODEBASE
PTC.ACTION
|
void |
exportStartDate(ExecutionObject obj,
String tag)
Export the StartDate of the specified
ExecutionObject . |
void |
exportStatusInfo(ExecutionObject exObj,
boolean isTask0)
Export the PTC.RISK , PTC.RISK_DESC ,
PTC.STATUS , PTC.STATUS_DESC and
PTC.EXEC_STATE extended attributes. |
private void |
exportSubPlanId(ProjectProxy proxy)
Export the sub plan id to PTC.PROJECT if existing |
void |
exportTask(ExecutionObject obj,
boolean isTask0)
Export the specified ExecutionObject
in Microsoft Project XML format. |
private void |
exportTasks(WfContainer c)
|
Work |
exportWork(ExecutionObject obj,
String tag)
Export the amount of work allocated to the specified ExecutionObject . |
Work |
exportWork(ProjectResource resource,
String tag)
Export the amount of work allocated to the specified ProjectResource . |
Work |
exportWork(ResourceAssignmentLink link,
String tag)
Export the amount of work allocated to the specified ResourceAssignmentLink . |
void |
exportWTContainer(ExecutionObject exObj,
boolean isTask0)
Export the following extended attributes: PTC.PROJECT
PTC.LOCATION
|
private long |
getLag(ProjectNode pred,
ProjectNode succ)
THIS WILL ONLY RETURN A NEGATIVE LAG OR 0 DOES NOT COMPUTE POSITIVE LAG Get the lag (the difference in working days between the finish of the predecessor and the start of the succesor. |
protected Timestamp |
getNow()
|
boolean |
isEdit()
Get the flag that determines whether this export is intended to supporting editing the plan in the client. |
Methods inherited from class wt.projmgmt.msproject.Exporter |
close, comment, decreaseIndent, endElement, exportBoolean, exportClass, exportCurrency, exportDateTime, exportDateTime, exportDuration, exportDuration, exportDuration, exportEnumeratedType, exportInt, exportNonNegInt, exportOwner, exportPercent, exportPrincipal, exportPrincipal, exportRate, exportString, exportUID, exportWork, getInfo, increaseIndent, startElement, startElement, writeElement, writeElement, writeElement, writeElement, writeElement, writeElement, writeElement, writeElementData, writeHeader |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final Currency ZERO_CURRENCY
private static final Work ZERO_WORK
private final Timestamp now
private int taskCounter
ID
for each task. They
are just numered sequentially as they appear.
private int resourceCounter
ID
for each resource. They
are just numered sequentially as they appear.
Constructor Detail |
public MPPXMLExporter(OutputStream ostream, ExportInfo info) throws UnsupportedEncodingException
Method Detail |
protected final Timestamp getNow()
public final boolean isEdit()
public void export(WfContainer c) throws WTException, IOException
ProjectPlan
or SummaryActivity
in
Microsoft Project XML
format.
The XML
is written to the OutputStream
that was passed in when this exporter was created.
export
in class Exporter
c
- the ProjectPlan or SummaryActivity to export
WTException
IOException
private void exportPlanAttributes(ExecutionObject exObj) throws WTException, IOException
WTException
IOException
private void exportExtendedAttributeDefs()
private void exportTasks(WfContainer c) throws WTException, IOException
WTException
IOException
private void exportResources(WfContainer c) throws WTException, IOException
WTException
IOException
private void exportAssignments(WfContainer c) throws WTException
WTException
public void exportExtendedAttributeDef(long uid, String fieldId, int type, String alias)
ExtendedAttribute
definition.
The type can be one of the following values:
uid
- the UID of the extended attributefieldId
- the fieldId of the extended attributetype
- the type of the extended attribute (0, 1, 2, 3, 4, 5, 6 or 7)public void exportTask(ExecutionObject obj, boolean isTask0) throws WTException
ExecutionObject
in Microsoft Project XML
format.
The XML
is written to the OutputStream
that was passed in when this exporter was created.
isTask0
- true if this is the top task (i.e. task 0)
WTException
private void exportResource(ProjectResource resource) throws WTException
ProjectResource
in Microsoft Project XML
format.
The XML
is written to the OutputStream
that was passed in when this exporter was created.
resource
- the resource to export
WTException
public void exportAssignment(ResourceAssignmentLink link) throws WTException
ResourceAssignmentLink
in Microsoft Project XML
format.
The XML
is written to the OutputStream
that was passed in when this exporter was created.
link
- the link to export
WTException
public void exportPredecessors(ProjectNode node) throws WTException
Predecessors
of the specified
ProjectNode
.
node
- the node to be exported
WTException
public void exportPredecessorLink(ProjectNode pred, ProjectNode succ) throws WTException
PredecessorLink
for the specified
predecessor and sucessor nodes.
pred
- the predecessor nodesucc
- the successor node
WTException
private long getLag(ProjectNode pred, ProjectNode succ) throws WTException
pred
- the predecessor nodesucc
- the successor node
WTException
public void exportProjectLinkType(ProjectLinkType type, String tag)
ProjectLinkType
.
type
- the type to be exportedtag
- the name of the tag that holds the typepublic void exportOrgContainer(ExecutionObject exObj, String tag) throws WTException
OrgContainer
that this ExecutionObject
lives in.
WTException
public void exportStartDate(ExecutionObject obj, String tag)
StartDate
of the specified
ExecutionObject
.
obj
- the execution object to exporttag
- the name of the tag that holds the datepublic Timestamp exportPlannedStart(ExecutionObject obj, String tag)
PlannedStart
of the specified
ExecutionObject
.
obj
- the execution object to exporttag
- the name of the tag that holds the date
public void exportFinishDate(ExecutionObject obj, String tag)
FinishDate
of the specified
ExecutionObject
.
obj
- the execution object to exporttag
- the name of the tag that holds the datepublic Timestamp exportPlannedFinish(ExecutionObject obj, String tag)
PlannedFinish
of the specified
ExecutionObject
.
obj
- the execution object to exporttag
- the name of the tag that holds the date
public void exportRemainingDuration(TimeToElapse total, TimeToElapse actual, String tag)
RemainingDuration
given the
total duration and the actual duration.
total
- the total durationactual
- the actual durationtag
- the name of the tag that holds the durationpublic void exportConstraint(ExecutionObject obj)
ExecutionObject
if required.
It is only possible to export one constraint. The start date takes precedence over the finish date when exporting the constraint.
timeToStart
is not computed then a
START_NO_EARLIER_THAN
constraint is exported for the
start date
timeToStart
is computed and the
estimatedFinishDate
is not rolled-up then a
FINISH_NO_LATER_THAN
constraint is exported for the
finish date
timeToStart
is computed and the
estimatedFinishDate
is rolled-up then an
AS_SOON_AS_POSSIBLE
constraint1 is exported
obj
- the execution object to export the constraint forpublic TimeToElapse exportPlannedDuration(ExecutionObject obj, String tag) throws WTException
PlannedDuration
of the specified
ExecutionObject
.
obj
- the execution object to exporttag
- the name of the tag that holds the date
WTException
public void exportPriority(ExecutionObject obj)
ExecutionObject
.
obj
- the obj to exportpublic void exportEmailAddress(ProjectResource resource)
ProjectResource
.
resource
- the resource to exportpublic void exportInitials(ProjectResource resource)
ProjectResource
.
resource
- the resource to exportpublic void exportConfirmed(ProjectResource resource, String tag) throws WTException
ContainerTeamManaged
associated with the plan being exported then this
resource is confirmed if its associated user has confirmed
participation in the container's team.
WTException
public void exportResponsePending(ProjectResource resource, String tag) throws WTException
ContainerTeamManaged
associated with the plan being
exported then this resource has a "pending response" if the user has
been sent an invitation but has not yet confirmed participation.
WTException
public void exportMaxUnits(ProjectResource resource)
ProjectResource
.
resource
- the resource to exportpublic void exportResourceUnits(ProjectResource resource, int units, String tag)
public Work exportWork(ExecutionObject obj, String tag) throws WTException
ExecutionObject
.
WTException
public Work exportRemainingWork(ExecutionObject obj, String tag) throws WTException
ExecutionObject
.
WTException
public Work exportWork(ProjectResource resource, String tag) throws WTException
ProjectResource
.
WTException
public Work exportWork(ResourceAssignmentLink link, String tag) throws WTException
ResourceAssignmentLink
.
This method uses ProjResourceService.getTotalUnits(wt.projmgmt.resource.ProjectResource, wt.projmgmt.execution.ProjectActivity)
which takes into account whether or not the activity has
work items.
WTException
ProjResourceService.getTotalUnits(wt.projmgmt.resource.ProjectResource, wt.projmgmt.execution.ProjectActivity)
public Work exportActualWork(ExecutionObject obj, String tag) throws WTException
ExecutionObject
.
WTException
public Work exportActualWork(ProjectResource resource, String tag) throws WTException
ProjectResource
.
WTException
public Work exportActualWork(ResourceAssignmentLink link, String tag) throws WTException
ResourceAssignmentLink
.
This method uses ProjResourceService.getCurrentUnits(wt.projmgmt.resource.ProjectResource, wt.projmgmt.execution.ProjectActivity, java.sql.Timestamp)
which takes into account whether or not the activity has
work items.
WTException
ProjResourceService.getCurrentUnits(wt.projmgmt.resource.ProjectResource, wt.projmgmt.execution.ProjectActivity, java.sql.Timestamp)
public void exportRemainingWork(Work total, Work actual, String tag) throws WTException
RemainingWork
given the total
work and the actual work.
total
- the total workactual
- the actual worktag
- the name of the tag that holds the work
WTException
public Currency exportCost(ProjectResource resource, String tag) throws WTException
ProjectResource
.
This method uses
ProjResourceService.getTotalResourceCost(wt.projmgmt.resource.ProjectResource)
.
WTException
ProjResourceService.getTotalResourceCost(wt.projmgmt.resource.ProjectResource)
public Currency exportCost(ResourceAssignmentLink link, String tag) throws WTException
ResourceAssignmentLink
.
This method uses ProjResourceService.getTotalCost(wt.projmgmt.execution.ExecutionObject)
.
When computing total cost, this method makes use of
ProjResourceService.getTotalUnits(wt.projmgmt.resource.ProjectResource, wt.projmgmt.execution.ProjectActivity)
which takes into account whether or not the activity has
work items.
WTException
ProjResourceService.getTotalCost(wt.projmgmt.execution.ExecutionObject)
,
ProjResourceService.getTotalUnits(wt.projmgmt.resource.ProjectResource, wt.projmgmt.execution.ProjectActivity)
public Currency exportActualCost(ProjectResource resource, String tag) throws WTException
ProjectResource
.
This method uses
ProjResourceService.getCurrentResourceCost(wt.projmgmt.resource.ProjectResource, java.sql.Timestamp)
.
WTException
ProjResourceService.getCurrentResourceCost(wt.projmgmt.resource.ProjectResource, java.sql.Timestamp)
public Currency exportActualCost(ResourceAssignmentLink link, String tag) throws WTException
ResourceAssignmentLink
.
This method uses ProjResourceService.getCurrentCost(wt.projmgmt.execution.ExecutionObject, java.sql.Timestamp)
.
When computing current cost, this method makes use of
ProjResourceService.getCurrentUnits(wt.projmgmt.resource.ProjectResource, wt.projmgmt.execution.ProjectActivity, java.sql.Timestamp)
which takes into account whether or not the activity has
work items.
WTException
ProjResourceService.getCurrentCost(wt.projmgmt.execution.ExecutionObject, java.sql.Timestamp)
,
ProjResourceService.getCurrentUnits(wt.projmgmt.resource.ProjectResource, wt.projmgmt.execution.ProjectActivity, java.sql.Timestamp)
public void exportRemainingCost(Currency total, Currency actual, String tag)
RemainingCost
given the
total cost and the actual cost.
total
- the total costactual
- the actual costtag
- the name of the tag that holds the costpublic void exportPlannedStart(ResourceAssignmentLink link, String tag) throws WTException
ResourceAssignmentLink
.
WTException
public void exportPercentComplete(ResourceAssignmentLink link, String tag) throws WTException
ResourceAssignmentLink
.
WTException
public void exportActualStart(ResourceAssignmentLink link, String tag) throws WTException
ResourceAssignmentLink
.
WTException
public void exportPlannedFinish(ResourceAssignmentLink link, String tag) throws WTException
ResourceAssignmentLink
.
WTException
public void exportActualFinish(ResourceAssignmentLink link, String tag) throws WTException
ResourceAssignmentLink
.
WTException
public void exportName(ProjectResource resource, String tag)
ProjectResource
.
Microsoft Project
does not allow commas or
brackets in resource names, so replace these characers
with acceptable characters:
resource
- the resource to exportpublic void exportExtendedAttributeType(int type, String tag)
The type can be one of the following values:
public void exportOID(Persistable p, boolean isTask0)
PTC.ID
and PTC.CLASS
extended attributes. If isTask0
is true
then 0
is used as the value for the attribute's
UID
element.
public void exportServerInfo(Persistable p, boolean isTask0)
PTC.CODEBASE
PTC.ACTION
public void exportWTContainer(ExecutionObject exObj, boolean isTask0) throws WTException
PTC.PROJECT
PTC.LOCATION
WTException
public void exportDeliverables(ExecutionObject exObj) throws WTException
PTC.DELIVERABLES
extended attribute.
WTException
public void exportMiscFields(ExecutionObject exObj) throws WTException
Since M010, the Notebook textfield was renamed to MISC and combined with other fields
the MISC textfield contains NoteBookReference-ExecutionConfiguration|BeforeDeadline|AfterDeadline where before and after deadline are stored as days. There are 4 possible scenarios:
WTException
public void exportPTCOwner(ExecutionObject exObj, boolean isTask0) throws WTException
PTC.OWNER
extended attribute.
WTException
public void exportStatusInfo(ExecutionObject exObj, boolean isTask0) throws WTException
PTC.RISK
, PTC.RISK_DESC
,
PTC.STATUS
, PTC.STATUS_DESC
and
PTC.EXEC_STATE
extended attributes.
WTException
private void exportSubPlanId(ProjectProxy proxy)
PTC.PROJECT
if existing
public void exportExtendedAttribute(Persistable p, long ea_uid, String ea_value, String ea_fieldId)
ExtendedAttribute
. If the
persistable is null
then the value of the
UID
element is exported as 0
. If
ea_value
is null
then nothing
is exported.
p
- the persistable that the attribute applies toea_uid
- the UID of the extended attributeea_value
- the value for the extended attributeea_fieldId
- the field ID for the extended attributepublic void exportExtendedAttribute(Persistable p, long ea_uid, long ea_value, String ea_fieldId)
ExtendedAttribute
.
p
- the persistable that the attribute applies toea_uid
- the UID of the extended attributeea_value
- the value for the extended attributeea_fieldId
- the field ID for the extended attributepublic void exportExtendedAttribute(Persistable p, long ea_uid, EnumeratedType enum, String ea_fieldId)
ExtendedAttribute
.
p
- the persistable that the attribute applies toea_uid
- the UID of the extended attributeea_fieldId
- the field ID for the extended attributepublic void exportEaEstimatedStart(ExecutionObject obj)
public void exportEaEstimatedFinish(ExecutionObject obj)
public void exportEaEstimatedDuration(ExecutionObject obj) throws WTException
WTException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |