# # ITSV GmbH # CCDB - Command and Control Database # # FILE: dquermfile_mfiles.txt # DESCRIPTION: DQUERY definition for CCDB DQUERY "mfiles" # @querytitle Managed files anzeigen @querydescription @group DATAFILE # @attributenames searchstring:string:{{searchstringoptions}},lpath:mfilelpath:{{lpathoptions}},mfiletype:mfiletype:{{mfiletypeoptions}},mfileattribs:string:{{mfileattribsoptions}},addwhereclause:string:{{addwhereclauseoptions}} @attributenames lpath:mfilelpath:{{lpathoptions}},mfiletype:mfiletype:{{mfiletypeoptions}},mfileattribs:string:{{mfileattribsoptions}},addwhereclause:string:{{addwhereclauseoptions}} @searchstringoptions.labeltext Suchbegriff @searchstringoptions.typedesc Ein Teil des Namens, der ID oder der Attribut-Definitionen, nach dem Managed files ausgesucht werden sollen @searchstringoptions.check_qexpression /* this is dummy code, it does not (yet) work */ if (qryatt.is_optional) return true; @lpathoptions {"labeltext":"logischer Pfad","typedesc":"Logischer Verzeichnispfad, aus dem managed files angezeigt werden sollen","is_optional":"true"} @mfiletypeoptions {"labeltext":"Managed File Type","typedesc":"Type der Managed Files, die angezeigt werden sollen","is_optional":"true"} @mfileattribsoptions {"labeltext":"Attribute","typedesc":"Wert des MFILEATTRIBS-Felds für die auszuwählenden managed-File Einträge","is_optional":"true"} @addwhereclauseoptions {"labeltext":"Auswahlbedingungen","typedesc":"SQL-where Ausdruck zur Einschränkung der Auswahl","is_optional":"true"} @querytype dbselect @toptext @pre_query that.query.whereclause = ""; that.query.wcactive = false; if (that.query.lpath) { that.query.lpath = that.query.lpath.trim(); if (that.query.lpath.substring(0,5).toUpperCase()=='WHERE') that.query.lpath = that.query.lpath.substring(5); if (!that.query.wcactive) that.query.whereclause = "WHERE "; that.query.whereclause += "(MFILELPATH='"+that.query.lpath+"')"; that.query.wcactive = true; that.query.title += " auf logischem Pfad \""+that.query.lpath+"\""; } if (that.query.mfiletype) { that.query.mfiletype = that.query.mfiletype.trim(); if (that.query.mfiletype.substring(0,5).toUpperCase()=='WHERE') that.query.mfiletype = that.query.mfiletype.substring(5); if (that.query.wcactive) { that.query.whereclause += " and "; } else { that.query.whereclause = "WHERE "; } that.query.whereclause += "(MFILETYPE='"+that.query.mfiletype+"')"; that.query.wcactive = true; that.query.title += " der Type "+that.query.mfiletype; } if (that.query.mfileattribs) { logger.debug("MFILES.UDBG.filter.mfileattribs="+that.query.mfileattribs); that.query.mfileattribs = that.query.mfileattribs.trim(); if (that.query.mfileattribs.substring(0,5).toUpperCase()=='WHERE') that.query.mfileattribs = that.query.mfileattribs.substring(5); if (that.query.wcactive) { that.query.whereclause += " and "; } else { that.query.whereclause = "WHERE "; } that.query.whereclause += "(MFILEATTRIBS='"+that.query.mfileattribs+"')"; that.query.wcactive = true; that.query.title += " mit Attributen \""+that.query.mfileattribs+"\""; } if (that.query.addwhereclause) { that.query.addwhereclause = that.query.addwhereclause.trim(); if (that.query.addwhereclause.substring(0,5).toUpperCase()=='WHERE') that.query.addwhereclause = that.query.addwhereclause.substring(5); if (that.query.wcactive) { that.query.whereclause += " and "; } else { that.query.whereclause = "WHERE "; } that.query.whereclause += "(" + that.query.addwhereclause + ")"; that.query.wcactive = true; that.query.title += " mit Bedingung\"( "+that.query.addwhereclause+")\"" } @sql_mysql select mfileid as "Managed File ID", mfiletype as "Managed File Type", mfilename as "Ursprünglicher Dateiname", mfilepath as "Speicherpfad", mfilelpath as "Logischer Pfad", mfileattribs as "Attribute (JSON-Format)", mfileid as "Auswahl" from CCMFILES {{whereclause}} order by "Managed File ID" asc @options.notranslate true @post_query proc: { let escaped_whereclause = that.query.whereclause.replace(/\"/g,'"'); that.result.toptext = that.query.toptext + "
ERROR: could not find column \"Managed File Type\" in Result of managed files listing
"; break proc; } for (let ri=0; ri