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
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
Christian Merten
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' =
...
@@ -303,7 +303,7 @@ type GargPrivateAPI' =
:<|>
New
.
AddWithForm
:<|>
New
.
AddWithForm
:<|>
New
.
AddWithQuery
:<|>
New
.
AddWithQuery
:<|>
Annuaire
.
AddWithForm
:<|>
"annuaire"
:>
Annuaire
.
AddWithForm
-- :<|> New.AddWithFile
-- :<|> New.AddWithFile
-- :<|> "scraper" :> WithCallbacks ScraperAPI
-- :<|> "scraper" :> WithCallbacks ScraperAPI
-- :<|> "new" :> New.Api
-- :<|> "new" :> New.Api
...
@@ -406,7 +406,7 @@ serverPrivateGargAPI' (AuthenticatedUser (NodeId uid))
...
@@ -406,7 +406,7 @@ serverPrivateGargAPI' (AuthenticatedUser (NodeId uid))
-- TODO access
-- TODO access
-- :<|> addUpload
-- :<|> addUpload
-- :<|> (\corpus -> addWithQuery corpus :<|> addWithFile corpus)
-- :<|> (\corpus -> addWithQuery corpus :<|> addWithFile corpus)
:<|>
addCorpusWithForm
:<|>
addCorpusWithForm
"user1"
:<|>
addCorpusWithQuery
:<|>
addCorpusWithQuery
:<|>
addAnnuaireWithForm
:<|>
addAnnuaireWithForm
...
@@ -432,15 +432,15 @@ addWithFile cid i f =
...
@@ -432,15 +432,15 @@ addWithFile cid i f =
serveJobsAPI
$
serveJobsAPI
$
JobFunction
(
\
_i
log
->
New
.
addToCorpusWithFile
cid
i
f
(
liftIO
.
log
))
JobFunction
(
\
_i
log
->
New
.
addToCorpusWithFile
cid
i
f
(
liftIO
.
log
))
addCorpusWithForm
::
GargServer
New
.
AddWithForm
addCorpusWithForm
::
Text
->
GargServer
New
.
AddWithForm
addCorpusWithForm
cid
=
addCorpusWithForm
username
cid
=
serveJobsAPI
$
serveJobsAPI
$
JobFunction
(
\
i
log
->
JobFunction
(
\
i
log
->
let
let
log'
x
=
do
log'
x
=
do
printDebug
"addCorpusWithForm"
x
printDebug
"addCorpusWithForm"
x
liftIO
$
log
x
liftIO
$
log
x
in
New
.
addToCorpusWithForm
cid
i
log'
)
in
New
.
addToCorpusWithForm
username
cid
i
log'
)
addAnnuaireWithForm
::
GargServer
Annuaire
.
AddWithForm
addAnnuaireWithForm
::
GargServer
Annuaire
.
AddWithForm
addAnnuaireWithForm
cid
=
addAnnuaireWithForm
cid
=
...
...
src/Gargantext/API/Corpus/New.hs
View file @
b69c48c1
...
@@ -214,6 +214,7 @@ addToCorpusWithFile cid input filetype logStatus = do
...
@@ -214,6 +214,7 @@ addToCorpusWithFile cid input filetype logStatus = do
,
_scst_remaining
=
Just
138
,
_scst_remaining
=
Just
138
,
_scst_events
=
Just
[]
,
_scst_events
=
Just
[]
}
}
printDebug
"addToCorpusWithFile"
cid
_h
<-
postUpload
cid
filetype
input
_h
<-
postUpload
cid
filetype
input
pure
ScraperStatus
{
_scst_succeeded
=
Just
137
pure
ScraperStatus
{
_scst_succeeded
=
Just
137
...
@@ -240,11 +241,12 @@ addToCorpusWithForm' cid (WithForm ft d l) logStatus = do
...
@@ -240,11 +241,12 @@ addToCorpusWithForm' cid (WithForm ft d l) logStatus = do
pure s'
pure s'
-}
-}
addToCorpusWithForm
::
FlowCmdM
env
err
m
addToCorpusWithForm
::
FlowCmdM
env
err
m
=>
CorpusId
=>
Text
->
CorpusId
->
WithForm
->
WithForm
->
(
ScraperStatus
->
m
()
)
->
(
ScraperStatus
->
m
()
)
->
m
ScraperStatus
->
m
ScraperStatus
addToCorpusWithForm
cid
(
WithForm
ft
d
l
_n
)
logStatus
=
do
addToCorpusWithForm
username
cid
(
WithForm
ft
d
l
_n
)
logStatus
=
do
let
let
parse
=
case
ft
of
parse
=
case
ft
of
...
@@ -270,7 +272,7 @@ addToCorpusWithForm cid (WithForm ft d l _n) logStatus = do
...
@@ -270,7 +272,7 @@ addToCorpusWithForm cid (WithForm ft d l _n) logStatus = do
printDebug
"Starting extraction : "
cid
printDebug
"Starting extraction : "
cid
-- TODO granularity of the logStatus
-- TODO granularity of the logStatus
_cid'
<-
flowCorpus
"user1"
_cid'
<-
flowCorpus
username
(
Right
[
cid
])
(
Right
[
cid
])
(
Multi
$
fromMaybe
EN
l
)
(
Multi
$
fromMaybe
EN
l
)
(
map
(
map
toHyperdataDocument
)
docs
)
(
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