COmp INtfc Code

Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

/* 01/07/2008 modified for usability enhancements */ /* 12/12/2007 modified for usability enhancements */ import PSXP_RPTDEFNMANAGER:*; import EP_FUNCTIONS:EP_Utilities2; Declare

Declare Declare ; Declare a; Declare Declare Function DeleteLocalFile PeopleCode PSXPFUNCLIB.FUNCLIB FieldFormula; Function GetDirSeparator PeopleCode PSXPFUNCLIB.FUNCLIB FieldFormula; Function GetFileNameFromPath PeopleCode PSXPFUNCLIB.FUNCLIB FieldFormula Function GetDirectoryFromPath PeopleCode PSXPFUNCLIB.FUNCLIB FieldFormul Function GetFileExtension PeopleCode PSXPFUNCLIB.FUNCLIB FieldFormula; Function GetText PeopleCode FUNCLIB_EP.HR_SSTEXT_KEY1 FieldFormula;

Global Record &EP_GBLKEYS_WRK; Local string &strSection, &strItem, &strSubItem; &EP_Utilities2 = create EP_FUNCTIONS:EP_Utilities2(); Evaluate %Component When = Component.EP_APPR_BASE &strSection = "EP_APPR_B_SEC"; &strItem = "EP_APPR_B_ITEM"; &strLearn = "EP_LM_LEARNING"; &strSubItem = "EP_APPR_B_SUB"; Break; When = Component.EP_APPR_MAIN &strSection = "EP_APPR_SECTION"; &strItem = "EP_APPR_ITEM"; &strLearn = "EP_LM_LEARNING"; &strSubItem = "EP_APPR_SUBITEM"; &strAttach = "EP_ATTACH"; Break; End-Evaluate; Local Rowset &rsHeader = GetLevel0(); Local Record &recHeader = GetRecord(Record.EP_APPR); Local Record &recDerived = GetRecord(Record.DERIVED_EP); Local Record &recButton = GetRecord(Record.EP_BTN_LINK_WRK); Local XmlDoc &xmldocRoot = CreateXmlDoc("<?xml version='1.0' encoding = 'UTF-8'? ><root></root>"); Local XmlNode &nodeRoot = &xmldocRoot.DocumentElement; Local XmlNode &nodeCurrent, &nodeParent, &nodeEvaluation, &nodeSection, &nodeIte m, &nodeSubItem, &nodeEmployee; /* Header Elements */ &nodeCurrent = &nodeRoot.AddElement("document_id"); &nodeCurrent.NodeValue = &recHeader.EP_APPRAISAL_ID.Value; &nodeCurrent = &nodeRoot.AddElement("document_transaction_title"); &nodeCurrent.NodeValue = &recButton.EP_TRANSTITLE.Value; &nodeCurrent = &nodeRoot.AddElement("document_page_title"); &nodeCurrent.NodeValue = &recButton.EP_PAGETITLE1.Value; /* remove html tags as they are not understood by xmlp */

/*&STR_NO_HTML = &EP_Utilities2.RemHtmlTags(&recButton.EP_HTMLAREA1.Value);*/ If %Component = Component.EP_APPR_BASE Then &recButton.EP_HTMLAREA1.Visible = False; End-If; If &recButton.EP_HTMLAREA1.Visible = True Then &STR_NO_HTML = StripOffHtmlTags(&recButton.EP_HTMLAREA1.Value); &nodeCurrent = &nodeRoot.AddElement("document_instructional_text"); &nodeCurrent.NodeValue = &STR_NO_HTML; End-If; &nodeCurrent = &nodeRoot.AddElement("document_type"); &nodeCurrent.NodeValue = EP_REVW_TYP_TBL.EP_REVW_DESCR.Value; &nodeCurrent = &nodeRoot.AddElement("document_template"); &nodeCurrent.AddAttribute("value", EP_TMPL_DEFN.DESCR.Value); &nodeCurrent.AddAttribute("id", &recHeader.EP_TEMPLATE_ID.Value); &nodeCurrent = &nodeRoot.AddElement("document_period_begin_date"); &nodeCurrent.NodeValue = &recHeader.PERIOD_BEGIN_DT.FormattedValue; &nodeCurrent = &nodeRoot.AddElement("document_period_end_date"); &nodeCurrent.NodeValue = &recHeader.PERIOD_END_DT.FormattedValue; &nodeCurrent = &nodeRoot.AddElement("document_status"); &nodeCurrent.AddAttribute("value", &recHeader.EP_REVIEW_STATUS.LongTranslateValu e); &nodeCurrent.AddAttribute("id", &recHeader.EP_REVIEW_STATUS.Value); If %Component = Component.EP_APPR_MAIN Then If &recHeader.EP_APPROVAL_STATUS.Visible Then &nodeCurrent = &nodeRoot.AddElement("document_approval_status"); &nodeCurrent.AddAttribute("value", &recHeader.EP_APPROVAL_STATUS.LongTrans lateValue); &nodeCurrent.AddAttribute("id", &recHeader.EP_APPROVAL_STATUS.Value); &nodeCurrent.AddAttribute("label", &recHeader.EP_APPROVAL_STATUS.Label); End-If; End-If; If &recDerived.EP_NAME.Visible = True Then &nodeCurrent = &nodeRoot.AddElement("document_employee_id"); &nodeCurrent.NodeValue = &recHeader.EMPLID.Value; &nodeCurrent = &nodeRoot.AddElement("document_employee_name"); &nodeCurrent.NodeValue = &recDerived.EP_NAME.Value; &nodeCurrent = &nodeRoot.AddElement("document_employee_job_code"); /* CC - JK - 06/04/2011 - CC_CHG1041738 - Start of Modification */ Local string &Job_Title; SQLExec("SELECT A.CC_JOB_TITLE FROM PS_JOB A WHERE A.EMPLID = :1 AND A.EMPL_R CD = :2 AND A.EFFDT = (SELECT MAX(B.EFFDT) FROM PS_JOB B WHERE B.EMPLID = A.EMPL ID AND B.EMPL_RCD = A.EMPL_RCD AND B.EFFDT <= %CURRENTDATEIN) AND A.EFFSEQ = (SE LECT MAX(C.EFFSEQ) FROM PS_JOB C WHERE C.EMPLID = A.EMPLID AND C.EMPL_RCD = A.EM PL_RCD AND C.EFFDT = A.EFFDT)", &recHeader.EMPLID.Value, &recHeader.EMPL_RCD.Val ue, &Job_Title); rem &nodeCurrent.NodeValue = JOBCODE_TBL.DESCR.Value; &nodeCurrent.NodeValue = &Job_Title; /* CC - JK - 06/04/2011 - CC_CHG1041738 - End of Modification */ End-If;

