B4A.UTIL.DOCU.BODY-DEPENDENCY-CHECK
Summary
%{XML2ATTR,PREFIX=xml,KEY=::}
%{SCRIPT:groovy: def deps = $attributes.xml.best4Automic.pm.package.dependencies instanceof String ? [] : $attributes.xml.best4Automic.pm.package.dependencies.dependency
def status = [
OK : 0,
FAILED : 0,
MISSING : 0
]
if ( deps instanceof HashMap )
deps = [ deps ]
for ( dep in deps ) {
status[ dep.status ] += 1
}
def errors = status.FAILED + status.MISSING > 0
$output.append( """\
Summary
Status | Count |
---|---|
Correct | $status.OK |
Failed | $status.FAILED |
Missing | $status.MISSING |
$output.append( "<h1>Errors in Dependency Check</h1>" )
def filteredDeps = deps.findAll{ it.status.equals( "MISSING" ) }
if ( filteredDeps.size() > 0 ) {
$output.append( "<h2>Missing Packages</h2><table><tr><th>Package</th></tr>" )
for ( dep in filteredDeps ) {
$output.append( "<tr><td>$dep.package</td></tr>" )
}
}
$output.append( "</table>" )
filteredDeps = deps.findAll{ it.status.equals( "FAILED" ) }
if ( filteredDeps.size() > 0 ) {
$output.append( "<h2>Wrong Package Version installed</h2><table><tr><th>Package</th><th>Operator</th><th>Version</th><th>Installed Version</th></tr>" )
for ( dep in filteredDeps ) {
$output.append( "<tr><td>$dep.package</td>$dep.operator<td><td>$dep.version</td><td>$dep.installed.version</td></tr>" )
}
}
$output.append( "</table>" )
}
- Object type
- DOCU
- Object Folder
- PACKAGES/BEST4AUTOMIC/B4A.UTIL/CONFIG
- Title
- mail body for pm.DependencyDefinitionVerify
- Archive Key 1
- -
- Archive Key 2
- -
- Created
- WRITER/B4A am: 2024-01-09 10:32:28
- Last Modified
- WRITER/B4A am: 2024-01-09 10:32:28 1 x
- Last Used
- -
Text Documentation
%{XML2ATTR,PREFIX=xml,KEY=%(custom.key):%(custom.variable):}
%{SCRIPT:groovy: def deps = $attributes.xml.best4Automic.pm.package.dependencies instanceof String ? [] : $attributes.xml.best4Automic.pm.package.dependencies.dependency
def status = [
OK : 0,
FAILED : 0,
MISSING : 0
]
if ( deps instanceof HashMap )
deps = [ deps ]
for ( dep in deps ) {
status[ dep.status ] += 1
}
def errors = status.FAILED + status.MISSING > 0
$output.append( """\
Summary
Status | Count |
---|---|
Correct | $status.OK |
Failed | $status.FAILED |
Missing | $status.MISSING |
$output.append( "<h1>Errors in Dependency Check</h1>" )
def filteredDeps = deps.findAll{ it.status.equals( "MISSING" ) }
if ( filteredDeps.size() > 0 ) {
$output.append( "<h2>Missing Packages</h2><table><tr><th>Package</th></tr>" )
for ( dep in filteredDeps ) {
$output.append( "<tr><td>$dep.package</td></tr>" )
}
}
$output.append( "</table>" )
filteredDeps = deps.findAll{ it.status.equals( "FAILED" ) }
if ( filteredDeps.size() > 0 ) {
$output.append( "<h2>Wrong Package Version installed</h2><table><tr><th>Package</th><th>Operator</th><th>Version</th><th>Installed Version</th></tr>" )
for ( dep in filteredDeps ) {
$output.append( "<tr><td>$dep.package</td>$dep.operator<td><td>$dep.version</td><td>$dep.installed.version</td></tr>" )
}
}
$output.append( "</table>" )
}
XML Documentation