Jump to: navigation, search

TestPDMSubjAreaQuery

This query template is the Cargo equivalent of Template:TestPDMSubjAreaDPL and the DPL in Template:TestPDMs_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:TestPDMTable, Template:TestPDMView, Template:TestPDMs_SubjectArea (for Library book pages), and Template:TestPDMTablePageFormat and Template:TestPDMSubjAreaPageFormat(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=TestPDMTable,TestPDMTable__subjectAreas,TestPDMs_SubjectArea
|join on=TestPDMTable._ID=TestPDMTable__subjectAreas._rowID,TestPDMTable.subjectAreas HOLDS TestPDMs_SubjectArea.subjectArea
|fields=CONCAT('[[Documentation:{{#explode:{{{page}}}|:|1}}:{{#explode:{{{page}}}|:|2}}:SubjArea-',TestPDMs_SubjectArea.subjectArea,':{{#explode:{{{page}}}|:|4}}|',TestPDMs_SubjectArea.subjectArea,']]',IF( (TestPDMs_SubjectArea.shortDesc IS NOT NULL),CONCAT(' &mdash; ',TestPDMs_SubjectArea.shortDesc),''))
|where=TestPDMTable._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 TestPDMs_SubjectArea._pageName LIKE CONCAT('Documentation:{{#switch:{{#explode:{{{page}}}|:|1}}|PSAAS=GIM|#default={{#explode:{{{page}}}|:|1}}}}:Library:SubjArea-',TestPDMs_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=TestPDMTable,TestPDMs_SubjectArea;join on=TestPDMTable.subjectAreas HOLDS TestPDMs_SubjectArea.subjectArea;fields=CONCAT('[[Documentation:{{#explode:{{{page}}}|:|1}}:{{#explode:{{{page}}}|:|2}}:Table-',IF(SUBSTRING(TestPDMTable.tableName,-1)="_",SUBSTRING(TestPDMTable.tableName,1,(LENGTH(TestPDMTable.tableName)-1)),TestPDMTable.tableName),':{{#explode:{{{page}}}|:|4}}|',TestPDMTable.tableName,']]')=Table/View,TestPDMTable.shortDesc=Description;where=TestPDMs_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 TestPDMTable._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=TestPDMView,TestPDMs_SubjectArea;join on=TestPDMView.subjectAreas HOLDS TestPDMs_SubjectArea.subjectArea;fields=CONCAT('[[Documentation:{{#explode:{{{page}}}|:|1}}:{{#explode:{{{page}}}|:|2}}:View-',IF(SUBSTRING(TestPDMView.viewName,-1)="_",SUBSTRING(TestPDMView.viewName,1,(LENGTH(TestPDMView.viewName)-1)),TestPDMView.viewName),':{{#explode:{{{page}}}|:|4}}|',TestPDMView.viewName,']] view')=Table/View,TestPDMView.shortDesc=Description;where=TestPDMs_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 TestPDMView._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 December 19, 2019, at 13:44.
Comments or questions about this documentation? Contact us for support!