Gadreel / divconq

File Transfer Server Framework
Apache License 2.0
12 stars 5 forks source link

dc message system #144

Open Gadreel opened 9 years ago

Gadreel commented 9 years ago

see #26 too

a general purpose - message thread based - communication platform

Gadreel commented 9 years ago

Messaging

high level

registry

/Usr/[id] - message to a user /Bdg/Staff - message to Staff pool /Grp/[id] - message to a group as pool

NO

~/Sub/General - message to general registry (as pool) /Sub/Projects - message to project registry (as pool)~

SHA256 on registry path (no, too long for most)

projects and tasks are not registries

responds to @ - important

threads (in 1 or more registry)

collection of content based on a SHA256 - this can be the SHA256 of the subject (remove RE: and FWD: first to see if thread already exists)

in notes the thread can come from the # title of the first note (once set, doesn't change even if title is edited), if a reply/note has a # at first char then a new thread is created

so # is important

structure (per thread)

no more than 2 deep, use filters too

/Usr/Calendar /[section name] /Usr/InBox (to read) /Email /[General] /[section name] /Usr/Sent /[group or section name] /Usr/Drafts (to write msg to someone) /[group or section name] /Usr/Notes (to keep a record of) /[group or section name] /Usr/Files /Attachments (from all emails, archived when email is archived) /Public (read anyone) /[section name] /Usr/Projects /[group or section name] /Usr/Tasks (to do something, besides read or write) /Personal (generic personal tasks) /[group or section name]

/Usr/Archive /Usr/Spam /Usr/Trash

but first part of part is hidden in display so two messages:

/Usr/InBox/General /Bdg/InBox/General

appear as:

/InBox/General - 2

folders can be made sticky so they always show - otherwise, only show folder if there is something in it

use ! to indicate path


maybe instead

/Usr/[uid]/Calendar /[channel name] /Usr/[uid]/InBox (to read) /Email /[General] /[channel name] /[customer alias - projects/tasks related to customer] /Usr/[uid]/Drafts (started to create a message, or event or reminder or note or task, or anything I haven't finished) (only users have drafts, other registry do not) /[group or section name] /Usr/[uid]/Notes (to keep a record of) /[group or section name] /Usr/[uid]/Tasks (to do something, besides read or write) /Personal (generic personal tasks) (pinned for users, not other registry) /[group or section name]

/Usr/[uid]/Archive /Sent (pinned for users, not other registry)

/Usr/[uid]/Trash /Spam (pinned for users, not other registry)

keep folders separate, repeat the tree (most of it) for each registry. advanced option to show a combined view with message labels to distinguish msgs to pools/others from user

/Bdg/Staff/Calendar *an optional feature for some registries /[channel name] /Bdg/Staff/InBox (to read) /[channel name] /[customer alias - projects/tasks related to customer] /Bdg/Staff/Notes (to keep a record of) /[group or section name] /Bdg/Staff/Tasks (to do something, besides read or write) /[group or section name]

/Bdg/Staff/Archive /Bdg/Staff/Trash

label filter (per thread)

/[year] /[customer] /[account] /[other] /Personal /Work-AWWW /Work-dCA /Work-Dad

use $ to indicate the label

function

examples

message or chat to users

dcRecord([domain],"dcmThread",[id], "dcmParty","/Usr/00007",[stamp],"Data")="/Usr/00007" - key'ed by Party "dcmParty","/Usr/00119",[stamp],"Data")="/Usr/00119" "dcmParty","/Usr/00001",[stamp],"Data")="/Usr/00001" - sent by

"dcmFolder","/Usr/00007",[stamp],"Data")="/InBox/TDS"               - key'ed by Party 
"dcmFolder","/Usr/00119",[stamp],"Data")="/InBox/TDS"
"dcmFolder","/Usr/00001",[stamp],"Data")="/Archive/Sent"

"dcmLabels",[stamp],"Data")="|2015|TDS|Priority|"                       - shared labels, including Priority flag

"dcmPartyLabels","/Usr/00119",[stamp],"Data")="|Work-dCA|"      - private label, keyed by Party
"dcmPartyLabels","/Usr/00007",[stamp],"Data")="|dCA|Starred|"       - private label

