# # ITSV GmbH # CCDB - Command and Control Database # # FILE: dquermfile_qryTextChildren.txt # DESCRIPTION: DQUERY definition for CCDB DQUERY "qryTextChildren" # @querytitle Untergeordnete Texte und Inhalt eines Texts anzeigen @querydescription zeigt zu einem Text (identifiziert mit seiner Text-ID) alle untergeordneten Texte und den Inhalt (alle Fragmente dieses Texts) an @group ADMINTEXTFRAG @paramnames parTextId:textid:{{parTextIdoptions}} @parTextIdoptions {"labeltext":"Parent Text-ID","typedesc":"Text-ID des Texts, dessen untergeordnete Texte abgefragt werden sollen"} @querytype dbselect # # SQL selects 3 types of rows (column "Teil"): # "03_Sub": one row for each distinct "ident" of text fragments having parTextId as parent # "02": a separation row # "01_Inhalt": one row for each text fragment having parTExtId as "ident" # @sql select distinct ident as "ID", ident as "Inhalt", parent as "ParentID", child_index as "Index", GROUP_CONCAT(frag_index) as "FragmentIndex", GROUP_CONCAT(distinct type) as "Typen", '' as "Daten", '' as "Aktionen", '03_Sub' as "Teil" from CCTEXTFRAG where parent=::parTextId:: group by ident, child_index UNION select '---'as "ID", '---' as "Inhalt", '---' as "ParentID", '---' as "Index", '---' as "FragmentIndex", '---' as "Typen", '---' as "Daten", '' as "Aktionen", '02' as "Teil" UNION select ident as "ID", ident as "Inhalt", parent as "ParentID", child_index as "Index", frag_index as "FragmentIndex", type as "Type", data as "Daten", '' as "Aktionen", '01_Inhalt' as "Teil" from CCTEXTFRAG where ident=::parTextId:: order by "Teil" asc, "Index" asc @decoration.debug false @decoration.decorate_colcell.0 $LINK:ident:identoptions @identoptions.qexpression logger.debug("qryTextChildren.0/identoptions.decoration: "+aux.objTxt({ row: resobj.row, cv: cv })); if (resobj.row.Teil=="02") { cv.tdattribs = "colspan=\"9\""; } else { cv.hyperlink = { href: "/dquery?dataname=qryTextChildren&parTextId="+resobj.row.ID, title: "Alle untergeordneten Text-Ids von "+resobj.row.ID+" anzeigen" }; cv.value = resobj.row.ID; } @decoration.decorate_colcell.1.hyperlink.href /dquery?dataname=textInfo&textid=@@row.ID@@ @decoration.decorate_colcell.1.hyperlink.title Information zu Text mit ID @@row.ID@@ anzeigen @decoration.decorate_colcell.1.value Inhalt @decoration.decorate_colcell.2 $TEXTAREA:parinput:parinputoptions @parinputoptions.rows 1 @parinputoptions.cols 15 @parinputoptions.qexpression logger.debug("qryTextChildren.2/parinputoptions.decoration: "+aux.objTxt({ row: resobj.row, token: token, opts: opts, sopts: sopts, copts: copts, addoptions: addoptions, cv: cv})); if (resobj.row.Teil=='03_Sub') { cv = { value: resobj.row.ParentID }; } else if (resobj.row.Teil=='02') { cv.doNotGenerate = true; } @decoration.decorate_colcell.3 $TEXTAREA:childindexinput:childindexinputoptions @childindexinputoptions.rows 1 @childindexinputoptions.cols 4 @childindexinputoptions.qexpression if (resobj.row.Teil=='03_Sub') { cv = { value: resobj.row.Index }; } else if (resobj.row.Teil=='02') { cv.doNotGenerate = true; } @decoration.decorate_colcell.4 $TEXTAREA:fragindexinput:fragindexinputoptions @fragindexinputoptions.rows 1 @fragindexinputoptions.cols 15 @fragindexinputoptions.qexpression if (resobj.row.Teil=='03_Sub') { cv = { value: resobj.row.FragmentIndex }; } else if (resobj.row.Teil=='02') { cv.doNotGenerate = true; } @decoration.decorate_colcell.5 $TEXTAREA:typeinput:typeinputoptions @typeinputoptions.rows 1 @typeinputoptions.cols 15 @typeinputoptions.qexpression if (resobj.row.Teil=='03_Sub') { cv = { value: resobj.row.Typen }; } else if (resobj.row.Teil=='02') { cv.doNotGenerate = true; } @decoration.decorate_colcell.6 $TEXTAREA:datainput:datainputoptions @datainputoptions.rows 1 @datainputoptions.cols 15 @datainputoptions.style font-family: monospace; @datainputoptions.qexpression if (resobj.row.Teil=='03_Sub') { cv = { value: resobj.row.Daten }; } else if (resobj.row.Teil=='02') { cv.doNotGenerate = true; } @decoration.decorate_colcell.7.doNotGenerate true @decoration.decorate_colcell.8.doNotGenerate true @decoration.decorate_colcell.9.doNotGenerate true @post_query that.nd=new Date(); that.result.setResultAttribute('nowdate',that.nd.getFullYear()+"-"+aux.DEC(that.nd.getMonth()+1,2)); let acn = that.result.findColumn("Aktionen"); let tcn = that.result.findColumn("Type"); let dcn = that.result.findColumn("Daten"); let crow, trow, parUpId=null, rawhtml, type; for (let i=0; i=0) { trow = that.result.getRowObject(i,"value"); rawhtml = ""+ ""; if (crow.Teil=="01_Inhalt") { rawhtml += " "+ ""; } that.result.setCellValue(i,acn,"rawhtml",rawhtml); } } that.result.parUpId = parUpId; @title Untergeordnete Texte und Inhalt von [[parTextId]] @toptext

Weitere Aktionen