Jump to: navigation, search

GIMTranscludeForCloud

Template to streamline transclusion of content from the GIM docs (mainly PDM) to the Cloud. The template transcludes content from a Library book page with the same topic name, with the Library book version determined by the version of the transcluding page.

The template was modified in November 2019 to avoid use of Ponydocs variables and, following GIM's move to 9.0, hard-code the versions for the GIM source page as DRAFT, PDMSource, or Current, as applicable. The template was further modified in December 2019 to reproduce the content of Template:TestPDMPageQuery, for use with the refactored PDM templates.

Content of the template used to be:

{{#if:{{{doc|}}}|{{Documentation:GIM:{{{doc}}}:{{#explode:{{FULLPAGENAME}}|:|3}}:{{#switch:{{#explode:{{FULLPAGENAME}}|:|4}}|draft=DRAFT|Public=Current}}}}|{{Documentation:GIM:Library:{{#if:{{{page|}}}|{{{page}}}|{{#explode:{{FULLPAGENAME}}|:|3}}}}:{{#switch:{{#explode:{{FULLPAGENAME}}|:|4}}|draft=DRAFT|Public=PDMSource}}}}}}

New temporary content is:

{{#switch:{{#explode:{{#explode:{{FULLPAGENAME}}|:|3}}|-|0}}
|Table=<!-- Query to populate Table pages-->
{{#cargo_query:
tables=PDMTable
|fields=_pageName=pageName,tableName=tableName,tableDesc=tableDesc,subjectAreas=subjectAreas,dbSchema=dbSchema,introduced=introduced,modified=modified,discontinued=discontinued,tableGroup=group,dataExport=dataExport,partitioned=partitioned,CONCAT('{{FULLPAGENAME}}')=page
|where=_pageName LIKE "{{#if:{{{source|}}}|{{{source}}}|Documentation:{{#switch:{{#explode:{{FULLPAGENAME}}|:|1}}|PSAAS=GIM:Library:{{#explode:{{FULLPAGENAME}}|:|3}}:{{#switch:{{#explode:{{FULLPAGENAME}}|:|4}}|draft=DRAFT|Public=PDMSource}}
|#default={{#explode:{{FULLPAGENAME}}|:|1}}:Library:{{anchorencode:{{#explode:{{FULLPAGENAME}}|:|3}}}}:{{#switch:{{lc:{{#sub:{{FULLPAGENAME}}|-5}}}}|draft|ource={{#explode:{{FULLPAGENAME}}|:|4}}|#default={{#switch:{{lc:{{#explode:{{FULLPAGENAME}}|:|4}}}}|public|current=PDMSource|#default={{#sub:{{#explode:{{FULLPAGENAME}}|:|4}}|0|3}}PDMSource}}}}}}}}"
|format=template
|template=PDMTablePageFormat
|default=This table is reserved.
|named args=yes
}}
|Schema=<!--Query to populate Schema pages-->
{{#cargo_query:
tables=PDMSchema
|fields=_pageName=pageName,schemaName=schemaName,schemaDesc=schemaDesc,priority=priority,diagram=diagram,caption=caption,diagramComment=diagramComment,CONCAT('{{FULLPAGENAME}}')=page
|where=_pageName LIKE "{{#if:{{{source|}}}|{{{source}}}|Documentation:{{#explode:{{FULLPAGENAME}}|:|1}}:Library:{{anchorencode:{{#explode:{{FULLPAGENAME}}|:|3}}}}:{{#switch:{{lc:{{#sub:{{FULLPAGENAME}}|-5}}}}|draft|ource={{#explode:{{FULLPAGENAME}}|:|4}}|#default={{#switch:{{lc:{{#explode:{{FULLPAGENAME}}|:|4}}}}|public|current=PDMSource|#default={{#sub:{{#explode:{{FULLPAGENAME}}|:|4}}|0|3}}PDMSource}}}}}}"
|format=template
|template=PDMSchemaPageFormat
|order by=priority
|named args=yes
}}
|View=<!-- Query to populate View pages-->
{{#cargo_query:
tables=PDMView
|fields=_pageName=pageName,viewName=viewName,viewDesc=viewDesc,subjectAreas=subjectAreas,introduced=introduced,modified=modified,discontinued=discontinued,dataExport=dataExport,SQLQuery=SQLQuery,CONCAT('{{FULLPAGENAME}}')=page
|where=_pageName LIKE "{{#if:{{{source|}}}|{{{source}}}|Documentation:{{#switch:{{#explode:{{FULLPAGENAME}}|:|1}}|PSAAS=GIM:Library:{{#explode:{{FULLPAGENAME}}|:|3}}:{{#switch:{{#explode:{{FULLPAGENAME}}|:|4}}|draft=DRAFT|Public=PDMSource}}
|#default={{#explode:{{FULLPAGENAME}}|:|1}}:Library:{{anchorencode:{{#explode:{{FULLPAGENAME}}|:|3}}}}:{{#switch:{{lc:{{#sub:{{FULLPAGENAME}}|-5}}}}|draft|ource={{#explode:{{FULLPAGENAME}}|:|4}}|#default={{#switch:{{lc:{{#explode:{{FULLPAGENAME}}|:|4}}}}|public|current=PDMSource|#default={{#sub:{{#explode:{{FULLPAGENAME}}|:|4}}|0|3}}PDMSource}}}}}}}}"
|format=template
|template=PDMViewPageFormat
|named args=yes
}}
|SubjArea=<!-- Query to populate Subject Area pages-->
{{#cargo_query:
tables=PDMs_SubjectArea
|fields=_pageName=pageName,subjectArea=subjectArea,description=description,diagram=diagram,CONCAT('{{FULLPAGENAME}}')=page
|where=_pageName LIKE "{{#if:{{{source|}}}|{{{source}}}|Documentation:{{#switch:{{#explode:{{FULLPAGENAME}}|:|1}}|PSAAS=GIM:Library:{{#explode:{{FULLPAGENAME}}|:|3}}:{{#switch:{{#explode:{{FULLPAGENAME}}|:|4}}|draft=DRAFT|Public=PDMSource}}
|#default={{#explode:{{FULLPAGENAME}}|:|1}}:Library:{{anchorencode:{{#explode:{{FULLPAGENAME}}|:|3}}}}:{{#switch:{{lc:{{#sub:{{FULLPAGENAME}}|-5}}}}|draft|ource={{#explode:{{FULLPAGENAME}}|:|4}}|#default={{#switch:{{lc:{{#explode:{{FULLPAGENAME}}|:|4}}}}|public|current=PDMSource|#default={{#sub:{{#explode:{{FULLPAGENAME}}|:|4}}|0|3}}PDMSource}}}}}}}}"
|format=template
|template=PDMSubjAreaPageFormat
|named args=yes
}}
|InfoMartReferences={{PDMRefQuery|page={{FULLPAGENAME}}}}
|#default=<!-- Default is to transclude the equivalent Library book page for the applicable version-->
{{Documentation:{{#switch:{{#explode:{{FULLPAGENAME}}|:|1}}|PSAAS=GIM|#default={{#explode:{{FULLPAGENAME}}|:|1}}}}:{{#if:{{{doc|}}}|{{{doc}}}|Library}}:{{#explode:{{FULLPAGENAME}}|:|3}}:{{#switch:{{lc:{{#explode:{{FULLPAGENAME}}|:|4}}}}|public|current={{#if:{{{doc|}}}|Current|PDMSource}}|{{#switch:{{lc:{{#sub:{{FULLPAGENAME}}|-5}}}}|draft={{#if:{{{doc|}}}|DRAFT|{{#explode:{{FULLPAGENAME}}|:|4}}}}|#default={{#sub:{{#explode:{{FULLPAGENAME}}|:|4}}|0|3}}PDMSource}}}}}}
}}


Documentation:GIMTranscludeForCloud:Library::PDMSource

This page was last edited on June 23, 2022, at 21:03.
Comments or questions about this documentation? Contact us for support!