"dcmRead","/Usr/00007",[stamp],"Data")=true                         - key'ed by Party
"dcmLastRead","/Usr/00007",[stamp],"Data")=YYYYDDMMTHHMMSSZ
"dcmRead","/Usr/00119",[stamp],"Data")=false
"dcmRead","/Usr/00001",[stamp],"Data")=true                         
"dcmLastRead","/Usr/00001",[stamp],"Data")=YYYYDDMMTHHMMSSZ

"dcmTitle",[stamp],"Data")=[dcString]
"dcmTitleHash",[stamp],"Data")=[SHA256]                                 - the original hash of the thread, used to link external resources into the thread
"dcmCreated",[stamp],"Data")=YYYYDDMMTHHMMSSZ
"dcmModified",[stamp],"Data")=YYYYDDMMTHHMMSSZ                          - last time content was added
"dcmOriginator",[stamp],"Data")="00001"                                 - originator ID if any

"dcmTargetDate",[stamp],"Data")=YYYYDDMMTHHMMSSZ
"dcmEndDate",[stamp],"Data")=YYYYDDMMTHHMMSSZ                           - optional

"dcmContent",YYYYDDMMTHHMMSSZ,[stamp],"Data")=[string]              - keyed by when content was added
"dcmContentType",YYYYDDMMTHHMMSSZ,[stamp],"Data")=ENUM -> Text,UnsafeMD,SafeMD,HTML,MIME:[type]
"dcmContentHash",YYYYDDMMTHHMMSSZ,[stamp],"Data")=[SHA256]                          - the original hash of the content, identify block (that or the datetime stamp)
"dcmSource",YYYYDDMMTHHMMSSZ,[stamp],"Data")=[string]               - only if source is different from Content (minus attachments for emails)
"dcmAttributes",YYYYDDMMTHHMMSSZ,[stamp],"Data")=[AnyRecord]

message or chat to pool

Assume we have a registry like this:

thus the Party for the pool is /StaffPool

dcRecord([domain],"dcmThread",[id], "dcmParty","/StaffPool",[stamp],"Data")="/StaffPool" - keyed by Party "dcmParty","/Usr/00001",[stamp],"Data")="/Usr/00001" - sent by

"dcmFolder","/StaffPool",[stamp],"Data")="/InBox"               - keyed by Party and originator
"dcmFolder","/Usr/00001",[stamp],"Data")="/Archive/Sent"

"dcmLabel",[stamp],"Data")="|2015|"     - keded by label, User badge = shared/universal
"dcmLabel",[stamp],"Data")="|Work|"     

"dcmPartyLabels","/StaffPool",[stamp],"Data")="|Humor|"         - private label for pool only, keyed by Party
"dcmPartyLabels","/Usr/00001",[stamp],"Data")="|Jokes|"         - private label for sender - allowed

"dcmRead","/Usr/00007",[stamp],"Data")=true                         - keyed by user
"dcmLastRead","/Usr/00007",[stamp],"Data")=YYYYDDMMTHHMMSSZ
"dcmRead","/Usr/00001",[stamp],"Data")=true                         
"dcmLastRead","/Usr/00001",[stamp],"Data")=YYYYDDMMTHHMMSSZ

"dcmTitle",[stamp],"Data")=[dcString]
"dcmTitleHash",[stamp],"Data")=[SHA256]                                 - the original hash of the thread, used to link external resources into the thread
"dcmCreated",[stamp],"Data")=YYYYDDMMTHHMMSSZ
"dcmModified",[stamp],"Data")=YYYYDDMMTHHMMSSZ                          - last time content was added
"dcmOriginator",[stamp],"Data")="00001"                                 - originator ID if any

"dcmTargetDate",[stamp],"Data")=YYYYDDMMTHHMMSSZ
"dcmEndDate",[stamp],"Data")=YYYYDDMMTHHMMSSZ                           - optional

