{"action":"created","comment":{"url":"https://api.github.com/repos/whole-tale/girder_wholetale/pulls/comments/190768505","pull_request_review_id":123218187,"id":190768505,"diff_hunk":"@@ -24,57 +29,95 @@ def create_resource_map(resmap_pid, eml_pid, file_pids):\n     :rtype: bytes\n     \"\"\"\n \n-    print(\"FILE_PIDS      \", file_pids)\n     logger.debug('Entered create_resource_map')\n+#    logger.debug('resmap_pids: {}'.format(resmap_pid))\n+#    logger.debug('eml_pids: {}'.format(eml_pid))\n+#    logger.debug('file_pids {}'.format(file_pids))\n     res_map = createSimpleResourceMap(resmap_pid, eml_pid, file_pids)\n     # createSimpleResourceMap returns type d1_common.resource_map.ResourceMap\n \n     logger.debug('Leaving create_resource_map')\n     return res_map.serialize()\n \n \n-def create_minimum_eml(tale, user):\n+def create_minimum_eml(tale, user, item_ids, eml_pid):\n     \"\"\"\n-    Creates a bare minimum EML record for a package. This includes the title,\n-    creator, and contact.\n+    Creates a bare minimum EML record for a package.\n \n     :param tale: The tale that is being packaged.\n     :param user: The user that hit the endpoint\n+    :param item_ids: A lsit of the item ids of the objects that are going to be packaged\n+    :param eml_pid: The PID for the eml document. Assume that this is the package doi\n     :type tale: wholetale.models.tale\n     :type user: girder.models.user\n+    :type item_ids: list\n+    :type eml_pid: str\n     :return: The EML as as string of bytes\n     :rtype: bytes\n     \"\"\"\n \n-    logger.debug('Entered create_minimum_eml')\n-    top = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'\n-    namespace = '<eml:eml xmlns:eml=\"eml://ecoinformatics.org/eml-2.1.1\" ' \\\n-                'xmlns:stmml=\"http://www.xml-cml.org/schema/stmml-1.1\" xmlns:' \\\n-                'xsi=\"http://www.w3.org/2001/XMLSchema-instance\" packageId=\"' \\\n-                'doi:10.18739/A20Q25\" system=\"https://arcticdata.io\" xsi:' \\\n-                'schemaLocation=\"eml://ecoinformatics.org/eml-2.1.1 eml.xsd\">'\n-\n-    dataset = '<dataset>\\n'\n-    title = '<title>{0}</title>\\n'.format(str(tale.get('title', '')))\n-\n-    individual_name = '<individualName>\\n<surName>\\n{0}\\n</surName>\\n</individualName>'.format(\n-        str(user.get('lastName', '')))\n-\n-    creator = '<creator>\\n{0}\\n</creator>\\n'.format(individual_name)\n-    contact = '<contact>\\n{0}\\n</contact>\\n'.format(individual_name)\n-    dataset_close = '</dataset>\\n'\n-    eml_close = '</eml:eml>'\n-\n-    # Append the above xml together to form the EML document\n-    xml = top+namespace+dataset+title+creator+contact+dataset_close+eml_close\n-\n+    # The surName in the EML record is taken by the user's last name. If\n+    # it doesn't exist, try to use the first name.\n+    lastName = user.get('lastName', 'None')","path":"server/dataone_package.py","position":80,"original_position":75,"commit_id":"7dc5f651ed1d28a26db45e0500b82f44cf7d2300","original_commit_id":"bb5f9ddd2d4f04b92cf202118d404cd640606128","user":{"login":"ThomasThelen","id":9289652,"avatar_url":"https://avatars1.githubusercontent.com/u/9289652?v=4","gravatar_id":"","url":"https://api.github.com/users/ThomasThelen","html_url":"https://github.com/ThomasThelen","followers_url":"https://api.github.com/users/ThomasThelen/followers","following_url":"https://api.github.com/users/ThomasThelen/following{/other_user}","gists_url":"https://api.github.com/users/ThomasThelen/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasThelen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasThelen/subscriptions","organizations_url":"https://api.github.com/users/ThomasThelen/orgs","repos_url":"https://api.github.com/users/ThomasThelen/repos","events_url":"https://api.github.com/users/ThomasThelen/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasThelen/received_events","type":"User","site_admin":false},"body":"I'm not sure how likely it is that the user has a first and last name-I can do some testing with different OAuth accounts to see if I can generate an account with either missing.\r\n\r\nI could probably fall back to their email, and then fall back to `'None'` or throw an exception if we don't want them to continue","created_at":"2018-05-25T01:00:10Z","updated_at":"2018-05-25T01:00:10Z","html_url":"https://github.com/whole-tale/girder_wholetale/pull/88#discussion_r190768505","pull_request_url":"https://api.github.com/repos/whole-tale/girder_wholetale/pulls/88","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/whole-tale/girder_wholetale/pulls/comments/190768505"},"html":{"href":"https://github.com/whole-tale/girder_wholetale/pull/88#discussion_r190768505"},"pull_request":{"href":"https://api.github.com/repos/whole-tale/girder_wholetale/pulls/88"}},"in_reply_to_id":190764612},"pull_request":{"url":"https://api.github.com/repos/whole-tale/girder_wholetale/pulls/88","id":189198104,"html_url":"https://github.com/whole-tale/girder_wholetale/pull/88","diff_url":"https://github.com/whole-tale/girder_wholetale/pull/88.diff","patch_url":"https://github.com/whole-tale/girder_wholetale/pull/88.patch","issue_url":"https://api.github.com/repos/whole-tale/girder_wholetale/issues/88","number":88,"state":"open","locked":false,"title":"Add Richer EML","user":{"login":"ThomasThelen","id":9289652,"avatar_url":"https://avatars1.githubusercontent.com/u/9289652?v=4","gravatar_id":"","url":"https://api.github.com/users/ThomasThelen","html_url":"https://github.com/ThomasThelen","followers_url":"https://api.github.com/users/ThomasThelen/followers","following_url":"https://api.github.com/users/ThomasThelen/following{/other_user}","gists_url":"https://api.github.com/users/ThomasThelen/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasThelen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasThelen/subscriptions","organizations_url":"https://api.github.com/users/ThomasThelen/orgs","repos_url":"https://api.github.com/users/ThomasThelen/repos","events_url":"https://api.github.com/users/ThomasThelen/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasThelen/received_events","type":"User","site_admin":false},"body":"Adds richer EML for the packages, more comments, and I moved some code around.\r\n\r\nd1_python still hasn't been updated on pip yet-so the tests will fail.\r\n\r\nFixes issue #82 ","created_at":"2018-05-19T17:25:36Z","updated_at":"2018-05-25T01:00:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"87079d8c1e5d6a633f3430fe0b0834338359d886","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/whole-tale/girder_wholetale/pulls/88/commits","review_comments_url":"https://api.github.com/repos/whole-tale/girder_wholetale/pulls/88/comments","review_comment_url":"https://api.github.com/repos/whole-tale/girder_wholetale/pulls/comments{/number}","comments_url":"https://api.github.com/repos/whole-tale/girder_wholetale/issues/88/comments","statuses_url":"https://api.github.com/repos/whole-tale/girder_wholetale/statuses/7dc5f651ed1d28a26db45e0500b82f44cf7d2300","head":{"label":"ThomasThelen:dataone_publishing","ref":"dataone_publishing","sha":"7dc5f651ed1d28a26db45e0500b82f44cf7d2300","user":{"login":"ThomasThelen","id":9289652,"avatar_url":"https://avatars1.githubusercontent.com/u/9289652?v=4","gravatar_id":"","url":"https://api.github.com/users/ThomasThelen","html_url":"https://github.com/ThomasThelen","followers_url":"https://api.github.com/users/ThomasThelen/followers","following_url":"https://api.github.com/users/ThomasThelen/following{/other_user}","gists_url":"https://api.github.com/users/ThomasThelen/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasThelen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasThelen/subscriptions","organizations_url":"https://api.github.com/users/ThomasThelen/orgs","repos_url":"https://api.github.com/users/ThomasThelen/repos","events_url":"https://api.github.com/users/ThomasThelen/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasThelen/received_events","type":"User","site_admin":false},"repo":{"id":125545653,"name":"girder_wholetale","full_name":"ThomasThelen/girder_wholetale","owner":{"login":"ThomasThelen","id":9289652,"avatar_url":"https://avatars1.githubusercontent.com/u/9289652?v=4","gravatar_id":"","url":"https://api.github.com/users/ThomasThelen","html_url":"https://github.com/ThomasThelen","followers_url":"https://api.github.com/users/ThomasThelen/followers","following_url":"https://api.github.com/users/ThomasThelen/following{/other_user}","gists_url":"https://api.github.com/users/ThomasThelen/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasThelen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasThelen/subscriptions","organizations_url":"https://api.github.com/users/ThomasThelen/orgs","repos_url":"https://api.github.com/users/ThomasThelen/repos","events_url":"https://api.github.com/users/ThomasThelen/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasThelen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ThomasThelen/girder_wholetale","description":"Girder plugin providing basic Whole Tale functionality","fork":true,"url":"https://api.github.com/repos/ThomasThelen/girder_wholetale","forks_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/forks","keys_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/teams","hooks_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/hooks","issue_events_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/issues/events{/number}","events_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/events","assignees_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/assignees{/user}","branches_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/branches{/branch}","tags_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/tags","blobs_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/git/refs{/sha}","trees_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/statuses/{sha}","languages_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/languages","stargazers_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/stargazers","contributors_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/contributors","subscribers_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/subscribers","subscription_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/subscription","commits_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/commits{/sha}","git_commits_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/git/commits{/sha}","comments_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/comments{/number}","issue_comment_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/issues/comments{/number}","contents_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/contents/{+path}","compare_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/merges","archive_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/downloads","issues_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/issues{/number}","pulls_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/pulls{/number}","milestones_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/milestones{/number}","notifications_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/labels{/name}","releases_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/releases{/id}","deployments_url":"https://api.github.com/repos/ThomasThelen/girder_wholetale/deployments","created_at":"2018-03-16T16:59:07Z","updated_at":"2018-04-30T16:49:24Z","pushed_at":"2018-05-25T00:51:43Z","git_url":"git://github.com/ThomasThelen/girder_wholetale.git","ssh_url":"git@github.com:ThomasThelen/girder_wholetale.git","clone_url":"https://github.com/ThomasThelen/girder_wholetale.git","svn_url":"https://github.com/ThomasThelen/girder_wholetale","homepage":"","size":523,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"whole-tale:dataone_publishing","ref":"dataone_publishing","sha":"9e1a3e7f6faa9cf59b431a0dffaa56f378c4542c","user":{"login":"whole-tale","id":13108471,"avatar_url":"https://avatars2.githubusercontent.com/u/13108471?v=4","gravatar_id":"","url":"https://api.github.com/users/whole-tale","html_url":"https://github.com/whole-tale","followers_url":"https://api.github.com/users/whole-tale/followers","following_url":"https://api.github.com/users/whole-tale/following{/other_user}","gists_url":"https://api.github.com/users/whole-tale/gists{/gist_id}","starred_url":"https://api.github.com/users/whole-tale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whole-tale/subscriptions","organizations_url":"https://api.github.com/users/whole-tale/orgs","repos_url":"https://api.github.com/users/whole-tale/repos","events_url":"https://api.github.com/users/whole-tale/events{/privacy}","received_events_url":"https://api.github.com/users/whole-tale/received_events","type":"Organization","site_admin":false},"repo":{"id":66147054,"name":"girder_wholetale","full_name":"whole-tale/girder_wholetale","owner":{"login":"whole-tale","id":13108471,"avatar_url":"https://avatars2.githubusercontent.com/u/13108471?v=4","gravatar_id":"","url":"https://api.github.com/users/whole-tale","html_url":"https://github.com/whole-tale","followers_url":"https://api.github.com/users/whole-tale/followers","following_url":"https://api.github.com/users/whole-tale/following{/other_user}","gists_url":"https://api.github.com/users/whole-tale/gists{/gist_id}","starred_url":"https://api.github.com/users/whole-tale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whole-tale/subscriptions","organizations_url":"https://api.github.com/users/whole-tale/orgs","repos_url":"https://api.github.com/users/whole-tale/repos","events_url":"https://api.github.com/users/whole-tale/events{/privacy}","received_events_url":"https://api.github.com/users/whole-tale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/whole-tale/girder_wholetale","description":"Girder plugin providing basic Whole Tale functionality","fork":true,"url":"https://api.github.com/repos/whole-tale/girder_wholetale","forks_url":"https://api.github.com/repos/whole-tale/girder_wholetale/forks","keys_url":"https://api.github.com/repos/whole-tale/girder_wholetale/keys{/key_id}","collaborators_url":"https://api.github.com/repos/whole-tale/girder_wholetale/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/whole-tale/girder_wholetale/teams","hooks_url":"https://api.github.com/repos/whole-tale/girder_wholetale/hooks","issue_events_url":"https://api.github.com/repos/whole-tale/girder_wholetale/issues/events{/number}","events_url":"https://api.github.com/repos/whole-tale/girder_wholetale/events","assignees_url":"https://api.github.com/repos/whole-tale/girder_wholetale/assignees{/user}","branches_url":"https://api.github.com/repos/whole-tale/girder_wholetale/branches{/branch}","tags_url":"https://api.github.com/repos/whole-tale/girder_wholetale/tags","blobs_url":"https://api.github.com/repos/whole-tale/girder_wholetale/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/whole-tale/girder_wholetale/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/whole-tale/girder_wholetale/git/refs{/sha}","trees_url":"https://api.github.com/repos/whole-tale/girder_wholetale/git/trees{/sha}","statuses_url":"https://api.github.com/repos/whole-tale/girder_wholetale/statuses/{sha}","languages_url":"https://api.github.com/repos/whole-tale/girder_wholetale/languages","stargazers_url":"https://api.github.com/repos/whole-tale/girder_wholetale/stargazers","contributors_url":"https://api.github.com/repos/whole-tale/girder_wholetale/contributors","subscribers_url":"https://api.github.com/repos/whole-tale/girder_wholetale/subscribers","subscription_url":"https://api.github.com/repos/whole-tale/girder_wholetale/subscription","commits_url":"https://api.github.com/repos/whole-tale/girder_wholetale/commits{/sha}","git_commits_url":"https://api.github.com/repos/whole-tale/girder_wholetale/git/commits{/sha}","comments_url":"https://api.github.com/repos/whole-tale/girder_wholetale/comments{/number}","issue_comment_url":"https://api.github.com/repos/whole-tale/girder_wholetale/issues/comments{/number}","contents_url":"https://api.github.com/repos/whole-tale/girder_wholetale/contents/{+path}","compare_url":"https://api.github.com/repos/whole-tale/girder_wholetale/compare/{base}...{head}","merges_url":"https://api.github.com/repos/whole-tale/girder_wholetale/merges","archive_url":"https://api.github.com/repos/whole-tale/girder_wholetale/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/whole-tale/girder_wholetale/downloads","issues_url":"https://api.github.com/repos/whole-tale/girder_wholetale/issues{/number}","pulls_url":"https://api.github.com/repos/whole-tale/girder_wholetale/pulls{/number}","milestones_url":"https://api.github.com/repos/whole-tale/girder_wholetale/milestones{/number}","notifications_url":"https://api.github.com/repos/whole-tale/girder_wholetale/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/whole-tale/girder_wholetale/labels{/name}","releases_url":"https://api.github.com/repos/whole-tale/girder_wholetale/releases{/id}","deployments_url":"https://api.github.com/repos/whole-tale/girder_wholetale/deployments","created_at":"2016-08-20T13:01:58Z","updated_at":"2018-04-23T19:01:10Z","pushed_at":"2018-05-25T00:51:45Z","git_url":"git://github.com/whole-tale/girder_wholetale.git","ssh_url":"git@github.com:whole-tale/girder_wholetale.git","clone_url":"https://github.com/whole-tale/girder_wholetale.git","svn_url":"https://github.com/whole-tale/girder_wholetale","homepage":"","size":505,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":29,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":3,"open_issues":29,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/whole-tale/girder_wholetale/pulls/88"},"html":{"href":"https://github.com/whole-tale/girder_wholetale/pull/88"},"issue":{"href":"https://api.github.com/repos/whole-tale/girder_wholetale/issues/88"},"comments":{"href":"https://api.github.com/repos/whole-tale/girder_wholetale/issues/88/comments"},"review_comments":{"href":"https://api.github.com/repos/whole-tale/girder_wholetale/pulls/88/comments"},"review_comment":{"href":"https://api.github.com/repos/whole-tale/girder_wholetale/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/whole-tale/girder_wholetale/pulls/88/commits"},"statuses":{"href":"https://api.github.com/repos/whole-tale/girder_wholetale/statuses/7dc5f651ed1d28a26db45e0500b82f44cf7d2300"}},"author_association":"NONE"}}
{"actor":{"display_login":"ThomasThelen"}}