Noah Botimer

SAK-41442 - Fix ContentItem insertion in Assignments (#6619)

This is the minimal fix for the problem, but the whole plugin should be

cleaned up. The problem was with multiple editor instances on the page

and some incidental shared state.

The init function registers the ContentItemDialog with the top level

CKEDITOR object for each editor instance. What was happening in this

particular case was that the dialog was overwritten with the binding to

the second instance, for peer assessment, which is hidden. The editor

reference in the onOk callback was not for the actual editor that

invoked the dialog, but the last one initialized.

The error thrown was for the first selection range (range.checkReadOnly)

from insertHtml/insert in editable.js in CKEditor. With the second

editor hidden, the selection range array is empty, so the first item was

undefined. The shared/overwritten reference would have been more obvious

if the second editor was visible -- the item would have been inserted in

the wrong text area.

A more thorough fix would examine the init vs. onLoad details and make

sure that addIframe is called the appropriate number of times and that

only initialization that must run for each editor instance does. I

believe that would be the addCommand and addButton pieces. The

ContentItemIFrameWindow is also global. It is incidentally safe to use

because only one dialog can be in process at a time, but this should

reside within the instance of the dialog itself.

(cherry picked from commit 5ed6eaed47a11c6a72d94ab64c416b6b43df87c1)

SAK-41442 - Fix ContentItem insertion in Assignments (#6619)

This is the minimal fix for the problem, but the whole plugin should be

cleaned up. The problem was with multiple editor instances on the page

and some incidental shared state.

The init function registers the ContentItemDialog with the top level

CKEDITOR object for each editor instance. What was happening in this

particular case was that the dialog was overwritten with the binding to

the second instance, for peer assessment, which is hidden. The editor

reference in the onOk callback was not for the actual editor that

invoked the dialog, but the last one initialized.

The error thrown was for the first selection range (range.checkReadOnly)

from insertHtml/insert in editable.js in CKEditor. With the second

editor hidden, the selection range array is empty, so the first item was

undefined. The shared/overwritten reference would have been more obvious

if the second editor was visible -- the item would have been inserted in

the wrong text area.

A more thorough fix would examine the init vs. onLoad details and make

sure that addIframe is called the appropriate number of times and that

only initialization that must run for each editor instance does. I

believe that would be the addCommand and addButton pieces. The

ContentItemIFrameWindow is also global. It is incidentally safe to use

because only one dialog can be in process at a time, but this should

reside within the instance of the dialog itself.

(cherry picked from commit 5ed6eaed47a11c6a72d94ab64c416b6b43df87c1)

SAK-41442 - Fix ContentItem insertion in Assignments (#6619)

This is the minimal fix for the problem, but the whole plugin should be

cleaned up. The problem was with multiple editor instances on the page

and some incidental shared state.

The init function registers the ContentItemDialog with the top level

CKEDITOR object for each editor instance. What was happening in this

particular case was that the dialog was overwritten with the binding to

the second instance, for peer assessment, which is hidden. The editor

reference in the onOk callback was not for the actual editor that

invoked the dialog, but the last one initialized.

The error thrown was for the first selection range (range.checkReadOnly)

from insertHtml/insert in editable.js in CKEditor. With the second

editor hidden, the selection range array is empty, so the first item was

undefined. The shared/overwritten reference would have been more obvious

if the second editor was visible -- the item would have been inserted in

the wrong text area.

A more thorough fix would examine the init vs. onLoad details and make

sure that addIframe is called the appropriate number of times and that

only initialization that must run for each editor instance does. I

believe that would be the addCommand and addButton pieces. The

ContentItemIFrameWindow is also global. It is incidentally safe to use

because only one dialog can be in process at a time, but this should

reside within the instance of the dialog itself.

KNL-1011 - Pick up site title changes for user caches

git-svn-id: https://source.sakaiproject.org/svn/kernel/trunk@124677 66ffb92e-73f9-0310-93c1-f5514f145a0a

KNL-1011 - Fix caching/lazy loading by copying loaded flag properly

The m_fullyLoaded flag was not being copied over properly when sites

were copied. Since sites are always cached as copies, the flag was

always false in the cache. This was causing significant reretrieval of

sites.

Big thanks to Sam O for the debugging and patch.

git-svn-id: https://source.sakaiproject.org/svn/kernel/trunk@124136 66ffb92e-73f9-0310-93c1-f5514f145a0a

KNL-1011 - Fix extra user-site cache invalidation

There was an extra call to invalidate user-site caches for all members

of a site upon calling cacheSite, which lead to significant stomping of

the values. There are event observers to catch site updates, which

handle invalidation when membership changes. This is the appropriate

time as opposed to clearing upon caching of each site.

git-svn-id: https://source.sakaiproject.org/svn/kernel/trunk@123981 66ffb92e-73f9-0310-93c1-f5514f145a0a

KNL-1011 - Fix lazy-loading/caching bug in performance improvements

This fix ensures that fully/partially loaded sites are tracked properly,

that the cache is updated when sites are saved, and that the user-site

cache is purged for updated sites.

Note that this change reverts r120432, so both will be required for

merges.

git-svn-id: https://source.sakaiproject.org/svn/kernel/trunk@120433 66ffb92e-73f9-0310-93c1-f5514f145a0a

KNL-1011 - Improve performance of SiteService and Portal

git-svn-id: https://source.sakaiproject.org/svn/portal/trunk@120416 66ffb92e-73f9-0310-93c1-f5514f145a0a

KNL-1011 - Improve performance of SiteService and Portal

git-svn-id: https://source.sakaiproject.org/svn/sitestats/trunk@120415 66ffb92e-73f9-0310-93c1-f5514f145a0a

KNL-1011 - Improve performance of SiteService and Portal

git-svn-id: https://source.sakaiproject.org/svn/site/trunk@120414 66ffb92e-73f9-0310-93c1-f5514f145a0a

KNL-1011 - Improve performance of SiteService and Portal

git-svn-id: https://source.sakaiproject.org/svn/sakai-mock/trunk@120413 66ffb92e-73f9-0310-93c1-f5514f145a0a

KNL-1011 - Improve performance of SiteService and Portal

git-svn-id: https://source.sakaiproject.org/svn/entitybroker/trunk@120412 66ffb92e-73f9-0310-93c1-f5514f145a0a

KNL-1011 - Improve performance of SiteService and Portal

git-svn-id: https://source.sakaiproject.org/svn/kernel/trunk@120411 66ffb92e-73f9-0310-93c1-f5514f145a0a

KNL-1011 - Clean up bad whitespace in original patch
KNL-1011 - Clean up bad whitespace in original patch

git-svn-id: https://source.sakaiproject.org/svn/kernel/branches/KNL-1011@119098 66ffb92e-73f9-0310-93c1-f5514f145a0a

KNL-1011 - Allow control of lazy loading in Site copying and caching

* Add collection getters to BaseSite that can avoid fetching

* Call the lazy getters for copy construction (in set())

* Call the lazy getters from SiteCacheImpl when making copies

for cache put notification

KNL-1011 - Allow control of lazy loading in Site copying and caching

* Add collection getters to BaseSite that can avoid fetching

* Call the lazy getters for copy construction (in set())

* Call the lazy getters from SiteCacheImpl when making copies

for cache put notification

git-svn-id: https://source.sakaiproject.org/svn/kernel/branches/KNL-1011@118313 66ffb92e-73f9-0310-93c1-f5514f145a0a

KNL-1011 - Invalidate current user's site cache on unjoin
KNL-1011 - Invalidate current user's site cache on unjoin

git-svn-id: https://source.sakaiproject.org/svn/kernel/branches/KNL-1011@118310 66ffb92e-73f9-0310-93c1-f5514f145a0a

KNL-1011 - Update portal to improve site performance

* Use SiteService.getUserSites when getting user site lists

* Use Site.getHtmlDescription and getHtmlShortDescription to

avoid repeatedly HTML-escaping text

* Post an event on denied site visits for analytics and to trigger

user-site cache invalidation

KNL-1011 - Update portal to improve site performance

* Use SiteService.getUserSites when getting user site lists

* Use Site.getHtmlDescription and getHtmlShortDescription to

avoid repeatedly HTML-escaping text

* Post an event on denied site visits for analytics and to trigger

user-site cache invalidation

git-svn-id: https://source.sakaiproject.org/svn/portal/branches/KNL-1011@118309 66ffb92e-73f9-0310-93c1-f5514f145a0a

KNL-1011 - Update sitestats mock for Site changes
KNL-1011 - Update sitestats mock for Site changes

git-svn-id: https://source.sakaiproject.org/svn/sitestats/branches/KNL-1011@118308 66ffb92e-73f9-0310-93c1-f5514f145a0a

KNL-1011 - Update MergedList to use SiteService.getUserSites
KNL-1011 - Update MergedList to use SiteService.getUserSites

git-svn-id: https://source.sakaiproject.org/svn/site/branches/KNL-1011@118307 66ffb92e-73f9-0310-93c1-f5514f145a0a

KNL-1011 - Update sakai-mock for Site changes
KNL-1011 - Update sakai-mock for Site changes

git-svn-id: https://source.sakaiproject.org/svn/sakai-mock/branches/KNL-1011@118306 66ffb92e-73f9-0310-93c1-f5514f145a0a

KNL-1011 - Update entitybroker for Site changes
KNL-1011 - Update entitybroker for Site changes

git-svn-id: https://source.sakaiproject.org/svn/entitybroker/branches/KNL-1011@118305 66ffb92e-73f9-0310-93c1-f5514f145a0a

KNL-1011 - Improve performance of SiteService and Portal

This is the parent change for all of the solutions proposed on KNL-1011.

Specifically, the following are implemented (not all in this commit):

* Leave SiteService.getSites behavior unchanged for existing calls

(except potentially faster because of caching)

* Add a SiteService.getSites signature to retrieve records without

processing descriptions

* Implement a four-stage approach in SiteService.getSites: get IDs,

check cache for each; query by ID for only those uncached, cache new

* For sites loaded without descriptions, lazily load descriptions on

loadAll and getSite (which retrieves all pages, etc. and caches a

single site fully)

* Add a new SiteService method, getUserSites that caches the complete

list of sites for a user

* Call getUserSites from SiteNeighbourhoodServiceImpl.getAllSites to

take advantage of cache

* Call getUserSites from MergedList in site/mergedlist-util (used for

announcements, etc.)

* Add new methods to Site, getHtmlShortDescription and

getHtmlDescription to escape and retain them internally

* Call the new HTML-safe description getters from PortalSiteHelperImpl

instead of Web.escapeHtml on the plaintext descriptions

Note that some of the above are implemented in commits against other

modules. These should all be combined and committed to trunk in a single

revision with the above details when the time is right (by using a

sparse working copy).