"dcmContent",YYYYDDMMTHHMMSSZ,[stamp],"Data")=[string]              - keyed by when content was added
"dcmContentType",YYYYDDMMTHHMMSSZ,[stamp],"Data")=ENUM -> Text,UnsafeMD,SafeMD,HTML,MIME:[type]
"dcmSource",YYYYDDMMTHHMMSSZ,[stamp],"Data")=[string]               - only if source is different from Content (minus attachments for emails)
"dcmAttributes",YYYYDDMMTHHMMSSZ,[stamp],"Data")=[AnyRecord]

Thread Indexes

dcmThreadA([domain],Party,Folder,Modified,Id)=status (0 = read, 1 = not read) | combined Labels with ending |)=null

dcmThreadA([domain], "/Usr/00007","/InBox/TDS",[mod time 1],[thrd id 1])="0|2015|TDS|Starred|Priority|" "/Usr/00119","/InBox/TDS",[mod time 1],[thrd id 1])="1|2015|TDS|Priority|" "/Usr/00001","/Archive/Sent",[mod time 1],[thrd id 1])="0|2015|TDS|Priority|" "/Usr/00001","/Archive/Sent",[mod time 2],[thrd id 2])="0|2015|Work|Jokes|" "/StaffPool","/InBox",[mod time 2],[thrd id 2])="0|2015|Work|Humor|"

check folder counts from here this global - check the next calculate needed part, recalculate if past due only works if no filter is applied??

dcmThreadB([domain],Label,Party,Folder) = [new count]|[total count]|[pri count]|[next calculate needed]

dcmThreadB([domain],"*", "/Usr/00007","/InBox/TDS")="0,1,1,[mod time 1 for any newer/future messages in this folder]" "/Usr/00119","/InBox/TDS")="1,1,1,[mod time 1 for any newer/future messages in this folder]" "/Usr/00001","/Archive/Sent")="0,2,1,[mod time 1 or 2, which ever is newer, for any newer/future messages in this folder]" "/StaffPool","/InBox")="0,1,0,[mod time 2 for any newer/future messages in this folder]"

"*" - means no filter, if a filter is requested on a Label(s) then we build/use those instead

if label filters where on we would have:

dcmThreadB([domain],"2015", "/Usr/00007","/InBox/TDS")="0,1,1,[mod time 1 for any newer/future messages in this folder]" "/Usr/00119","/InBox/TDS")="1,1,1,[mod time 1 for any newer/future messages in this folder]" "/Usr/00001","/Archive/Sent")="0,2,1,[mod time 1 or 2, which ever is newer, for any newer/future messages in this folder]" "/StaffPool","/InBox")="0,1,0,[mod time 2 for any newer/future messages in this folder]"

dcmThreadB([domain],"TDS", "/Usr/00007","/InBox/TDS")="0,1,1,[mod time 1 for any newer/future messages in this folder]" "/Usr/00119","/InBox/TDS")="1,1,1,[mod time 1 for any newer/future messages in this folder]" "/Usr/00001","/Archive/Sent")="0,1,1,[mod time 1 for any newer/future messages in this folder]"

dcmThreadB([domain],"Priority", "/Usr/00007","/InBox/TDS")="0,1,1,[mod time 1 for any newer/future messages in this folder]" "/Usr/00119","/InBox/TDS")="1,1,1,[mod time 1 for any newer/future messages in this folder]" "/Usr/00001","/Archive/Sent")="0,1,1,[mod time 1 for any newer/future messages in this folder]"

dcmThreadB([domain],"Starred", "/Usr/00007","/InBox/TDS")="0,1,1,[mod time 1 for any newer/future messages in this folder]"

dcmThreadB([domain],"Work", "/Usr/00001","/Archive/Sent")="0,1,0,[mod time 2 for any newer/future messages in this folder]" "/StaffPool","/InBox")="0,1,0,[mod time 2 for any newer/future messages in this folder]"

dcmThreadB([domain],"Jokes", "/Usr/00001","/Archive/Sent")="0,1,0,[mod time 2 for any newer/future messages in this folder]"

dcmThreadB([domain],"Humor", "/StaffPool","/InBox")="0,1,0,[mod time 2 for any newer/future messages in this folder]"

Calc rules:

1) party added

2) party removed

3) folder changed for party

4) modified changed

5) read status changed for party

6) label add/remove for party

7) shared label add/remove

NOTE: if someone needs to Label a message in a pool using their own label, then what we do is add that person as a Party and put the personal label in the user Party

