123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326 |
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <meta name="generator" content=
- "HTML Tidy for Windows (vers 1st July 2003), see www.w3.org">
- <title>Selection Context Library Test Page</title>
- <script language="javascript" src=
- "http://localhost/cognos8/cognoslaunch.js" type="text/javascript">
- </script>
- <script language="javascript" src=
- "http://localhost/cognos8/drill/utility.js" type="text/javascript">
- </script>
- <script language="javascript" src=
- "http://localhost/cognos8/drill/CSelectionContextBuilder.js" type=
- "text/javascript">
- </script>
- </head>
- <body>
- <script language="javascript" type="text/javascript">
- <!--
-
- function BuildBasicSelection()
- {
-
- var oSelectionContext = new CSelectionContext(document.getElementById("fModelPath").value);
-
- var oProdLine = oSelectionContext.addSelectedCell( "Product line",
- "[Great_Outdoors].[Products].[Products].[Product line]",
- "[Great_Outdoors].[Products].[Products].[Product line]->:[PC].[@MEMBER].[2103]",
- "memberUniqueName",
- "Personal Accessories");
-
- document.getElementById("fSC").value = oSelectionContext.toString();
- }
-
-
- function BuildNestedSelection()
- {
-
- var oSelectionContext = new CSelectionContext(document.getElementById("fModelPath").value);
-
- var oOrderMethod = oSelectionContext.addSelectedCell( "Order method type",
- "[Great_Outdoors].[Order method].[Order method].[Order method type]",
- "[Great_Outdoors].[Order method].[Order method].[Order method type]->:[PC].[@MEMBER].[603]",
- "memberUniqueName",
- "Mail");
-
- var oProdLine = oOrderMethod.addDefiningCell( "Product line",
- "[Great_Outdoors].[Products].[Products].[Product line]",
- "[Great_Outdoors].[Products].[Products].[Product line]->:[PC].[@MEMBER].[2103]",
- "memberUniqueName",
- "Personal Accessories");
-
-
- oProdLine.addProperty('ordinal', '2');
-
- document.getElementById("fSC").value = oSelectionContext.toString();
- }
-
-
- function BuildNestedMeasure()
- {
-
- var oSelectionContext = new CSelectionContext(document.getElementById("fModelPath").value);
-
- var oMeasure = oSelectionContext.addSelectedCell( "Quantity",
- "[Great_Outdoors].[Measures].[Quantity]",
- "500",
- "Decimal",
- "$500.00",
- "measure");
-
- var oProdType = oMeasure.addDefiningCell( "Product type",
- "[Great_Outdoors].[Products].[Products].[Product type]",
- "[Great_Outdoors].[Products].[Products].[Product type]->:[PC].[@MEMBER].[102]",
- "memberUniqueName",
- "Personal Accessories",
- "identifier");
-
- var oProdLine = oProdType.addDefiningCell( "Product line",
- "[Great_Outdoors].[Products].[Products].[Product line]",
- "[Great_Outdoors].[Products].[Products].[Product line]->:[PC].[@MEMBER].[2103]",
- "memberUniqueName",
- "Personal Accessories",
- "identifier");
-
- oMeasure.addDefiningCell( "Year",
- "[Great_Outdoors].[Time].[Time].[Year]",
- "[Great_Outdoors].[Time].[Time].[Year]->:[PC].[@MEMBER].[20050101-20051231]",
- "memberUniqueName",
- "2005",
- "identifier");
-
- document.getElementById("fSC").value = oSelectionContext.toString();
- }
-
- function BuildMultiSelectSameItemAtRoot()
- {
-
- var oSelectionContext = new CSelectionContext(document.getElementById("fModelPath").value);
-
- var oProdType = oSelectionContext.addSelectedCell( "Product type",
- "[Great_Outdoors].[Products].[Products].[Product type]",
- "[Great_Outdoors].[Products].[Products].[Product type]->:[PC].[@MEMBER].[102]",
- "memberUniqueName",
- "Tents");
-
- var oProdType2 = oSelectionContext.addSelectedCell( "Product type",
- "[Great_Outdoors].[Products].[Products].[Product type]",
- "[Great_Outdoors].[Products].[Products].[Product type]->:[PC].[@MEMBER].[104]",
- "memberUniqueName",
- "Packs");
-
- oProdType2.addProperty('LevelUniqueName', '[Great_Outdoors].[Products].[Products].[Product line]');
-
-
- document.getElementById("fSC").value = oSelectionContext.toString();
- }
-
-
- function BuildMultiSelectTwoChildrenSameParent()
- {
-
- var oSelectionContext = new CSelectionContext(document.getElementById("fModelPath").value);
-
- var oProdTypeTents = oSelectionContext.addSelectedCell( "Product type",
- "[Great_Outdoors].[Products].[Products].[Product type]",
- "[Great_Outdoors].[Products].[Products].[Product type]->:[PC].[@MEMBER].[102]",
- "memberUniqueName",
- "Personal Accessories");
-
- var oProdTypePacks = oSelectionContext.addSelectedCell( "Product type",
- "[Great_Outdoors].[Products].[Products].[Product type]",
- "[Great_Outdoors].[Products].[Products].[Product type]->:[PC].[@MEMBER].[104]",
- "memberUniqueName",
- "Packs");
-
- var oProdLine = oProdTypeTents.addDefiningCell( "Product line",
- "[Great_Outdoors].[Products].[Products].[Product line]",
- "[Great_Outdoors].[Products].[Products].[Product line]->:[PC].[@MEMBER].[2103]",
- "memberUniqueName",
- "Personal Accessories");
-
- oProdTypePacks.referenceDefiningCell(oProdLine);
-
-
- document.getElementById("fSC").value = oSelectionContext.toString();
- }
-
- function BuildMeasureBasedScope()
- {
-
- var oSelectionContext = new CSelectionContext(document.getElementById("fModelPath").value);
-
- var oQuantity = oSelectionContext.addSelectedCell( "Quantity",
- "[Great_Outdoors].[Measures].[Quantity]",
- "1000",
- "Decimal");
-
- document.getElementById("fSC").value = oSelectionContext.toString();
- }
-
- function LaunchGotoPage()
- {
- var sGateway = document.getElementById('fGateway').value;
- var sModelPath = document.getElementById('fModelPath').value;
- var sEncodedModelPath = sEncodedModelPath = encode64(document.getElementById('fModelPath').value);
- var sTool = "Goto2";
- var sDirectLaunch = "true";
- var sLang = "";
- var sRoutingServerGroup = "";
- var sEncExecutionParameters = "";
- var sAuthoredDrillthru = "";
- var sModeledDrillthru = "";
- var sDrillContext = document.getElementById('fSC').value;
-
- cognosLaunch('ui.gateway', sGateway,
- 'ui.tool', sTool,
- 'directLaunch', sDirectLaunch,
- 'lang', sLang,
- 'ui.routingServerGroup', sRoutingServerGroup,
- 'encExecutionParameters', sEncExecutionParameters,
- 'authoredDrillthru', sAuthoredDrillthru,
- 'modeledDrillthru', sModeledDrillthru,
- 'modelPath', sModelPath,
- 'drillContext', sDrillContext);
- }
- -->
- </script>
- <h1>Selection Context Library Test Page</h1>
- <h2>The following are values required to launch the Go To
- page...</h2>
- <table>
- <tr>
- <td>*Name:</td>
- <td><input type="text" name="fGateway" value=
- "http://localhost/cognos8/cgi-bin/cognos.cgi" size="100"></td>
- </tr>
- <tr>
- <td>*Model:</td>
- <td><input type="text" name="fModelPath" value=
- "/content/package[@name='sales and marketing cube']/model[last()]"
- size="100"></td>
- </tr>
- <tr>
- <td>Action:</td>
- <td><input type="text" name="fAction" value="filter" size="100" id=
- "Text1"></td>
- </tr>
- <tr>
- <td colspan="2" align="right">* denotes "Required"</td>
- </tr>
- </table>
- <h2>Produce example Selection Contexts using the Selection Context
- Builder Library...</h2>
- <table id="SelectionContextLibraryTable">
- <tr>
- <td colspan="2">=== Example 1: "Simple Selection" ====<br>
- OLAP Product Line = "Personal Accessories"<br>
- <button onclick="BuildBasicSelection()" id="Basic" type=
- "button">=== Example 1: "Simple Selection" ====</button></td>
- </tr>
- <tr>
- <td colspan="2">=== Example 2: "Single axis nested Selection
- ===<br>
- OLAP Product type = "Tents" nested under<br>
- OLAP Product Line = "Personal Accessories"<br>
- <button onclick="BuildNestedSelection()" id="Nested" type=
- "button">=== Example 2: "Single axis nested Selection
- ===</button></td>
- </tr>
- <tr>
- <td colspan="2">=== Example 3: Measure selection (with nested row
- axis) ===<br>
- Measure: Quantity<br>
- Rows: Product type = "Tents" nested under Product Line = "Personal
- Accessories"<br>
- Cols: Year = "2005"<br>
- <button onclick="BuildNestedMeasure()" id="Button2" type=
- "button">=== Example 3: Measure selection (with nested row axis)
- ===</button></td>
- </tr>
- <tr>
- <td colspan="2">=== Example 4: Multi select of same item at the
- root (or select) ===<br>
- Product type = "Tents"<br>
- Product type = "Packs"<br>
- <button onclick="BuildMultiSelectSameItemAtRoot()" id="Button1"
- type="button">=== Example 4: Multi select of same item at the
- selection root (or select) ===</button></td>
- </tr>
- <tr>
- <td colspan="2">=== Example 5: Multi select - two cells have the
- same defining cell ===<br>
- Product type = "Tents"<br>
- Product type = "Packs"<br>
- <button onclick="BuildMultiSelectTwoChildrenSameParent()" id=
- "Button4" type="button">=== Example 5: Multi select - two cells
- have the same defining cell ===</button></td>
- </tr>
- <tr>
- <td colspan="2">=== Example 6: Measure Based Scope ===<br>
- Quantity = "1000"<br>
- <button onclick="BuildMeasureBasedScope()" id="Button6" type=
- "button">=== Example 6: Measure Based Scope ===</button></td>
- </tr>
- <tr>
- <td width="74">Output<br>
- Selection<br>
- Context:</td>
- <td>
- <textarea rows="30" cols="100" name="fSC" id="fSC">
- </textarea></td>
- </tr>
- <tr>
- <td align="right" colspan="2"><b>Launch the goto page with this
- output selection context:<br>
- <button onclick="LaunchGotoPage()" id="Button3" type=
- "button">Launch Goto Page</button></b></td>
- </tr>
- </table>
- </body>
- </html>
|