Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

674 views

Published on

This presentation will allow you to learn how to configure blocks to bundle up blocks to store site-specific information, index block to pick up site-specific information stored in Configuration blocks, create template-level formats to redistribute information to div elements, and convert XSLT library to process blocks

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
674
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

  1. 1. BLOCK CHOOSERS, CONFIGURATION BLOCKS, METADATA SETS, INDEXING, AND XSLT Presented by Wing Ming Chan, Sep 16, 2013 Upstate Medical University chanw@upstate.edu 1
  2. 2. TOPICS  Objectives of the design  Template with no regions for site-specific information  Configuration set vs. configuration block  Block choosers in DEFAULT and configuration blocks  Indexing  XSLT formats  Formats for regions  Template format  Xalan component (if time allows)  Metadata sets 2
  3. 3. OBJECTIVES OF THE DESIGN  Avoid having too many site-specific components and assets: templates, configuration sets, content types, metadata sets, formats, index blocks  Separating the two functions of a configuration:  Controlling file format, output and publishing  Bundling blocks in regions for a site  Using blocks without regions 3
  4. 4. THREE TYPES OF INFORMATION ON A PAGE  Global  Site-specific  Page-specific 4
  5. 5. GLOBAL INFORMATION  Global navigation  Logo  Search  Breadcrumb  Footer (partially) 5
  6. 6. SITE-SPECIFIC INFORMATION  Site title (text or image)  Menu bar  Left column  Right column  Footer contact information  Footer fourth column 6
  7. 7. PAGE-SPECIFIC INFORMATION  DEFAULT  Page-specific left/right columns  Other regions in the center column 7
  8. 8. GLOBAL TEMPLATE (WITHOUT A LOT OF REGIONS) 8
  9. 9. CONFIGURATION VS. CONFIGURATION BLOCK  Global configuration  Regions defined for global information and page- specific information  Control file output, file extensions, publishing  No regions defined for site-specific information  Site-specific configuration blocks  Replace regions in configurations for sites  Block bundling 9
  10. 10. CUSTOMIZABLE GLOBAL CONFIGURATIONS  Customizable regions for specific sites/pages  The entire header replaceable  Left column (one single region)  Right column (one single region) 10
  11. 11. BLOCK CHOOSERS IN DEFAULT  Allowing blocks in DEFAULT  Main reason: when switching content type, only data in DEFAULT is kept 11
  12. 12. DATA DEFINITION FOR DEFAULT 12
  13. 13. CONFIGURATION BLOCK I  A data definition block  Containing multiple block choosers and other UI fields  Not plugged into any region (typical use)  Existing in and belonging to a specific site  To be indexed  Global index block  Global format processing the information gathered and stored in STORAGE 13
  14. 14. CONFIGURATION BLOCK II  Containing site-specific/page-specific information  Site title  Menu bar  Theme  Local stylesheet  JavaScript library  Footer contact information  Blocks in left/right columns 14
  15. 15. CONFIGURATION BLOCK III  Four of them:  _site-info  _footer-contact  _left-column  _right-column  In Base Folder or any indexable sub-folders 15
  16. 16. _SITE-INFO 16
  17. 17. DATA DEFINITIONS OF CONFIGURATION BLOCKS 17
  18. 18. CONFIGURATION BLOCKS IN A SITE AND A FOLDER 18
  19. 19. TWO TYPES OF INDEXING  Absolute indexing  Tied with a folder  Belonging to a site  Block existing in a site, not reusable by other sites  Example: dropdown menu bar  Relative indexing  Starts from the calling page  Exists in global area  Block existing in _common, reusable by all sites  Examples: tabbed menu bar, breadcrumb, left menu 19
  20. 20. INDEXING CONFIGURATION BLOCKS I 20
  21. 21. INDEXING CONFIGURATION BLOCKS II  Relative indexing  The index block is plugged into a region named STORAGE in the global configuration  Picking up information stored in the four configuration blocks in a site  Blocks chosen: some global, some site-specific (local)  Global: global menu bar, left menu, theme, global bricks  Local: local menu bar, JavaScript, local stylesheet, local bricks 21
  22. 22. FORMATTING THE INFORMATION  Using XSLT  Configuration blocks are sorted using number of ancestor folders in descending order  Closest configuration block takes precedence 22
  23. 23. THE FORMAT 23
  24. 24. DISTRIBUTING INFORMATION IN STORAGE  Template-level formats written in XSLT  Grab information from named div's and send it to named div's  Clean up STORAGE 24
  25. 25. TEMPLATE FORMAT 25
  26. 26. WHY THE STORAGE REGION AND TEMPLATE-LEVEL FORMATS?  Global and local blocks made available to the entire site  Information made available to all regions on the page  Requires template-level formats  Moving information from a div in STORAGE to any div on the page  Cleaning up all junks (STORAGE, unwanted div’s, etc.)  Applications  Bricks  Blocks in WYSIWYG’s  Injecting code into <head> at the page level  Wrapping up an entire newsletter in a block 26
  27. 27. GLOBAL METADATA SETS I 27
  28. 28. GLOBAL METADATA SETS II 28
  29. 29. OTHER USES OF CONFIGURATION BLOCKS  Page-specific left/right column  Not to be indexed (hidden in non-indexable folder)  Directly plugged into regions (LEFT COLUMN or RIGHT COLUMN) at the page level  Used with formats 29
  30. 30. USES OF DATA DEFINITION BLOCKS  Four different ways of using a data definition block (with respect to four different formats)  In a configuration block to be indexed  In a configuration block to be plugged into a region at the page level (customizable configuration)  Plugged into a region at the page level, used with a format  Chosen in a block chooser in DEFAULT 30
  31. 31. WHY XSLT?  Same processing code in four different formats  Centralized library code  Use call-template everywhere  Support of Xalan components if programming logic needed  Use of template-level formats  As of Cascade 7.6, Velocity code library is possible; what about template-level format? 31
  32. 32. IDENTIFYING BLOCKS INSIDE CONFIGURATION BLOCKS  Each block has a unique identifier  Text blocks: unique names  Data definition blocks: hidden type identifiers  Index blocks: unique names 32
  33. 33. BLOCK DATA DEFINITION 33
  34. 34. PROCESSING BLOCKS IN FORMATS  Named templates paired with blocks  Hosting formats: switch-board code  Call named templates in different hosting formats 34
  35. 35. XSLT LIBRARIES  Named templates in library files  Namespaces  Using XPath with names and attributes  Using context nodes  Where named templates are used  In DEFAULT format  In the STORAGE region  In customized left/right column regions  In other regions in center column 35
  36. 36. SWITCH-BOARD CODE 36
  37. 37. LIBRARY PROCESSING CODE 37
  38. 38. TRICKS ABOUT CONTEXT NODE I  The parent node of system-data-structure is content  By selecting content when calling apply- templates, the content node is passed in as the context node 38
  39. 39. TRICKS ABOUT CONTEXT NODE II  Within the context, system-data-structure can be referred to directly  In left-right-column-processing, the template that matches system-data-structure just sits there, waiting to be used  There are no calls to templates that match bare system-data-structure  This eliminates accidental matching of system- data-structure somewhere in the library  Whenever a match of system-data-structure is needed, prefix it with an XPath 39
  40. 40. KNOWN ISSUES RELATED TO INDEXING  Cyclic indexing  At one point, blocks were used to generate items in left menu  Index block left-menu indexing pages, folders, references, external links, and blocks (including configuration blocks)  Configuration block _left-column contains left-menu  Index cache  Menu highlighting not updated instantly 40
  41. 41. BRICKS I  Bricks blocks: data definition blocks, which can be either global or site-specific  Chosen in _site-info  Information available in STORAGE, no special treatment needed  String replacement in template format  Brick values available anywhere on a page (DEFAULT, right column, left column, header, footer, etc.) 41
  42. 42. BRICKS II 42
  43. 43. BRICKS III 43
  44. 44. BRICKS IV  Adding code to site-block-indexing (used by STORAGE) so that the information is made available in STORAGE 44
  45. 45. BRICKS V  Adding a library file: bricks-processing 45
  46. 46. BRICKS VI  New code in template format: 46
  47. 47. BRICKS VII  A page with a brick: 47
  48. 48. BLICKS, BROCKS, OR BIW’S I  A block that can be inserted into a WYSIWYG  Something between a brick and a block  Block choosers in _site-info, all assigned a fixed set of id’s  Block info made available in STORAGE  In WYSIWYG, insert div’s with matching id’s  Template formats distribute info in STORAGE to these div’s 48
  49. 49. BLICKS, BROCKS, OR BIW’S II 49
  50. 50. BLICKS, BROCKS, OR BIW’S III 50
  51. 51. PROBLEM  The div element is invisible in the WYSIWYG  Dummy content can be added to the div (a string or an image); the content will be removed by the template formats 51
  52. 52. SOLUTION I  An id can be entered directly into the WYSIWYG, wrapped by <p></p> tags  Assign a pre-defined class to the p element 52
  53. 53. SOLUTION II  Create the div element with the id in the format for DEFAULT  Assign appropriate classes to the div or wrapping div 53
  54. 54. INJECTING STYLE INTO HEAD AT PAGE LEVEL I  Add a div (id=“show-page-style”) in <head> in the template  Choose a block containing style information in _site-info 54
  55. 55. INJECTING STYLE INTO HEAD AT PAGE LEVEL II  On the page:  The format for DEFAULT turns the p into a div: 55
  56. 56. INJECTING STYLE INTO HEAD AT PAGE LEVEL III  The template formats match the page name in the block and the page name on the page, and inserts the style rules into <head> 56
  57. 57. INJECTING STYLE INTO HEAD AT PAGE LEVEL IV 57
  58. 58. USING STORAGE: THE LOGICAL CONCLUSION  There is no reason why the region STORAGE cannot be associated with a mega block, containing multiple block choosers  site-block-indexing can be just one of the blocks available to STORAGE  Global blocks can also be chosen by the mega block; then global blocks can be replaced at site level (no difference between global and local any more)  Besides DEFAULT, there will be only one region, namely STORAGE, in an entire template  Only XSLT formats make sense in this setup, unless we are ready for a huge Velocity format 58
  59. 59. QUESTIONS?  Email: chanw@upstate.edu 59

×