History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: UP-1923
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Nick Bolton
Reporter: Eric Dalquist
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
uPortal

Dynamic channel titles only work on full rendering

Created: 21/Jan/08 12:33 PM   Updated: 05/Mar/08 10:00 AM
Component/s: User Interface
Affects Version/s: 2.6.1, 3.0.0-M5
Fix Version/s: 2.6.2, 3.0.0-RC2

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
File Attachments: 1. Java Source File ChannelTitleFilterPrintWriter.java (5 kb)
2. Java Source File ChannelTitleIncorporationWiterFilter.java (9 kb)
3. Java Source File ChannelTitleIncorporationWiterFilterTest.java (4 kb)
4. Zip Archive TokenReplacementFilter.zip (30 kb)
5. Zip Archive TokenReplacementFilter.zip (4 kb)

Issue Links:
Duplicate
 
This issue is duplicated by:
UP-1247 JSR-168 portlet dynamic titles Major Closed


 Description  « Hide
Dynamic channel title (and portlet title) support was added by UP-1247 and UP-1246. The problem is the dynamic title content is cached in the system character cache so subsequent requests that render from the character cache don't update the channel titles.

 All   Comments   Work Log   Change History      Sort Order:
Eric Dalquist [21/Jan/08 12:34 PM]
Looking at the current dynamic title code there are already a few restrictions, mainly the title can't be use in an attribute of any element in the rendered markup because the CharacterCachingChannelIncorporationFilter currently just replaces the <channel-title defaultValue="foo" channelSubscribeId="id"/> element with the correct title after the theme transform is complete. If this restriction is OK than a solution to rendering dynamic titles with character caching enabled shouldn't be too difficult to implement as follows.

The CharacterCacheEntry class would be changed from a List<String> of serialized content fragments and a List<String> of channel ids which are interleaved into just a List<CacheEntry> (the CacheEntry class and related classes are outlined below). The each CacheEntry would describe what content should go in its place, cached serialized characters, a channel title, or channel content. For the channel title and content entries the CacheEntry would provide the channel subscribe id to get the content for. For the cached characters entry the serialized String would be part of the entry. The rendering pipeline code that replays the cached List<CacheEntry> would then just take the appropriate action based on the type of entry and either write out cached data or query the channel manager for the channel content or title. This will result in more interleaving that currently exists but there should be no real performance change as retrieving and writing out a channel title is a very cheap operation.

enum CacheType { CHARACTERS; CHANNEL_TITLE; CHANNEL_CONTENT; }
interface CacheEntry { CacheType getCacheType(); }
class StringCacheEntry implements CacheEntry {
CacheType getCacheType() { return CacheType.CHARACTERS; }
String getCachedCharacters(){ return chars; }
}
abstract class BaseChannelCacheEntry implements CacheEntry {
String getChannelId(){ return id; }
}
class ChannelContentCacheEntry extends BaseChannelCacheEntry {
CacheType getCacheType() { return CacheType.CHANNEL_CONTENT; }
}
class ChannelTitleCacheEntry extends BaseChannelCacheEntry {
CacheType getCacheType() { return CacheType.CHANNEL_TITLE; }
String getDefaultTitle() { return defaultTitle; }
}


Nick Bolton [25/Jan/08 12:10 PM]
Proposed PrintWriter wrapper

Eric Dalquist [25/Jan/08 04:33 PM]
Streaming token replacement filter

Eric Dalquist [25/Jan/08 04:34 PM]
Unit test for streaming token replacement filter

Eric Dalquist [25/Jan/08 04:54 PM]
Updated token replacement code that moves the non-channel title logic into an abstract class.

Eric Dalquist [25/Jan/08 05:23 PM]
Updated test cases to try chunked filtering and to filter an actual HTML page with multiple tokens.

Nick Bolton [31/Jan/08 03:07 PM]
The UserInstance system block cache mechanism to allow the addition of a new block type CHANNE_TITLE. The new cache block type was not needed, but the refactoring is useful.

To support dynamic titles within cached system blocks (page fragments outside the channel content), A token (UP:CHANNEL_TITLE-{channelSubscribeId}) was created that represents a channel's title. Then the PrintWriter for the response is wrapped with a filter that will replace these tokens.