450 likes | 471 Views
Azalia Shamsaei. Extensible Visualization Property Model Cognos BI 10.2.2. Agenda. Introduction to Extensible Visualization property model Demo RAVE template Parameters Parameter Values IBM Cognos Visualization Customizer tool Limitations Work Flow Q & A.
E N D
Azalia Shamsaei Extensible Visualization Property Model Cognos BI 10.2.2
Agenda • Introduction to Extensible Visualization property model • Demo • RAVE template • Parameters • Parameter Values • IBM Cognos Visualization Customizer tool Limitations • Work Flow • Q & A
Extensible Visualization property model • Define Properties for a Visbundle (using IBM Cognos Visualization Tool) • Property types supported: Integer, decimal, string, boolean, enum, color, font • Ability to create property groups • Import Visualization with Properties into IBM Cognos BI • Consume in Report Studio and Cognos Workspace Advanced • Displays in property sheets
Extensible Visualization Parameters to Properties Report Studio Rave Chart Properties
What is a RAVE Template? • A RAVE Template is part of the visJson • The RAVE visJson can have 3 sections • Parameters Array: ("parameters") contains a list of parameter items. • Parameter Values: ("parameterValues") contains values for parameters items defined in the parameter arrray. This is optional and is used for testing. • RAVE Spec: this is the standard RAVE spec
Parameter Attributes - id, type: { "parameters":[ { "id": "setFontStyle", "type": "font", } ], .... <rave specification to be modified> .... }
Parameter Attributes – label, description, defaultValue: { "parameters":[ { "label": "Set font style for title.", "description": "Set font style for title", "defaultValue": { "family": "Verdana"}, }, ] .... <rave specification to be modified> .... }
Parameter Attributes - required: { "parameters":[ { "required": false, }, ] .... <rave specification to be modified> .... }
Parameter Attributes - resolution: { "parameters":[ { "resolution": [ { "method": "set", "target": "/titles[0]/style/font", "sourceParameter": "setFontStyle" } ] } ], <rave specification to be modified>
Resolution – Mechanism to define action: { "parameters":[ { "resolution": [ { "method": "remove", "target": "//elements[0]/label[*]/style/font/size” } ] } ], <rave specification to be modified> }
Resolution – method example: { "parameters":[ { "id": "eltLabelSize", "type": "integer", "resolution": [ { "method": "createOrSet", "target": "//elements[0]/label[*]/style/font/size”, "sourceParameter": " eltLabelSize " } ] } ], <rave specification to be modified> }
Resolution – Mechanism to define action (cont.): • In order to set an attribute value, resolution must tell Template framework what value to use or at least, where to look for value.
Resolution – SourceValue example: { "parameters":[ { "id": "bigFontSize", "type": "integer", "defaultValue": 12 "resolution": [ { "method": "createOrSet", "sourceValue": 22, "target": "//elements[0]/label[*]/style/font/size” } ] } ], <rave specification to be modified> }
Resolution – SourceParameter example: { "parameters":[ { "id": "setFontSize", "label": "Create a font size style and set its value.", "type": "integer", "defaultValue": 12 "resolution": [ { "method": "createOrSet", "sourceParameter": "setFontSize", "target": "//elements[0]/label[*]/style/font/size” } ] } ], <rave specification to be modified> }
Resolution – SourcePath : { "parameters":[ { "id": "copyStyle", "required": false, "type": "string", "defaultValue":“solid", "resolution": [ { "method": "createOrSet", "target": "/grammar[0]/coordinates/dimensions[0]/axis[0]/gridStyle", "sourcePath":"/grammar[0]/coordinates/dimensions[1]/axis[0]/gridStyle", } ] } ], <rave specification to be modified> }
Parameter Attributes - resolutionCases: { "parameters" : [ { "id":"palette", "type":"string", "required":false, "description":"Set the palette.", "defaultValue":"Classic", "resolutionCases": [ { "resolutionCase":"Classic", "resolution": [ { "method":"set", "target":"/grammar[0]/elements[0]/color[0]/palette", "sourceValue": [ "#000066" ] } ] }, { "resolutionCase": "Flow", "resolution": [ { "method":"set", "target":"/grammar[0]/elements[0]/color[0]/palette", "sourceValue": ["#1183ad"] } ] } ] },} ] }
Parameters Attributes – resolveOrder: { "parameters": [{ … "resolution": [{ "method": "createOrSet", "target": "//cordinates/transforms[0]/type“ "sourceValue": "transpose" }], … "resolveOrder": 10, "resolution": [{ "method": "createOrSet", "target": "//cordinates/transforms[0]/type", "sourceValue": "stack" }], … "resolveOrder": 1, "resolution": [{ "method": "remove", "target": "//cordinates/transforms" }] }]} <rave specification to be modified> } 3 2 1
Parameter Values • Parameter Values are a simple way to valid and test the parameters in the visJson • The parameter value is set to the parameter defined in ‘parameters’ array. • Parameter value is matched to its corresponding parameter using its ‘id’. • ‘parameterValues’ can be part of same Template file that contains ‘parameters’ and Rave spec or it can be specified as a separate file
Parameter Values - example: • Below example provides value for the parameter with id “setFontStyle”. Value defined in parameterValues overrides ‘defaultValue’ defined inside parameter. { "parameterValues": [ { "id": "setFontStyle", "value": {"size":"18pt","style":"italic", "family":"arial"} } ], "parameters":[ { "id": "setFontStyle", "type": "font", "label": "Set font style for title.", "description": "Set font style for title", "defaultValue": { "family": "Verdana"}, } ]
Parameter Values: • Provides value to the parameter defined in ‘parameters’ array. Parameter value is matched to its corresponding parameter using its ‘id’. ‘parameterValues’ can be part of same Template file that contains ‘parameters’ and Rave spec or it can be specified as a separate file.
IBM Cognos Visualization Customizer tool Limitations 1: When you generate a vizbundle, by default, the properties are not grouped. Show Gridlines { "id":"showGridlines", "required":false, "defaultValue":true, "type":"boolean", "resolutionCases": [ { "resolutionCase":false, "resolution": [ { "method":"remove", "target":"/grammar[*]/coordinates/dimensions[*]/axis/gridStyle", "sourceParameter":"showGridlines" }] } ] },
IBM Cognos Visualization Customizer tool Limitations 1: When you generate a vizbundle, by default, the properties are not grouped. Gridline Style { "id":"gridlineStyle", "required":false, "defaultValue":"Solid", "type":"string", "resolution": [ { "method":"createOrSet", "target":"/grammar[*]/coordinates/dimensions[*]/axis/gridStyle/stroke/style", "sourceParameter":"gridlineStyle" } ] },
IBM Cognos Visualization Customizer tool Limitations 1: When you generate a vizbundle, by default, the properties are not grouped. You can manually add groups to chart type definition xml file. <propertiesGroup name="numericAxisProperties"> <groupProperties> <booleanProperty name="showGridlines"> <label ids='lblShowGridlines'/> <tooltip ids='tooltipShowGridlines'/> <description ids="descShowGridlines"/> <defaultBoolean>true</defaultBoolean> </booleanProperty> <stringProperty name="gridlineStyle"> <label ids='lblGridlineStyle'/> <tooltip ids='tooltipGridlineStyle'/> <description ids="descGridlineStyle"/> <defaultString>Solid</defaultString> </stringProperty> </groupProperties> <label ids="lblNumericAxisGroup">Numeric Axis</label> </propertiesGroup> Group numericAxis properties
IBM Cognos Visualization Customizer tool Limitations 1: When you generate a vizbundle, by default, the properties are not grouped. You can manually add groups to chart type definition xml and string resource file. Add group properties “unique name” in chart type definition <propertiesGroup name="numericAxisProperties"> <groupProperties> <booleanProperty name="showGridlines"> <label ids='lblShowGridlines'/> <tooltip ids='tooltipShowGridlines'/> <description ids="descShowGridlines"/> <defaultBoolean>true</defaultBoolean> </booleanProperty> <stringProperty name="gridlineStyle"> <label ids='lblGridlineStyle'/> <tooltip ids='tooltipGridlineStyle'/> <description ids="descGridlineStyle"/> <defaultString>Solid</defaultString> </stringProperty> </groupProperties> <label ids="lblNumericAxisGroup">Numeric Axis</label> </propertiesGroup> 1 Results in Report Studio 2 Add string ID “unique name” in string resource file lblNumericAxisGroup=Numeric Axis
IBM Cognos Visualization Customizer tool Limitations 2: When you generate a vizbundle, by default, the enum property is not generated in the xml file. You can manually add enum to chart type definition xml file. { "id":"gridlineStyle", "required":false, "defaultValue":"Solid", "type":"string", "resolution": [ { "method":"createOrSet", "target":"/grammar[*]/coordinates/dimensions[*]/axis/gridStyle/stroke/style", "sourceParameter":"gridlineStyle" } ] },
IBM Cognos Visualization Customizer tool Limitations 2: You can manually add enum to chart type definition xml file. <enumProperty name="gridlineStyle"> <enumValues> <enumValue value="Solid"> <label ids="lblSolid">Solid</label> </enumValue> <enumValue value="LongDash"> <label ids="lblLongDash">Long Dash</label> </enumValue> <enumValue value="LongDashDot"> <label ids="lblLongDashDot">Long Dash Dot</label> </enumValue> <enumValue value="LongDash"> <label ids="lblLongDash">Long Dash</label> </enumValue> <enumValue value="ShortDash"> <label ids="lblShortDash">Short Dash</label> </enumValue> <enumValue value="ShortDashDot"> <label ids="lblShortDashDot">Short Dash Dot</label> </enumValue> </enumValues> <label ids="lblGridlineStyle">Gridline Style</label> <defaultValue>Solid</defaultValue> </enumProperty>
IBM Cognos Visualization Customizer tool Limitations 2: When you generate a vizbundle, by default, the enum property is not generated in the xml file. You can manually add enum to chart type definition xml file. Add enumProperty in chart type definition <enumProperty name="gridlineStyle"> <enumValues> <enumValue value="Solid"> <label ids="lblSolid">Solid</label> </enumValue> <enumValue value="LongDash"> <label ids="lblLongDash">Long Dash</label> </enumValue> <enumValue value="LongDashDot"> <label ids="lblLongDashDot">Long Dash Dot</label> </enumValue> <enumValue value="LongDash"> <label ids="lblLongDash">Long Dash</label> </enumValue> <enumValue value="ShortDash"> <label ids="lblShortDash">Short Dash</label> </enumValue> <enumValue value="ShortDashDot"> <label ids="lblShortDashDot">Short Dash Dot</label> </enumValue> </enumValues> <label ids="lblGridlineStyle">Gridline Style</label> <defaultValue>Solid</defaultValue> </enumProperty> 1 Results in Report Studio 2 lblDot=Dot lblLongDashDot=Long Dash Dot … Add string ID in string resource file
RAVE font Datatype RAVE font datatype definition { "id":"chartTitleFont", "required":false, "type":"font", "defaultValue": { "family":"Arial Unicode MS, Andale WT", "size":"9pt", "weight":"bold", "style":"normal" }, "resolution": [ { "method":"createOrSet", "target":"/titles[*]/style/font", "sourceParameter":"chartTitleFont" } ] }
RAVE font Datatype Font datatype definition default generation in chart type definition xml file. <fontProperty name="chartTitleFont" unit="px,%,cm,mm,pt,pc"> <label ids='lblChartTitleFont'/> <tooltip ids='tooltipChartTitleFont'/> <description ids="descChartTitleFont"/> <defaultFont family="Arial Unicode MS, Andale WT" size="9pt" weight="bold“ style="normal"/> </fontProperty>
RAVE font Datatype The font datatype results in the generation of the font dialog box in Report Studio
RAVE color Datatype RAVE color datatype definition { "id":"chartTitleColor", "required":false, "type":"color", "resolveOrder":1, "defaultValue":"#808080", "resolution": [ { "method":"createOrSet", "target":"/titles[*]/style/fill", "sourceParameter":"chartTitleColor" } ] }
RAVE color Datatype Color datatype definition default generation in chart type definition xml file. <colorProperty name="chartTitleColor"> <label ids='lblChartTitleColor'/> <tooltip ids='tooltipChartTitleColor'/> <description ids="descChartTitleColor"/> <defaultColor> <RGBA r="128" g="128" b="128"/> </defaultColor> </colorProperty>
RAVE color Datatype The color datatype results in the generation of the color dialog box in Report Studio
Work flow: Add parameters 1. Add parameters to JSON file
Work flow: Prepare your bundle • 2. Provide a unique name for the bundle. • 3. Click the Generate Viz Bundle Definition to create the Chart type Definition file. • 4. Properties that correspond to Parameters • have been created automatically in XML file. • 5. If necessary customize XML file for groups and enumerated lists. 2- Click • 3-
Work flow: Prepare your bundle • 6. Default strings will be created for the resource file. They can be customized. • 7. Save the bundle as the same name as the Bundle Name. • 8. Publish to the content store
Work flow: Final Result Results in Report Studio
RAVE palette Datatype This datatype is currently not supported with Cognos BI. There is a workaround by creating name palettes Note: it does not provide granular swatch changes { "id":"palette", "type":"string", "label":"Palette", "required":false, "description":"Set the palette.", "defaultValue":"Classic", "resolutionCases": [ { "resolutionCase":"Classic", "resolution": [ { "method":"set", "target":"/grammar[0]/elements[0]/color[0]/palette", "sourceValue": [ "#000066" ] } ] },