If %Component = Component.EP_APPR_MAIN Then If &recButton.EP_HTMLAREA9.Visible Then &nodeCurrent = &nodeRoot.AddElement("other_contributors"); &nodeCurrent.AddAttribute("label", &recButton.EP_GROUPBOX16.Label); &nodeCurrent.AddAttribute("value", &recButton.EP_HTMLAREA9.Value); End-If; End-If; If %Component = Component.EP_APPR_MAIN Then If &recButton.EP_GROUPBOX15.Visible = True Then &nodeEmployee = &nodeRoot.AddElement("employee"); &nodeEmployee.AddAttribute("label", &recButton.EP_GROUPBOX15.Label); End-If; If &recDerived.EMPLID.Visible = True And &recButton.EP_GROUPBOX15.Visible = True Then &nodeCurrent = &nodeEmployee.AddElement("employee_det"); &nodeCurrent.AddAttribute("label", &recDerived.EMPLID.GetLongLabel("EMPLID ")); &nodeCurrent.AddAttribute("value", &recDerived.EMPLID.Value); &nodeCurrent.AddAttribute("id", " "); End-If; If &recDerived.DEPTID.Visible = True And &recButton.EP_GROUPBOX15.Visible = True Then &nodeCurrent = &nodeEmployee.AddElement("employee_det"); &nodeCurrent.AddAttribute("label", &recDerived.DEPTID.GetLongLabel("DEPTID ")); &nodeCurrent.AddAttribute("value", &recDerived.DEPTID.Value); &nodeCurrent.AddAttribute("id", DEPT_TBL.DESCR.Value); End-If; If &recDerived.LOCATION.Visible = True And &recButton.EP_GROUPBOX15.Visible = True Then &nodeCurrent = &nodeEmployee.AddElement("employee_det"); &nodeCurrent.AddAttribute("label", &recDerived.LOCATION.GetShortLabel("LOC ATION")); &nodeCurrent.AddAttribute("value", &recDerived.LOCATION.Value); &nodeCurrent.AddAttribute("id", LOCATION_TBL.DESCR.Value); End-If; If &recDerived.GRADE.Visible = True And &recButton.EP_GROUPBOX15.Visible = True Then &nodeCurrent = &nodeEmployee.AddElement("employee_det"); &nodeCurrent.AddAttribute("label", &recDerived.SAL_ADMIN_PLAN.GetShortLabe l("SALPLAN/GRADE")); /* label can also be concatenated if nedded similar to values below */ &grade = &recDerived.GRADE.Value; &sal_plan = &recDerived.SAL_ADMIN_PLAN.Value; &grade_sal_plan = &grade ", " &sal_plan; &nodeCurrent.AddAttribute("value", &recDerived.SAL_ADMIN_PLAN.Value); &nodeCurrent.AddAttribute("id", &recDerived.GRADE.Value); End-If; If &recDerived.EP_STEP.Visible = True And &recButton.EP_GROUPBOX15.Visible = True Then &nodeCurrent = &nodeEmployee.AddElement("employee_det"); &nodeCurrent.AddAttribute("label", &recDerived.EP_STEP.GetShortLabel("EP_S TEP")); &nodeCurrent.AddAttribute("value", &recDerived.EP_STEP.Value); &nodeCurrent.AddAttribute("id", " "); End-If; If &recDerived.EP_YRS_SERV.Visible = True And

&recButton.EP_GROUPBOX15.Visible = True Then &nodeCurrent = &nodeEmployee.AddElement("employee_det"); &nodeCurrent.AddAttribute("label", &recDerived.EP_YRS_SERV.GetLongLabel("E P_YRS_SERVICE")); &yrs_serv = &recDerived.EP_YRS_SERV.Value " " &recDerived.EP_CHAR1.Val ue " " &recDerived.EP_MM_SERV.Value " " &recDerived.EP_CHAR2.Value; &nodeCurrent.AddAttribute("value", &yrs_serv); &nodeCurrent.AddAttribute("id", " "); End-If; If &recDerived.EP_YRS_TIME_ENTRY.Visible = True And &recButton.EP_GROUPBOX15.Visible = True Then &nodeCurrent = &nodeEmployee.AddElement("employee_det"); &nodeCurrent.AddAttribute("label", &recDerived.EP_YRS_TIME_ENTRY.GetLongLa bel("EP_YRS_TIMEENTRY")); &yrs_time = &recDerived.EP_YRS_TIME_ENTRY.Value " " &recDerived.EP_CHA R3.Value " " &recDerived.EP_MM_TIME_ENTRY.Value " " &recDerived.EP_CHAR4 .Value; &nodeCurrent.AddAttribute("value", &yrs_time); &nodeCurrent.AddAttribute("id", " "); End-If; End-If; &nodeEvaluation = &nodeRoot.AddElement("evaluation"); /* Evaluation Elements */ If %Component = Component.EP_APPR_MAIN Then Local Record &recRole = GetRecord(Record.EP_APPR_ROLE); &nodeCurrent = &nodeEvaluation.AddElement("evaluator_id"); &nodeCurrent.NodeValue = &recRole.EP_REVIEWER_ID.Value; &nodeCurrent = &nodeEvaluation.AddElement("evaluator_name"); &nodeCurrent.AddAttribute("value", &recDerived.EP_REVIEWER_NAME.Value); &nodeCurrent.AddAttribute("label", &recRole.EP_REVIEWER_ID.Label); &nodeCurrent = &nodeEvaluation.AddElement("evaluator_role"); &nodeCurrent.AddAttribute("value", EP_ROLE_TBL.EP_DESCR.Value); &nodeCurrent.AddAttribute("id", &recRole.EP_ROLE.Value); &nodeCurrent.AddAttribute("label", &recRole.EP_ROLE.Label); &nodeCurrent = &nodeEvaluation.AddElement("evaluator_due_date"); &nodeCurrent.AddAttribute("value", &recRole.EP_DUE_DT.FormattedValue); &nodeCurrent.AddAttribute("label", &recRole.EP_DUE_DT.Label); &nodeCurrent = &nodeEvaluation.AddElement("evaluator_status"); &nodeCurrent.AddAttribute("value", &recRole.EP_REVIEW_STATUS.LongTranslateVal ue); &nodeCurrent.AddAttribute("id", &recRole.EP_REVIEW_STATUS.Value); &nodeCurrent.AddAttribute("label", &recRole.EP_REVIEW_STATUS.Label); End-If; &nodeSections = &nodeEvaluation.AddElement("evaluator_sections"); /* Section Elements */ Local Rowset &rsSection = GetLevel0()(1).GetRowset(@("Scroll." &strSection)); For &i = 1 To &rsSection.ActiveRowCount Local Record &recSection = &rsSection(&i).GetRecord(@("Record." &strSection )); Local Record &recSectionDerived = &rsSection(&i).GetRecord(Record.DERIVED_EP)

; Local Record &recSectionButton = &rsSection(&i).GetRecord(Record.EP_BTN_LINK_ WRK); /* when there is no visible field in section groupbox, tools automatically hi des groupbox but groupbox visible property is still true so section still shows up in report. To get around check if all fields are not visible. */ If &recSection.EP_SPCL_PROCESS.Value = "O" And &recSection.EP_RESULTS.Visible = False And &recSection.REVIEW_RATING.Visible = False Then Break; End-If; /* new check - print esign section in manager doc only */ If &recSection.EP_SECTION_TYPE.Value <> "ESIGN" Or (%Component = Component.EP_APPR_MAIN And &recSection.EP_SECTION_TYPE.Value = "ESIGN" And &recRole.EP_ROLE.Value = "M") Then &nodeSection = &nodeSections.AddElement("section"); &nodeCurrent = &nodeSection.AddElement("section_type"); &nodeCurrent.AddAttribute("value", &recSection.EP_SECTION_TYPE.Value); &nodeCurrent.AddAttribute("label", &recSectionButton.EP_SECTION_HEADER.Lab el); /* NEW start - to be used later*/ If &recSection.EP_SECTION_TYPE.Value = "ESIGN" Then If %Component = Component.EP_APPR_MAIN And %Component = Component.EP_APPR_MAIN And &recRole.EP_ROLE.Value = "M" Then If &recSectionButton.EP_HTMLAREA2.Visible Then Evaluate &recHeader.EP_EMPL_ACK_IND.Value When = "ACKN" &nodeCurrent = &nodeSection.AddElement("sign_instructional_tex t"); &ep_name = &recDerived.EP_NAME_DISPLAY5.Value; &ep_dttm = &recRole.EP_ACKNOWLEDG_DTTM.FormattedValue; &ep_issue = &recHeader.EP_EMPL_ACK_IND.LongTranslateValue; &EMPLOYEE_LINE = GetText("APPR_MAIN1_INST2", " ", &recSection. EP_SECTION_TYPE.Value, "E", "", " ", &ep_name, &ep_dttm, " ", " ", " "); /*&STR_NO_HTML = &EP_Utilities2.RemHtmlTags(&EMPLOYEE_LINE);*/ &STR_NO_HTML = StripOffHtmlTags(&EMPLOYEE_LINE); /* create another text value for employee for text id as below for employee line */ &nodeCurrent.AddAttribute("value", &STR_NO_HTML); &nodeCurrent.AddAttribute("value1", &ep_name); &nodeCurrent.AddAttribute("value2", " "); &nodeCurrent.AddAttribute("value3", &ep_dttm); Break; When = "OVRD" &nodeCurrent = &nodeSection.AddElement("sign_instructional_tex t"); &ep_name = &recDerived.EP_NAME_DISPLAY5.Value; &ep_dttm = &recRole.EP_ACKNOWLEDG_DTTM.FormattedValue; /* &MONTH = Month(&ep_dttm); &DAY = Day(&ep_dttm); &YEAR = Year(&ep_dttm); &fin_date = &MONTH " " &DAY "," &YEAR;*/ &ep_issue = &recHeader.EP_EMPL_ACK_IND.LongTranslateValue;

