Commit b41a366d authored by Bas Lijnse's avatar Bas Lijnse

Intermediate commit of ad-hoc stuff

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/trunk@1154 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent 56fb27b3
......@@ -4,13 +4,13 @@ import iTasks
import Groups, Messaging, Consensus, Lists
Start :: !*World -> *World
Start world = startEngine workflows world
where
workflows = [ workflow "Groups" manageGroups
, workflow "Lists" manageLists
, workflow "Ask opinions" askOpinions
: flatten [ messaging, lists ]
: messaging
]
messaging :: [Workflow]
......@@ -18,10 +18,4 @@ messaging
= [ workflow "Messaging/Send a new Message" newMessage
, workflow "Messaging/Send a new Group-Message" newMessageToGroup
, workflow "Messaging/View Message Archive" viewArchive
]
lists :: [Workflow]
lists = [ workflow "List Management/New List" newList
, workflow "List Management/Edit List" editList
, workflow "List Management/Push List" pushList
]
]
\ No newline at end of file
......@@ -10,7 +10,7 @@ definition module Groups
import iTasks
:: Group =
{ no :: !Int
{ groupId :: !Int
, name :: !String
, members :: ![User]
}
......
......@@ -7,15 +7,15 @@ derive bimap Maybe, (,)
instance DB Group
where
databaseId = mkDBid "Groups"
getItemId g = DBRef g.Group.no
setItemId (DBRef no) g = {Group| g & no = no}
databaseId = mkDBid "Groups"
getItemId g = DBRef g.Group.groupId
setItemId (DBRef groupId) g = {Group| g & groupId = groupId}
instance toString Group where toString g = g.Group.name
createGroup :: !String !User -> Task Group
createGroup name user
= dbCreateItem {Group | no = 0, name = name, members = [user]}
= dbCreateItem {Group | groupId = 0, name = name, members = [user]}
getAllGroups :: Task [Group]
getAllGroups
......
......@@ -2,6 +2,42 @@ definition module Lists
import iTasks
:: List a =
{ name :: !String
, description :: !Maybe Note
, items :: ![a]
}
:: ListMeta =
{ listId :: !Int
, owner :: !User
, sharedWith :: !Maybe [User]
}
:: SimpleList :== List String
:: TodoList :== List (Bool, String)
:: DateList :== List (Date, String)
:: DocumentList :== List (Document, String)
:: AnyList = SimpleList SimpleList
| TodoList TodoList
| DateList DateList
| DocumentList DocumentList
derive class iTask List, ListMeta, AnyList
instance DB ListMeta
manageLists :: Task Void
manageList :: AnyList -> Task Void
createList :: !String -> Task AnyList
getAllLists :: Task [AnyList]
getMyLists :: Task [AnyList]
deleteList :: !AnyList -> Task AnyList
//Never mind this...
/*
:: ListDB
getListDB :: DBid ListDB
......@@ -9,4 +45,5 @@ pushList :: Task Void
editList :: Task Void
newList :: Task Void
\ No newline at end of file
newList :: Task Void
*/
\ No newline at end of file
......@@ -2,7 +2,34 @@ implementation module Lists
import iTasks, CommonDomain
derive class iTask List, ListMeta, AnyList
derive bimap Maybe, (,)
instance DB ListMeta
where
databaseId = mkDBid "Lists"
getItemId l = DBRef l.ListMeta.listId
setItemId (DBRef listId) l = {ListMeta| l & listId = listId}
manageLists :: Task Void
manageLists = stop
manageList :: AnyList -> Task Void
manageList list = stop
createList :: !String -> Task AnyList
createList name = getDefaultValue
getAllLists :: Task [AnyList]
getAllLists = return []
getMyLists :: Task [AnyList]
getMyLists = return []
deleteList :: !AnyList -> Task AnyList
deleteList list = return list
/*
:: ListDB :== [DBid ListDBItem]
:: ListDBItem = NoteList (List Note) | DateList (List Date) | DocList (List Document)
......@@ -155,4 +182,5 @@ getShortDescription item
(DocList list) = list.List.description
= case mbDesc of
Just (Note d) = if(size d > 27) ((d % (0,27))+++"...") d
Nothing = "..."
\ No newline at end of file
Nothing = "..."
*/
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment