PDMSubjAreaQuery
This query template is the Cargo equivalent of Template:PDMSubjAreaDPL and the DPL in Template:PDMs_SubjectArea and the supplementary templates they used to provide the list of subject areas on table and view pages and the list of tables and views on subject area pages in the customer-facing docs. It switches on the prefix in the topic name to identify which query to use.
This template is called by Template:PDMTable, Template:PDMView, Template:PDMs_SubjectArea (for Library book pages), and Template:PDMTablePageFormat and Template:PDMSubjAreaPageFormat(for RDBMS-specific pages).
Content is:
{{#switch:{{#explode:{{#explode:{{{page}}}|:|3}}|-|0}}
|Table=<!--Generate the list of subject areas on Table pages-->
{{#cargo_query:
tables=PDMTable,PDMTable__subjectAreas,PDMs_SubjectArea
|join on=PDMTable._ID=PDMTable__subjectAreas._rowID,PDMTable.subjectAreas HOLDS PDMs_SubjectArea.subjectArea
|fields=CONCAT('[[Documentation:{{#explode:{{{page}}}|:|1}}:{{#explode:{{{page}}}|:|2}}:SubjArea-',PDMs_SubjectArea.subjectArea,':{{#explode:{{{page}}}|:|4}}|',PDMs_SubjectArea.subjectArea,']]',IF( (PDMs_SubjectArea.shortDesc IS NOT NULL),CONCAT(' — ',PDMs_SubjectArea.shortDesc),''))
|where=PDMTable._pageName LIKE "{{#if:{{{source|}}}|{{{source}}}|Documentation:{{#switch:{{#explode:{{{page}}}|:|1}}|PSAAS=GIM:Library:{{#explode:{{{page}}}|:|3}}:{{#switch:{{#explode:{{{page}}}|:|4}}|draft=DRAFT|Public=PDMSource}}|#default={{#explode:{{{page}}}|:|1}}:Library:{{anchorencode:{{#explode:{{{page}}}|:|3}}}}:{{#switch:{{lc:{{#sub:{{{page}}}|-5}}}}|draft|ource={{#explode:{{{page}}}|:|4}}|#default={{#switch:{{lc:{{#explode:{{{page}}}|:|4}}}}|public|current=PDMSource|#default={{#sub:{{#explode:{{{page}}}|:|4}}|0|3}}PDMSource}}}}}}}}" AND PDMs_SubjectArea._pageName LIKE CONCAT('Documentation:{{#switch:{{#explode:{{{page}}}|:|1}}|PSAAS=GIM|#default={{#explode:{{{page}}}|:|1}}}}:Library:SubjArea-',PDMs_SubjectArea.subjectArea,':{{#switch:{{lc:{{#sub:{{{page}}}|-5}}}}|draft|ource={{#explode:{{{page}}}|:|4}}|#default={{#switch:{{lc:{{#explode:{{{page}}}|:|4}}}}|public|current=PDMSource|#default={{#sub:{{#explode:{{{page}}}|:|4}}|0|3}}PDMSource}}}}')
|default=No subject area information available.
|format=ul
}}
|View=<!--Current display does not require the list of subject areas on View pages-->
|SubjArea=<!--Generate the list of tables/views on Subject Area pages-->
{{#cargo_compound_query:
tables=PDMTable,PDMs_SubjectArea;join on=PDMTable.subjectAreas HOLDS PDMs_SubjectArea.subjectArea;fields=CONCAT('[[Documentation:{{#explode:{{{page}}}|:|1}}:{{#explode:{{{page}}}|:|2}}:Table-',IF(SUBSTRING(PDMTable.tableName,-1)="_",SUBSTRING(PDMTable.tableName,1,(LENGTH(PDMTable.tableName)-1)),PDMTable.tableName),':{{#explode:{{{page}}}|:|4}}|',PDMTable.tableName,']]')=Table/View,PDMTable.shortDesc=Description;where=PDMs_SubjectArea._pageName LIKE "{{#if:{{{source|}}}|{{{source}}}|Documentation:{{#switch:{{#explode:{{{page}}}|:|1}}|PSAAS=GIM|#default={{#explode:{{{page}}}|:|1}}}}:Library:{{anchorencode:{{#explode:{{{page}}}|:|3}}}}:{{#switch:{{lc:{{#sub:{{{page}}}|-5}}}}|draft|ource={{#explode:{{{page}}}|:|4}}|#default={{#switch:{{lc:{{#explode:{{{page}}}|:|4}}}}|public|current=PDMSource|#default={{#sub:{{#explode:{{{page}}}|:|4}}|0|3}}PDMSource}}}}}}" AND PDMTable._pageName LIKE "Documentation:{{#switch:{{#explode:{{{page}}}|:|1}}|PSAAS=GIM|#default={{#explode:{{{page}}}|:|1}}}}:Library:%%:{{#switch:{{lc:{{#sub:{{{page}}}|-5}}}}|draft|ource={{#explode:{{{page}}}|:|4}}|#default={{#switch:{{lc:{{#explode:{{{page}}}|:|4}}}}|public|current=PDMSource|#default={{#sub:{{#explode:{{{page}}}|:|4}}|0|3}}PDMSource}}}}"
|tables=PDMView,PDMs_SubjectArea;join on=PDMView.subjectAreas HOLDS PDMs_SubjectArea.subjectArea;fields=CONCAT('[[Documentation:{{#explode:{{{page}}}|:|1}}:{{#explode:{{{page}}}|:|2}}:View-',IF(SUBSTRING(PDMView.viewName,-1)="_",SUBSTRING(PDMView.viewName,1,(LENGTH(PDMView.viewName)-1)),PDMView.viewName),':{{#explode:{{{page}}}|:|4}}|',PDMView.viewName,']] view')=Table/View,PDMView.shortDesc=Description;where=PDMs_SubjectArea._pageName LIKE "{{#if:{{{source|}}}|{{{source}}}|Documentation:{{#switch:{{#explode:{{{page}}}|:|1}}|PSAAS=GIM|#default={{#explode:{{{page}}}|:|1}}}}:Library:{{anchorencode:{{#explode:{{{page}}}|:|3}}}}:{{#switch:{{lc:{{#sub:{{{page}}}|-5}}}}|draft|ource={{#explode:{{{page}}}|:|4}}|#default={{#switch:{{lc:{{#explode:{{{page}}}|:|4}}}}|public|current=PDMSource|#default={{#sub:{{#explode:{{{page}}}|:|4}}|0|3}}PDMSource}}}}}}" AND PDMView._pageName LIKE "Documentation:{{#switch:{{#explode:{{{page}}}|:|1}}|PSAAS=GIM|#default={{#explode:{{{page}}}|:|1}}}}:Library:%%:{{#switch:{{lc:{{#sub:{{{page}}}|-5}}}}|draft|ource={{#explode:{{{page}}}|:|4}}|#default={{#switch:{{lc:{{#explode:{{{page}}}|:|4}}}}|public|current=PDMSource|#default={{#sub:{{#explode:{{{page}}}|:|4}}|0|3}}PDMSource}}}}"
|format=table
}}
|#default=}}
This page was last edited on January 3, 2020, at 19:49.
Comments or questions about this documentation? Contact us for support!