Labels

accessibility (2) ADF (1) archiver (3) cmu (1) contributor (13) cookie (1) DAM (3) date (3) download (3) dynamic list (4) ephox (5) fatwire (1) fck (1) filters (1) folders (4) headers (2) IBR (3) ImageAlchemy (3) java (4) javascript (2) layout/template (4) link (6) locale (2) multilingual (1) rendition (3) replicator (4) rules (1) schema (1) search (11) sites (1) sitestudio (24) ssp/sspu (5) SSUrlFieldName (2) stellent (4) timezone (1) urm (1) weblogic (1) workflow (2)

Wednesday 10 November 2010

Add a "future release" icon to contribution mode

Ken posed a good question on the intradoc forums. He wrote:
Our editors have requested that we add a "Future Release" indicator to the Site Studio contribution mode screen, similar to the workflow icon that can appear... Does anyone know what the syntax for accessing the metadata of the content is?
I thought it was a great idea, so I looked into it.

His JavaScript is perfect, but the problem he faced was reporting the release date back to the JavaScript. To solve, write a component to override the "ss_compute_region_config_object" function, like this:
<@dynamichtml ss_compute_region_config_object@>
<$if parseDate(DOC_INFO.dInDate) gt parseDate(dateCurrent())$>
  <$rsAppendRowValues("SSState","isFutureRelease,true")$>
  <$rsAppendRowValues("SSState","releaseDate,"&DOC_INFO.dInDate)$>
<$else$>
  <$rsAppendRowValues("SSState","isFutureRelease,false")$>
<$endif$>
<$include super.ss_compute_region_config_object$>
<@end@>
Now that is done, his JavaScript enhancement can be used. It would then read the date in as:
var releaseDate = regionConfig['state']['releaseDate'];
Finally, I'd suggest moving his JavaScript into the component rather than editing the Oracle files - it gets tedious to redo file hacks every time you upgrade/install.

No comments:

Post a Comment