archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1236634 - in /archiva/trunk/archiva-modules/archiva-web: archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ archiva-rest/archiva-...
Date Fri, 27 Jan 2012 11:19:52 GMT
Author: olamy
Date: Fri Jan 27 11:19:51 2012
New Revision: 1236634

URL: http://svn.apache.org/viewvc?rev=1236634&view=rev
Log:
move this rest services used only by the js ui in a new rest ui service

Added:
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/DefaultRuntimeInfoService.java
  (with props)
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/RuntimeInfoService.java
  (with props)
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/model/
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/model/ApplicationRuntimeInfo.java
  (contents, props changed)
      - copied, changed from r1236633, archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ArchivaRuntimeInfo.java
Removed:
    archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ArchivaRuntimeInfo.java
Modified:
    archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/CommonServices.java
    archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultCommonServices.java
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/resources/META-INF/spring-context.xml
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/CommonServices.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/CommonServices.java?rev=1236634&r1=1236633&r2=1236634&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/CommonServices.java
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/CommonServices.java
Fri Jan 27 11:19:51 2012
@@ -18,7 +18,6 @@ package org.apache.archiva.rest.api.serv
  * under the License.
  */
 
-import org.apache.archiva.rest.api.model.ArchivaRuntimeInfo;
 import org.codehaus.plexus.redback.authorization.RedbackAuthorization;
 
 import javax.ws.rs.GET;
@@ -61,12 +60,6 @@ public interface CommonServices
     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

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultCommonServices.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultCommonServices.java?rev=1236634&r1=1236633&r2=1236634&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultCommonServices.java
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultCommonServices.java
Fri Jan 27 11:19:51 2012
@@ -18,7 +18,6 @@ package org.apache.archiva.rest.services
  * 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;
@@ -31,7 +30,6 @@ import org.slf4j.LoggerFactory;
 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;
@@ -175,10 +173,6 @@ public class DefaultCommonServices
         }
     }
 
-    public ArchivaRuntimeInfo archivaRuntimeInfo()
-    {
-        return new ArchivaRuntimeInfo();
-    }
 
     public Boolean validateCronExpression( String cronExpression )
         throws ArchivaRestServiceException

Added: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/DefaultRuntimeInfoService.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/DefaultRuntimeInfoService.java?rev=1236634&view=auto
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/DefaultRuntimeInfoService.java
(added)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/DefaultRuntimeInfoService.java
Fri Jan 27 11:19:51 2012
@@ -0,0 +1,36 @@
+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;
+    }
+}

Propchange: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/DefaultRuntimeInfoService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/DefaultRuntimeInfoService.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/RuntimeInfoService.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/RuntimeInfoService.java?rev=1236634&view=auto
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/RuntimeInfoService.java
(added)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/RuntimeInfoService.java
Fri Jan 27 11:19:51 2012
@@ -0,0 +1,41 @@
+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();
+}

Propchange: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/RuntimeInfoService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/api/RuntimeInfoService.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Copied: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/model/ApplicationRuntimeInfo.java
(from r1236633, archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ArchivaRuntimeInfo.java)
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/model/ApplicationRuntimeInfo.java?p2=archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/model/ApplicationRuntimeInfo.java&p1=archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ArchivaRuntimeInfo.java&r1=1236633&r2=1236634&rev=1236634&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ArchivaRuntimeInfo.java
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/model/ApplicationRuntimeInfo.java
Fri Jan 27 11:19:51 2012
@@ -1,4 +1,4 @@
-package org.apache.archiva.rest.api.model;
+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
@@ -24,14 +24,14 @@ import javax.xml.bind.annotation.XmlRoot
  * @author Olivier Lamy
  * @since 1.4-M3
  */
-@XmlRootElement( name = "archivaRuntimeInfo" )
-public class ArchivaRuntimeInfo
+@XmlRootElement( name = "applicationRuntimeInfo" )
+public class ApplicationRuntimeInfo
 {
     private boolean devMode = false;
 
     private boolean javascriptLog = false;
 
-    public ArchivaRuntimeInfo()
+    public ApplicationRuntimeInfo()
     {
         this.devMode = Boolean.getBoolean( "archiva.devMode" );
 
@@ -62,7 +62,7 @@ public class ArchivaRuntimeInfo
     public String toString()
     {
         final StringBuilder sb = new StringBuilder();
-        sb.append( "ArchivaRuntimeInfo" );
+        sb.append( "ApplicationRuntimeInfo" );
         sb.append( "{devMode=" ).append( devMode );
         sb.append( ", javascriptLog=" ).append( javascriptLog );
         sb.append( '}' );

Propchange: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/model/ApplicationRuntimeInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/java/org/apache/archiva/webapp/ui/services/model/ApplicationRuntimeInfo.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/resources/META-INF/spring-context.xml
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/resources/META-INF/spring-context.xml?rev=1236634&r1=1236633&r2=1236634&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/resources/META-INF/spring-context.xml
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/resources/META-INF/spring-context.xml
Fri Jan 27 11:19:51 2012
@@ -22,15 +22,25 @@
        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"
/>
@@ -44,5 +54,26 @@
     <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

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html?rev=1236634&r1=1236633&r2=1236634&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html
Fri Jan 27 11:19:51 2012
@@ -48,11 +48,11 @@
 <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/"
           });



Mime
View raw message