Commit f1080643 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FEAT] External APIs HAL AND IsTex.

parent 4cc77edb
...@@ -26,12 +26,14 @@ import URI.Extra.QueryPairs as QP ...@@ -26,12 +26,14 @@ import URI.Extra.QueryPairs as QP
allDatabases :: Array Database allDatabases :: Array Database
allDatabases = [All, PubMed, Isidore_EN, Isidore_FR] allDatabases = [All, PubMed, Isidore_EN, Isidore_FR]
data Database = All | PubMed | HAL | IsTex data Database = All | PubMed
| Isidore_FR | Isidore_EN | HAL_EN | HAL_FR
| IsTex_EN | IsTex_FR
| Isidore_EN | Isidore_FR
data Langs = FR | EN data Langs = FR | EN
-- | Types needed for now maybe not useful later -- | Types needed for now maybe not useful later (we could factorize the Type with Database Lang but no need for now)
instance showLangs :: Show Langs where instance showLangs :: Show Langs where
show FR = "FR" show FR = "FR"
show EN = "EN" show EN = "EN"
...@@ -39,18 +41,28 @@ instance showLangs :: Show Langs where ...@@ -39,18 +41,28 @@ instance showLangs :: Show Langs where
instance showDatabase :: Show Database where instance showDatabase :: Show Database where
show All = "All" show All = "All"
show PubMed = "PubMed" show PubMed = "PubMed"
show HAL = "HAL"
show IsTex = "IsTex" show HAL_EN = "HAL" <> show EN
show Isidore_FR = "Isidore_" <> show FR show HAL_FR = "HAL" <> show FR
show IsTex_EN = "IsTex" <> show EN
show IsTex_FR = "Istex" <> show FR
show Isidore_EN = "Isidore_" <> show EN show Isidore_EN = "Isidore_" <> show EN
show Isidore_FR = "Isidore_" <> show FR
readDatabase :: String -> Maybe Database readDatabase :: String -> Maybe Database
readDatabase "All" = Just All readDatabase "All" = Just All
readDatabase "PubMed" = Just PubMed readDatabase "PubMed" = Just PubMed
readDatabase "HAL" = Just HAL
readDatabase "IsTex" = Just IsTex readDatabase "HAL_EN" = Just HAL_EN
readDatabase "Isidore_FR" = Just Isidore_FR readDatabase "HAL_FR" = Just HAL_FR
readDatabase "IsTex_EN" = Just IsTex_EN
readDatabase "IsTex_FR" = Just IsTex_FR
readDatabase "Isidore_EN" = Just Isidore_EN readDatabase "Isidore_EN" = Just Isidore_EN
readDatabase "Isidore_FR" = Just Isidore_FR
readDatabase _ = Nothing readDatabase _ = Nothing
......
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