/* concat name and ack indicator translate value */ /* create another text value for employee for text id as below for employee line */ &ep_issue = "(" &ep_issue ")"; &EMPLOYEE_LINE = GetText("APPR_MAIN1_INST2", " ", &recSection. EP_SECTION_TYPE.Value, "E", " ", " ", &ep_name, &ep_dttm, " ", " ", " "); /*&STR_NO_HTML = &EP_Utilities2.RemHtmlTags(&EMPLOYEE_LINE);*/ &STR_NO_HTML = StripOffHtmlTags(&EMPLOYEE_LINE); &nodeCurrent.AddAttribute("value", &STR_NO_HTML); &nodeCurrent.AddAttribute("value1", &ep_name); &nodeCurrent.AddAttribute("value2", &ep_issue); &nodeCurrent.AddAttribute("value3", &ep_dttm); Break; When = "RFSD" &nodeCurrent = &nodeSection.AddElement("sign_instructional_tex t"); &ep_name = &recDerived.EP_NAME_DISPLAY5.Value; &ep_dttm = &recRole.EP_ACKNOWLEDG_DTTM.FormattedValue; &ep_issue = &recHeader.EP_EMPL_ACK_IND.LongTranslateValue; &ep_issue = "(" &ep_issue ")"; /* concat name and ack indicator translate value */ /* create another text value for employee for text id as below for employee line */ &EMPLOYEE_LINE = GetText("APPR_MAIN1_INST2", " ", &recSection. EP_SECTION_TYPE.Value, "E", " ", " ", &ep_name, &ep_dttm, " ", " ", " "); /* &STR_NO_HTML = &EP_Utilities2.RemHtmlTags(&EMPLOYEE_LINE);* / &STR_NO_HTML = StripOffHtmlTags(&EMPLOYEE_LINE); &nodeCurrent.AddAttribute("value", &STR_NO_HTML); &nodeCurrent.AddAttribute("value1", &ep_name); &nodeCurrent.AddAttribute("value2", &ep_issue); &nodeCurrent.AddAttribute("value3", &ep_dttm); Break; End-Evaluate; If &recRole.EP_REVIEW_STATUS.Value = "CO" Then &ep_name_m = &recDerived.EP_NAME_DISPLAY6.Value; &ep_dttm_m = &recRole.EP_COMPLETE_DTTM.FormattedValue; End-If; If &recHeader.EP_EMPL_ACK_IND.Value = "ACKN" Or &recHeader.EP_EMPL_ACK_IND.Value = "RFSD" Or &recHeader.EP_EMPL_ACK_IND.Value = "OVRD" Or &recRole.EP_REVIEW_STATUS.Value = "CO" Then &MANAGER_LINE = GetText("APPR_MAIN1_INST2", " ", &recSection.E P_SECTION_TYPE.Value, "M", " ", " ", &ep_name_m, &ep_dttm_m, " ", " ", " "); /* &STR_NO_HTML = &EP_Utilities2.RemHtmlTags(&MANAGER_LINE);* / &STR_NO_HTML = StripOffHtmlTags(&MANAGER_LINE); /* EP_FUNCTIONS.Appraisalformat.onexecute - this text is loade d into HTMLAREA2, create another text for ESIGN for manager and employee */ &nodeCurrent = &nodeSection.AddElement("sign_instructional_tex t"); &nodeCurrent.AddAttribute("value", &STR_NO_HTML); &nodeCurrent.AddAttribute("value1", &ep_name_m); &nodeCurrent.AddAttribute("value2", " "); &nodeCurrent.AddAttribute("value3", &ep_dttm_m); End-If; End-If; End-If; Else If &recSectionButton.EP_HTMLAREA2.Visible Then

/* &STR_NO_HTML = &EP_Utilities2.RemHtmlTags(&recSectionButton.EP_HT MLAREA2.Value);*/ &STR_NO_HTML = StripOffHtmlTags(&recSectionButton.EP_HTMLAREA2.Value ); &nodeCurrent = &nodeSection.AddElement("section_instructional_text") ; &nodeCurrent.AddAttribute("value", &STR_NO_HTML); End-If; End-If; /* End-If;*/ /* NEW end */ /* get learning section */ If &recSection.EP_SECTION_TYPE.Value = "LEARNING" Then /* get grid labels */ If %Component = Component.EP_APPR_MAIN Then &gridLearning = GetGrid(Page.EP_APPR_MAIN1, "EP_LM_LEARNING"); &lrn_label = &gridLearning.label; Else &gridLearning = GetGrid(Page.EP_APPR_BASE1, "EP_LM_LEARNING"); &lrn_label = &gridLearning.label; End-If; &nodeLearn = &nodeSection.AddElement("learn"); If &recSectionButton.EP_LEARN_PAGETITLE.Visible = False Then &nodeLearning = &nodeLearn.AddElement("learning"); &nodeLearning.AddAttribute("label", &lrn_label); Local Rowset &rsLearn = &rsSection(&i).GetRowset(@("Scroll." &strL earn)); For &j = 1 To &rsLearn.ActiveRowCount Local Record &recLearn = &rsLearn(&j).GetRecord(@("Record." &st rLearn)); If All(&recLearn.EP_LM_PER_TRN_NM.Value) Then If &j = 1 Then &nodeCurrent = &nodeLearning.AddElement("Learninglabels"); &nodeCurrent.AddAttribute("learn_id", &gridLearning.GetColu mn("LEARNING_NAME").Label); &nodeCurrent.AddAttribute("learn_type", &recLearn.EP_LM_LRN _TYPEDESC.GetShortLabel("EP_LM_LRN_TYPEDESC")); &nodeCurrent.AddAttribute("status", &recLearn.EP_LM_STTS_DE SCR.GetShortLabel("EP_LM_STTS_DESCR")); &nodeCurrent.AddAttribute("status_date", &recLearn.EP_LM_ST ATUS_DT.GetLongLabel("EP_LM_STATUS_DT")); End-If; &nodeCurrent = &nodeLearning.addelement("learnthis"); &nodeCurrent.AddAttribute("learn_id", &recLearn.EP_LM_PER_TRN_ NM.Value); &nodeCurrent.AddAttribute("learn_type", &recLearn.EP_LM_LRN_TY PEDESC.Value); &nodeCurrent.AddAttribute("status", &recLearn.EP_LM_STTS_DESCR .Value); &nodeCurrent.AddAttribute("status_date", &recLearn.EP_LM_STATU S_DT.FormattedValue); End-If; End-For; Else &nodeCurrent = &nodeLearn.addelement("learnmsg"); &nodeCurrent.AddAttribute("msg", &recSectionButton.EP_LEARN_PAGETITL E.Value); End-If;

