{"action":"created","comment":{"url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/pulls/comments/60045319","id":60045319,"diff_hunk":"@@ -126,30 +95,70 @@ export class DSpaceDirectory {\n     }\n \n     /**\n-     * Method to load context details.\n-     * Calls prepare with the context received.\n+     * Method to load context details. Calls prepare with the context received.\n      *\n      * @param type\n      *      string: community, collection, or item\n      * @param id\n-     *      current context id which needing to load context details.\n+     *      current context id which needing to load context details\n+     * @param page\n+     *      current context page\n+     * @param limit\n+     *      current context limit\n      */\n-    loadObj(type, id, page) {\n+    loadObj(type, id, page?, limit?) {\n         // needed to be used within scope of promise\n         let directory = this;\n         return new Promise(function (resolve, reject) {\n-            let context;\n-            if ((context = directory.dspaceStore.get(directory.dspaceConstants[type].PLURAL, id))) {\n-                directory.page(context, page);\n-                directory.prepare(null, context);\n-                resolve(context);\n+            let parent;\n+            let useCachedContext = false;\n+            let directoryContext = directory.find(type, id);\n+            if(directoryContext) {\n+                useCachedContext = true;\n+                if(type == 'item' && !directoryContext.fullItem) {\n+                    useCachedContext = false;\n+                }\n+            }\n+            if (useCachedContext) {\n+                parent = directoryContext.type == 'item' ? directoryContext.parentCollection : directoryContext.parentCommunity;\n+                if(limit) directoryContext.limit = limit;","path":"src/app/dspace/dspace.directory.ts","position":171,"original_position":171,"commit_id":"cd237c3f873d79200288787945198c35222c1723","original_commit_id":"cd237c3f873d79200288787945198c35222c1723","user":{"login":"wellingWilliam","id":16831046,"avatar_url":"https://avatars.githubusercontent.com/u/16831046?v=3","gravatar_id":"","url":"https://api.github.com/users/wellingWilliam","html_url":"https://github.com/wellingWilliam","followers_url":"https://api.github.com/users/wellingWilliam/followers","following_url":"https://api.github.com/users/wellingWilliam/following{/other_user}","gists_url":"https://api.github.com/users/wellingWilliam/gists{/gist_id}","starred_url":"https://api.github.com/users/wellingWilliam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wellingWilliam/subscriptions","organizations_url":"https://api.github.com/users/wellingWilliam/orgs","repos_url":"https://api.github.com/users/wellingWilliam/repos","events_url":"https://api.github.com/users/wellingWilliam/events{/privacy}","received_events_url":"https://api.github.com/users/wellingWilliam/received_events","type":"User","site_admin":false},"body":"I have no problem with standardizing the use of brackets. If so, a pass over all the code should be done.","created_at":"2016-04-18T11:57:15Z","updated_at":"2016-04-18T11:57:15Z","html_url":"https://github.com/DSpace-Labs/angular2-ui-prototype/pull/55#discussion_r60045319","pull_request_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/pulls/55","_links":{"self":{"href":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/pulls/comments/60045319"},"html":{"href":"https://github.com/DSpace-Labs/angular2-ui-prototype/pull/55#discussion_r60045319"},"pull_request":{"href":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/pulls/55"}}},"pull_request":{"url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/pulls/55","id":66584439,"html_url":"https://github.com/DSpace-Labs/angular2-ui-prototype/pull/55","diff_url":"https://github.com/DSpace-Labs/angular2-ui-prototype/pull/55.diff","patch_url":"https://github.com/DSpace-Labs/angular2-ui-prototype/pull/55.patch","issue_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/issues/55","number":55,"state":"open","locked":false,"title":"Pagination bug fixes: this work connects to #49 and #53","user":{"login":"wellingWilliam","id":16831046,"avatar_url":"https://avatars.githubusercontent.com/u/16831046?v=3","gravatar_id":"","url":"https://api.github.com/users/wellingWilliam","html_url":"https://github.com/wellingWilliam","followers_url":"https://api.github.com/users/wellingWilliam/followers","following_url":"https://api.github.com/users/wellingWilliam/following{/other_user}","gists_url":"https://api.github.com/users/wellingWilliam/gists{/gist_id}","starred_url":"https://api.github.com/users/wellingWilliam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wellingWilliam/subscriptions","organizations_url":"https://api.github.com/users/wellingWilliam/orgs","repos_url":"https://api.github.com/users/wellingWilliam/repos","events_url":"https://api.github.com/users/wellingWilliam/events{/privacy}","received_events_url":"https://api.github.com/users/wellingWilliam/received_events","type":"User","site_admin":false},"body":"Now putting all navigation cached requests in the directory. This allows for all context using the same pointer to its context in the directory. Pagination works much better.","created_at":"2016-04-15T03:05:32Z","updated_at":"2016-04-18T11:57:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8f399cf990455c6c44f4e4e11e5133a0e82266f7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/pulls/55/commits","review_comments_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/pulls/55/comments","review_comment_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/issues/55/comments","statuses_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/statuses/cd237c3f873d79200288787945198c35222c1723","head":{"label":"wellingWilliam:pagination-bug-fixes","ref":"pagination-bug-fixes","sha":"cd237c3f873d79200288787945198c35222c1723","user":{"login":"wellingWilliam","id":16831046,"avatar_url":"https://avatars.githubusercontent.com/u/16831046?v=3","gravatar_id":"","url":"https://api.github.com/users/wellingWilliam","html_url":"https://github.com/wellingWilliam","followers_url":"https://api.github.com/users/wellingWilliam/followers","following_url":"https://api.github.com/users/wellingWilliam/following{/other_user}","gists_url":"https://api.github.com/users/wellingWilliam/gists{/gist_id}","starred_url":"https://api.github.com/users/wellingWilliam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wellingWilliam/subscriptions","organizations_url":"https://api.github.com/users/wellingWilliam/orgs","repos_url":"https://api.github.com/users/wellingWilliam/repos","events_url":"https://api.github.com/users/wellingWilliam/events{/privacy}","received_events_url":"https://api.github.com/users/wellingWilliam/received_events","type":"User","site_admin":false},"repo":{"id":55359289,"name":"angular2-ui-prototype","full_name":"wellingWilliam/angular2-ui-prototype","owner":{"login":"wellingWilliam","id":16831046,"avatar_url":"https://avatars.githubusercontent.com/u/16831046?v=3","gravatar_id":"","url":"https://api.github.com/users/wellingWilliam","html_url":"https://github.com/wellingWilliam","followers_url":"https://api.github.com/users/wellingWilliam/followers","following_url":"https://api.github.com/users/wellingWilliam/following{/other_user}","gists_url":"https://api.github.com/users/wellingWilliam/gists{/gist_id}","starred_url":"https://api.github.com/users/wellingWilliam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wellingWilliam/subscriptions","organizations_url":"https://api.github.com/users/wellingWilliam/orgs","repos_url":"https://api.github.com/users/wellingWilliam/repos","events_url":"https://api.github.com/users/wellingWilliam/events{/privacy}","received_events_url":"https://api.github.com/users/wellingWilliam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wellingWilliam/angular2-ui-prototype","description":"An Angular2 (https://angular.io/) extended prototype UI for DSpace","fork":true,"url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype","forks_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/forks","keys_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/teams","hooks_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/hooks","issue_events_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/issues/events{/number}","events_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/events","assignees_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/assignees{/user}","branches_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/branches{/branch}","tags_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/tags","blobs_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/git/refs{/sha}","trees_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/statuses/{sha}","languages_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/languages","stargazers_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/stargazers","contributors_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/contributors","subscribers_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/subscribers","subscription_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/subscription","commits_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/commits{/sha}","git_commits_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/git/commits{/sha}","comments_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/comments{/number}","issue_comment_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/issues/comments{/number}","contents_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/contents/{+path}","compare_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/merges","archive_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/downloads","issues_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/issues{/number}","pulls_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/pulls{/number}","milestones_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/milestones{/number}","notifications_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/labels{/name}","releases_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/releases{/id}","deployments_url":"https://api.github.com/repos/wellingWilliam/angular2-ui-prototype/deployments","created_at":"2016-04-03T17:31:41Z","updated_at":"2016-04-03T17:31:43Z","pushed_at":"2016-04-17T03:31:38Z","git_url":"git://github.com/wellingWilliam/angular2-ui-prototype.git","ssh_url":"git@github.com:wellingWilliam/angular2-ui-prototype.git","clone_url":"https://github.com/wellingWilliam/angular2-ui-prototype.git","svn_url":"https://github.com/wellingWilliam/angular2-ui-prototype","homepage":null,"size":419,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","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":"DSpace-Labs:master","ref":"master","sha":"9ee50525bd44fbbbf54689f15bfa51b2d34d33cf","user":{"login":"DSpace-Labs","id":11669193,"avatar_url":"https://avatars.githubusercontent.com/u/11669193?v=3","gravatar_id":"","url":"https://api.github.com/users/DSpace-Labs","html_url":"https://github.com/DSpace-Labs","followers_url":"https://api.github.com/users/DSpace-Labs/followers","following_url":"https://api.github.com/users/DSpace-Labs/following{/other_user}","gists_url":"https://api.github.com/users/DSpace-Labs/gists{/gist_id}","starred_url":"https://api.github.com/users/DSpace-Labs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DSpace-Labs/subscriptions","organizations_url":"https://api.github.com/users/DSpace-Labs/orgs","repos_url":"https://api.github.com/users/DSpace-Labs/repos","events_url":"https://api.github.com/users/DSpace-Labs/events{/privacy}","received_events_url":"https://api.github.com/users/DSpace-Labs/received_events","type":"Organization","site_admin":false},"repo":{"id":54654861,"name":"angular2-ui-prototype","full_name":"DSpace-Labs/angular2-ui-prototype","owner":{"login":"DSpace-Labs","id":11669193,"avatar_url":"https://avatars.githubusercontent.com/u/11669193?v=3","gravatar_id":"","url":"https://api.github.com/users/DSpace-Labs","html_url":"https://github.com/DSpace-Labs","followers_url":"https://api.github.com/users/DSpace-Labs/followers","following_url":"https://api.github.com/users/DSpace-Labs/following{/other_user}","gists_url":"https://api.github.com/users/DSpace-Labs/gists{/gist_id}","starred_url":"https://api.github.com/users/DSpace-Labs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DSpace-Labs/subscriptions","organizations_url":"https://api.github.com/users/DSpace-Labs/orgs","repos_url":"https://api.github.com/users/DSpace-Labs/repos","events_url":"https://api.github.com/users/DSpace-Labs/events{/privacy}","received_events_url":"https://api.github.com/users/DSpace-Labs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DSpace-Labs/angular2-ui-prototype","description":"An Angular2 (https://angular.io/) extended prototype UI for DSpace","fork":false,"url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype","forks_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/forks","keys_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/teams","hooks_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/hooks","issue_events_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/issues/events{/number}","events_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/events","assignees_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/assignees{/user}","branches_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/branches{/branch}","tags_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/tags","blobs_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/git/refs{/sha}","trees_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/statuses/{sha}","languages_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/languages","stargazers_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/stargazers","contributors_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/contributors","subscribers_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/subscribers","subscription_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/subscription","commits_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/commits{/sha}","git_commits_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/git/commits{/sha}","comments_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/comments{/number}","issue_comment_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/issues/comments{/number}","contents_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/contents/{+path}","compare_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/merges","archive_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/downloads","issues_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/issues{/number}","pulls_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/pulls{/number}","milestones_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/milestones{/number}","notifications_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/labels{/name}","releases_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/releases{/id}","deployments_url":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/deployments","created_at":"2016-03-24T15:56:08Z","updated_at":"2016-04-15T21:42:42Z","pushed_at":"2016-04-17T03:31:38Z","git_url":"git://github.com/DSpace-Labs/angular2-ui-prototype.git","ssh_url":"git@github.com:DSpace-Labs/angular2-ui-prototype.git","clone_url":"https://github.com/DSpace-Labs/angular2-ui-prototype.git","svn_url":"https://github.com/DSpace-Labs/angular2-ui-prototype","homepage":null,"size":399,"stargazers_count":2,"watchers_count":2,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":18,"forks":8,"open_issues":18,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/pulls/55"},"html":{"href":"https://github.com/DSpace-Labs/angular2-ui-prototype/pull/55"},"issue":{"href":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/issues/55"},"comments":{"href":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/issues/55/comments"},"review_comments":{"href":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/pulls/55/comments"},"review_comment":{"href":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/pulls/55/commits"},"statuses":{"href":"https://api.github.com/repos/DSpace-Labs/angular2-ui-prototype/statuses/cd237c3f873d79200288787945198c35222c1723"}}}}