@@ -131,12 +131,13 @@ protected File findPluginZipInDirectory(File dir) {
131131
132132 protected void installPlugin (String uri , AppConfig appConfig , DatabaseClient client ) {
133133 final String scope = appConfig .getPluginConfig ().getScope ();
134+ final String script = appConfig .getPluginConfig ().getInstallScript ();
134135 ServerEvaluationCall eval = client
135136 .newServerEval ()
136- .xquery (appConfig . getPluginConfig (). getInstallScript () )
137+ .xquery (script )
137138 .addVariable ("uri" , uri )
138139 .addVariable ("scope" , scope );
139- logger .info (format ("Installing plugin with scope '%s' from URI: %s" , scope , uri ));
140+ logger .info (format ("Installing plugin with scope '%s' from URI '%s' via script : %s" , scope , uri , script ));
140141 String result = eval .evalAs (String .class );
141142 logger .info (format ("Installed plugin with scope '%s', result: %s" , scope , result ));
142143 }
@@ -179,13 +180,18 @@ protected String getPluginName(File dir, AppConfig appConfig) {
179180
180181 protected void uninstallPlugin (String pluginName , AppConfig appConfig , DatabaseClient client ) {
181182 final String scope = appConfig .getPluginConfig ().getScope () + "/" + pluginName ;
183+ final String script = appConfig .getPluginConfig ().getUninstallScript ();
182184 ServerEvaluationCall eval = client
183185 .newServerEval ()
184- .xquery (appConfig . getPluginConfig (). getUninstallScript () )
186+ .xquery (script )
185187 .addVariable ("scope" , scope );
186- logger .info (format ("Uninstalling plugin with scope '%s'" , scope ));
188+ logger .info (format ("Uninstalling plugin with scope '%s' via script: %s " , scope , script ));
187189 String result = eval .evalAs (String .class );
188- logger .info (format ("Uninstalled plugin with scope '%s', result: %s" , scope , result ));
190+ if (result != null && result .trim ().length () > 0 ) {
191+ logger .info (format ("Uninstalled plugin with scope '%s', result: %s" , scope , result ));
192+ } else {
193+ logger .info (format ("Uninstalled plugin with scope '%s'" , scope ));
194+ }
189195 }
190196
191197 /**
0 commit comments