End-If; If &recSection.EP_WEIGHT.Visible Then &nodeCurrent = &nodeSection.AddElement("section_weight"); &nodeCurrent.AddAttribute("value", &recSection.EP_WEIGHT.Value); &nodeCurrent.AddAttribute("label", &recSection.EP_WEIGHT.Label); If &recSectionButton.EP_MINWT_TEXT.Visible Then &nodeCurrent.AddAttribute("min_value", &recSection.EP_MIN_WEIGHT.Val ue); &nodeCurrent.AddAttribute("min_label", &recSectionButton.EP_MINWT_TE XT.Value); End-If; End-If; If %Component = Component.EP_APPR_MAIN Then If &recSection.REVIEW_RATING.Visible Then &nodeCurrent = &nodeSection.AddElement("section_rating"); &nodeCurrent.AddAttribute("value", &recSection.REVIEW_RATING.GetRela ted(REVW_RATING_TBL.DESCR).Value); &nodeCurrent.AddAttribute("id", &recSection.REVIEW_RATING.Value); &nodeCurrent.AddAttribute("label", &recSection.REVIEW_RATING.Label); If &recSection.EP_RATING.Visible Then &nodeCurrent.AddAttribute("numeric", &recSection.EP_RATING.Format tedValue); Else If &recSection.REVIEW_POINTS.Visible Then &nodeCurrent.AddAttribute("numeric", &recSection.REVIEW_POINTS .FormattedValue); End-If; End-If; End-If; If &recSectionDerived.EP_AVG_DESCR.Visible Then &nodeCurrent = &nodeSection.AddElement("section_avg_rating"); &nodeCurrent.AddAttribute("value", &recSectionDerived.EP_AVG_DESCR.V alue); &nodeCurrent.AddAttribute("label", &recSectionDerived.EP_AVG_DESCR.L abel); If &recSectionDerived.EP_AVG_NUMERIC.Visible Then &nodeCurrent.AddAttribute("numeric", &recSectionDerived.EP_AVG_NU MERIC.FormattedValue); End-If; End-If; If &recSection.EP_RESULTS.Visible Then /*use CDATA section for long fields */ &nodeSecCom = &nodeSection.AddElement("section_com"); &nodeSecCom.AddAttribute("label", &recSection.EP_RESULTS.Label); &nodeCurrent = &nodeSecCom.AddElement("section_comments"); &cdatanode = &nodeCurrent.AddCDataSection(&recSection.EP_RESULTS.Val ue); /* &nodeCurrent = &nodeSection.AddElement("section_comments"); &nodeCurrent.AddAttribute("value", &recSection.EP_RESULTS.Value); &nodeCurrent.AddAttribute("label", &recSection.EP_RESULTS.Label);*/ End-If; If &recSection.REVIEW_RATING.Visible Or &recSectionDerived.EP_AVG_DESCR.Visible Or &recSection.EP_WEIGHT.Visible Or

&recSection.EP_RESULTS.Visible Then &nodeCurrent = &nodeSection.AddElement("section_summary"); &nodeCurrent.AddAttribute("value", &recSectionButton.EP_GROUPBOX2.La bel); End-If; Else If &recSection.EP_WEIGHT.Visible Then &nodeCurrent = &nodeSection.AddElement("section_summary"); &nodeCurrent.AddAttribute("value", &recSectionButton.EP_SECTION_SUMM .Value); End-If; End-If; &nodeItems = &nodeSection.AddElement("items"); /* Item Elements */ Local Rowset &rsItem = &rsSection(&i).GetRowset(@("Scroll." For &j = 1 To &rsItem.ActiveRowCount

&strItem));

Local Record &recItem = &rsItem(&j).GetRecord(@("Record." &strItem)); Local Record &recItemDerived = &rsItem(&j).GetRecord(Record.DERIVED_EP) ; Local Record &recItemButton = &rsItem(&j).GetRecord(Record.EP_BTN_LINK_ WRK); Local string &colonsp = ": "; /* Only include real items as sometimes there's a dummy tools row which we don't */ /* want. We check if this is a real row by seeing if the Title is popua ted. */ If All(&recItem.EP_TITLE.Value) Then &nodeItem = &nodeItems.AddElement("item"); &nodeCurrent = &nodeItem.AddElement("item_id"); &nodeCurrent.NodeValue = &recItem.EP_ITEM_ID.Value; If &recItem.EP_TITLE.Visible Then &nodeCurrent = &nodeItem.AddElement("item_title"); &nodeCurrent.AddAttribute("value", &recItem.EP_TITLE.Value); &nodeCurrent.AddAttribute("label", &recItem.EP_TITLE.Label); End-If; If &recItem.EP_DESCR254.Visible Then /* remove html tags as they are not understood by xmlp */ &STR_NO_HTML = &EP_Utilities2.RemHtmlTags(&recItem.EP_DESCR254.La bel); &nodeCurrent = &nodeItem.AddElement("item_long_description"); &nodeCurrent.AddAttribute("value", &recItem.EP_DESCR254.Value); &nodeCurrent.AddAttribute("label", &STR_NO_HTML); End-If; If &recItem.EP_MEASURE.Visible Then /* remove html tags as they are not understood by xmlp */ &STR_NO_HTML = &EP_Utilities2.RemHtmlTags(&recItem.EP_MEASURE.Lab el); &nodeCurrent = &nodeItem.AddElement("item_measurement"); &nodeCurrent.AddAttribute("value", &recItem.EP_MEASURE.Value); &nodeCurrent.AddAttribute("label", &STR_NO_HTML); End-If;

If &recItem.EP_EE_MEASURE.Visible Then /* remove html tags as they are not understood by xmlp */ &STR_NO_HTML = &EP_Utilities2.RemHtmlTags(&recItem.EP_EE_MEASURE. Label); &nodeCurrent = &nodeItem.AddElement("item_emeasurement"); &nodeCurrent.AddAttribute("value", &recItem.EP_EE_MEASURE.Value); &nodeCurrent.AddAttribute("label", &STR_NO_HTML); End-If; If All(&recSection.EP_LINK_SECTION.Value) And &recSection.EP_ITEM_LINKED_SW.Value = "Y" Then &nodeCurrent = &nodeItem.AddElement("item_supports"); &nodeCurrent.AddAttribute("value", &recItemDerived.EP_TITLE.Value ); &nodeCurrent.AddAttribute("label", &recItem.EP_ITEM_LINK.Label &colonsp); End-If; If &recItem.EP_ITEM_MANDTRY_SW.Visible Then &nodeCurrent = &nodeItem.AddElement("item_mandatory"); &nodeCurrent.AddAttribute("value", &recItem.EP_ITEM_MANDTRY_SW.Va lue); bel &nodeCurrent.AddAttribute("label", &recItem.EP_ITEM_MANDTRY_SW.La &colonsp); End-If;

