Commit 9012f930 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[Istex] fix getMetadataScroll call

parent 55ae7b50
......@@ -15,8 +15,7 @@ module Gargantext.Core.Text.Corpus.API
, Limit
, get
, externalAPIs
)
where
) where
import Data.Maybe
import Gargantext.API.Admin.Orchestrator.Types (ExternalAPIs(..), externalAPIs)
......@@ -42,7 +41,7 @@ get PubMed _la q _l = PUBMED.get q default_limit -- EN only by default
get HAL la q _l = HAL.get la q default_limit
get IsTex la q _l = ISTEX.get la q default_limit
get Isidore la q _l = ISIDORE.get la (fromIntegral <$> default_limit) (Just q) Nothing
get _ _ _ _ = undefined
get _ _ _ _ = undefined
-- | Some Sugar for the documentation
type Query = PUBMED.Query
......
......@@ -33,7 +33,8 @@ get la q ml = do
printDebug "[Istex.get] calling getMetadataScrollProgress for q" q
printDebug "[Istex.get] calling getMetadataScrollProgress for ml" ml
-- The "scroll" expects "d/h/m/s/ms" time interval. Let's set it to "1 month"
eDocs <- ISTEX.getMetadataScroll q ((\_n -> pack $ "1m") <$> ml) Nothing 0 --(fromIntegral <$> ml)
--eDocs <- ISTEX.getMetadataScroll q ((\_n -> pack $ "1m") <$> ml) Nothing 0 --(fromIntegral <$> ml)
eDocs <- ISTEX.getMetadataScroll q "1m" Nothing 0 --(fromIntegral <$> ml)
printDebug "[Istex.get] will print length" (0 :: Int)
case eDocs of
Left _ -> pure ()
......
......@@ -78,23 +78,23 @@ data FileFormat = WOS | RIS | RisPresse
-- | XML -- Not Implemented / see :
parseFormat :: FileFormat -> DB.ByteString -> Either Prelude.String [HyperdataDocument]
parseFormat CsvGargV3 bs = parseCsv' $ DBL.fromStrict bs
parseFormat CsvHal bs = parseHal' $ DBL.fromStrict bs
parseFormat :: FileFormat -> DB.ByteString -> IO (Either Prelude.String [HyperdataDocument])
parseFormat CsvGargV3 bs = pure $ parseCsv' $ DBL.fromStrict bs
parseFormat CsvHal bs = pure $ parseHal' $ DBL.fromStrict bs
parseFormat RisPresse bs = do
let docs = map (toDoc RIS)
<$> snd
<$> enrichWith RisPresse
$ partitionEithers
$ [runParser' RisPresse bs]
Right docs
pure $ Right docs
parseFormat WOS bs = do
let docs = map (toDoc WOS)
<$> snd
<$> enrichWith WOS
$ partitionEithers
$ [runParser' WOS bs]
Right docs
pure $ Right docs
parseFormat ZIP bs = do
path <- emptySystemTempFile "parsed-zip"
DB.writeFile path bs
......
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