59
BLOCK CHOOSERS, CONFIGURATION BLOCKS, METADATA SETS, INDEXING, AND XSLT Presented by Wing Ming Chan, Sep 16, 2013 Upstate Medical University [email protected] 1

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

Embed Size (px)

DESCRIPTION

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

Citation preview

Page 1: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

BLOCK CHOOSERS, CONFIGURATION BLOCKS, METADATA SETS, INDEXING, AND XSLT

Presented by

Wing Ming Chan, Sep 16, 2013

Upstate Medical University

[email protected]

1

Page 2: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

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

Page 3: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

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

Page 4: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

THREE TYPES OF INFORMATION ON A PAGE

Global Site-specific Page-specific

4

Page 5: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

GLOBAL INFORMATION

Global navigation Logo Search Breadcrumb Footer (partially)

5

Page 6: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

SITE-SPECIFIC INFORMATION

Site title (text or image) Menu bar Left column Right column Footer contact

information Footer fourth

column

6

Page 7: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

PAGE-SPECIFIC INFORMATION

DEFAULT Page-specific left/right columns Other regions in the center column

7

Page 8: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

GLOBAL TEMPLATE (WITHOUT A LOT OF REGIONS)

8

Page 9: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

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

Page 10: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

CUSTOMIZABLE GLOBAL CONFIGURATIONS

Customizable regions for specific sites/pages The entire header replaceable Left column (one single region) Right column (one single region)

10

Page 11: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

BLOCK CHOOSERS IN DEFAULT

Allowing blocks in DEFAULT Main reason: when switching content type,

only data in DEFAULT is kept

11

Page 12: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

DATA DEFINITION FOR DEFAULT

12

Page 13: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

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

Page 14: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

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

Page 15: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

CONFIGURATION BLOCK III

Four of them: _site-info _footer-contact _left-column _right-column

In Base Folder or any indexable sub-folders

15

Page 16: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

_SITE-INFO

16

Page 17: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

DATA DEFINITIONS OF CONFIGURATION BLOCKS

17

Page 18: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

CONFIGURATION BLOCKS IN A SITE AND A FOLDER

18

Page 19: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

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

Page 20: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

INDEXING CONFIGURATION BLOCKS I

20

Page 21: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

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 bricks21

Page 22: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

FORMATTING THE INFORMATION

Using XSLT Configuration blocks are sorted using number

of ancestor folders in descending order Closest configuration block takes precedence

22

Page 23: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

THE FORMAT

23

Page 24: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

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

Page 25: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

TEMPLATE FORMAT

25

Page 26: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

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

Page 27: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

GLOBAL METADATA SETS I

27

Page 28: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

GLOBAL METADATA SETS II

28

Page 29: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

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

Page 30: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

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

Page 31: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

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

Page 32: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

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

Page 33: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

BLOCK DATA DEFINITION

33

Page 34: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

PROCESSING BLOCKS IN FORMATS

Named templates paired with blocks Hosting formats: switch-board code Call named templates in different hosting

formats

34

Page 35: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

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

Page 36: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

SWITCH-BOARD CODE

36

Page 37: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

LIBRARY PROCESSING CODE

37

Page 38: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

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

Page 39: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

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

Page 40: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

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

Page 41: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

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

Page 42: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

BRICKS II

42

Page 43: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

BRICKS III

43

Page 44: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

BRICKS IV

Adding code to site-block-indexing (used by STORAGE) so that the information is made available in STORAGE

44

Page 45: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

BRICKS V

Adding a library file: bricks-processing

45

Page 46: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

BRICKS VI

New code in template format:

46

Page 47: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

BRICKS VII

A page with a brick:

47

Page 48: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

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

Page 49: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

BLICKS, BROCKS, OR BIW’S II

49

Page 50: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

BLICKS, BROCKS, OR BIW’S III

50

Page 51: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

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

Page 52: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

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

Page 53: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

SOLUTION II

Create the div element with the id in the format for DEFAULT

Assign appropriate classes to the div or wrapping div

53

Page 54: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

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

Page 55: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

INJECTING STYLE INTO HEAD AT PAGE LEVEL II

On the page:

The format for DEFAULT turns the p into a div:

55

Page 56: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

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

Page 57: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

INJECTING STYLE INTO HEAD AT PAGE LEVEL IV

57

Page 58: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

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

Page 59: Block Choosers, Configuration Blocks, Metadata Sets, Indexing and XSLT

QUESTIONS?

Email: [email protected]

59