Local string &strTextValue; If &recItem.EP_ITEM_CRIT_SW.Visible Then &nodeCurrent = &nodeItem.AddElement("item_critical"); If &recItem.EP_ITEM_CRIT_SW.Value = "Y" Then &strTextValue = GetText("APPR_BASE_ITEM04", " ", " ", " ", &EP _GBLKEYS_WRK.EP_USER_ROLE.Value, " ", " ", " ", " ", " ", " "); Else &strTextValue = GetText("APPR_BASE_ITEM05", " ", " ", " ", &EP _GBLKEYS_WRK.EP_USER_ROLE.Value, " ", " ", " ", " ", " ", " "); End-If; &nodeCurrent.AddAttribute("value", &strTextValue); &nodeCurrent.AddAttribute("label", &recItem.EP_ITEM_CRIT_SW.Label ); End-If; If &recItem.EP_STRETCH_SW.Visible Then &nodeCurrent = &nodeItem.AddElement("item_stretch"); If &recItem.EP_STRETCH_SW.Value = "Y" Then &strTextValue = GetText("APPR_BASE_ITEM06", " ", " ", " ", &EP _GBLKEYS_WRK.EP_USER_ROLE.Value, " ", " ", " ", " ", " ", " "); Else &strTextValue = GetText("APPR_BASE_ITEM07", " ", " ", " ", &EP _GBLKEYS_WRK.EP_USER_ROLE.Value, " ", " ", " ", " ", " ", " "); End-If; &nodeCurrent.AddAttribute("value", &strTextValue); &nodeCurrent.AddAttribute("label", &recItem.EP_STRETCH_SW.Label); End-If; If &recItem.EP_ITEM_DUE_DT.Visible Then &nodeCurrent = &nodeItem.AddElement("item_due_date"); &nodeCurrent.AddAttribute("value", &recItem.EP_ITEM_DUE_DT.Format tedValue); &nodeCurrent.AddAttribute("label", &recItem.EP_ITEM_DUE_DT.Label

&colonsp); End-If; If &recItem.EP_ITEM_REMIND_DT.Visible Then &nodeCurrent = &nodeItem.AddElement("item_reminder_date"); &nodeCurrent.AddAttribute("value", &recItem.EP_ITEM_REMIND_DT.For mattedValue); &nodeCurrent.AddAttribute("label", &recItem.EP_ITEM_REMIND_DT.Lab el &colonsp); End-If; If &recItem.EP_ITEM_START_DT.Visible Then &nodeCurrent = &nodeItem.AddElement("item_reminder_date"); &nodeCurrent.AddAttribute("value", &recItem.EP_ITEM_START_DT.Form attedValue); &nodeCurrent.AddAttribute("label", &recItem.EP_ITEM_START_DT.Labe l &colonsp); End-If; If &recItem.EP_ITEM_END_DT.Visible Then &nodeCurrent = &nodeItem.AddElement("item_reminder_date"); &nodeCurrent.AddAttribute("value", &recItem.EP_ITEM_END_DT.Format tedValue); &nodeCurrent.AddAttribute("label", &recItem.EP_ITEM_END_DT.Label &colonsp); End-If; If &recItem.EP_ITEM_OWNER_IND.Visible Then &nodeCurrent = &nodeItem.AddElement("item_ownership"); &nodeCurrent.AddAttribute("value", &recItem.EP_ITEM_OWNER_IND.Lon gTranslateValue); &nodeCurrent.AddAttribute("id", &recItem.EP_ITEM_OWNER_IND.Value) ; &nodeCurrent.AddAttribute("label", &recItem.EP_ITEM_OWNER_IND.Lab el &colonsp); End-If; If &recItem.EP_SUB_LEVEL.Visible Then &nodeCurrent = &nodeItem.AddElement("level_of_difficulty"); &nodeCurrent.AddAttribute("value", &recItem.EP_SUB_LEVEL.Formatte dValue); &nodeCurrent.AddAttribute("label", &recItem.EP_SUB_LEVEL.Label &colonsp); End-If; If &recItem.EP_ITEM_STATUS.Visible Then &nodeCurrent = &nodeItem.AddElement("item_status"); &nodeCurrent.AddAttribute("value", &recItem.EP_ITEM_STATUS.LongTr anslateValue); &nodeCurrent.AddAttribute("id", &recItem.EP_ITEM_STATUS.Value); &nodeCurrent.AddAttribute("label", &recItem.EP_ITEM_STATUS.Label &colonsp); End-If; If &recItem.EP_ITEM_PCT.Visible Then &nodeCurrent = &nodeItem.AddElement("item_percentage_complete"); &nodeCurrent.AddAttribute("value", &recItem.EP_ITEM_PCT.Value); &nodeCurrent.AddAttribute("label", &recItem.EP_ITEM_PCT.Label & colonsp); End-If; /* If &recItemDerived.EP_TITLE.Visible And

All(&recItemDerived.EP_TITLE.Value) Then &nodeCurrent = &nodeItem.AddElement("item_supports"); &nodeCurrent.AddAttribute("value", &recItemDerived.EP_TITLE.Value ); &nodeCurrent.AddAttribute("label", &recItem.EP_ITEM_LINK.Label); End-If; */ If &recItemButton.EPO_GROUPBOX4.Visible Then &nodeCurrent = &nodeItem.AddElement("epo_item"); &nodeCurrent.AddAttribute("value", &recItem.EPO_ITEM_TITLE.Value) ; &nodeCurrent.AddAttribute("label", &recItem.EPO_ITEM_TITLE.Label) ; End-If; If &recItemButton.EPO_GROUPBOX4.Visible Then &nodeCurrent = &nodeItem.AddElement("epo_mod"); &nodeCurrent.AddAttribute("value", &recItemDerived.EPO_LAST_MOD_D TTM.Value); &nodeCurrent.AddAttribute("label", &recItemDerived.EPO_LAST_MOD_D TTM.Label); End-If; If &recItem.EP_TARGET_RATING.Visible Then &nodeCurrent = &nodeItem.AddElement("item_target_rating"); &nodeCurrent.AddAttribute("value", &recItem.EP_TARGET_RATING.Form attedValue); l &nodeCurrent.AddAttribute("label", &recItem.EP_TARGET_RATING.Labe &colonsp); End-If; If &recItem.EP_WEIGHT.Visible Then &nodeCurrent = &nodeItem.AddElement("item_weight"); &nodeCurrent.AddAttribute("value", &recItem.EP_WEIGHT.Value); &nodeCurrent.AddAttribute("label", &recItem.EP_WEIGHT.Label); If &recItem.EP_MIN_WEIGHT.Visible Then &nodeCurrent.AddAttribute("min_value", &recItem.EP_MIN_WEIGHT. Value); &nodeCurrent.AddAttribute("min_label", &recItemButton.EP_MINWT _TEXT.Value); End-If; End-If; If %Component = Component.EP_APPR_MAIN Then If &recItem.REVIEW_RATING.Visible Then &nodeCurrent = &nodeItem.AddElement("item_rating"); &nodeCurrent.AddAttribute("value", &recItem.REVIEW_RATING.Form attedValue); &nodeCurrent.AddAttribute("id", &recItem.REVIEW_RATING.Value); &nodeCurrent.AddAttribute("label", &recItem.REVIEW_RATING.Labe l); If &recItem.EP_RATING.Visible Then &nodeCurrent.AddAttribute("numeric", &recItem.EP_RATING.For mattedValue); Else If &recItem.REVIEW_POINTS.Visible Then &nodeCurrent.AddAttribute("numeric", &recItem.REVIEW_POI NTS.FormattedValue); End-If;

End-If; End-If; If &recItemDerived.EP_AVG_DESCR.Visible Then &nodeCurrent = &nodeItem.AddElement("item_avg_rating"); &nodeCurrent.AddAttribute("value", &recItemDerived.EP_AVG_DESC R.Value); &nodeCurrent.AddAttribute("label", &recItemDerived.EP_AVG_DESC R.Label); If &recItemDerived.EP_AVG_NUMERIC.Visible Then &nodeCurrent.AddAttribute("numeric", &recItemDerived.EP_AVG _NUMERIC.FormattedValue); End-If; End-If; If &recItem.EP_RESULTS.Visible Then /*use CDATA section for long fields */ &nodeItCom = &nodeItem.AddElement("item_com"); &nodeItCom.AddAttribute("label", &recItem.EP_RESULTS.Label); &nodeCurrent = &nodeItCom.AddElement("item_comments"); &cdatanode = &nodeCurrent.AddCDataSection(&recItem.EP_RESULTS. Value); /* &nodeCurrent = &nodeItem.AddElement("item_comments"); &nodeCurrent.AddAttribute("value", &recItem.EP_RESULTS.Value); &nodeCurrent.AddAttribute("label", &recItem.EP_RESULTS.Label); */ End-If; End-If; &nodeSubItems = &nodeItem.AddElement("sub_items"); /* SubItem Elements */ Local Rowset &rsSubItem = &rsItem(&j).GetRowset(@("Scroll." bItem)); For &k = 1 To &rsSubItem.ActiveRowCount Local Record &recSubItem = &rsSubItem(&k).GetRecord(@("Record." &strSubItem)); Local Record &recSubDerived = &rsSubItem(&k).GetRecord(Record.DER IVED_EP); /* Only include real subitems as sometimes there's a dummy tools */ /* don't want. We check if this is a real row by seeing if the Ti tle is popuated. */ If All(&recSubItem.EP_TITLE.Value) Then row which we &nodeSubItem = &nodeSubItems.AddElement("sub_item"); &nodeCurrent = &nodeSubItem.AddElement("sub_id"); &nodeCurrent.NodeValue = &recSubItem.EP_SUB_ID.Value; If &recSubItem.EP_TITLE.Visible Then &nodeCurrent = &nodeSubItem.AddElement("sub_title"); &nodeCurrent.AddAttribute("value", &recSubDerived.EP_TITLE. Value); &nodeCurrent.AddAttribute("label", &recSubItem.EP_TITLE.Lab el); End-If; &strSu

