rave-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Geer <ch...@cxtsoftware.com>
Subject Re: svn commit: r1506105 - in /rave/trunk: rave-components/rave-core-api/src/main/java/org/apache/rave/rest/ rave-components/rave-core-api/src/main/java/org/apache/rave/rest/interceptor/ rave-components/rave-core/src/main/java/org/apache/rave/rest/impl/ ra...
Date Tue, 23 Jul 2013 15:48:52 GMT
Erin,

Even in the branch, can you make sure the source files have the correct
headers and stuff? It's a development branch but it's still an Apache
project so the files need the correct source headers before making it into
source control.

Thanks,
Chris


On Tue, Jul 23, 2013 at 8:16 AM, <erinnp@apache.org> wrote:

> Author: erinnp
> Date: Tue Jul 23 15:16:41 2013
> New Revision: 1506105
>
> URL: http://svn.apache.org/r1506105
> Log:
> Rave 983: Apply patch from Dan gornstein
>
> Added:
>
> rave/trunk/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/interceptor/
>
> rave/trunk/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/interceptor/JsonResponseWrapperInterceptor.java
> Modified:
>
> rave/trunk/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/PagesResource.java
>
> rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/rest/impl/DefaultPageResource.java
>     rave/trunk/rave-portal-resources/src/main/resources/requireBuild.js
>
> rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/cxf-applicationContext.xml
>
> rave/trunk/rave-portal-resources/src/main/webapp/static/script/requireConfig.js
>
> Modified:
> rave/trunk/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/PagesResource.java
> URL:
> http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/PagesResource.java?rev=1506105&r1=1506104&r2=1506105&view=diff
>
> ==============================================================================
> ---
> rave/trunk/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/PagesResource.java
> (original)
> +++
> rave/trunk/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/PagesResource.java
> Tue Jul 23 15:16:41 2013
> @@ -69,13 +69,14 @@ public interface PagesResource {
>      /**
>       * Returns the given page
>       *
> -     * @param pageId ID of the page on which the operation is to take
> place
> +     *
> +     * @param id ID of the page on which the operation is to take place
>       * @return
>       */
>      @GET
>      @Path("/{pageId}")
>      @Produces(MediaType.APPLICATION_JSON)
> -    Response getPage(@PathParam("pageId") String pageId);
> +    Page getPage(@PathParam("pageId") String id);
>
>      /**
>       * Updates the given page
>
> Added:
> rave/trunk/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/interceptor/JsonResponseWrapperInterceptor.java
> URL:
> http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/interceptor/JsonResponseWrapperInterceptor.java?rev=1506105&view=auto
>
> ==============================================================================
> ---
> rave/trunk/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/interceptor/JsonResponseWrapperInterceptor.java
> (added)
> +++
> rave/trunk/rave-components/rave-core-api/src/main/java/org/apache/rave/rest/interceptor/JsonResponseWrapperInterceptor.java
> Tue Jul 23 15:16:41 2013
> @@ -0,0 +1,30 @@
> +package org.apache.rave.rest.interceptor;
> +
> +import org.apache.cxf.interceptor.Fault;
> +import org.apache.cxf.message.Message;
> +import org.apache.cxf.phase.AbstractPhaseInterceptor;
> +import org.apache.cxf.phase.Phase;
> +import org.apache.rave.rest.model.JsonResponseWrapper;
> +
> +/**
> + * Created with IntelliJ IDEA.
> + * User: erinnp
> + * Date: 7/22/13
> + * Time: 4:56 PM
> + * To change this template use File | Settings | File Templates.
> + */
> +public class JsonResponseWrapperInterceptor extends
> AbstractPhaseInterceptor<Message> {
> +
> +    public JsonResponseWrapperInterceptor() {
> +        super(Phase.WRITE);
> +    }
> +
> +    @Override
> +    public void handleMessage(Message message) throws Fault {
> +        Object o = message.getContent(Object.class);
> +
> +        JsonResponseWrapper wrapper = new JsonResponseWrapper(o);
> +
> +        message.setContent(JsonResponseWrapper.class, wrapper);
> +    }
> +}
>
> Modified:
> rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/rest/impl/DefaultPageResource.java
> URL:
> http://svn.apache.org/viewvc/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/rest/impl/DefaultPageResource.java?rev=1506105&r1=1506104&r2=1506105&view=diff
>
> ==============================================================================
> ---
> rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/rest/impl/DefaultPageResource.java
> (original)
> +++
> rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/rest/impl/DefaultPageResource.java
> Tue Jul 23 15:16:41 2013
> @@ -20,10 +20,7 @@
>  package org.apache.rave.rest.impl;
>
>
> -import com.google.common.collect.Lists;
>  import org.apache.rave.portal.service.PageService;
> -import org.apache.rave.portal.service.UserService;
> -import org.apache.rave.portal.web.renderer.RenderService;
>  import org.apache.rave.rest.PagesResource;
>  import org.apache.rave.rest.model.*;
>  import org.slf4j.Logger;
> @@ -55,17 +52,11 @@ public class DefaultPageResource impleme
>      }
>
>      @Override
> -    public Response getPage(String id) {
> +    public Page getPage(String id) {
>          logger.debug("Retrieving page for export: " + id);
>          org.apache.rave.model.Page fromDb = pageService.getPage(id);
> -        if(fromDb == null) {
> -            return Response.status(Response.Status.NOT_FOUND).build();
> -        }
> -        else {
> -            Page responsePage =  new Page(fromDb);
>
> -            return Response.ok(new
> JsonResponseWrapper(responsePage)).build();
> -        }
> +        return new Page(fromDb);
>      }
>
>      @Override
>
> Modified:
> rave/trunk/rave-portal-resources/src/main/resources/requireBuild.js
> URL:
> http://svn.apache.org/viewvc/rave/trunk/rave-portal-resources/src/main/resources/requireBuild.js?rev=1506105&r1=1506104&r2=1506105&view=diff
>
> ==============================================================================
> --- rave/trunk/rave-portal-resources/src/main/resources/requireBuild.js
> (original)
> +++ rave/trunk/rave-portal-resources/src/main/resources/requireBuild.js
> Tue Jul 23 15:16:41 2013
> @@ -22,6 +22,9 @@
>      mainConfigFile:
> '${basedir}/src/main/webapp/static/script/requireConfig.js',
>      baseUrl: '.',
>      dir:
> '${project.build.directory}/${project.build.finalName}/static/script-built',
> +    paths: {
> +        'clientMessages': 'empty:'
> +    },
>      modules: [
>          {
>              name: 'rave'
> @@ -43,4 +46,4 @@
>              exclude: ['rave']
>          }
>      ]
> -})
> \ No newline at end of file
> +})
>
> Modified:
> rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/cxf-applicationContext.xml
> URL:
> http://svn.apache.org/viewvc/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/cxf-applicationContext.xml?rev=1506105&r1=1506104&r2=1506105&view=diff
>
> ==============================================================================
> ---
> rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/cxf-applicationContext.xml
> (original)
> +++
> rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/cxf-applicationContext.xml
> Tue Jul 23 15:16:41 2013
> @@ -21,11 +21,14 @@
>  <beans xmlns="http://www.springframework.org/schema/beans"
>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>         xmlns:jaxrs="http://cxf.apache.org/jaxrs"
> +       xmlns:cxf="http://cxf.apache.org/core"
>         xsi:schemaLocation="
>              http://www.springframework.org/schema/beans
>              http://www.springframework.org/schema/beans/spring-beans.xsd
>              http://cxf.apache.org/jaxrs
> -            http://cxf.apache.org/schemas/jaxrs.xsd">
> +            http://cxf.apache.org/schemas/jaxrs.xsd
> +            http://cxf.apache.org/core
> +            http://cxf.apache.org/schemas/core.xsd">
>
>      <!-- do not use import statements if CXFServlet init parameters link
> to this beans.xml -->
>
> @@ -46,6 +49,12 @@
>          </jaxrs:serviceBeans>
>      </jaxrs:server>
>
> +    <cxf:bus>
> +        <cxf:outInterceptors>
> +            <ref bean="JsonResponseWrapperInterceptor" />
> +        </cxf:outInterceptors>
> +    </cxf:bus>
> +
>      <bean id="peopleBean"
> class="org.apache.rave.rest.impl.DefaultPeopleResource">
>          <property name="userService" ref="userService"/>
>      </bean>
> @@ -62,4 +71,6 @@
>      <bean id="pagesBean"
> class="org.apache.rave.rest.impl.DefaultPageResource" autowire="byType" />
>      <bean id="pagesForRenderBean"
> class="org.apache.rave.rest.impl.DefaultPageForRenderResource"
> autowire="byType" />
>
> +    <bean id="JsonResponseWrapperInterceptor"
> class="org.apache.rave.rest.interceptor.JsonResponseWrapperInterceptor"/>
> +
>  </beans>
> \ No newline at end of file
>
> Modified:
> rave/trunk/rave-portal-resources/src/main/webapp/static/script/requireConfig.js
> URL:
> http://svn.apache.org/viewvc/rave/trunk/rave-portal-resources/src/main/webapp/static/script/requireConfig.js?rev=1506105&r1=1506104&r2=1506105&view=diff
>
> ==============================================================================
> ---
> rave/trunk/rave-portal-resources/src/main/webapp/static/script/requireConfig.js
> (original)
> +++
> rave/trunk/rave-portal-resources/src/main/webapp/static/script/requireConfig.js
> Tue Jul 23 15:16:41 2013
> @@ -21,9 +21,7 @@ requirejs.config({
>      "paths":{
>          "backbone":"//
> cdnjs.cloudflare.com/ajax/libs/backbone.js/0.9.10/backbone-min",
>          "bootstrap": '//
> cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.0.3/bootstrap.min',
> -        //The qs param ?a=b is a hack to force r.js optimizer to treat
> this as a network script, so it
> -        //won't try to bundle the resource
> -        "clientMessages":
> "../../app/messagebundle/rave_client_messages.js?a=b",
> +        "clientMessages": "../../app/messagebundle/rave_client_messages",
>          "handlebars":"//
> cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.rc.2/handlebars.min",
>          "jquery": "//ajax.aspnetcdn.com/ajax/jquery/jquery-1.7.2.min",
>          "jqueryUi":"//
> ajax.aspnetcdn.com/ajax/jquery.ui/1.8.17/jquery-ui.min",
> @@ -65,4 +63,4 @@ requirejs.config({
>              exports: '_'
>          }
>      }
> -});
> \ No newline at end of file
> +});
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message