Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Przemyslaw Kaminski
haskell-gargantext
Commits
b679a10b
Commit
b679a10b
authored
Sep 25, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[REST] Tree.
parent
a18c8462
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
10 deletions
+22
-10
API.hs
src/Gargantext/API.hs
+2
-2
Node.hs
src/Gargantext/API/Node.hs
+10
-2
Main.hs
src/Gargantext/Core/Types/Main.hs
+4
-4
Node.hs
src/Gargantext/Database/Types/Node.hs
+6
-2
No files found.
src/Gargantext/API.hs
View file @
b679a10b
...
...
@@ -191,11 +191,11 @@ type SwaggerAPI = SwaggerSchemaUI "swagger-ui" "swagger.json"
-- | API for serving main operational routes of @gargantext.org@
type
GargAPI
=
"api"
:>
Summary
"
Version API
"
:>
GargAPIVersion
type
GargAPI
=
"api"
:>
Summary
"
API
"
:>
GargAPIVersion
-- | TODO :<|> Summary "Latest API" :> GargAPI'
type
GargAPIVersion
=
"v1.0"
:>
Summary
"
API
v1.0: "
:>
GargAPI'
type
GargAPIVersion
=
"v1.0"
:>
Summary
"v1.0: "
:>
GargAPI'
type
GargAPI'
=
...
...
src/Gargantext/API/Node.hs
View file @
b679a10b
...
...
@@ -62,6 +62,8 @@ type Roots = Get '[JSON] [Node Value]
type
NodesAPI
=
Delete
'[
J
SON
]
Int
type
NodeAPI
=
Get
'[
J
SON
]
(
Node
Value
)
:<|>
Post
'[
J
SON
]
Int
:<|>
Put
'[
J
SON
]
Int
:<|>
Delete
'[
J
SON
]
Int
:<|>
"children"
:>
Summary
" Summary children"
:>
QueryParam
"type"
NodeType
...
...
@@ -119,6 +121,8 @@ treeAPI _ _ = undefined
nodeAPI
::
Connection
->
NodeId
->
Server
NodeAPI
nodeAPI
conn
id
=
liftIO
(
putStrLn
(
"/node"
::
Text
)
>>
getNode
conn
id
)
:<|>
postNode
conn
id
:<|>
putNode
conn
id
:<|>
deleteNode'
conn
id
:<|>
getNodesWith'
conn
id
:<|>
getFacet
conn
id
...
...
@@ -126,11 +130,15 @@ nodeAPI conn id = liftIO (putStrLn ("/node" :: Text) >> getNode co
-- :<|> upload
-- :<|> query
nodesAPI
::
Connection
->
[
NodeId
]
->
Server
NodesAPI
nodesAPI
conn
ids
=
deleteNodes'
conn
ids
postNode
::
Connection
->
NodeId
->
Handler
Int
postNode
=
undefined
putNode
::
Connection
->
NodeId
->
Handler
Int
putNode
=
undefined
deleteNodes'
::
Connection
->
[
NodeId
]
->
Handler
Int
deleteNodes'
conn
ids
=
liftIO
(
deleteNodes
conn
ids
)
...
...
src/Gargantext/Core/Types/Main.hs
View file @
b679a10b
...
...
@@ -56,9 +56,7 @@ gargNode = [userTree]
-- | User Tree simplified
userTree
::
Tree
NodeTree
userTree
=
TreeN
(
NodeTree
"user name"
NodeUser
1
)
$
[
leafT
$
NodeTree
"MyPage"
UserPage
0
]
<>
[
annuaireTree
,
projectTree
]
userTree
=
TreeN
(
NodeTree
"user name"
NodeUser
1
)
[
annuaireTree
,
projectTree
]
-- | Project Tree
projectTree
::
Tree
NodeTree
...
...
@@ -73,7 +71,9 @@ annuaireTree = TreeN (NodeTree "Annuaire" Annuaire 41) ( [leafT $ NodeTree "IM
)
corpusTree
::
NodeId
->
Text
->
Tree
NodeTree
corpusTree
nId
t
=
TreeN
(
NodeTree
(
"Corpus "
<>
t
)
NodeCorpus
nId
)
(
[
leafT
$
NodeTree
"Documents"
Document
(
nId
+
1
)]
corpusTree
nId
t
=
TreeN
(
NodeTree
(
"Corpus "
<>
t
)
NodeCorpus
nId
)
(
[
leafT
$
NodeTree
"Dashboard"
Dashboard
(
nId
+
1
)
,
leafT
$
NodeTree
"Graph"
Graph
(
nId
+
2
)
]
-- <> [ leafT $ NodeTree "My lists" Lists 5]
-- <> [ leafT (NodeTree "Metrics A" Metrics 6) ]
-- <> [ leafT (NodeTree "Class A" Classification 7)]
...
...
src/Gargantext/Database/Types/Node.hs
View file @
b679a10b
...
...
@@ -274,10 +274,14 @@ type NodeCorpus = Node HyperdataCorpus
type
Document
=
Node
HyperdataDocument
------------------------------------------------------------------------
data
NodeType
=
NodeUser
|
Project
|
Folder
|
NodeCorpus
|
Annuaire
|
Document
|
Individu
|
UserPage
|
DocumentCopy
|
Favorites
data
NodeType
=
NodeUser
|
Project
|
Folder
|
NodeCorpus
|
Annuaire
|
Document
|
Individu
|
UserPage
|
DocumentCopy
|
Favorites
|
Dashboard
|
Graph
|
Classification
|
Lists
|
Metrics
|
Occurrences
|
Metrics
|
Occurrences
deriving
(
Show
,
Read
,
Eq
,
Generic
)
instance
FromJSON
NodeType
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment