diff --git a/docs/Section Parsing Formatting.md b/docs/Section Parsing Formatting.md new file mode 100644 index 0000000..771883c --- /dev/null +++ b/docs/Section Parsing Formatting.md @@ -0,0 +1,318 @@ +# Section Parsing Definitions + + + +- [Introduction](#introduction) +- [Directory Information](#directory-information) +- [Initial Message](#initial-message) +- [Edit](#edit) +- [Status](#status) +- [Assignment](#assignment) +- [Reply To User](#reply-to-user) +- [Reply from User](#reply-from-user) + + + +## Introduction +The body of an item is made up of seven distinct actions Below are descriptions of each action, its purpose, behavior, metadata and delimiters. + +## Directory Information +Information about the user such as alias, phone number and office location. This only appears once right after the headers and right before the initial message. This only occurs if the item is submitted through the [Trouble Reporting](https://engineering.purdue.edu/ECN/AboutUs/ContactUs) page. + +### Fields +| Key | Value | +| - | - | +| `Name` | The real name of the sender. | +| `Login` | The career account alias of the sender. | +| `Computer` | The computer the item is related to. Formatting may vary. | +| `Location` | Where the computer is located. | +| `Email` | The email address of the sender. | +| `Phone` | The phone number of the sender. | +| `Office` | The office location of the sender. | +| `UNIX Dir` | The home directory for the user on non-Windows systems | +| `Zero Dir` | The home directory for the user via Active Directory | +| `User ECNDB` | Link to the sender's username report in ECNDB | +| `Host ECNDB` | Link to the computer report in ECNDB | +| `Subject` | The subject of the email sent to the queue | + +### Delimiters +- **Start**: The second line after the first newline followed by a tab `\n\t`. +- **End**: The first non-empty line after the start that begins with whitespace then "Subject:" + +### Plain Text Example +``` +\tName: Jerry L Guerrero\n + Login: jerry\n" + Computer: x-ee27å0bpc1 (128.46.164.29)\n + Location: EE 270B\n + Email: jerry@purdue.edu\n + Phone: \n + Office: \n + UNIX Dir: /home/pier/c/jerry\n + Zero Dir: U=\\\\pier.ecn.purdue.edu\\jerry\n + User ECNDB: http://eng.purdue.edu/jump/bcafa8\n + Host ECNDB: http://eng.purdue.edu/jump/2dbd461 \n + Subject: Win7 to Win10 Migration List - kevin\n +``` + +### Parsed Example +```jsonc +{ + "type": "directoryInformation", + "Name": "Jerry L Guerrero", + "Login": "jerry", + "Computer": "x-ee27å0bpc1 (128.46.164.29)", + "Location": "EE 270B", + "Email": "jerry@purdue.edu", + "Phone": "", + "Office": "", + "UNIX Dir": "/home/pier/c/jerry", + "Zero Dir": "U=\\\\pier.ecn.purdue.edu\\jerry", + "User ECNDB": "http://eng.purdue.edu/jump/bcafa8", + "Host ECNDB": "http://eng.purdue.edu/jump/2dbd461", + "Subject": "Win7 to Win10 Migration List - kevin" +} +``` + +## Initial Message +The body of the email the item originated from. This usually appears directly after the headers unless directory information is present. + +### Fields +| Key | Value | +| - | - | +| `type` | `initial_message` | +| `datetime` | RFC 8061 formatted datetime string. | +| `from_name` | The sender's real name. Formatting may vary. This can be |empty. +| `from_email` | The sender's email address. | +| `to` | A list of names(s) and email(s) of people this message was sent |to. +| `cc` | A list of name(s) and email(s) of people who were CC'd. This can |be empty. +| `content` | The content of the message as an list of strings | + +### Delimiters +- **Start**: First newline after directory information if present, otherwise first newline. +- **End**: Beginning of another delimiter if present, otherwise end of file. + +### Plain Text Example +``` +I need some help with something. +``` + +### Parsed Example +```jsonc +{ + "type": "initial_message", + "datetime": "2020-09-11T01:26:45+00:00", + "from_name": "Justin Campbell", + "from_email": "campb303@purdue.edu", + "to": [ + { "name": "John Doe", "email": "johndoe@example.com" }, + ], + "cc": [ + { "name": "", "email": "janesmith@example.com" } + ], + "content": [ + "I need some help with something.\n" + ] +} +``` + +## Edit +Information added by someone at ECN, usually for internal use and/or communication. This can occur anywhere in the item after the initial message. + +### Fields +| Key | Value | +| - | - | +| `type` | `edit` | +| `datetime` | RFC 8061 formatted datetime string. | +| `by` | The career account alias of the person who added the edit. | +| `content` | The content of the edit as a list of strings. | + +### Delimiters +- **Start**: Line starting with `*** Edited` +- **End**: Beginning of another delimiter if present, otherwise end of file. + +### Plain Text Example +``` +*** Edited by: knewell at: 04/22/20 16:39:51 *** +This is related to another item. I need to do X next. +``` + +### Parsed Example +```jsonc +{ + "type": "edit", + "datetime": "2020-04-22T16:39:51", + "by": "knewell", + "content": [ + "This is related to another item. I need to do X next.\n" + ] +} +``` + +## Status +A short message about the progress of the item. This can occur anywhere in the item after the initial message. + +### Fields +| Key | Value | +| - | - | +| `type` | `status` | +| `datetime` | RFC 8061 formatted datetime string. | +| `by` | The career account alias of the person who updated the status. | +| `content` | The content of the status as a list of strings. | + + +### Delimiters +- **Start**: Line starting with `*** Status` +- **End**: Beginning of another delimiter if present, otherwise end of file. + +### Plain Text Example +``` +*** Status updated by: knewell at: 4/23/2020 10:35:47 *** +Doing X thing. +``` + +### Parsed Example +```jsonc +{ + "type": "status", + "datetime": "2020-04-23T10:35:47", + "by": "knewell", + "content": [ + "Doing X thing." + ] +} +``` + +## Assignment +Assigning the item to someone. This does not occur in the body of the item. It it tracked in the headers using three different entries: + + +- `Assigned-To-Updated-By`: the career account alias of the person who updated the assignment +- `Assigned-To-Updated-Time`: the time the assignment was updated +- `Assigned-To`: the career account alias of the person the item was assigned to + +### Fields +| Key | Value | +| - | - | +| `type` | `assignment` | +| `datetime` | RFC 8061 formatted datetime string. | +| `by` | The career account alias of the person who changed the |assignment. | +| `to` | The career account alias of the person who the item was assigned to. | + +### Delimiters +N/A + +### Plain Text Example +``` +Assigned-To: campb303 +Assigned-To-Updated-Time: Tue, 23 Jun 2020 13:27:00 EDT +Assigned-To-Updated-By: harley +``` + +### Parsed Example +```jsonc +{ + "type": "assignment", + "datetime": "2020-06-23T13:27:00", + "by": "harley", + "to": "campb303", +} +``` + +## Reply To User +A message from ECN to the user and/or related parties. This can occur anywhere in the item after the initial message. + +### Fields +| Key | Value | +| - | - | +| `type` | `reply_to_user` | +| `datetime` | RFC 8061 formatted datetime string. | +| `by` | The sender's real name. Formatting may vary. This can be empty. | +| `content` | The content of the message as an list of strings | + + +### Delimiters +- **Start**: Line starting with `*** Replied` +- **End**: Beginning of another delimiter if present, otherwise end of file. + +### Plain Text Example +``` +*** Replied by: ewhile at: 05/08/20 09:21:43 *** +Sascha, + +Chicken kevin biltong, flank jowl prosciutto shoulder meatball meatloaf sirloin. + +Ethan White +ECN +``` + +### Parsed Example +```jsonc +{ + "type": "reply_to_user", + "datetime": "2020-05-08T09:21:43", + "by": "ewhile", + "content": [ + "Sascha,\n", + "\n", + "Chicken kevin biltong, flank jowl prosciutto shoulder meatball meatloaf sirloin.\n", + "\n", + "Ethan White\n", + "ECN" + ] +} +``` + +## Reply from User +A message from the user and/or related parties. This is only found after two or more items have been merged together. This can occur anywhere in the item after the initial message. + +### Fields +| Key | Value | +| - | - | +| `type` | `reply_from_user` | +| `datetime` | RFC 8061 formatted datetime string. | +| `from_name` | The sender's real name. Formatting may vary. This can be empty. | +| `from_email` | The sender's email address. | +| `cc` | A list of name(s) and email(s) of people who were CC'd. This can be empty. | +| `content` | The content of the message as an list of strings | + +### Delimiters: +- **Start**: Line starting with `=== ` +- **End**: Line starting with `====` + +### Plain Text Example +``` +=== Additional information supplied by user === + +Subject: RE: New Computer Deploy +From: "Reckowsky, Michael J." +Date: Fri, 8 May 2020 13:57:17 +0000 + +Ethan, + +Biltong beef ribs doner chuck, pork chop jowl salami cow filet mignon pork. + +Mike +=============================================== +``` + +### Parsed Example +```jsonc +{ + "type": "reply_from_user", + "datetime": "2020-05-08T13:57:18+00:00", + "from_name": "Reckowsky, Michael J.", + "from_email": "mreckowsky@purdue.edu", + "cc": [ + { "name": "John Doe", "email": "johndoe@example.com" }, + { "name": "", "email": "janesmith@example.com" } + ], + "content": [ + "Ethan,\n", + "\n", + "Biltong beef ribs doner chuck, pork chop jowl salami cow filet mignon pork.\n", + "\n", + "Mike\n", + ] +} +``` \ No newline at end of file