From 3604a1c2f853c7afd3c18cecc1dfd75eda929fe0 Mon Sep 17 00:00:00 2001 From: Jon Iles Date: Mon, 16 Dec 2024 18:21:02 +0000 Subject: [PATCH] Add parent code methods to interface (#793) --- src/changes/changes.xml | 1 + .../java/net/sf/mpxj/ActivityCodeValue.java | 17 +-- src/main/java/net/sf/mpxj/CodeValue.java | 14 ++ .../java/net/sf/mpxj/ProjectCodeValue.java | 14 +- .../java/net/sf/mpxj/ProjectProperties.java | 2 +- src/main/java/net/sf/mpxj/Resource.java | 4 +- .../java/net/sf/mpxj/ResourceAssignment.java | 2 +- .../sf/mpxj/ResourceAssignmentCodeValue.java | 14 +- .../java/net/sf/mpxj/ResourceCodeValue.java | 14 +- src/main/java/net/sf/mpxj/RoleCodeValue.java | 14 +- .../primavera/PrimaveraPMProjectWriter.java | 130 +++--------------- .../primavera/PrimaveraXERFileWriter.java | 28 ++-- 12 files changed, 66 insertions(+), 188 deletions(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 06dea0ee1c..75a0dcf619 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -16,6 +16,7 @@ Marked the `ActivityCodeValue.getParent()` method as deprecated. Use `ActivityCodeValue.getParentValue()` instead. Marked the `ActivityCodeValue.getParentUniqueID()` method as deprecated. Use `ActivityCodeValue.getParentValueUniqueID()` instead. Marked the `ActivityCodeValue.Builder.parent()` method as deprecated. Use `ActivityCodeValue.Builder.parentValue()` instead. + Marked the `ActivityCodeValue.getActivityCode()` method as deprecated. Use `ActivityCodeValue.getParentCode()` instead. Update the MPXJ ruby gem to allow access to calendar data. diff --git a/src/main/java/net/sf/mpxj/ActivityCodeValue.java b/src/main/java/net/sf/mpxj/ActivityCodeValue.java index 116ef94e22..d51be1c252 100644 --- a/src/main/java/net/sf/mpxj/ActivityCodeValue.java +++ b/src/main/java/net/sf/mpxj/ActivityCodeValue.java @@ -52,7 +52,7 @@ private ActivityCodeValue(Builder builder) * Retrieves the parent activity code. * * @return ActivityCode instance - * @deprecated use getActivityCode instead + * @deprecated use getParentCode instead */ @Deprecated public ActivityCode getType() { @@ -63,18 +63,19 @@ private ActivityCodeValue(Builder builder) * Retrieves the parent activity code. * * @return ActivityCode instance + * @deprecated use getParentCode instead */ - public ActivityCode getActivityCode() + @Deprecated public ActivityCode getActivityCode() { return m_activityCode; } - /** - * Retrieves the parent activity code unique ID. - * - * @return parent activity code unique ID - */ - public Integer getActivityCodeUniqueID() + @Override public ActivityCode getParentCode() + { + return m_activityCode; + } + + @Override public Integer getParentCodeUniqueID() { return m_activityCode == null ? null : m_activityCode.getUniqueID(); } diff --git a/src/main/java/net/sf/mpxj/CodeValue.java b/src/main/java/net/sf/mpxj/CodeValue.java index b9bf1f246e..2c49176eee 100644 --- a/src/main/java/net/sf/mpxj/CodeValue.java +++ b/src/main/java/net/sf/mpxj/CodeValue.java @@ -36,6 +36,20 @@ public interface CodeValue */ Integer getUniqueID(); + /** + * Retrieve the parent Code. + * + * @return parent Code instance + */ + Code getParentCode(); + + /** + * Retrieve the parent code's unique ID. + * + * @return parent code unique ID + */ + Integer getParentCodeUniqueID(); + /** * Retrieves the sequence number for this value. * diff --git a/src/main/java/net/sf/mpxj/ProjectCodeValue.java b/src/main/java/net/sf/mpxj/ProjectCodeValue.java index ac3dce8f50..f106549048 100644 --- a/src/main/java/net/sf/mpxj/ProjectCodeValue.java +++ b/src/main/java/net/sf/mpxj/ProjectCodeValue.java @@ -45,22 +45,12 @@ private ProjectCodeValue(Builder builder) m_parentValue = builder.m_parentValue; } - /** - * Retrieves the parent project code. - * - * @return ProjectCode instance - */ - public ProjectCode getProjectCode() + @Override public ProjectCode getParentCode() { return m_projectCode; } - /** - * Retrieves the parent project code unique ID. - * - * @return parent project code unique ID - */ - public Integer getProjectCodeUniqueID() + @Override public Integer getParentCodeUniqueID() { return m_projectCode == null ? null : m_projectCode.getUniqueID(); } diff --git a/src/main/java/net/sf/mpxj/ProjectProperties.java b/src/main/java/net/sf/mpxj/ProjectProperties.java index 69c184660e..65c5bf6227 100644 --- a/src/main/java/net/sf/mpxj/ProjectProperties.java +++ b/src/main/java/net/sf/mpxj/ProjectProperties.java @@ -3598,7 +3598,7 @@ public void setProjectWebsiteUrl(String value) */ @SuppressWarnings("unchecked") public void addProjectCodeValue(ProjectCodeValue value) { - ((Map) get(ProjectField.PROJECT_CODE_VALUES)).put(value.getProjectCode(), value); + ((Map) get(ProjectField.PROJECT_CODE_VALUES)).put(value.getParentCode(), value); } /** diff --git a/src/main/java/net/sf/mpxj/Resource.java b/src/main/java/net/sf/mpxj/Resource.java index 46976b2772..d50e67b195 100644 --- a/src/main/java/net/sf/mpxj/Resource.java +++ b/src/main/java/net/sf/mpxj/Resource.java @@ -2712,7 +2712,7 @@ public void setPrimaryRole(Resource role) */ @SuppressWarnings("unchecked") public void addResourceCodeValue(ResourceCodeValue value) { - ((Map) get(ResourceField.RESOURCE_CODE_VALUES)).put(value.getResourceCode(), value); + ((Map) get(ResourceField.RESOURCE_CODE_VALUES)).put(value.getParentCode(), value); } /** @@ -2732,7 +2732,7 @@ public void setPrimaryRole(Resource role) */ @SuppressWarnings("unchecked") public void addRoleCodeValue(RoleCodeValue value) { - ((Map) get(ResourceField.ROLE_CODE_VALUES)).put(value.getRoleCode(), value); + ((Map) get(ResourceField.ROLE_CODE_VALUES)).put(value.getParentCode(), value); } /** diff --git a/src/main/java/net/sf/mpxj/ResourceAssignment.java b/src/main/java/net/sf/mpxj/ResourceAssignment.java index 1149f5f80b..08f237cd69 100644 --- a/src/main/java/net/sf/mpxj/ResourceAssignment.java +++ b/src/main/java/net/sf/mpxj/ResourceAssignment.java @@ -3030,7 +3030,7 @@ public Rate getEffectiveRate(LocalDateTime date) */ @SuppressWarnings("unchecked") public void addResourceAssignmentCodeValue(ResourceAssignmentCodeValue value) { - ((Map) get(AssignmentField.RESOURCE_ASSIGNMENT_CODE_VALUES)).put(value.getResourceAssignmentCode(), value); + ((Map) get(AssignmentField.RESOURCE_ASSIGNMENT_CODE_VALUES)).put(value.getParentCode(), value); } /** diff --git a/src/main/java/net/sf/mpxj/ResourceAssignmentCodeValue.java b/src/main/java/net/sf/mpxj/ResourceAssignmentCodeValue.java index c41cc2c12f..f5c8776d3b 100644 --- a/src/main/java/net/sf/mpxj/ResourceAssignmentCodeValue.java +++ b/src/main/java/net/sf/mpxj/ResourceAssignmentCodeValue.java @@ -45,22 +45,12 @@ private ResourceAssignmentCodeValue(Builder builder) m_parentValue = builder.m_parentValue; } - /** - * Retrieves the parent assignment code. - * - * @return ResourceAssignmentCode instance - */ - public ResourceAssignmentCode getResourceAssignmentCode() + @Override public ResourceAssignmentCode getParentCode() { return m_resourceAssignmentCode; } - /** - * Retrieves the parent assignment code unique ID. - * - * @return parent assignment code unique ID - */ - public Integer getResourceAssignmentCodeUniqueID() + @Override public Integer getParentCodeUniqueID() { return m_resourceAssignmentCode == null ? null : m_resourceAssignmentCode.getUniqueID(); } diff --git a/src/main/java/net/sf/mpxj/ResourceCodeValue.java b/src/main/java/net/sf/mpxj/ResourceCodeValue.java index c49318e590..6eef25b464 100644 --- a/src/main/java/net/sf/mpxj/ResourceCodeValue.java +++ b/src/main/java/net/sf/mpxj/ResourceCodeValue.java @@ -45,22 +45,12 @@ private ResourceCodeValue(Builder builder) m_parentValue = builder.m_parentValue; } - /** - * Retrieves the parent resource code. - * - * @return ResourceCode instance - */ - public ResourceCode getResourceCode() + @Override public ResourceCode getParentCode() { return m_resourceCode; } - /** - * Retrieves the parent resource code unique ID. - * - * @return parent resource code unique ID - */ - public Integer getResourceCodeUniqueID() + @Override public Integer getParentCodeUniqueID() { return m_resourceCode == null ? null : m_resourceCode.getUniqueID(); } diff --git a/src/main/java/net/sf/mpxj/RoleCodeValue.java b/src/main/java/net/sf/mpxj/RoleCodeValue.java index be56f15ed5..1aa5b1e2cc 100644 --- a/src/main/java/net/sf/mpxj/RoleCodeValue.java +++ b/src/main/java/net/sf/mpxj/RoleCodeValue.java @@ -45,22 +45,12 @@ private RoleCodeValue(Builder builder) m_parentValue = builder.m_parentValue; } - /** - * Retrieves the parent role code. - * - * @return RoleCode instance - */ - public RoleCode getRoleCode() + @Override public RoleCode getParentCode() { return m_roleCode; } - /** - * Retrieves the parent role code unique ID. - * - * @return parent role code unique ID - */ - public Integer getRoleCodeUniqueID() + @Override public Integer getParentCodeUniqueID() { return m_roleCode == null ? null : m_roleCode.getUniqueID(); } diff --git a/src/main/java/net/sf/mpxj/primavera/PrimaveraPMProjectWriter.java b/src/main/java/net/sf/mpxj/primavera/PrimaveraPMProjectWriter.java index f2c9c78963..e3720afa62 100644 --- a/src/main/java/net/sf/mpxj/primavera/PrimaveraPMProjectWriter.java +++ b/src/main/java/net/sf/mpxj/primavera/PrimaveraPMProjectWriter.java @@ -41,6 +41,8 @@ import net.sf.mpxj.ActivityCodeValue; import net.sf.mpxj.Availability; import net.sf.mpxj.AvailabilityTable; +import net.sf.mpxj.Code; +import net.sf.mpxj.CodeValue; import net.sf.mpxj.CostAccount; import net.sf.mpxj.CostRateTable; import net.sf.mpxj.CostRateTableEntry; @@ -194,7 +196,7 @@ private void write(boolean baseline) m_udf = project.getUDF(); writeProjectProperties(project); - writeProjectCodeAssignments(project.getCode()); + writeCodeAssignments(m_projectFile.getProjectProperties().getProjectCodeValues(), project.getCode()); writeActivityCodeDefinitions(project.getActivityCodeType(), project.getActivityCode()); writeCalendars(project.getCalendar()); writeTasks(); @@ -225,7 +227,7 @@ private void write(boolean baseline) writeResourceCodeDefinitions(); writeRoleCodeDefinitions(); writeResourceAssignmentCodeDefinitions(); - writeProjectCodeAssignments(project.getCode()); + writeCodeAssignments(m_projectFile.getProjectProperties().getProjectCodeValues(), project.getCode()); writeActivityCodeDefinitions(project.getActivityCodeType(), project.getActivityCode()); writeCalendars(project.getCalendar()); writeUDF(); @@ -931,7 +933,7 @@ private void writeResource(Resource mpxj) xml.getUDF().addAll(writeUserDefinedFieldAssignments(FieldTypeClass.RESOURCE, false, mpxj)); - writeResourceCodeAssignments(mpxj, xml.getCode()); + writeCodeAssignments(mpxj.getResourceCodeValues(), xml.getCode()); } /** @@ -959,7 +961,7 @@ private void writeRole(Resource mpxj) xml.setResponsibilities(getNotes(mpxj.getNotesObject())); xml.setSequenceNumber(mpxj.getSequenceNumber()); - writeRoleCodeAssignments(mpxj, xml.getCode()); + writeCodeAssignments(mpxj.getRoleCodeValues(), xml.getCode()); } /** @@ -1182,7 +1184,7 @@ private void writeActivity(Task mpxj) writeActivityNote(mpxj); writePredecessors(mpxj); - writeActivityCodeAssignments(mpxj, xml); + writeCodeAssignments(mpxj.getActivityCodeValues(), xml.getCode()); } /** @@ -1287,7 +1289,7 @@ private void writeAssignment(ResourceAssignment mpxj) xml.setRemainingCurve(TimephasedHelper.write(calendar, mpxj.getTimephasedWork())); } - writeResourceAsssignmentCodeAssignments(mpxj, xml.getCode()); + writeCodeAssignments(mpxj.getResourceAssignmentCodeValues(), xml.getCode()); } private Double getResourceAssignmentRemainingDuration(Task task, ResourceAssignment mpxj) @@ -1969,101 +1971,26 @@ private void writeResourceAssignmentCodeDefinitions() } /** - * Write project code assignments. + * Write code assignments. * - * @param assignments project code assignments + * @param assignments code assignments */ - private void writeProjectCodeAssignments(List assignments) + private void writeCodeAssignments(Map map, List assignments) { - m_projectFile.getProjectProperties().getProjectCodeValues().values().stream().sorted(Comparator.comparing(ProjectCodeValue::getUniqueID)).forEach(v -> writeProjectCodeAssignment(assignments, v)); + map.values().stream().sorted(Comparator.comparing(CodeValue::getUniqueID)).forEach(v -> writeCodeAssignment(assignments, v)); } /** - * Write a project code assignment. + * Write a code assignment. * - * @param assignments project code assignments + * @param assignments code assignments * @param value project code value */ - private void writeProjectCodeAssignment(List assignments, ProjectCodeValue value) + private void writeCodeAssignment(List assignments, CodeValue value) { CodeAssignmentType xml = m_factory.createCodeAssignmentType(); assignments.add(xml); - xml.setTypeObjectId(NumberHelper.getInt(value.getProjectCodeUniqueID())); - xml.setValueObjectId(NumberHelper.getInt(value.getUniqueID())); - } - - /** - * Write resource code assignments. - * - * @param resource parent resource - * @param assignments resource code assignments - */ - private void writeResourceCodeAssignments(Resource resource, List assignments) - { - resource.getResourceCodeValues().values().stream().sorted(Comparator.comparing(ResourceCodeValue::getUniqueID)).forEach(v -> writeResourceCodeAssignment(assignments, v)); - } - - /** - * Write role code assignments. - * - * @param role parent role - * @param assignments role code assignments - */ - private void writeRoleCodeAssignments(Resource role, List assignments) - { - role.getRoleCodeValues().values().stream().sorted(Comparator.comparing(RoleCodeValue::getUniqueID)).forEach(v -> writeRoleCodeAssignment(assignments, v)); - } - - /** - * Write resource assignment code assignments. - * - * @param assignment parent resource assignment - * @param assignments resource assignment code assignments - */ - private void writeResourceAsssignmentCodeAssignments(ResourceAssignment assignment, List assignments) - { - assignment.getResourceAssignmentCodeValues().values().stream().sorted(Comparator.comparing(ResourceAssignmentCodeValue::getUniqueID)).forEach(v -> writeResourceAssignmentCodeAssignment(assignments, v)); - } - - /** - * Write a resource code assignment. - * - * @param assignments resource code assignments - * @param value resource code value - */ - private void writeResourceCodeAssignment(List assignments, ResourceCodeValue value) - { - CodeAssignmentType xml = m_factory.createCodeAssignmentType(); - assignments.add(xml); - xml.setTypeObjectId(NumberHelper.getInt(value.getResourceCodeUniqueID())); - xml.setValueObjectId(NumberHelper.getInt(value.getUniqueID())); - } - - /** - * Write a role code assignment. - * - * @param assignments role code assignments - * @param value role code value - */ - private void writeRoleCodeAssignment(List assignments, RoleCodeValue value) - { - CodeAssignmentType xml = m_factory.createCodeAssignmentType(); - assignments.add(xml); - xml.setTypeObjectId(NumberHelper.getInt(value.getRoleCodeUniqueID())); - xml.setValueObjectId(NumberHelper.getInt(value.getUniqueID())); - } - - /** - * Write a resource assignment code assignment. - * - * @param assignments resource assignment code assignments - * @param value role code value - */ - private void writeResourceAssignmentCodeAssignment(List assignments, ResourceAssignmentCodeValue value) - { - CodeAssignmentType xml = m_factory.createCodeAssignmentType(); - assignments.add(xml); - xml.setTypeObjectId(NumberHelper.getInt(value.getResourceAssignmentCodeUniqueID())); + xml.setTypeObjectId(NumberHelper.getInt(value.getParentCodeUniqueID())); xml.setValueObjectId(NumberHelper.getInt(value.getUniqueID())); } @@ -2092,31 +2019,6 @@ private void writeActivityCodeValueDefinition(ActivityCodeTypeType code, Activit value.getChildValues().stream().sorted(comparator).forEach(v -> writeActivityCodeValueDefinition(code, xml, values, v, comparator)); } - /** - * Write activity code assignments for this task. - * - * @param task MPXJ task - * @param xml PMXML activity - */ - private void writeActivityCodeAssignments(Task task, ActivityType xml) - { - task.getActivityCodeValues().values().stream().sorted(Comparator.comparing(ActivityCodeValue::getUniqueID)).forEach(v -> writeActivityCodeAssignment(xml, v)); - } - - /** - * Write an individual activity code assignment. - * - * @param xml PMXML activity - * @param value activity code value - */ - private void writeActivityCodeAssignment(ActivityType xml, ActivityCodeValue value) - { - CodeAssignmentType assignment = m_factory.createCodeAssignmentType(); - xml.getCode().add(assignment); - assignment.setTypeObjectId(NumberHelper.getInt(value.getActivityCodeUniqueID())); - assignment.setValueObjectId(NumberHelper.getInt(value.getUniqueID())); - } - /** * Sets the value of a UDF. * diff --git a/src/main/java/net/sf/mpxj/primavera/PrimaveraXERFileWriter.java b/src/main/java/net/sf/mpxj/primavera/PrimaveraXERFileWriter.java index b364369e60..ce0d310836 100644 --- a/src/main/java/net/sf/mpxj/primavera/PrimaveraXERFileWriter.java +++ b/src/main/java/net/sf/mpxj/primavera/PrimaveraXERFileWriter.java @@ -808,7 +808,7 @@ private void writeProjectCodeAssignments() m_writer.writeTable("PROJPCAT", PROJECT_CODE_ASSIGNMENT_COLUMNS); Integer projectID = getProjectID(m_file.getProjectProperties().getUniqueID()); - assignments.values().stream().sorted(Comparator.comparing(ProjectCodeValue::getProjectCodeUniqueID)).map(v -> populateProjectCodeAssignment(projectID, v)).forEach(a -> m_writer.writeRecord(PROJECT_CODE_ASSIGNMENT_COLUMNS, a)); + assignments.values().stream().sorted(Comparator.comparing(ProjectCodeValue::getParentCodeUniqueID)).map(v -> populateProjectCodeAssignment(projectID, v)).forEach(a -> m_writer.writeRecord(PROJECT_CODE_ASSIGNMENT_COLUMNS, a)); } /** @@ -822,7 +822,7 @@ private Map populateProjectCodeAssignment(Integer projectID, Pro { Map map = new HashMap<>(); map.put("proj_id", projectID); - map.put("proj_catg_type_id", value.getProjectCodeUniqueID()); + map.put("proj_catg_type_id", value.getParentCodeUniqueID()); map.put("proj_catg_id", value.getUniqueID()); return map; } @@ -861,7 +861,7 @@ private void writeResourceCodeValues() private void writeResourceCodeAssignments() { List> assignments = getSortedResourceStream() - .map(r -> r.getResourceCodeValues().values().stream().sorted(Comparator.comparing(ResourceCodeValue::getResourceCodeUniqueID)) + .map(r -> r.getResourceCodeValues().values().stream().sorted(Comparator.comparing(ResourceCodeValue::getParentCodeUniqueID)) .map(v -> populateResourceCodeAssignment(r.getUniqueID(), v)).collect(Collectors.toList())) .flatMap(Collection::stream).collect(Collectors.toList()); @@ -908,7 +908,7 @@ private void writeRoleCodeValues() private void writeRoleCodeAssignments() { List> assignments = getSortedRoleStream() - .map(r -> r.getRoleCodeValues().values().stream().sorted(Comparator.comparing(RoleCodeValue::getRoleCodeUniqueID)) + .map(r -> r.getRoleCodeValues().values().stream().sorted(Comparator.comparing(RoleCodeValue::getParentCodeUniqueID)) .map(v -> populateRoleCodeAssignment(r.getUniqueID(), v)).collect(Collectors.toList())) .flatMap(Collection::stream).collect(Collectors.toList()); @@ -955,7 +955,7 @@ private void writeResourceAssignmentCodeValues() private void writeResourceAssignmentCodeAssignments() { List> assignments = getSortedResourceAssignmentStream() - .map(r -> r.getResourceAssignmentCodeValues().values().stream().sorted(Comparator.comparing(ResourceAssignmentCodeValue::getResourceAssignmentCodeUniqueID)) + .map(r -> r.getResourceAssignmentCodeValues().values().stream().sorted(Comparator.comparing(ResourceAssignmentCodeValue::getParentCodeUniqueID)) .map(v -> populateResourceAssignmentCodeAssignment(r.getUniqueID(), v)).collect(Collectors.toList())) .flatMap(Collection::stream).collect(Collectors.toList()); @@ -981,7 +981,7 @@ private Map populateResourceCodeAssignment(Integer resourceID, R { Map map = new HashMap<>(); map.put("rsrc_id", resourceID); - map.put("rsrc_catg_type_id", value.getResourceCodeUniqueID()); + map.put("rsrc_catg_type_id", value.getParentCodeUniqueID()); map.put("rsrc_catg_id", value.getUniqueID()); return map; } @@ -997,7 +997,7 @@ private Map populateRoleCodeAssignment(Integer roleID, RoleCodeV { Map map = new HashMap<>(); map.put("role_id", roleID); - map.put("role_catg_type_id", value.getRoleCodeUniqueID()); + map.put("role_catg_type_id", value.getParentCodeUniqueID()); map.put("role_catg_id", value.getUniqueID()); return map; } @@ -1013,7 +1013,7 @@ private Map populateResourceAssignmentCodeAssignment(Integer res { Map map = new HashMap<>(); map.put("taskrsrc_id", resourceAssignmentID); - map.put("asgnmnt_catg_type_id", value.getResourceAssignmentCodeUniqueID()); + map.put("asgnmnt_catg_type_id", value.getParentCodeUniqueID()); map.put("asgnmnt_catg_id", value.getUniqueID()); map.put("proj_id", getProjectID(m_file.getProjectProperties().getUniqueID())); return map; @@ -1877,7 +1877,7 @@ interface ExportFunction { ACTIVITY_CODE_VALUE_COLUMNS.put("actv_code_id", a -> a.getUniqueID()); ACTIVITY_CODE_VALUE_COLUMNS.put("parent_actv_code_id", a -> a.getParentValueUniqueID()); - ACTIVITY_CODE_VALUE_COLUMNS.put("actv_code_type_id", a -> a.getActivityCodeUniqueID()); + ACTIVITY_CODE_VALUE_COLUMNS.put("actv_code_type_id", a -> a.getParentCodeUniqueID()); ACTIVITY_CODE_VALUE_COLUMNS.put("actv_code_name", a -> StringHelper.stripControlCharacters(a.getDescription())); ACTIVITY_CODE_VALUE_COLUMNS.put("short_name", a -> StringHelper.stripControlCharacters(a.getName())); ACTIVITY_CODE_VALUE_COLUMNS.put("seq_num", a -> a.getSequenceNumber()); @@ -1889,7 +1889,7 @@ interface ExportFunction static { ACTIVITY_CODE_ASSIGNMENT_COLUMNS.put("task_id", p -> p.getFirst().getUniqueID()); - ACTIVITY_CODE_ASSIGNMENT_COLUMNS.put("actv_code_type_id", p -> p.getSecond().getActivityCodeUniqueID()); + ACTIVITY_CODE_ASSIGNMENT_COLUMNS.put("actv_code_type_id", p -> p.getSecond().getParentCodeUniqueID()); ACTIVITY_CODE_ASSIGNMENT_COLUMNS.put("actv_code_id", p -> p.getSecond().getUniqueID()); ACTIVITY_CODE_ASSIGNMENT_COLUMNS.put("proj_id", p -> getProjectID(p.getFirst().getParentFile().getProjectProperties().getUniqueID())); } @@ -2032,7 +2032,7 @@ interface ExportFunction static { PROJECT_CODE_VALUE_COLUMNS.put("proj_catg_id", v -> v.getUniqueID()); - PROJECT_CODE_VALUE_COLUMNS.put("proj_catg_type_id", v -> v.getProjectCodeUniqueID()); + PROJECT_CODE_VALUE_COLUMNS.put("proj_catg_type_id", v -> v.getParentCodeUniqueID()); PROJECT_CODE_VALUE_COLUMNS.put("seq_num", v -> v.getSequenceNumber()); PROJECT_CODE_VALUE_COLUMNS.put("proj_catg_short_name", v -> v.getName()); PROJECT_CODE_VALUE_COLUMNS.put("parent_proj_catg_id", v -> v.getParentValueUniqueID()); @@ -2060,7 +2060,7 @@ interface ExportFunction static { RESOURCE_CODE_VALUE_COLUMNS.put("rsrc_catg_id", v -> v.getUniqueID()); - RESOURCE_CODE_VALUE_COLUMNS.put("rsrc_catg_type_id", v -> v.getResourceCodeUniqueID()); + RESOURCE_CODE_VALUE_COLUMNS.put("rsrc_catg_type_id", v -> v.getParentCodeUniqueID()); RESOURCE_CODE_VALUE_COLUMNS.put("seq_num", v -> v.getSequenceNumber()); RESOURCE_CODE_VALUE_COLUMNS.put("rsrc_catg_short_name", v -> v.getName()); RESOURCE_CODE_VALUE_COLUMNS.put("rsrc_catg_name", v -> v.getDescription()); @@ -2088,7 +2088,7 @@ interface ExportFunction static { ROLE_CODE_VALUE_COLUMNS.put("role_catg_id", v -> v.getUniqueID()); - ROLE_CODE_VALUE_COLUMNS.put("role_catg_type_id", v -> v.getRoleCodeUniqueID()); + ROLE_CODE_VALUE_COLUMNS.put("role_catg_type_id", v -> v.getParentCodeUniqueID()); ROLE_CODE_VALUE_COLUMNS.put("seq_num", v -> v.getSequenceNumber()); ROLE_CODE_VALUE_COLUMNS.put("role_catg_short_name", v -> v.getName()); ROLE_CODE_VALUE_COLUMNS.put("role_catg_name", v -> v.getDescription()); @@ -2116,7 +2116,7 @@ interface ExportFunction static { RESOURCE_ASSIGNMENT_CODE_VALUE_COLUMNS.put("asgnmnt_catg_id", v -> v.getUniqueID()); - RESOURCE_ASSIGNMENT_CODE_VALUE_COLUMNS.put("asgnmnt_catg_type_id", v -> v.getResourceAssignmentCodeUniqueID()); + RESOURCE_ASSIGNMENT_CODE_VALUE_COLUMNS.put("asgnmnt_catg_type_id", v -> v.getParentCodeUniqueID()); RESOURCE_ASSIGNMENT_CODE_VALUE_COLUMNS.put("seq_num", v -> v.getSequenceNumber()); RESOURCE_ASSIGNMENT_CODE_VALUE_COLUMNS.put("asgnmnt_catg_short_name", v -> v.getName()); RESOURCE_ASSIGNMENT_CODE_VALUE_COLUMNS.put("asgnmnt_catg_name", v -> v.getDescription());