Skip to main content

B4A.UTIL.DOCU.BODY-DEPENDENCY-CHECK

Description

Details

PropertyValue
TypeDOCU
FolderPACKAGES/BEST4AUTOMIC/B4A.UTIL/CONFIG
Titlemail body for pm.DependencyDefinitionVerify
Archive Key 1-
Archive Key 2-
CreatedTimon Schnakenberg am: 2024-01-05 15:47:05
Last ModifiedTimon Schnakenberg am: 2024-01-05 15:47:11 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( """\
<h1>Summary</h1><table><tr><th>Status</th><th>Count</th></tr><tr><td>Correct</td><td>$status.OK</td></tr><tr><td>Failed</td><td>$status.FAILED</td></tr><tr><td>Missing</td><td>$status.MISSING</td></tr></table>""" )

$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

<Content>

</Content>