* under the License.
*/
+import org.apache.archiva.rest.api.model.ArchivaRuntimeInfo;
import org.codehaus.plexus.redback.authorization.RedbackAuthorization;
import javax.ws.rs.GET;
String getAllI18nResources( @QueryParam( "locale" ) String locale )
throws ArchivaRestServiceException;
- @Path( "devMode" )
+ @Path( "archivaRuntimeInfo" )
@GET
- @Produces( { MediaType.TEXT_PLAIN } )
+ @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
@RedbackAuthorization( noRestriction = true )
- Boolean devMode();
+ ArchivaRuntimeInfo archivaRuntimeInfo();
}
* under the License.
*/
+import org.apache.archiva.rest.api.model.ArchivaRuntimeInfo;
import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
import org.apache.archiva.rest.api.services.CommonServices;
import org.apache.commons.io.IOUtils;
}
}
- public Boolean devMode()
+ public ArchivaRuntimeInfo archivaRuntimeInfo()
{
- return Boolean.getBoolean( "archiva.devMode" );
+ return new ArchivaRuntimeInfo();
}
}
<tomcatRunPort>9091</tomcatRunPort>
<tomcatRunPath>/archiva</tomcatRunPath>
<archiva.devMode>true</archiva.devMode>
+ <archiva.javascriptLog>true</archiva.javascriptLog>
</properties>
<dependencies>
<java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
<archiva.user.configFileName>${project.build.directory}/appserver-base/conf/archiva.xml</archiva.user.configFileName>
<archiva.devMode>${archiva.devMode}</archiva.devMode>
+ <archiva.javascriptLog>${archiva.javascriptLog}</archiva.javascriptLog>
</systemProperties>
</configuration>
<dependencies>
<java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
<archiva.user.configFileName>${project.build.directory}/appserver-base/conf/archiva.xml</archiva.user.configFileName>
<archiva.devMode>${archiva.devMode}</archiva.devMode>
+ <archiva.javascriptLog>${archiva.javascriptLog}</archiva.javascriptLog>
</systemProperties>
</configuration>
<dependencies>
<java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
<archiva.user.configFileName>${project.build.directory}/appserver-base/conf/archiva.xml</archiva.user.configFileName>
<archiva.devMode>${archiva.devMode}</archiva.devMode>
+ <archiva.javascriptLog>${archiva.javascriptLog}</archiva.javascriptLog>
</systemProperties>
</configuration>
<dependencies>
<script type="text/javascript">
$.ajax(
{
- url: "restServices/archivaServices/commonServices/devMode",
+ url: "restServices/archivaServices/commonServices/archivaRuntimeInfo",
+ dataType: 'json',
success:function(data){
- window.archivaDevMode=data=='true';
+ window.archivaDevMode=data.archivaRuntimeInfo.devMode;
+ window.archivaJavascriptLog=data.archivaRuntimeInfo.javascriptLog;
require.config({
baseUrl: "js/"
});
$.log("devMode:"+window.archivaDevMode);
- // no cache for ajax queries
+ // no cache for ajax queries as we get datas from servers so preventing caching !!
jQuery.ajaxSetup( {
- cache: !window.archivaDevMode
+ cache: false//!window.archivaDevMode
} );
* log message in the console
*/
$.log = (function(message) {
+ if ( !window.archivaJavascriptLog ){
+ return;
+ }
if (typeof window.console != 'undefined' && typeof window.console.log != 'undefined') {
console.log(message);
} else {