Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
158
Issues
158
List
Board
Labels
Milestones
Merge Requests
11
Merge Requests
11
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
gargantext
haskell-gargantext
Commits
b69c48c1
Commit
b69c48c1
authored
Apr 06, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[API] Add corpus username/uid.
parent
dcaef593
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
API.hs
src/Gargantext/API.hs
+5
-5
New.hs
src/Gargantext/API/Corpus/New.hs
+5
-3
No files found.
src/Gargantext/API.hs
View file @
b69c48c1
...
...
@@ -303,7 +303,7 @@ type GargPrivateAPI' =
:<|>
New
.
AddWithForm
:<|>
New
.
AddWithQuery
:<|>
Annuaire
.
AddWithForm
:<|>
"annuaire"
:>
Annuaire
.
AddWithForm
-- :<|> New.AddWithFile
-- :<|> "scraper" :> WithCallbacks ScraperAPI
-- :<|> "new" :> New.Api
...
...
@@ -406,7 +406,7 @@ serverPrivateGargAPI' (AuthenticatedUser (NodeId uid))
-- TODO access
-- :<|> addUpload
-- :<|> (\corpus -> addWithQuery corpus :<|> addWithFile corpus)
:<|>
addCorpusWithForm
:<|>
addCorpusWithForm
"user1"
:<|>
addCorpusWithQuery
:<|>
addAnnuaireWithForm
...
...
@@ -432,15 +432,15 @@ addWithFile cid i f =
serveJobsAPI
$
JobFunction
(
\
_i
log
->
New
.
addToCorpusWithFile
cid
i
f
(
liftIO
.
log
))
addCorpusWithForm
::
GargServer
New
.
AddWithForm
addCorpusWithForm
cid
=
addCorpusWithForm
::
Text
->
GargServer
New
.
AddWithForm
addCorpusWithForm
username
cid
=
serveJobsAPI
$
JobFunction
(
\
i
log
->
let
log'
x
=
do
printDebug
"addCorpusWithForm"
x
liftIO
$
log
x
in
New
.
addToCorpusWithForm
cid
i
log'
)
in
New
.
addToCorpusWithForm
username
cid
i
log'
)
addAnnuaireWithForm
::
GargServer
Annuaire
.
AddWithForm
addAnnuaireWithForm
cid
=
...
...
src/Gargantext/API/Corpus/New.hs
View file @
b69c48c1
...
...
@@ -214,6 +214,7 @@ addToCorpusWithFile cid input filetype logStatus = do
,
_scst_remaining
=
Just
138
,
_scst_events
=
Just
[]
}
printDebug
"addToCorpusWithFile"
cid
_h
<-
postUpload
cid
filetype
input
pure
ScraperStatus
{
_scst_succeeded
=
Just
137
...
...
@@ -240,11 +241,12 @@ addToCorpusWithForm' cid (WithForm ft d l) logStatus = do
pure s'
-}
addToCorpusWithForm
::
FlowCmdM
env
err
m
=>
CorpusId
=>
Text
->
CorpusId
->
WithForm
->
(
ScraperStatus
->
m
()
)
->
m
ScraperStatus
addToCorpusWithForm
cid
(
WithForm
ft
d
l
_n
)
logStatus
=
do
addToCorpusWithForm
username
cid
(
WithForm
ft
d
l
_n
)
logStatus
=
do
let
parse
=
case
ft
of
...
...
@@ -270,7 +272,7 @@ addToCorpusWithForm cid (WithForm ft d l _n) logStatus = do
printDebug
"Starting extraction : "
cid
-- TODO granularity of the logStatus
_cid'
<-
flowCorpus
"user1"
_cid'
<-
flowCorpus
username
(
Right
[
cid
])
(
Multi
$
fromMaybe
EN
l
)
(
map
(
map
toHyperdataDocument
)
docs
)
...
...
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