Commit 28cb31ce authored by Alexandre Delanoë's avatar Alexandre Delanoë

Merge branch 'testing' into stable

parents 6622956b 27829aa3
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
* Guided Tour * Guided Tour
* Sources form highlighting crawlers * Sources form highlighting crawlers
## Version 3.0.8.1
* WOS parser date FIX
* EUROPRESS parser author/text article FIX
* Backend: each project as user node as parent
## Version 3.0.7 ## Version 3.0.7
* Alembic implemented to manage database migrations * Alembic implemented to manage database migrations
......
...@@ -81,8 +81,9 @@ class EuropresseParser(Parser): ...@@ -81,8 +81,9 @@ class EuropresseParser(Parser):
# "./header/div/p[@class='titreArticleVisu grandTitre']" # "./header/div/p[@class='titreArticleVisu grandTitre']"
# #
# title_xpath (chemin plus générique) # title_xpath (chemin plus générique)
title_xpath = "./header//*[contains(@class,'titreArticle')]" title_xpath = "./header//*[contains(@class,'titreArticleVisu rdp__articletitle')]"
text_xpath = "./section/div[@class='DocText']//p" authors_xpath = "./header//*[contains(@class,'docAuthors')]"
text_xpath = "./section/div[@class='DocText clearfix']//p"
entire_header_xpath = "./header" entire_header_xpath = "./header"
# diagnosed during date retrieval and used for rubrique # diagnosed during date retrieval and used for rubrique
...@@ -144,6 +145,15 @@ class EuropresseParser(Parser): ...@@ -144,6 +145,15 @@ class EuropresseParser(Parser):
yield(hyperdata) yield(hyperdata)
continue continue
# Authors
# --------
try:
authors = scrap_text(html_article.xpath(authors_xpath))
hyperdata['authors'] = '; '.join([author for author in authors])
except:
pass
# FULLTEXT # FULLTEXT
# -------- # --------
...@@ -154,6 +164,7 @@ class EuropresseParser(Parser): ...@@ -154,6 +164,7 @@ class EuropresseParser(Parser):
except: except:
pass pass
# PUBLICATIONNAME # PUBLICATIONNAME
# ---------------- # ----------------
try: try:
......
...@@ -5,6 +5,7 @@ from collections import defaultdict ...@@ -5,6 +5,7 @@ from collections import defaultdict
from gargantext.util.toolchain import * from gargantext.util.toolchain import *
import copy import copy
from gargantext.util.db import session from gargantext.util.db import session
from gargantext.models import UserNode
class ProjectList(APIView): class ProjectList(APIView):
'''API endpoint that represent a list of projects owned by a user''' '''API endpoint that represent a list of projects owned by a user'''
...@@ -36,10 +37,16 @@ class ProjectList(APIView): ...@@ -36,10 +37,16 @@ class ProjectList(APIView):
return Response({"detail":"Project with this name already exists", "url":"/projects/%s" %str(project.id)}, status = HTTP_409_CONFLICT) return Response({"detail":"Project with this name already exists", "url":"/projects/%s" %str(project.id)}, status = HTTP_409_CONFLICT)
else: else:
user_node = session.query(UserNode).filter_by(user_id=request.user.id).one_or_none()
if user_node is None:
print("??? Can't find UserNode for %r to create ProjectNode with name %r ???" % (request.user, name))
new_project = Node( new_project = Node(
user_id = request.user.id, user_id = request.user.id,
typename = 'PROJECT', typename = 'PROJECT',
name = name, name = name,
parent_id = user_node and user_node.id,
) )
session.add(new_project) session.add(new_project)
......
...@@ -367,7 +367,7 @@ ...@@ -367,7 +367,7 @@
<p> <p>
Gargantext Gargantext
<span class="glyphicon glyphicon-registration-mark" aria-hidden="true"></span> <span class="glyphicon glyphicon-registration-mark" aria-hidden="true"></span>
, version 3.0.8, , version 3.0.8.1,
<a href="http://www.cnrs.fr" target="blank" title="Institution that enables this project."> <a href="http://www.cnrs.fr" target="blank" title="Institution that enables this project.">
Copyrights Copyrights
<span class="glyphicon glyphicon-copyright-mark" aria-hidden="true"></span> <span class="glyphicon glyphicon-copyright-mark" aria-hidden="true"></span>
......
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