If &recSubItem.EP_DESCR254.Visible Then &nodeCurrent = &nodeSubItem.AddElement("sub_long_descriptio n"); &nodeCurrent.AddAttribute("value", &recSubItem.EP_DESCR254. Value); &nodeCurrent.AddAttribute("label", &recSubItem.EP_DESCR254. Label); End-If; If %Component = Component.EP_APPR_MAIN Then If &recSubItem.REVIEW_RATING.Visible Then &nodeCurrent = &nodeSubItem.AddElement("sub_rating"); &nodeCurrent.AddAttribute("value", &recSubItem.REVIEW_RA TING.FormattedValue); &nodeCurrent.AddAttribute("id", &recSubItem.REVIEW_RATIN G.Value); &nodeCurrent.AddAttribute("label", &recSubItem.REVIEW_RA TING.Label); If &recSubItem.EP_RATING.Visible Then &nodeCurrent.AddAttribute("numeric", &recSubItem.EP_R ATING.FormattedValue); Else If &recSubItem.REVIEW_POINTS.Visible Then &nodeCurrent.AddAttribute("numeric", &recSubItem.R EVIEW_POINTS.FormattedValue); End-If; End-If; End-If; End-If; End-If; End-For; If &recItemDerived.EP_NAME_DISPLAY1.Visible Then &nodeCurrent = &nodeItem.AddElement("item_aud"); &nodeCurrent.AddAttribute("label", &recItemDerived.EP_NAME_DISPLA Y1.Label); &nodeCurrent.AddAttribute("id", &recItemDerived.EP_NAME_DISPLAY1. Value); &nodeCurrent.AddAttribute("date", &recItem.EP_ITEM_ADDED_DTTM.For mattedValue); End-If; If &recItemDerived.EP_NAME_DISPLAY2.Visible Then &nodeCurrent = &nodeItem.AddElement("item_aud"); &nodeCurrent.AddAttribute("label", &recItemDerived.EP_NAME_DISPLA Y2.Label); &nodeCurrent.AddAttribute("id", &recItemDerived.EP_NAME_DISPLAY2. Value); &nodeCurrent.AddAttribute("date", &recItem.EP_ITEM_MOD_DTTM.Forma ttedValue); End-If; End-If; End-For; End-If; End-For; /* get data for attachments */ /* attachments are only for main doc (not establish criteria) so only add node i

f main doc component so that it can be checked in template*/ If %Component = Component.EP_APPR_MAIN Then If &recRole.EP_ROLE.Value = "M" /* CC - JK - 21/03/2011 - CC_CHG1041419 - Start of Modification */ Or &recRole.EP_ROLE.Value = "E" Then /* CC - JK - 21/03/2011 - CC_CHG1041419 - End of Modification */ If &recButton.EP_GROUPBOX14.Visible = False Then Local Rowset &rsAttach = GetLevel0()(1).GetRowset(@("Scroll." &strAtt ach)); Local Grid &grd_Attachment; &nodeAttach = &nodeRoot.AddElement("attach"); If &rsAttach(1).Visible = True Then &grd_Attachment = GetGrid(Page.EP_APPR_MAIN1, "EP_ATTACH"); &attach_label = &grd_Attachment.Label; &nodeAttachment = &nodeAttach.AddElement("attachment"); &nodeAttachment.AddAttribute("label", &attach_label); For &m = 1 To &rsAttach.RowCount If All(&rsAttach(&m).EP_ATTACH.ATTACHUSERFILE.Value) Then /* CC - JK - 18-04-2011- CC_CHG1041834 - Start of Modification */ Local string &Att_Addedby, &Att_EP_Role, &Att_User_Role; &Att_EP_Role = &recRole.EP_ROLE.Value; /* Document Version Rol e */ &Att_User_Role = &EP_GBLKEYS_WRK.EP_USER_ROLE.Value; /* Role o f person Who is Opening the document */ &Att_Addedby = FetchValue(Scroll.EP_ATTACH, &m, EP_ATTACH.LAST UPDOPRID); If (((&Att_EP_Role = &Att_User_Role) And (&Att_Addedby = %UserId)) Or ((&Att_EP_Role <> &Att_User_Role) And (&Att_Addedby <> %UserId))) Then /* CC - JK - 18-04-2011- CC_CHG1041834 - End of Modificatio n */ If &m = 1 Then &nodeCurrent = &nodeAttachment.AddElement("attachfilelab els"); &nodeCurrent.AddAttribute("label", &grd_Attachment.GetCo lumn("ATTACHVIEW").Label); /* CC - JK - 21/03/2011 - CC_CHG1041419 - Start of Modif ication */ /* To Change the Column Label from "Description " to " " */ rem &nodeCurrent.AddAttribute("descr", &rsAttach(&m).EP_ ATTACH.DESCR.GetLongLabel("DESCR")); &rsAttach(&m).EP_ATTACH.DESCR.Label = GetText("CC_ATTACH _DESCR", " ", " ", " ", " ", " ", " ", " ", " ", " ", " "); &nodeCurrent.AddAttribute("descr", &rsAttach(&m).EP_ATTA CH.DESCR.Label); Description (Optional)" /* Commented out the below statement To Hide Column "Att achment Audience" */

