{"action":"created","comment":{"url":"https://api.github.com/repos/aptana/studio3/pulls/comments/24706396","id":24706396,"diff_hunk":"@@ -111,6 +120,143 @@ public Object getSamples()\n \t}\n \n \t/**\n+\t * Adds a new sample from the local file system or a remote URI into the Samples Manager<br>\n+\t * The attributes passed to this call should hold the following required attributes of the sample to be added.\n+\t * <ul>\n+\t * <li>category</li>\n+\t * <li>name</li>\n+\t * <li>id</li>\n+\t * <li>description</li>\n+\t * <li>location</li>\n+\t * </ul>\n+\t *\n+\t * <pre>\n+\t *   <b>Sample JS code:</b>\n+\t *   <code>result = dispatch($H({controller:'portal.samples', action:\"addSample\", args:\"sample_json_data\"}).toJSON());</code>\n+\t * </pre>\n+\t *\n+\t * @param attributes\n+\t *            Contains the Sample data in JSON format.\n+\t * @return The status\n+\t * @see #getSamples()\n+\t */\n+\t@ControllerAction\n+\tpublic Object addSample(Object attributes)\n+\t{\n+\t\tISamplesManager samplesManager = SamplesPlugin.getDefault().getSamplesManager();\n+\t\t// We have got the sample data in a JSON format. Now lets try and parse it\n+\t\t// and create an IProjectSample object which we will add to the Samples Manager\n+\t\tObject[] arr = (Object[]) attributes;\n+\n+\t\tif (arr == null || arr.length < 1 || arr[0] == null || !(arr[0] instanceof HashMap))\n+\t\t{\n+\t\t\tIdeLog.logError(SamplesUIPlugin.getDefault(),\n+\t\t\t\t\t\"The addSample ControllerAction should get an attribute in JSON format\", IDebugScopes.START_PAGE); //$NON-NLS-1$\n+\t\t\treturn IBrowserNotificationConstants.JSON_ERROR;\n+\t\t}\n+\n+\t\t@SuppressWarnings({ \"rawtypes\" })","path":"plugins/com.aptana.samples.ui/src/com/aptana/samples/ui/portal/actionController/SamplesActionController.java","position":83,"original_position":83,"commit_id":"313a3ad6a5b8267bb23704bbc006dd74e97cd142","original_commit_id":"313a3ad6a5b8267bb23704bbc006dd74e97cd142","user":{"login":"pinnamur","id":2413570,"avatar_url":"https://avatars.githubusercontent.com/u/2413570?v=3","gravatar_id":"","url":"https://api.github.com/users/pinnamur","html_url":"https://github.com/pinnamur","followers_url":"https://api.github.com/users/pinnamur/followers","following_url":"https://api.github.com/users/pinnamur/following{/other_user}","gists_url":"https://api.github.com/users/pinnamur/gists{/gist_id}","starred_url":"https://api.github.com/users/pinnamur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pinnamur/subscriptions","organizations_url":"https://api.github.com/users/pinnamur/orgs","repos_url":"https://api.github.com/users/pinnamur/repos","events_url":"https://api.github.com/users/pinnamur/events{/privacy}","received_events_url":"https://api.github.com/users/pinnamur/received_events","type":"User","site_admin":false},"body":"It might be good to move these annotations above the method declaration.","created_at":"2015-02-13T23:36:19Z","updated_at":"2015-02-13T23:36:19Z","html_url":"https://github.com/aptana/studio3/pull/292#discussion_r24706396","pull_request_url":"https://api.github.com/repos/aptana/studio3/pulls/292","_links":{"self":{"href":"https://api.github.com/repos/aptana/studio3/pulls/comments/24706396"},"html":{"href":"https://github.com/aptana/studio3/pull/292#discussion_r24706396"},"pull_request":{"href":"https://api.github.com/repos/aptana/studio3/pulls/292"}}},"pull_request":{"url":"https://api.github.com/repos/aptana/studio3/pulls/292","id":29304910,"html_url":"https://github.com/aptana/studio3/pull/292","diff_url":"https://github.com/aptana/studio3/pull/292.diff","patch_url":"https://github.com/aptana/studio3/pull/292.patch","issue_url":"https://api.github.com/repos/aptana/studio3/issues/292","number":292,"state":"open","locked":false,"title":"TISTUD-7144:Allow Studio dashboard to dynamically inject samples into Studio","user":{"login":"sujmishra","id":8658904,"avatar_url":"https://avatars.githubusercontent.com/u/8658904?v=3","gravatar_id":"","url":"https://api.github.com/users/sujmishra","html_url":"https://github.com/sujmishra","followers_url":"https://api.github.com/users/sujmishra/followers","following_url":"https://api.github.com/users/sujmishra/following{/other_user}","gists_url":"https://api.github.com/users/sujmishra/gists{/gist_id}","starred_url":"https://api.github.com/users/sujmishra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sujmishra/subscriptions","organizations_url":"https://api.github.com/users/sujmishra/orgs","repos_url":"https://api.github.com/users/sujmishra/repos","events_url":"https://api.github.com/users/sujmishra/events{/privacy}","received_events_url":"https://api.github.com/users/sujmishra/received_events","type":"User","site_admin":false},"body":"This PR allows studio dashboard to dynamically inject samples into studio.\r\n\r\nresult = dispatch($H({controller:'portal.samples', action:\"addSample\", args:\"sample_json_data\"}).toJSON());\r\n\r\nThe JSON should have the following required attributes\r\n1.id\r\n2.name\r\n3.description\r\n4.location\r\n\r\nWhen the sample is added the response will be \"ok\"","created_at":"2015-02-13T22:30:56Z","updated_at":"2015-02-13T23:36:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b8820cb7e379d4250d9b2cd0378f3572979e7a0e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aptana/studio3/pulls/292/commits","review_comments_url":"https://api.github.com/repos/aptana/studio3/pulls/292/comments","review_comment_url":"https://api.github.com/repos/aptana/studio3/pulls/comments/{number}","comments_url":"https://api.github.com/repos/aptana/studio3/issues/292/comments","statuses_url":"https://api.github.com/repos/aptana/studio3/statuses/313a3ad6a5b8267bb23704bbc006dd74e97cd142","head":{"label":"sujmishra:TISTUD-7144","ref":"TISTUD-7144","sha":"313a3ad6a5b8267bb23704bbc006dd74e97cd142","user":{"login":"sujmishra","id":8658904,"avatar_url":"https://avatars.githubusercontent.com/u/8658904?v=3","gravatar_id":"","url":"https://api.github.com/users/sujmishra","html_url":"https://github.com/sujmishra","followers_url":"https://api.github.com/users/sujmishra/followers","following_url":"https://api.github.com/users/sujmishra/following{/other_user}","gists_url":"https://api.github.com/users/sujmishra/gists{/gist_id}","starred_url":"https://api.github.com/users/sujmishra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sujmishra/subscriptions","organizations_url":"https://api.github.com/users/sujmishra/orgs","repos_url":"https://api.github.com/users/sujmishra/repos","events_url":"https://api.github.com/users/sujmishra/events{/privacy}","received_events_url":"https://api.github.com/users/sujmishra/received_events","type":"User","site_admin":false},"repo":{"id":23673920,"name":"studio3","full_name":"sujmishra/studio3","owner":{"login":"sujmishra","id":8658904,"avatar_url":"https://avatars.githubusercontent.com/u/8658904?v=3","gravatar_id":"","url":"https://api.github.com/users/sujmishra","html_url":"https://github.com/sujmishra","followers_url":"https://api.github.com/users/sujmishra/followers","following_url":"https://api.github.com/users/sujmishra/following{/other_user}","gists_url":"https://api.github.com/users/sujmishra/gists{/gist_id}","starred_url":"https://api.github.com/users/sujmishra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sujmishra/subscriptions","organizations_url":"https://api.github.com/users/sujmishra/orgs","repos_url":"https://api.github.com/users/sujmishra/repos","events_url":"https://api.github.com/users/sujmishra/events{/privacy}","received_events_url":"https://api.github.com/users/sujmishra/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sujmishra/studio3","description":"This repository contains the code for core components of Aptana Studio 3. ","fork":true,"url":"https://api.github.com/repos/sujmishra/studio3","forks_url":"https://api.github.com/repos/sujmishra/studio3/forks","keys_url":"https://api.github.com/repos/sujmishra/studio3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sujmishra/studio3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sujmishra/studio3/teams","hooks_url":"https://api.github.com/repos/sujmishra/studio3/hooks","issue_events_url":"https://api.github.com/repos/sujmishra/studio3/issues/events{/number}","events_url":"https://api.github.com/repos/sujmishra/studio3/events","assignees_url":"https://api.github.com/repos/sujmishra/studio3/assignees{/user}","branches_url":"https://api.github.com/repos/sujmishra/studio3/branches{/branch}","tags_url":"https://api.github.com/repos/sujmishra/studio3/tags","blobs_url":"https://api.github.com/repos/sujmishra/studio3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sujmishra/studio3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sujmishra/studio3/git/refs{/sha}","trees_url":"https://api.github.com/repos/sujmishra/studio3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sujmishra/studio3/statuses/{sha}","languages_url":"https://api.github.com/repos/sujmishra/studio3/languages","stargazers_url":"https://api.github.com/repos/sujmishra/studio3/stargazers","contributors_url":"https://api.github.com/repos/sujmishra/studio3/contributors","subscribers_url":"https://api.github.com/repos/sujmishra/studio3/subscribers","subscription_url":"https://api.github.com/repos/sujmishra/studio3/subscription","commits_url":"https://api.github.com/repos/sujmishra/studio3/commits{/sha}","git_commits_url":"https://api.github.com/repos/sujmishra/studio3/git/commits{/sha}","comments_url":"https://api.github.com/repos/sujmishra/studio3/comments{/number}","issue_comment_url":"https://api.github.com/repos/sujmishra/studio3/issues/comments/{number}","contents_url":"https://api.github.com/repos/sujmishra/studio3/contents/{+path}","compare_url":"https://api.github.com/repos/sujmishra/studio3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sujmishra/studio3/merges","archive_url":"https://api.github.com/repos/sujmishra/studio3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sujmishra/studio3/downloads","issues_url":"https://api.github.com/repos/sujmishra/studio3/issues{/number}","pulls_url":"https://api.github.com/repos/sujmishra/studio3/pulls{/number}","milestones_url":"https://api.github.com/repos/sujmishra/studio3/milestones{/number}","notifications_url":"https://api.github.com/repos/sujmishra/studio3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sujmishra/studio3/labels{/name}","releases_url":"https://api.github.com/repos/sujmishra/studio3/releases{/id}","created_at":"2014-09-04T18:18:30Z","updated_at":"2015-02-11T21:12:28Z","pushed_at":"2015-02-13T22:23:05Z","git_url":"git://github.com/sujmishra/studio3.git","ssh_url":"git@github.com:sujmishra/studio3.git","clone_url":"https://github.com/sujmishra/studio3.git","svn_url":"https://github.com/sujmishra/studio3","homepage":"http://aptana.com/products/studio3","size":266656,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"development"}},"base":{"label":"aptana:development","ref":"development","sha":"66bfd24887a8459d26c788bab7effeb334e05bd1","user":{"login":"aptana","id":31783,"avatar_url":"https://avatars.githubusercontent.com/u/31783?v=3","gravatar_id":"","url":"https://api.github.com/users/aptana","html_url":"https://github.com/aptana","followers_url":"https://api.github.com/users/aptana/followers","following_url":"https://api.github.com/users/aptana/following{/other_user}","gists_url":"https://api.github.com/users/aptana/gists{/gist_id}","starred_url":"https://api.github.com/users/aptana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aptana/subscriptions","organizations_url":"https://api.github.com/users/aptana/orgs","repos_url":"https://api.github.com/users/aptana/repos","events_url":"https://api.github.com/users/aptana/events{/privacy}","received_events_url":"https://api.github.com/users/aptana/received_events","type":"Organization","site_admin":false},"repo":{"id":339002,"name":"studio3","full_name":"aptana/studio3","owner":{"login":"aptana","id":31783,"avatar_url":"https://avatars.githubusercontent.com/u/31783?v=3","gravatar_id":"","url":"https://api.github.com/users/aptana","html_url":"https://github.com/aptana","followers_url":"https://api.github.com/users/aptana/followers","following_url":"https://api.github.com/users/aptana/following{/other_user}","gists_url":"https://api.github.com/users/aptana/gists{/gist_id}","starred_url":"https://api.github.com/users/aptana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aptana/subscriptions","organizations_url":"https://api.github.com/users/aptana/orgs","repos_url":"https://api.github.com/users/aptana/repos","events_url":"https://api.github.com/users/aptana/events{/privacy}","received_events_url":"https://api.github.com/users/aptana/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aptana/studio3","description":"This repository contains the code for core components of Aptana Studio 3. ","fork":false,"url":"https://api.github.com/repos/aptana/studio3","forks_url":"https://api.github.com/repos/aptana/studio3/forks","keys_url":"https://api.github.com/repos/aptana/studio3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aptana/studio3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aptana/studio3/teams","hooks_url":"https://api.github.com/repos/aptana/studio3/hooks","issue_events_url":"https://api.github.com/repos/aptana/studio3/issues/events{/number}","events_url":"https://api.github.com/repos/aptana/studio3/events","assignees_url":"https://api.github.com/repos/aptana/studio3/assignees{/user}","branches_url":"https://api.github.com/repos/aptana/studio3/branches{/branch}","tags_url":"https://api.github.com/repos/aptana/studio3/tags","blobs_url":"https://api.github.com/repos/aptana/studio3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aptana/studio3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aptana/studio3/git/refs{/sha}","trees_url":"https://api.github.com/repos/aptana/studio3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aptana/studio3/statuses/{sha}","languages_url":"https://api.github.com/repos/aptana/studio3/languages","stargazers_url":"https://api.github.com/repos/aptana/studio3/stargazers","contributors_url":"https://api.github.com/repos/aptana/studio3/contributors","subscribers_url":"https://api.github.com/repos/aptana/studio3/subscribers","subscription_url":"https://api.github.com/repos/aptana/studio3/subscription","commits_url":"https://api.github.com/repos/aptana/studio3/commits{/sha}","git_commits_url":"https://api.github.com/repos/aptana/studio3/git/commits{/sha}","comments_url":"https://api.github.com/repos/aptana/studio3/comments{/number}","issue_comment_url":"https://api.github.com/repos/aptana/studio3/issues/comments/{number}","contents_url":"https://api.github.com/repos/aptana/studio3/contents/{+path}","compare_url":"https://api.github.com/repos/aptana/studio3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aptana/studio3/merges","archive_url":"https://api.github.com/repos/aptana/studio3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aptana/studio3/downloads","issues_url":"https://api.github.com/repos/aptana/studio3/issues{/number}","pulls_url":"https://api.github.com/repos/aptana/studio3/pulls{/number}","milestones_url":"https://api.github.com/repos/aptana/studio3/milestones{/number}","notifications_url":"https://api.github.com/repos/aptana/studio3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aptana/studio3/labels{/name}","releases_url":"https://api.github.com/repos/aptana/studio3/releases{/id}","created_at":"2009-10-15T23:46:08Z","updated_at":"2015-02-10T13:40:27Z","pushed_at":"2015-02-10T01:13:05Z","git_url":"git://github.com/aptana/studio3.git","ssh_url":"git@github.com:aptana/studio3.git","clone_url":"https://github.com/aptana/studio3.git","svn_url":"https://github.com/aptana/studio3","homepage":"http://aptana.com/products/studio3","size":322820,"stargazers_count":269,"watchers_count":269,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":68,"mirror_url":null,"open_issues_count":55,"forks":68,"open_issues":55,"watchers":269,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/aptana/studio3/pulls/292"},"html":{"href":"https://github.com/aptana/studio3/pull/292"},"issue":{"href":"https://api.github.com/repos/aptana/studio3/issues/292"},"comments":{"href":"https://api.github.com/repos/aptana/studio3/issues/292/comments"},"review_comments":{"href":"https://api.github.com/repos/aptana/studio3/pulls/292/comments"},"review_comment":{"href":"https://api.github.com/repos/aptana/studio3/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/aptana/studio3/pulls/292/commits"},"statuses":{"href":"https://api.github.com/repos/aptana/studio3/statuses/313a3ad6a5b8267bb23704bbc006dd74e97cd142"}}}}