-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from GeoNodeUserGroup-DE/issue#18_UPLOAD_suppo…
…rt_new_importer_design_in_verison_4.1 Issue#18 upload support new importer design in verison 4.1
- Loading branch information
Showing
16 changed files
with
260 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"processor": [ | ||
{ | ||
"pk": 1000, | ||
"username": "admin" | ||
}, | ||
{ | ||
"pk": 1001 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"funders": [ | ||
{ | ||
"award_title": "MOTivational strength of ecosystem services", | ||
"award_uri": "http://cordis.europa.eu/project/rcn/100180_en.html", | ||
"award_number": "282625", | ||
"funding_reference": { | ||
"funder_identifier_type": "BMBF" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"related_identifier": [ | ||
{ | ||
"related_identifier": "test10", | ||
"related_identifier_type": { | ||
"label": "ARK" | ||
}, | ||
"relation_type": { | ||
"label": "IsNewVersionOf" | ||
} | ||
}, | ||
{ | ||
"related_identifier": "test2", | ||
"related_identifier_type": { | ||
"label": "bibcode" | ||
}, | ||
"relation_type": { | ||
"label": "Documents" | ||
} | ||
} | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"related_projects": [{"label": "signal"},{"label": "rhizo_bread_and_beer"}]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
from src.geonodetypes import GeonodeCmdOutListKey | ||
from src.geonodeobject import GeonodeObjectHandler | ||
from src.rest import GeonodeRest | ||
|
||
from typing import Dict | ||
|
||
|
||
class GeonodeExecutionRequestHandler(GeonodeRest): | ||
ENDPOINT_NAME = "executionrequest" | ||
JSON_OBJECT_NAME = "requests" | ||
SINGULAR_RESOURCE_NAME = "request" | ||
|
||
# TODO | ||
LIST_CMDOUT_HEADER = [ | ||
GeonodeCmdOutListKey(key="exec_id"), | ||
GeonodeCmdOutListKey(key="name"), | ||
GeonodeCmdOutListKey(key="status"), | ||
GeonodeCmdOutListKey(key="user"), | ||
GeonodeCmdOutListKey(key="source"), | ||
GeonodeCmdOutListKey(key="created"), | ||
GeonodeCmdOutListKey(key="log"), | ||
] | ||
|
||
def cmd_describe(self, exec_id: str, **kwargs): | ||
obj = self.get(exec_id=exec_id, **kwargs) | ||
GeonodeObjectHandler.print_json(obj) | ||
|
||
def get(self, exec_id: str, **kwargs) -> Dict: | ||
""" | ||
get details for a given exec_id | ||
Args: | ||
exec_id (str): exec_id of the object | ||
Returns: | ||
Dict: obj details | ||
""" | ||
r = self.http_get( | ||
endpoint=f"{self.ENDPOINT_NAME}/{exec_id}?page_size={kwargs['page_size']}" | ||
) | ||
return r[self.SINGULAR_RESOURCE_NAME] | ||
|
||
def cmd_list(self, **kwargs): | ||
"""show list of geonode obj on the cmdline""" | ||
obj = self.list(**kwargs) | ||
if kwargs["json"]: | ||
GeonodeObjectHandler.print_json(obj) | ||
else: | ||
GeonodeObjectHandler.print_list_on_cmd(obj) | ||
|
||
def list(self, **kwargs) -> Dict: | ||
"""returns dict of datasets from geonode | ||
Returns: | ||
Dict: request response | ||
""" | ||
r = self.http_get( | ||
endpoint=f"{self.ENDPOINT_NAME}/?page_size={kwargs['page_size']}" | ||
) | ||
return r[self.JSON_OBJECT_NAME] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.