rem &nodeCurrent.AddAttribute("aud", &rsAttach(&m).EP_ ATTACH.EP_ATTACH_AUD.GetLongLabel("EP_ATTACH_AUD")); /* CC - JK - 21/03/2011 - CC_CHG1041419 - End of Modific ation */ &nodeCurrent.AddAttribute("updoprid", &rsAttach(&m).PERS ON_NAME.NAME_DISPLAY.GetLongLabel("UPLOADEDBY")); &nodeCurrent.AddAttribute("upddttm", &rsAttach(&m).EP_AT TACH.LASTUPDDTTM.GetLongLabel("LASTUPDDTTM")); End-If; &nodeCurrent = &nodeAttachment.AddElement("attachfile"); &nodeCurrent.AddAttribute("label", &rsAttach(&m).EP_ATTACH. ATTACHUSERFILE.Value); &nodeCurrent.AddAttribute("descr", &rsAttach(&m).EP_ATTACH. DESCR.Value); /* CC - JK - 21/03/2011 - CC_CHG1041419 - Start of Modifica tion */ /* Commented out the below statement To Hide Column "Attach ment Audience" */ rem &nodeCurrent.AddAttribute("aud", &rsAttach(&m).EP_ATTA CH.EP_ATTACH_AUD.LongTranslateValue); /* CC - JK - 21/03/2011 - CC_CHG1041419 - End of Modificati on */ &nodeCurrent.AddAttribute("updoprid", &rsAttach(&m).PERSON_ NAME.NAME_DISPLAY.Value); &nodeCurrent.AddAttribute("upddttm", &rsAttach(&m).EP_ATTAC H.LASTUPDDTTM.FormattedValue); /* CC - JK - 18-04-2011- CC_CHG1041834 - Start of Modificat ion */ End-If; /* CC - JK - 18-04-2011- CC_CHG1041834 - End of Modification * / End-If; End-For End-If; Else &nodeAttach = &nodeRoot.AddElement("attach"); &nodeCurrent = &nodeAttach.AddElement("attachmsg"); /* CC - JK - 21/03/2011 - CC_CHG1041419 - Start of Modification */ rem &nodeCurrent.AddAttribute("label", &recButton.EP_GROUPBOX14.GetLon gLabel("EP_GROUPBOX14")); &nodeCurrent.AddAttribute("label", GetText("APPR_ATTACH", " ", " ", " " , &EP_GBLKEYS_WRK.EP_USER_ROLE.Value, " ", " ", " ", " ", " ", " ")); /* CC - JK - 21/03/2011 - CC_CHG1041419 - End of Modification */ &nodeCurrent.AddAttribute("msg", &recButton.EP_ATTH_MSG.Value); End-If; End-If; End-If; /* get data for audit section */ If %Component = Component.EP_APPR_MAIN Then &nodeAudit = &nodeRoot.AddElement("audit"); &nodeAudit.AddAttribute("label", "Audit History"); /* get title from message from subpage ? */ If All(&recRole.EP_CREATE_OPRID.Value) And &recDerived.EP_NAME_DISPLAY1.Visible = True Then &nodeCurrent = &nodeAudit.addelement("audit_det"); &nodeCurrent.AddAttribute("label", &recDerived.EP_NAME_DISPLAY1.GetLongLab

el("EP_NAME_DISPLAY1")); &nodeCurrent.AddAttribute("id", &recDerived.EP_NAME_DISPLAY1.Value); &nodeCurrent.AddAttribute("date", &recRole.EP_CREATE_DTTM.FormattedValue); End-If; If All(&recRole.LASTUPDOPRID.Value) And &recDerived.EP_NAME_DISPLAY2.Visible = True Then &nodeCurrent = &nodeAudit.addelement("audit_det"); &nodeCurrent.AddAttribute("label", &recDerived.EP_NAME_DISPLAY2.GetLongLab el("EP_NAME_DISPLAY2")); &nodeCurrent.AddAttribute("id", &recDerived.EP_NAME_DISPLAY2.Value); &nodeCurrent.AddAttribute("date", &recRole.LASTUPDDTTM.FormattedValue); End-If; If &recRole.EP_ROLE.Value = "M" Then If All(&recHeader.EP_MANAGER_FROM.Value) And &recDerived.EP_NAME_DISPLAY3.Visible = True Then &nodeCurrent = &nodeAudit.addelement("audit_det"); &nodeCurrent.AddAttribute("label", &recDerived.EP_NAME_DISPLAY3.GetLong Label("EP_NAME_DISPLAY3")); &nodeCurrent.AddAttribute("id", &recDerived.EP_NAME_DISPLAY3.Value); &nodeCurrent.AddAttribute("date", &recRole.EP_TRANSFROM_DTTM.FormattedV alue); End-If; If All(&recHeader.EP_MANAGER_TO.Value) And &recDerived.EP_NAME_DISPLAY4.Visible = True Then &nodeCurrent = &nodeAudit.addelement("audit_det"); &nodeCurrent.AddAttribute("label", &recDerived.EP_NAME_DISPLAY4.GetLong Label("EP_NAME_DISPLAY4")); &nodeCurrent.AddAttribute("id", &recDerived.EP_NAME_DISPLAY4.Value); &nodeCurrent.AddAttribute("date", &recRole.EP_TRANSFTO_DTTM.FormattedVa lue); End-If; If All(&recHeader.EP_TRANSFBY_OPRID.Value) And &recDerived.EP_NAME_DISPLAY8.Visible = True Then &nodeCurrent = &nodeAudit.addelement("audit_det"); &nodeCurrent.AddAttribute("label", &recDerived.EP_NAME_DISPLAY8.GetLong Label("EP_NAME_DISPLAY8")); &nodeCurrent.AddAttribute("id", &recDerived.EP_NAME_DISPLAY8.Value); &nodeCurrent.AddAttribute("date", &recHeader.EP_TRANSFBY_DTTM.Formatted Value); End-If; If All(&recRole.EP_ACKNOWLED_OPRID.Value) And &recDerived.EP_NAME_DISPLAY6.Visible = True Then &nodeCurrent = &nodeAudit.addelement("audit_det"); &nodeCurrent.AddAttribute("label", &recDerived.EP_NAME_DISPLAY5.GetLong Label("EP_NAME_DISPLAY5")); &nodeCurrent.AddAttribute("id", &recDerived.EP_NAME_DISPLAY5.Value); &nodeCurrent.AddAttribute("date", &recRole.EP_ACKNOWLEDG_DTTM.Formatted Value); End-If; End-If; If All(&recRole.EP_COMPLETE_OPRID.Value) And &recDerived.EP_NAME_DISPLAY6.Visible = True Then &nodeCurrent = &nodeAudit.addelement("audit_det"); &nodeCurrent.AddAttribute("label", &recDerived.EP_NAME_DISPLAY6.GetLongLab el("EP_NAME_DISPLAY6")); &nodeCurrent.AddAttribute("id", &recDerived.EP_NAME_DISPLAY6.Value); &nodeCurrent.AddAttribute("date", &recRole.EP_COMPLETE_DTTM.FormattedValue ); End-If;

If All(&recRole.EP_CANCEL_OPRID.Value) And &recDerived.EP_NAME_DISPLAY7.Visible = True Then &nodeCurrent = &nodeAudit.addelement("audit_det"); &nodeCurrent.AddAttribute("label", &recDerived.EP_NAME_DISPLAY7.GetLongLab el("EP_NAME_DISPLAY7")); &nodeCurrent.AddAttribute("id", &recDerived.EP_NAME_DISPLAY7.Value); &nodeCurrent.AddAttribute("date", &recRole.EP_CANCEL_DTTM.FormattedValue); End-If; <* If &recRole.EP_ROLE.Value = "M" Then If All(&recRole.EP_RESET_OPRID.Value) And &recDerived.EP_NAME_DISPLAY9.Visible = True Then &nodeCurrent = &nodeAudit.addelement("audit_det"); &nodeCurrent.AddAttribute("label", &recDerived.EP_NAME_DISPLAY9.GetLong Label("EP_NAME_DISPLAY9")); &nodeCurrent.AddAttribute("id", &recDerived.EP_NAME_DISPLAY9.Value); &nodeCurrent.AddAttribute("date", &recRole.EP_RESET_DTTM.FormattedValue ); End-If; End-If; *> <* If &recRole.EP_ROLE.Value <> "M" Then *> If All(&recRole.EP_REOPEN_OPRID.Value) And &recDerived.EP_NAME_DISPLAY9.Visible = True Then &nodeCurrent = &nodeAudit.addelement("audit_det"); &nodeCurrent.AddAttribute("label", &recDerived.EP_NAME_DISPLAY9.GetLongLab el("EP_NAME_DISPLAY9")); &nodeCurrent.AddAttribute("id", &recDerived.EP_NAME_DISPLAY9.Value); &nodeCurrent.AddAttribute("date", &recRole.EP_REOPEN_DTTM.FormattedValue); End-If; End-If; <*End-If;*> /* audit data for establish criteria */ If %Component = Component.EP_APPR_BASE Then &nodeAudit = &nodeRoot.AddElement("audit"); &nodeAudit.AddAttribute("label", "Audit History"); /* get title from message from subpage ? */ If All(&recHeader.EP_CREATE_OPRID.Value) And &recDerived.EP_NAME_DISPLAY1.Visible = True Then &nodeCurrent = &nodeAudit.addelement("audit_det"); &nodeCurrent.AddAttribute("label", &recDerived.EP_NAME_DISPLAY1.GetLongLab el("EP_NAME_DISPLAY1")); &nodeCurrent.AddAttribute("id", &recDerived.EP_NAME_DISPLAY1.Value); &nodeCurrent.AddAttribute("date", &recHeader.EP_CREATE_DTTM.FormattedValue ); End-If; If All(&recHeader.LASTUPDOPRID.Value) And &recDerived.EP_NAME_DISPLAY2.Visible = True Then &nodeCurrent = &nodeAudit.addelement("audit_det"); &nodeCurrent.AddAttribute("label", &recDerived.EP_NAME_DISPLAY2.GetLongLab el("EP_NAME_DISPLAY2")); &nodeCurrent.AddAttribute("id", &recDerived.EP_NAME_DISPLAY2.Value); &nodeCurrent.AddAttribute("date", &recHeader.LASTUPDDTTM.FormattedValue); End-If; /* If &recRole.EP_ROLE.Value = "M" Then*/ If All(&recHeader.EP_MANAGER_FROM.Value) And &recDerived.EP_NAME_DISPLAY3.Visible = True Then &nodeCurrent = &nodeAudit.addelement("audit_det"); &nodeCurrent.AddAttribute("label", &recDerived.EP_NAME_DISPLAY3.GetLongLab el("EP_NAME_DISPLAY3"));