check Folder Counts (Bus) Service

registry

other fields

dcmParty - really means Participant but Party is shorter

dcmFlag: dcTinyString, List, Index

content has been placed in a state that will be swept (Spam, Trash)

dcmFlagAt: DateTime, List ?? (maybe we can get this from non-compact query)

dcmRole: Enum -> (CC, ReadOnly - TODO) , List (keyed by Party)

dcmSender: dcSmallString

for messages, maybe put in content struct?

dcmOriginator (aka Owner): Id

empty for external email, but there for internal, tasks, events - anything the consuming user creates for self

dcmActivity Log: [future]

dcmDescription: dcString

for events, tasks, notes

dcmLink (aka Attachment): links to files, reminders, events, tasks, etc...anything for this thread

TODO think this through

dcmDependsOn: List, boolean

tasks we depend on, key'ed as dcmlink

dcmEstimatedWork

for tasks dcmEndDate is the due date


field details

Partys (To): dcSmallString, List, Indexed

Values - direct: "User:uid", pool: "Tag:Staff"

Status: Enum (New,Read), List PER User LastRead: DateTime, List PER User

ContentTags: dcSmallString, List, Indexed

What features/operations/views are available for this message starts with / if it goes in a folder

  • Calendar (reminders, milestones and events, events can have reminders - events can have plan ahead reminders too) (events are notes, attributes: start, end, depends on) (shows both events and reminders - reminders have a date/time (or just a date), events have a start/end) (notifications/alerts may be attached to reminders or events - these are how to communicate) (reminders may be attached to any event, message, note, file, reminder, project, task)
  • Files (attributes: shared - this isn't how we want it, should be a property of the folder you are in, - can have reminders)
  • Attachments (from emails)
  • Public
  • Messages and Conversations (attributes: pri, read - can have reminders)
  • fixed folders for everyone are: Inbox, Sent, Drafts
  • Channel features (shared chats, can create private chats too) (notifications per user per channel)
  • Projects
  • Notes (text and lists - can have reminders) (can become projects or tasks)
  • Tasks (are notes, attributes: estimated effort, due date, depends on - project management?)

/* inside whole page filter

Values: [any string]

Flags: dcTinyString, List, Index

content has been placed in a state that will be swept (Spam, Trash) Flag Created: DateTime, List ?? (maybe we can get this from non-compact query)

~LocationTags: dcSmallString, List

What folders are available for this message~

~When: DateTime, Scalar, Indexed~

Priority: Enum (High,Standard), Scalar

~Stared: Boolean, List~ PER USER - no make this a label

Title: dcSmallString (aka Subject) Created: DateTime (first date associated with this) TargetDate: DateTime (when is the message for, or when was the file/note/event last modified) Sender: dcSmallString

for messages, maybe put in content struct? Owner: Id
empty for messages, but there for files, tasks, events - anything the consuming user creates for self

~Size: Integer

mostly for files, but can be messages too~

Content: Struct

Source: String (email source, attachments stripped)

Activity Log: [future]

Description: dcString

mostly for files, but can be messages too

~Stickies: Struct (attached by Partys)~

Links (aka Attachments): links to files, reminders, events, tasks, stickies (inline, not a separate record), etc...anything for this thread

overview

Unified Display

Whole Page Level

filter - Label (see just 1 label - or a few - at a time for the entire folder structure filter - Registry (see just 1 - or a few - registry at a time)

Box View Level

sort by title or by target date (or by sender) grid view or list view, or custom for Box, such as Calendar View all subfolders too (top level folder, such as calendar, shows all subs) - should this be a flag or default? Show preview pane

Settings

Are set per folder and can be copied to subs on change

index

one entry, value separated by pipe

^dcMsgAll(Domain,To,Tag,When,Id)= [status - n/r]|[pri - t/f]

folders load from here - check the next calculate needed part, recalculate if past due

^dcMsgFast(Domain,To,Tag) = [new count]|[read count]|[pri count]|[next calculate needed]

check folders Service

So we make sure all the labels (folders) the user has made show in results and are recalculated. At least one tag is always required, so we'll pick up all the messages somehow.