Skip to content

Commit

Permalink
1.4 : new level in library, new Recommendation
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre-yves-monnet committed Aug 26, 2020
1 parent 336ae05 commit 5479543
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Actions.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public class Actions {
else if ("propscollect".equals(action))
{
File pageDirectory = pageResourceProvider.getPageDirectory();
actionAnswer.responseMap.putAll( DrillCarAPI.propsCollects( jsonParam , pageDirectory ));
actionAnswer.responseMap.putAll( DrillCarAPI.propsCollects( jsonParam , pageDirectory, processAPI, identityAPI,tenantId ));
}
else if ("saveprops".equals(action)) {
logger.info("Save properties paramJsonSt="+paramJsonSt);
Expand Down
17 changes: 10 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<table><tr><td><h1>Drill Car</h1></td><td rowspan="2"><img src="img/drillcar.jpg" width="150" heigth="150" /></td></tr>
<tr><td>
<center>
V1.3
V1.4
</center>
</td></tr>
</table>
Expand All @@ -76,8 +76,8 @@
<li ng-class="{active: active, disabled: false}" id="form-tab" heading="analysis" active="true" title="Recommendations" select="ctrl.navbaractiv == 'recommendations'" class="{{ctrl.getNavClass('recommendations')}}" style="{{ctrl.getNavStyle('recommendations')}}">
<a ng-click="ctrl.navbaractiv='recommendations'" class="ng-binding">Recommendations</a>
</li>
<li ng-class="{active: active, disabled: false}" id="form-tab" heading="differentiel" active="true" title="Differentiel" select="ctrl.navbaractiv == 'differentiel'" class="{{ctrl.getNavClass('differentiel')}}" style="{{ctrl.getNavStyle('differentiel')}}">
<a ng-click="ctrl.navbaractiv='differentiel'" class="ng-binding">Differentiel</a>
<li ng-class="{active: active, disabled: false}" id="form-tab" heading="differential" active="true" title="differential" select="ctrl.navbaractiv == 'differential'" class="{{ctrl.getNavClass('differential')}}" style="{{ctrl.getNavStyle('differential')}}">
<a ng-click="ctrl.navbaractiv='differential'" class="ng-binding">Differential</a>
</li>
<li ng-class="{active: active, disabled: false}" id="form-tab" heading="parameters" active="true" title="Parameters" select="ctrl.navbaractiv == 'parameters'" class="{{ctrl.getNavClass('parameters')}}" style="{{ctrl.getNavStyle('parameters')}}">
<a ng-click="ctrl.navbaractiv='parameters'" class="ng-binding">Parameters</a>
Expand Down Expand Up @@ -372,10 +372,10 @@ <h3>Recommendations</h3>
</div>

<!-- ************************************************************ -->
<!-- Differentiel -->
<!-- Differential -->
<!-- ************************************************************ -->
<!-- Keep it ng-show, else the file drop will not work ! -->
<div class="col-lg-12" ng-show="ctrl.navbaractiv == 'differentiel'">
<div class="col-lg-12" ng-show="ctrl.navbaractiv == 'differential'">

<div class="col-lg-10">
<div class="panel panel-primary">
Expand Down Expand Up @@ -423,7 +423,7 @@ <h3>Recommendations</h3>
<tr style="padding: 10px 5px 20px 10px;"><td>Ignore temporary directory:</td><td><input type="checkbox" ng-model="ctrl.diff.param.ignoreTemp" title="Temporary directory (temp, tmp) are ignored in the comparison"></input></td></tr>
<tr style="padding: 10px 5px 20px 10px;"><td>Ignore License files:</td><td><input type="checkbox" ng-model="ctrl.diff.param.ignoreLicence" title="License file are ignored"></input></td></tr>
<tr style="padding: 10px 5px 20px 10px;"><td>Ignore setup directory:</td><td><input type="checkbox" ng-model="ctrl.diff.param.ignoreSetup" title="Setup directory are ignored, then the comparison is only on the environment (memory, SSO..)"></input></td></tr>
<tr style="padding: 10px 5px 20px 10px;"><td>Ignore Deffered JS:</td><td><input type="checkbox" ng-model="ctrl.diff.param.ignoreDeferedJs" title="Execution generated multiple deferended JS to improve performance. They are ignored."></input></td></tr>
<tr style="padding: 10px 5px 20px 10px;"><td>Ignore Defered JS:</td><td><input type="checkbox" ng-model="ctrl.diff.param.ignoreDeferedJs" title="Execution generated multiple deferended JS to improve performance. They are ignored."></input></td></tr>
</table>
<center>
<div ng-show="ctrl.inprogress">
Expand Down Expand Up @@ -463,7 +463,7 @@ <h3>Differences</h3>

<!-- Final status -->
<div ng-if="ctrl.diff.result.finalstatus == 'IDENTICAL'">
<div class="alert alert-success">Two applications are identicals</div>
<div class="alert alert-success">Two applications are identical</div>
</div>

<!-- <a ng-click="ctrl.analysisExportData('comparison')" title="Click to export to a Excel file"><img src="img/docexcel.gif" /></a> -->
Expand All @@ -475,6 +475,9 @@ <h3>Differences</h3>
<label class="btn btn-warning">
<input type="radio" value="1" name="displaylevel" data-ng-model="ctrl.diff.displaylevel">CRITICAL / IMPORTANT
</label>
<label class="btn btn-warning">
<input type="radio" value="2" name="displaylevel" data-ng-model="ctrl.diff.displaylevel">EXPECTED
</label>
<label class="btn btn-info">
<input type="radio" value="100" name="displaylevel" data-ng-model="ctrl.diff.displaylevel">All
</label>
Expand Down
Binary file removed lib/CustomPageDrillCar-1.3.0.jar
Binary file not shown.
Binary file added lib/CustomPageDrillCar-1.4.0.jar
Binary file not shown.
Binary file removed lib/bonita-serverconfiguration-1.4.0.jar
Binary file not shown.
Binary file added lib/bonita-serverconfiguration-1.7.0.jar
Binary file not shown.
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.bonitasoft.custompage</groupId>
<artifactId>CustomPageDrillCar</artifactId>
<version>1.3.0</version>
<version>1.4.0</version>
<dependencies>
<dependency>
<groupId>org.bonitasoft.engine</groupId>
Expand All @@ -23,17 +23,17 @@
<dependency>
<groupId>org.bonitasoft.serverconfiguration</groupId>
<artifactId>bonita-serverconfiguration</artifactId>
<version>1.4.0</version>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>org.bonitasoft.log.event</groupId>
<artifactId>bonita-event</artifactId>
<version>1.7.0</version>
<version>1.9.0</version>
</dependency>
<dependency>
<groupId>org.bonitasoft.properties</groupId>
<artifactId>bonita-properties</artifactId>
<version>2.1.1</version>
<version>2.4.0</version>
</dependency>
<!-- copy the library from the BonitaServerConfiguration pom.xml -->
<dependency>
Expand All @@ -58,7 +58,7 @@
<dependency>
<groupId>org.bonitasoft.store</groupId>
<artifactId>bonita-store</artifactId>
<version>1.1.0</version>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>org.bonitasoft.engine</groupId>
Expand Down
21 changes: 15 additions & 6 deletions src/main/java/org/bonitasoft/custompage/drillcar/DrillCarAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
import java.util.HashMap;
import java.util.Map;

import org.bonitasoft.engine.api.APIAccessor;
import org.bonitasoft.engine.api.IdentityAPI;
import org.bonitasoft.engine.api.ProcessAPI;
import org.bonitasoft.log.event.BEvent;
import org.bonitasoft.log.event.BEventFactory;
import org.bonitasoft.log.event.BEvent.Level;
import org.bonitasoft.serverconfiguration.CollectOperation.BonitaAccessor;
import org.bonitasoft.serverconfiguration.CollectOperation.TYPECOLLECT;
import org.bonitasoft.serverconfiguration.CollectResult;
import org.bonitasoft.serverconfiguration.CollectResult.COLLECTLOGSTRATEGY;
Expand All @@ -31,11 +35,15 @@ public class DrillCarAPI {
* @param pageDirectory
* @return
*/
public static Map<String, Object> propsCollects(Map<String, Object> parameters, File pageDirectory) {

public static Map<String, Object> propsCollects(Map<String, Object> parameters, File pageDirectory,ProcessAPI processAPI, IdentityAPI identityAPI, long tenantId) {
BonitaAccessor bonitaAccessor = new BonitaAccessor();
bonitaAccessor.processAPI = processAPI;
bonitaAccessor.identityAPI = identityAPI;
bonitaAccessor.tenantId = tenantId;

File fileBundle = null;
fileBundle = new File(pageDirectory.getAbsoluteFile() + "/../../../../../../../");
ArrayList<BEvent> listEvents = new ArrayList<BEvent>();
ArrayList<BEvent> listEvents = new ArrayList<>();

try {
fileBundle = new File(fileBundle.getCanonicalPath());
Expand All @@ -58,14 +66,15 @@ public static Map<String, Object> propsCollects(Map<String, Object> parameters,
}

// now, collect result
CollectResult collectResult = currentConfig.collectParameters( collectParameter, COLLECTLOGSTRATEGY.LOGALL);
// Note : collectParameters contains the marker "hidePassword", to pilot the collect. In case of analysis (and only for analysis), this marker is set to false
CollectResult collectResult = currentConfig.collectParameters( collectParameter, COLLECTLOGSTRATEGY.LOGALL, bonitaAccessor);

// I want the result in JSON, so use a ResultDecoMap
CollectResultDecoMap decoMap = new CollectResultDecoMap(collectResult, "", localBonitaConfig.getRootPath() );
decoMap.setLineFeedToHtml( true );
// ok, get the value of decoration

Map<String,Object> result=new HashMap<String,Object>();
Map<String,Object> result=new HashMap<>();
if (collectParameter.listTypeCollect.contains(TYPECOLLECT.SETUP))
result.put("setup", decoMap.getMap( TYPECOLLECT.SETUP));
if (collectParameter.listTypeCollect.contains(TYPECOLLECT.SERVER))
Expand All @@ -88,7 +97,7 @@ public static Map<String, Object> propsCollects(Map<String, Object> parameters,
*/
public static Map<String, Object> diffAnalysis(Map<String, Object> parameters, File pageDirectory) {

ArrayList<BEvent> listEvents = new ArrayList<BEvent>();
ArrayList<BEvent> listEvents = new ArrayList<>();
ComparaisonParameter comparaisonParameter;
try {
comparaisonParameter = ComparaisonParameter.getInstanceFromMap(parameters);
Expand Down

0 comments on commit 5479543

Please sign in to comment.