+++ /dev/null
-package org.apache.archiva.rest.api.model;
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * @author Olivier Lamy
- * @since 1.4-M3
- */
-@XmlRootElement( name = "archivaRuntimeInfo" )
-public class ArchivaRuntimeInfo
-{
- private boolean devMode = false;
-
- private boolean javascriptLog = false;
-
- public ArchivaRuntimeInfo()
- {
- this.devMode = Boolean.getBoolean( "archiva.devMode" );
-
- this.javascriptLog = Boolean.getBoolean( "archiva.javascriptLog" );
- }
-
- public boolean isDevMode()
- {
- return devMode;
- }
-
- public void setDevMode( boolean devMode )
- {
- this.devMode = devMode;
- }
-
- public boolean isJavascriptLog()
- {
- return javascriptLog;
- }
-
- public void setJavascriptLog( boolean javascriptLog )
- {
- this.javascriptLog = javascriptLog;
- }
-
- @Override
- public String toString()
- {
- final StringBuilder sb = new StringBuilder();
- sb.append( "ArchivaRuntimeInfo" );
- sb.append( "{devMode=" ).append( devMode );
- sb.append( ", javascriptLog=" ).append( javascriptLog );
- sb.append( '}' );
- return sb.toString();
- }
-}
* 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( "archivaRuntimeInfo" )
- @GET
- @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
- @RedbackAuthorization( noRestriction = true )
- ArchivaRuntimeInfo archivaRuntimeInfo();
-
@Path( "validateCronExpression" )
@GET
* 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;
import org.springframework.stereotype.Service;
import javax.inject.Inject;
-import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Response;
import java.io.ByteArrayInputStream;
import java.io.IOException;
}
}
- public ArchivaRuntimeInfo archivaRuntimeInfo()
- {
- return new ArchivaRuntimeInfo();
- }
public Boolean validateCronExpression( String cronExpression )
throws ArchivaRestServiceException
--- /dev/null
+package org.apache.archiva.webapp.ui.services.api;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.webapp.ui.services.model.ApplicationRuntimeInfo;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author Olivier Lamy
+ */
+@Service( "runtimeInfoService#rest" )
+public class DefaultRuntimeInfoService
+ implements RuntimeInfoService
+{
+ public ApplicationRuntimeInfo archivaRuntimeInfo()
+ {
+ ApplicationRuntimeInfo archivaRuntimeInfo = new ApplicationRuntimeInfo();
+ return archivaRuntimeInfo;
+ }
+}
--- /dev/null
+package org.apache.archiva.webapp.ui.services.api;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.archiva.webapp.ui.services.model.ApplicationRuntimeInfo;
+import org.codehaus.plexus.redback.authorization.RedbackAuthorization;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4-M3
+ */
+@Path( "/runtimeInfoService/" )
+public interface RuntimeInfoService
+{
+ @Path( "archivaRuntimeInfo" )
+ @GET
+ @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
+ @RedbackAuthorization( noRestriction = true )
+ ApplicationRuntimeInfo archivaRuntimeInfo();
+}
--- /dev/null
+package org.apache.archiva.webapp.ui.services.model;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4-M3
+ */
+@XmlRootElement( name = "applicationRuntimeInfo" )
+public class ApplicationRuntimeInfo
+{
+ private boolean devMode = false;
+
+ private boolean javascriptLog = false;
+
+ public ApplicationRuntimeInfo()
+ {
+ this.devMode = Boolean.getBoolean( "archiva.devMode" );
+
+ this.javascriptLog = Boolean.getBoolean( "archiva.javascriptLog" );
+ }
+
+ public boolean isDevMode()
+ {
+ return devMode;
+ }
+
+ public void setDevMode( boolean devMode )
+ {
+ this.devMode = devMode;
+ }
+
+ public boolean isJavascriptLog()
+ {
+ return javascriptLog;
+ }
+
+ public void setJavascriptLog( boolean javascriptLog )
+ {
+ this.javascriptLog = javascriptLog;
+ }
+
+ @Override
+ public String toString()
+ {
+ final StringBuilder sb = new StringBuilder();
+ sb.append( "ApplicationRuntimeInfo" );
+ sb.append( "{devMode=" ).append( devMode );
+ sb.append( ", javascriptLog=" ).append( javascriptLog );
+ sb.append( '}' );
+ return sb.toString();
+ }
+}
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
+ xmlns:jaxrs="http://cxf.apache.org/jaxrs"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/util
- http://www.springframework.org/schema/util/spring-util-3.0.xsd"
+ http://www.springframework.org/schema/util/spring-util-3.0.xsd
+ http://cxf.apache.org/jaxrs
+ http://cxf.apache.org/schemas/jaxrs.xsd"
default-lazy-init="true">
+ <import resource="classpath:META-INF/cxf/cxf.xml"/>
+ <!--
+ <import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml"/>
+ -->
+ <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
+
<context:annotation-config/>
+ <context:component-scan base-package="org.apache.archiva.webapp.ui.services.api"/>
<util:properties id="archivaRuntimeProperties" location="classpath:application.properties" />
<constructor-arg value="${appserver.base}/data/jcr"/>
</bean>
+ <jaxrs:server id="archivaUiServices" address="/archivaUiServices">
+
+ <jaxrs:providers>
+ <ref bean="authenticationInterceptor#rest"/>
+ <ref bean="permissionInterceptor#rest"/>
+ <ref bean="archivaRestServiceExceptionMapper"/>
+ </jaxrs:providers>
+
+ <jaxrs:serviceBeans>
+ <ref bean="runtimeInfoService#rest"/>
+ </jaxrs:serviceBeans>
+
+ <jaxrs:outInterceptors>
+ <ref bean="threadLocalUserCleaner#rest"/>
+ </jaxrs:outInterceptors>
+
+ <jaxrs:outFaultInterceptors>
+
+ </jaxrs:outFaultInterceptors>
+ </jaxrs:server>
+
</beans>
\ No newline at end of file
<script type="text/javascript">
$.ajax(
{
- url: "restServices/archivaServices/commonServices/archivaRuntimeInfo",
+ url: "restServices/archivaUiServices/runtimeInfoService/archivaRuntimeInfo",
dataType: 'json',
success:function(data){
- window.archivaDevMode=data.archivaRuntimeInfo.devMode;
- window.archivaJavascriptLog=data.archivaRuntimeInfo.javascriptLog;
+ window.archivaDevMode=data.applicationRuntimeInfo.devMode;
+ window.archivaJavascriptLog=data.applicationRuntimeInfo.javascriptLog;
require.config({
baseUrl: "js/"
});