&nodeCurrent.AddAttribute("id", &recDerived.EP_NAME_DISPLAY3.Value); &nodeCurrent.AddAttribute("date", &recHeader.EP_TRANSFROM_DTTM.FormattedVa lue); End-If; If All(&recHeader.EP_MANAGER_TO.Value) And &recDerived.EP_NAME_DISPLAY4.Visible = True Then &nodeCurrent = &nodeAudit.addelement("audit_det"); &nodeCurrent.AddAttribute("label", &recDerived.EP_NAME_DISPLAY4.GetLongLab el("EP_NAME_DISPLAY4")); &nodeCurrent.AddAttribute("id", &recDerived.EP_NAME_DISPLAY4.Value); &nodeCurrent.AddAttribute("date", &recHeader.EP_TRANSFTO_DTTM.FormattedVal ue); End-If; If All(&recHeader.EP_TRANSFBY_OPRID.Value) And &recDerived.EP_NAME_DISPLAY8.Visible = True Then &nodeCurrent = &nodeAudit.addelement("audit_det"); &nodeCurrent.AddAttribute("label", &recDerived.EP_NAME_DISPLAY8.GetLongLab el("EP_NAME_DISPLAY8")); &nodeCurrent.AddAttribute("id", &recDerived.EP_NAME_DISPLAY8.Value); &nodeCurrent.AddAttribute("date", &recHeader.EP_TRANSFBY_DTTM.FormattedVal ue); End-If; If All(&recHeader.EP_ACKNOWLED_OPRID.Value) And &recDerived.EP_NAME_DISPLAY6.Visible = True Then &nodeCurrent = &nodeAudit.addelement("audit_det"); &nodeCurrent.AddAttribute("label", &recDerived.EP_NAME_DISPLAY5.GetLongLab el("EP_NAME_DISPLAY5")); &nodeCurrent.AddAttribute("id", &recDerived.EP_NAME_DISPLAY5.Value); &nodeCurrent.AddAttribute("date", &recHeader.EP_ACKNOWLEDG_DTTM.FormattedV alue); End-If; /* End-If;*/ If All(&recHeader.EP_COMPLETE_OPRID.Value) And &recDerived.EP_NAME_DISPLAY6.Visible = True Then &nodeCurrent = &nodeAudit.addelement("audit_det"); &nodeCurrent.AddAttribute("label", &recDerived.EP_NAME_DISPLAY6.GetLongLab el("EP_NAME_DISPLAY6")); &nodeCurrent.AddAttribute("id", &recDerived.EP_NAME_DISPLAY6.Value); &nodeCurrent.AddAttribute("date", &recHeader.EP_COMPLETE_DTTM.FormattedVal ue); End-If; If All(&recHeader.EP_CANCEL_OPRID.Value) And &recDerived.EP_NAME_DISPLAY7.Visible = True Then &nodeCurrent = &nodeAudit.addelement("audit_det"); &nodeCurrent.AddAttribute("label", &recDerived.EP_NAME_DISPLAY7.GetLongLab el("EP_NAME_DISPLAY7")); &nodeCurrent.AddAttribute("id", &recDerived.EP_NAME_DISPLAY7.Value); &nodeCurrent.AddAttribute("date", &recHeader.EP_CANCEL_DTTM.FormattedValue ); End-If; If All(&recHeader.EP_REOPEN_OPRID.Value) And &recDerived.EP_NAME_DISPLAY9.Visible = True Then &nodeCurrent = &nodeAudit.addelement("audit_det"); &nodeCurrent.AddAttribute("label", &recDerived.EP_NAME_DISPLAY9.GetLongLab el("EP_NAME_DISPLAY9")); &nodeCurrent.AddAttribute("id", &recDerived.EP_NAME_DISPLAY9.Value); &nodeCurrent.AddAttribute("date", &recHeader.EP_REOPEN_DTTM.FormattedValue

); End-If; End-If; /*WinMessage(&xmldocRoot.GenFormattedXmlString());*/ try /* detect system directory separator */ &sDirSep = GetDirSeparator(); /* create process directory */ CreateDirectory("XMLP", %FilePath_Relative); /* start logging */ WriteToLog(%ApplicationLogFence_Level1, art: " String(%Datetime) "***"); WriteToLog(%ApplicationLogFence_Level1, WriteToLog(%ApplicationLogFence_Level1, WriteToLog(%ApplicationLogFence_Level1, WriteToLog(%ApplicationLogFence_Level1, "*** XML Publisher View Report Job St "Report Name = " "EP_EVAL"); "As of Date = " %Date); "Output Format = " 2); "Language Code = " %Language_User);

/* create report defn object */ &oRptDefn = create PSXP_RPTDEFNMANAGER:ReportDefn("EP_EVAL"); &oRptDefn.Get(); /* output directory */ &RptOutputDir = GetEnv("PS_SERVDIR") &sDirSep "files" &sDirSep UuidGen(); &sOutputDir = &RptOutputDir &sDirSep "RptInst"; &sDataDir = &RptOutputDir &sDirSep "Data"; CreateDirectory(&sOutputDir, %FilePath_Absolute); CreateDirectory(&sDataDir, %FilePath_Absolute); &oRptDefn.OutDestination = &RptOutputDir; &oRptDefn.SetRuntimeDataXMLDoc(&xmldocRoot); &oRptDefn.ProcessReport(&sTemplateId, %Language_User, %Date, ""); &sFileExt = GetFileExtension(&sOutputFormat); CommitWork(); /* display the output */ &oRptDefn.DisplayOutput(); /* cleanup */ DeleteLocalFile(&sOutputFile, %FilePath_Absolute); WriteToLog(%ApplicationLogFence_Level1, "*** XML Publisher View Report Job En d: " String(%Datetime) "***"); catch Exception &Err Local string &sSub1, &sSub2, &sSub3, &sSub4, &sSub5; Evaluate &Err.SubstitutionCount When > 4 &sSub5 = &Err.GetSubstitution(5); When > 3 &sSub4 = &Err.GetSubstitution(4); When > 2 &sSub3 = &Err.GetSubstitution(3); When > 1 &sDirSep "XMLP"

&sSub2 = &Err.GetSubstitution(2); When > 0 &sSub1 = &Err.GetSubstitution(1); End-Evaluate; Error MsgGet(&Err.MessageSetNumber, &Err.MessageNumber, &Err.ToString(), &sSu b1, &sSub2, &sSub3, &sSub4, &sSub5); end-try; /* import EP_FUNCTIONS:AppraisalFormat; import EP_FUNCTIONS:BaselineFormat; Evaluate %Component When = Component.EP_APPR_BASE &TransferPg = "Page.EP_APPR_BASE1"; Local EP_FUNCTIONS:BaselineFormat &BaselineFormat = create EP_FUNCTIONS:Basel ineFormat(); &BaselineFormat.PrintFormat(); Break; When = Component.EP_APPR_MAIN &TransferPg = "Page.EP_APPR_MAIN1"; Local EP_FUNCTIONS:AppraisalFormat &AppraisalFormat = create EP_FUNCTIONS:App raisalFormat(); &AppraisalFormat.PrintFormat(); Break; When-Other Exit; Break; End-Evaluate; */

You might also like