{"action":"created","comment":{"url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/pulls/comments/33035974","id":33035974,"diff_hunk":"@@ -478,5 +501,186 @@ public static void fileUrl(String fAddress, String localFileName, String destina\n \t\t\t}\n \t\t}\n \t}\n+\n+\tpublic static void deletePage(String searchServer, String siteId, String username, String password) throws Exception{\n+\n+\t\tString pageToDelete = \"iTunes U\";\n+\n+\t\t// Create SOAP Connection\n+\t\tSOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();\n+\t\tSOAPConnection soapConnection = soapConnectionFactory.createConnection();\n+\n+\t\t// Send SOAP Message to SOAP Server\n+\t\tString sakaiLoginUrl = searchServer + \"sakai-axis/SakaiLogin.jws?wsdl\";\n+\t\tString sakaiScriptUrl = searchServer + \"sakai-axis/SakaiScript.jws?wsdl\";\n+\n+\t\t//Making the createLoginRequest call. Returns a response message containing the session id that should be active on server.\n+\t\tSOAPMessage soapResponse = soapConnection.call(createLoginRequest(searchServer, username, password), sakaiLoginUrl);\n+\n+\t\t// print SOAP Response\n+\t\tSystem.out.print(\"Response SOAP Message:\");\n+\t\tsoapResponse.writeTo(System.out);\n+\n+\t\t//Parses Soap Response to get session id as string\n+\t\tString sessionId = getSessionId(soapResponse);\n+\t\tSystem.out.println(\"\");\n+\t\tSystem.out.println(\"Session Id:\" + sessionId);\n+\n+\t\t//Test validity of session id by calling Check Session function\n+\t\tsoapResponse = soapConnection.call(createCheckSessionRequest(searchServer, sessionId), sakaiScriptUrl);\n+\t\tSystem.out.print(\"Response SOAP Message:\");\n+\t\tsoapResponse.writeTo(System.out);\n+\n+\t\tString checkedSessionId = getSessionId(soapResponse);\n+\t\tSystem.out.println(\"\");\n+\t\tSystem.out.println(\"Checked Session Id: \" + checkedSessionId);\n+\n+\t\t//while there are still sites to delete:\n+\t\tif(!checkedSessionId.equals(\"null\")){\n+\t\t\t\n+\t\t\t// if session id is not null then remove site\n+\t\t\tsoapResponse = soapConnection.call(createRemovePageRequest(searchServer, sessionId, siteId, pageToDelete), sakaiScriptUrl);\n+\t\t\tSystem.out.print(\"Response SOAP Message:\");\n+\t\t\tsoapResponse.writeTo(System.out);\n+\t\t\tSystem.out.println(\"\");\n+\t\t\t\n+\t\t}\n+\t\telse{\n+\t\t\t//else get new session id and then process site\n+\t\t\tsoapResponse = soapConnection.call(createLoginRequest(searchServer, username, password), sakaiLoginUrl);\n+\t\t\tSystem.out.print(\"Response SOAP Message:\");\n+\t\t\tsoapResponse.writeTo(System.out);\n+\t\t\t\n+\t\t\tcheckedSessionId = getSessionId(soapResponse);\n+\t\t\tSystem.out.println(\"\");\n+\t\t\tSystem.out.println(\"Session Id:\" + sessionId);\n+\t\t\t\n+\t\t}\n+\t\t\n+\t\tsoapConnection.close();\n+\t}\n+\n+\tpublic static SOAPMessage createLoginRequest(String serverURI, String username, String password) throws Exception {\n+\t\tMessageFactory messageFactory = MessageFactory.newInstance();\n+\t\tSOAPMessage soapMessage = messageFactory.createMessage();\n+\t\tSOAPPart soapPart = soapMessage.getSOAPPart();\n+\n+\t\tSOAPEnvelope envelope = soapPart.getEnvelope();\n+\t\tenvelope.addNamespaceDeclaration(\"example\", serverURI);\n+\n+\t\tSOAPBody soapBody = envelope.getBody();\n+\t\tSOAPElement soapBodyElem = soapBody.addChildElement(\"login\", \"example\");\n+\t\tSOAPElement soapBodyElem1 = soapBodyElem.addChildElement(\"id\", \"example\");\n+\t\tsoapBodyElem1.addTextNode(username);\n+\t\tSOAPElement soapBodyElem2 = soapBodyElem.addChildElement(\"pw\", \"example\");\n+\t\tsoapBodyElem2.addTextNode(password);\n+\n+\t\tMimeHeaders headers = soapMessage.getMimeHeaders();\n+\t\theaders.addHeader(\"SOAPAction\", serverURI  + \"login\");\n+\n+\t\tsoapMessage.saveChanges();\n+\n+\t\t/* Print the request message */\n+\t\tSystem.out.print(\"Request SOAP Message:\");\n+\t\tsoapMessage.writeTo(System.out);\n+\t\tSystem.out.println();\n+\n+\t\treturn soapMessage;\n+\t}\n+\n+\tpublic static String getSessionId(SOAPMessage soapResponse ) {\n+\t\tString sessionId = \"sessionId\";\n+\t\ttry {\n+\t\t\tsessionId = soapResponse.getSOAPBody().getFirstChild().getFirstChild().getTextContent();","path":"iTunesUDataPurge/RemoveITunesUCourses.java","position":156,"original_position":156,"commit_id":"8d5c493ad91c98d97a6c97bab462a8bd476791f5","original_commit_id":"8d5c493ad91c98d97a6c97bab462a8bd476791f5","user":{"login":"dovek","id":10280669,"avatar_url":"https://avatars.githubusercontent.com/u/10280669?v=3","gravatar_id":"","url":"https://api.github.com/users/dovek","html_url":"https://github.com/dovek","followers_url":"https://api.github.com/users/dovek/followers","following_url":"https://api.github.com/users/dovek/following{/other_user}","gists_url":"https://api.github.com/users/dovek/gists{/gist_id}","starred_url":"https://api.github.com/users/dovek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dovek/subscriptions","organizations_url":"https://api.github.com/users/dovek/orgs","repos_url":"https://api.github.com/users/dovek/repos","events_url":"https://api.github.com/users/dovek/events{/privacy}","received_events_url":"https://api.github.com/users/dovek/received_events","type":"User","site_admin":false},"body":"Would you like to see example SOAP requests as well, or just the responses?","created_at":"2015-06-23T12:40:56Z","updated_at":"2015-06-23T12:40:56Z","html_url":"https://github.com/tl-its-umich-edu/iTunesU/pull/9#discussion_r33035974","pull_request_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/pulls/comments/33035974"},"html":{"href":"https://github.com/tl-its-umich-edu/iTunesU/pull/9#discussion_r33035974"},"pull_request":{"href":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/pulls/9","id":38227050,"html_url":"https://github.com/tl-its-umich-edu/iTunesU/pull/9","diff_url":"https://github.com/tl-its-umich-edu/iTunesU/pull/9.diff","patch_url":"https://github.com/tl-its-umich-edu/iTunesU/pull/9.patch","issue_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/issues/9","number":9,"state":"open","locked":false,"title":"TLPSO-211","user":{"login":"dovek","id":10280669,"avatar_url":"https://avatars.githubusercontent.com/u/10280669?v=3","gravatar_id":"","url":"https://api.github.com/users/dovek","html_url":"https://github.com/dovek","followers_url":"https://api.github.com/users/dovek/followers","following_url":"https://api.github.com/users/dovek/following{/other_user}","gists_url":"https://api.github.com/users/dovek/gists{/gist_id}","starred_url":"https://api.github.com/users/dovek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dovek/subscriptions","organizations_url":"https://api.github.com/users/dovek/orgs","repos_url":"https://api.github.com/users/dovek/repos","events_url":"https://api.github.com/users/dovek/events{/privacy}","received_events_url":"https://api.github.com/users/dovek/received_events","type":"User","site_admin":false},"body":"Update RemoveITunesUCourses to remove both data and page/tools within CTools\r\n\r\nDue: 06/23/2015\r\n@zqian \r\n","created_at":"2015-06-22T12:36:45Z","updated_at":"2015-06-23T12:40:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c2d3ce030e80f45a1398de2ad946f9cd54722142","assignee":{"login":"dovek","id":10280669,"avatar_url":"https://avatars.githubusercontent.com/u/10280669?v=3","gravatar_id":"","url":"https://api.github.com/users/dovek","html_url":"https://github.com/dovek","followers_url":"https://api.github.com/users/dovek/followers","following_url":"https://api.github.com/users/dovek/following{/other_user}","gists_url":"https://api.github.com/users/dovek/gists{/gist_id}","starred_url":"https://api.github.com/users/dovek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dovek/subscriptions","organizations_url":"https://api.github.com/users/dovek/orgs","repos_url":"https://api.github.com/users/dovek/repos","events_url":"https://api.github.com/users/dovek/events{/privacy}","received_events_url":"https://api.github.com/users/dovek/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/pulls/9/commits","review_comments_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/pulls/9/comments","review_comment_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/issues/9/comments","statuses_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/statuses/8d5c493ad91c98d97a6c97bab462a8bd476791f5","head":{"label":"dovek:master","ref":"master","sha":"8d5c493ad91c98d97a6c97bab462a8bd476791f5","user":{"login":"dovek","id":10280669,"avatar_url":"https://avatars.githubusercontent.com/u/10280669?v=3","gravatar_id":"","url":"https://api.github.com/users/dovek","html_url":"https://github.com/dovek","followers_url":"https://api.github.com/users/dovek/followers","following_url":"https://api.github.com/users/dovek/following{/other_user}","gists_url":"https://api.github.com/users/dovek/gists{/gist_id}","starred_url":"https://api.github.com/users/dovek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dovek/subscriptions","organizations_url":"https://api.github.com/users/dovek/orgs","repos_url":"https://api.github.com/users/dovek/repos","events_url":"https://api.github.com/users/dovek/events{/privacy}","received_events_url":"https://api.github.com/users/dovek/received_events","type":"User","site_admin":false},"repo":{"id":34672814,"name":"iTunesU","full_name":"dovek/iTunesU","owner":{"login":"dovek","id":10280669,"avatar_url":"https://avatars.githubusercontent.com/u/10280669?v=3","gravatar_id":"","url":"https://api.github.com/users/dovek","html_url":"https://github.com/dovek","followers_url":"https://api.github.com/users/dovek/followers","following_url":"https://api.github.com/users/dovek/following{/other_user}","gists_url":"https://api.github.com/users/dovek/gists{/gist_id}","starred_url":"https://api.github.com/users/dovek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dovek/subscriptions","organizations_url":"https://api.github.com/users/dovek/orgs","repos_url":"https://api.github.com/users/dovek/repos","events_url":"https://api.github.com/users/dovek/events{/privacy}","received_events_url":"https://api.github.com/users/dovek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dovek/iTunesU","description":"Scripts for generating email notification related to iTunesU data purge","fork":true,"url":"https://api.github.com/repos/dovek/iTunesU","forks_url":"https://api.github.com/repos/dovek/iTunesU/forks","keys_url":"https://api.github.com/repos/dovek/iTunesU/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dovek/iTunesU/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dovek/iTunesU/teams","hooks_url":"https://api.github.com/repos/dovek/iTunesU/hooks","issue_events_url":"https://api.github.com/repos/dovek/iTunesU/issues/events{/number}","events_url":"https://api.github.com/repos/dovek/iTunesU/events","assignees_url":"https://api.github.com/repos/dovek/iTunesU/assignees{/user}","branches_url":"https://api.github.com/repos/dovek/iTunesU/branches{/branch}","tags_url":"https://api.github.com/repos/dovek/iTunesU/tags","blobs_url":"https://api.github.com/repos/dovek/iTunesU/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dovek/iTunesU/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dovek/iTunesU/git/refs{/sha}","trees_url":"https://api.github.com/repos/dovek/iTunesU/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dovek/iTunesU/statuses/{sha}","languages_url":"https://api.github.com/repos/dovek/iTunesU/languages","stargazers_url":"https://api.github.com/repos/dovek/iTunesU/stargazers","contributors_url":"https://api.github.com/repos/dovek/iTunesU/contributors","subscribers_url":"https://api.github.com/repos/dovek/iTunesU/subscribers","subscription_url":"https://api.github.com/repos/dovek/iTunesU/subscription","commits_url":"https://api.github.com/repos/dovek/iTunesU/commits{/sha}","git_commits_url":"https://api.github.com/repos/dovek/iTunesU/git/commits{/sha}","comments_url":"https://api.github.com/repos/dovek/iTunesU/comments{/number}","issue_comment_url":"https://api.github.com/repos/dovek/iTunesU/issues/comments{/number}","contents_url":"https://api.github.com/repos/dovek/iTunesU/contents/{+path}","compare_url":"https://api.github.com/repos/dovek/iTunesU/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dovek/iTunesU/merges","archive_url":"https://api.github.com/repos/dovek/iTunesU/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dovek/iTunesU/downloads","issues_url":"https://api.github.com/repos/dovek/iTunesU/issues{/number}","pulls_url":"https://api.github.com/repos/dovek/iTunesU/pulls{/number}","milestones_url":"https://api.github.com/repos/dovek/iTunesU/milestones{/number}","notifications_url":"https://api.github.com/repos/dovek/iTunesU/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dovek/iTunesU/labels{/name}","releases_url":"https://api.github.com/repos/dovek/iTunesU/releases{/id}","created_at":"2015-04-27T14:51:24Z","updated_at":"2015-05-08T12:37:13Z","pushed_at":"2015-06-22T12:25:42Z","git_url":"git://github.com/dovek/iTunesU.git","ssh_url":"git@github.com:dovek/iTunesU.git","clone_url":"https://github.com/dovek/iTunesU.git","svn_url":"https://github.com/dovek/iTunesU","homepage":null,"size":139,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"tl-its-umich-edu:master","ref":"master","sha":"4fd03699960a4c6e767424e649f5196be625fc7b","user":{"login":"tl-its-umich-edu","id":8292960,"avatar_url":"https://avatars.githubusercontent.com/u/8292960?v=3","gravatar_id":"","url":"https://api.github.com/users/tl-its-umich-edu","html_url":"https://github.com/tl-its-umich-edu","followers_url":"https://api.github.com/users/tl-its-umich-edu/followers","following_url":"https://api.github.com/users/tl-its-umich-edu/following{/other_user}","gists_url":"https://api.github.com/users/tl-its-umich-edu/gists{/gist_id}","starred_url":"https://api.github.com/users/tl-its-umich-edu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tl-its-umich-edu/subscriptions","organizations_url":"https://api.github.com/users/tl-its-umich-edu/orgs","repos_url":"https://api.github.com/users/tl-its-umich-edu/repos","events_url":"https://api.github.com/users/tl-its-umich-edu/events{/privacy}","received_events_url":"https://api.github.com/users/tl-its-umich-edu/received_events","type":"Organization","site_admin":false},"repo":{"id":33566964,"name":"iTunesU","full_name":"tl-its-umich-edu/iTunesU","owner":{"login":"tl-its-umich-edu","id":8292960,"avatar_url":"https://avatars.githubusercontent.com/u/8292960?v=3","gravatar_id":"","url":"https://api.github.com/users/tl-its-umich-edu","html_url":"https://github.com/tl-its-umich-edu","followers_url":"https://api.github.com/users/tl-its-umich-edu/followers","following_url":"https://api.github.com/users/tl-its-umich-edu/following{/other_user}","gists_url":"https://api.github.com/users/tl-its-umich-edu/gists{/gist_id}","starred_url":"https://api.github.com/users/tl-its-umich-edu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tl-its-umich-edu/subscriptions","organizations_url":"https://api.github.com/users/tl-its-umich-edu/orgs","repos_url":"https://api.github.com/users/tl-its-umich-edu/repos","events_url":"https://api.github.com/users/tl-its-umich-edu/events{/privacy}","received_events_url":"https://api.github.com/users/tl-its-umich-edu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tl-its-umich-edu/iTunesU","description":"Scripts for generating email notification related to iTunesU data purge","fork":false,"url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU","forks_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/forks","keys_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/teams","hooks_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/hooks","issue_events_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/issues/events{/number}","events_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/events","assignees_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/assignees{/user}","branches_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/branches{/branch}","tags_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/tags","blobs_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/git/refs{/sha}","trees_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/statuses/{sha}","languages_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/languages","stargazers_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/stargazers","contributors_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/contributors","subscribers_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/subscribers","subscription_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/subscription","commits_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/commits{/sha}","git_commits_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/git/commits{/sha}","comments_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/comments{/number}","issue_comment_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/issues/comments{/number}","contents_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/contents/{+path}","compare_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/merges","archive_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/downloads","issues_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/issues{/number}","pulls_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/pulls{/number}","milestones_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/milestones{/number}","notifications_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/labels{/name}","releases_url":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/releases{/id}","created_at":"2015-04-07T20:37:53Z","updated_at":"2015-05-08T17:32:29Z","pushed_at":"2015-06-22T12:36:45Z","git_url":"git://github.com/tl-its-umich-edu/iTunesU.git","ssh_url":"git@github.com:tl-its-umich-edu/iTunesU.git","clone_url":"https://github.com/tl-its-umich-edu/iTunesU.git","svn_url":"https://github.com/tl-its-umich-edu/iTunesU","homepage":null,"size":251,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/pulls/9"},"html":{"href":"https://github.com/tl-its-umich-edu/iTunesU/pull/9"},"issue":{"href":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/issues/9"},"comments":{"href":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/tl-its-umich-edu/iTunesU/statuses/8d5c493ad91c98d97a6c97bab462a8bd476791f5"}}}}