Template: PDMListQuery

From Genesys Documentation
Jump to: navigation, search

This template provides the queries for various lists. The query requires an object to be specified, and supports a number of optional parameters that further filter or format the resulting lists:

  • group
  • withDesc
  • format
  • addFilter (currently in the where condition for tables and views only)

The template has been modified from the one originally developed for Ponydocs, apart from anything else because it no longer needs to cover ICON.

Content is:

{{#switch:{{{object}}}
|Table=<!-- Lists of tables with shortdesc (in table format) and without shortdesc (in bullet format)-->
{{#switch:{{{withDesc}}}
|yes={{#css: th.field_Description {width:70%;} }}
{{#cargo_query:
tables=PDMTable
|fields=CONCAT('[[',REPLACE("{{{page}}}",'{{#explode:{{{page}}}|/|3}}',SUBSTRING_INDEX(_pageName,'/',-1)),'|',REPLACE(tableName,"_","_<wbr/>"),']]')=Table,shortDesc=Description
|where=_pageName LIKE "{{#switch:{{MINTYDOCSVERSION}}|Library={{#replace:{{{page}}}|{{#explode:{{{page}}}|/|3}}|%%}}|Current|#default={{#explode:{{{page}}}|/|0}}/Library/PDMLibrary{{#sub:{{#explode:{{anchorencode:{{#explode:{{{page}}}|/|2}}}}|_|0}}|5|3}}/%%}}"{{#switch:{{{group}}}|fact= AND tableName LIKE "%_FACT%"|dimension= AND tableName NOT LIKE "%_FACT%" AND tableName NOT LIKE "CTL_%%" AND tableName NOT LIKE "STG_%%" AND tableName NOT LIKE "IRF_USER_DATA_%%_1" AND tableName NOT LIKE "GIDB_%%"|dimensionalModel= AND tableName NOT LIKE "CTL_%%" AND tableName NOT LIKE "STG_%%" AND tableName NOT LIKE "GIDB_%%"|control= AND tableName LIKE "CTL_%%"|staging= AND tableName LIKE "STG_%%"|GIDB= AND tableName LIKE "GIDB_%%"|#default=}}{{#if:{{{addFilter|}}}|{{{addFilter}}}|}}
|limit=1000
|format=table
|named args=yes
}}
|no
|#default={{#cargo_query:
tables=PDMTable
|fields=CONCAT('[[',REPLACE("{{{page}}}",'{{#explode:{{{page}}}|/|3}}',SUBSTRING_INDEX(_pageName,'/',-1)),'|',REPLACE(tableName,"_","_<wbr/>"),']]')
|where=_pageName LIKE "{{#switch:{{MINTYDOCSVERSION}}|Library={{#replace:{{{page}}}|{{#explode:{{{page}}}|/|3}}|%%}}|Current|#default={{#explode:{{{page}}}|/|0}}/Library/PDMLibrary{{#sub:{{#explode:{{anchorencode:{{#explode:{{{page}}}|/|2}}}}|_|0}}|5|3}}/%%}}"{{#switch:{{{group}}}|fact= AND tableName LIKE "%_FACT%"|dimension= AND tableName NOT LIKE "%_FACT%" AND tableName NOT LIKE "CTL_%%" AND tableName NOT LIKE "STG_%%" AND tableName NOT LIKE "IRF_USER_DATA_%%_1" AND tableName NOT LIKE "GIDB_%%"|dimensionalModel= AND tableName NOT LIKE "CTL_%%" AND tableName NOT LIKE "STG_%%" AND tableName NOT LIKE "GIDB_%%"|control= AND tableName LIKE "CTL_%%"|staging= AND tableName LIKE "STG_%%"|GIDB= AND tableName LIKE "GIDB_%%"|#default=}}{{#if:{{{addFilter|}}}|{{{addFilter}}}|}}
|limit=1000
|format=ul
}}
}}
|View=<!-- Lists of views with shortdesc (in table format) and without shortdesc (in bullet format)-->
{{#switch:{{{withDesc}}}
|yes={{#css: th.field_Description {width:70%;} }}
{{#cargo_query:
tables=PDMView
|fields=CONCAT('[[',REPLACE("{{{page}}}",'{{#explode:{{{page}}}|/|3}}',SUBSTRING_INDEX(_pageName,'/',-1)),'|',REPLACE(viewName,"_","_<wbr/>"),']]')=View,shortDesc=Description
|where=_pageName LIKE "{{#switch:{{MINTYDOCSVERSION}}|Library={{#replace:{{{page}}}|{{#explode:{{{page}}}|/|3}}|%%}}|Current|#default={{#explode:{{{page}}}|/|0}}/Library/PDMLibrary{{#sub:{{#explode:{{anchorencode:{{#explode:{{{page}}}|/|2}}}}|_|0}}|5|3}}/%%}}" AND viewName NOT LIKE "CDR%%"{{#switch:{{{group}}}|admin= AND (viewName LIKE "Admin_%%" OR viewName LIKE "CTL_%%")|dimensionalModel= AND viewName NOT LIKE "Admin_%%" AND viewName NOT LIKE "CTL_%%"|#default=}}{{#if:{{{addFilter|}}}|{{{addFilter}}}|}}
|limit=1000
|format=table
|named args=yes
}}
|no
|#default={{#cargo_query:
tables=PDMView
|fields=CONCAT('[[',REPLACE("{{{page}}}",'{{#explode:{{{page}}}|/|3}}',SUBSTRING_INDEX(_pageName,'/',-1)),'|',REPLACE(viewName,"_","_<wbr/>"),']]')
|where=_pageName LIKE "{{#switch:{{MINTYDOCSVERSION}}|Library={{#replace:{{{page}}}|{{#explode:{{{page}}}|/|3}}|%%}}|Current|#default={{#explode:{{{page}}}|/|0}}/Library/PDMLibrary{{#sub:{{#explode:{{anchorencode:{{#explode:{{{page}}}|/|2}}}}|_|0}}|5|3}}/%%}}" AND viewName NOT LIKE "CDR%%"{{#switch:{{{group}}}|admin= AND (viewName LIKE "Admin_%%" OR viewName LIKE "CTL_%%")|dimensionalModel= AND viewName NOT LIKE "Admin_%%" AND viewName NOT LIKE "CTL_%%"|#default=}}{{#if:{{{addFilter|}}}|{{{addFilter}}}|}}
|limit=1000
|format=ul
}}
}}
|SubjArea=<!-- Lists of subject areas with shortdesc (in table format) and without shortdesc (in bullet format)-->
{{#switch:{{{withDesc}}}
|yes={{#cargo_query:
tables=PDMs_SubjectArea
|fields=CONCAT('[[',REPLACE("{{{page}}}",'{{#explode:{{{page}}}|/|3}}',SUBSTRING_INDEX(_pageName,'/',-1)),'|',REPLACE(subjectArea,"_","_<wbr/>"),']]')=Subject Area,shortDesc=Description
|where=_pageName LIKE "{{#switch:{{MINTYDOCSVERSION}}|Library={{#replace:{{{page}}}|{{#explode:{{{page}}}|/|3}}|%%}}|Current|#default={{#explode:{{{page}}}|/|0}}/Library/PDMLibrary{{#sub:{{#explode:{{anchorencode:{{#explode:{{{page}}}|/|2}}}}|_|0}}|5|3}}/%%}}"
|limit=1000
|format=table
|named args=yes
}}
|no
|#default={{#cargo_query:
tables=PDMs_SubjectArea
|fields=CONCAT('[[',REPLACE("{{{page}}}",'{{#explode:{{{page}}}|/|3}}',SUBSTRING_INDEX(_pageName,'/',-1)),'|',REPLACE(subjectArea,"_","_<wbr/>"),']]')
|where=_pageName LIKE "{{#switch:{{MINTYDOCSVERSION}}|Library={{#replace:{{{page}}}|{{#explode:{{{page}}}|/|3}}|%%}}|Current|#default={{#explode:{{{page}}}|/|0}}/Library/PDMLibrary{{#sub:{{#explode:{{anchorencode:{{#explode:{{{page}}}|/|2}}}}|_|0}}|5|3}}/%%}}"
|limit=1000
|format=ul
}}
}}
|Index=<!-- Lists of indexes in table format with shortdesc (used in GIM) -->
{{#css: td.field_U {text-align: center} td.field_C {text-align: center} }}
{{#cargo_query:
tables=PDMIndexItem,PDMTable
|join on=PDMIndexItem._pageName=PDMTable._pageName
|fields=CONCAT('[[',REPLACE("{{{page}}}",'{{#explode:{{{page}}}|/|3}}',SUBSTRING_INDEX(PDMIndexItem._pageName,'/',-1)),'|',REPLACE(PDMTable.tableName,"_","_<wbr/>"),']]')=Table,PDMIndexItem.indexName=Index,IF( LCASE(PDMIndexItem.isUnique)="yes",CONCAT('X'),'')=U,PDMIndexItem.indexDesc=Description
|where=PDMIndexItem._pageName LIKE "{{#switch:{{MINTYDOCSVERSION}}|Library={{#replace:{{{page}}}|{{#explode:{{{page}}}|/|3}}|%%}}|Current|#default={{#explode:{{{page}}}|/|0}}/Library/PDMLibrary{{#sub:{{#explode:{{anchorencode:{{#explode:{{{page}}}|/|2}}}}|_|0}}|5|3}}/%%}}"
|format=dynamic table
|order by=PDMTable.tableName
|limit=5000
|rows per page=150
}}
}}
Retrieved from "https://all.docs.genesys.com/Template:PDMListQuery (2024-04-19 19:04:56)"