Changeset 5603


Ignore:
Timestamp:
08/22/14 18:23:26 (10 years ago)
Author:
olhsha@mpi.nl
Message:

little fixes

Location:
ComponentRegistry/trunk/ComponentRegistry/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/model/ComponentRegistryResponse.java

    r3960 r5603  
    2121@XmlAccessorType(XmlAccessType.FIELD)
    2222@XmlSeeAlso({RegisterResponse.class, CommentResponse.class})
    23 @XmlType(propOrder = {"registered","isInUserSpace","errors"})
     23@XmlType(propOrder = {"registered","isPrivate","errors"})
    2424public class ComponentRegistryResponse {
    2525
     
    2828   
    2929    @XmlAttribute(required = true)
    30     private Boolean isInUserSpace;
     30    private Boolean isPrivate;
    3131   
    3232    @XmlElementWrapper(name = "errors", required = false)
     
    5858    }
    5959
    60     public void setIsInUserSpace(Boolean isInUserSpace) {
    61         this.isInUserSpace = isInUserSpace;
     60    public void setIsPrivate(Boolean isPrivate) {
     61        this.isPrivate = isPrivate;
    6262    }
    6363
    64     public Boolean isInUserSpace() {
    65         return isInUserSpace;
     64    public Boolean isPrivate() {
     65        return isPrivate;
    6666    }
    6767}
  • ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/rest/ComponentRegistryRestService.java

    r5567 r5603  
    13061306            RegisterResponse response = new RegisterResponse();
    13071307            //obsolete. Make it setstatus
    1308             response.setIsInUserSpace(!desc.isPublic());
     1308            response.setIsPrivate(!desc.isPublic());
    13091309            this.validate(response, descriptionValidator, validator);
    13101310            if (response.getErrors().isEmpty()) {
     
    13911391            CommentResponse responseLocal = new CommentResponse();
    13921392
    1393             responseLocal.setIsInUserSpace(!description.isPublic());
     1393            responseLocal.setIsPrivate(!description.isPublic());
    13941394            this.validateComment(responseLocal, validator);
    13951395            if (responseLocal.getErrors().isEmpty()) {
  • ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/rest/PublishAction.java

    r5549 r5603  
    2020    @Override
    2121    public int execute(BaseDescription desc, CMDComponentSpec spec, RegisterResponse response, ComponentRegistry registry) throws UserUnauthorizedException, ItemNotFoundException{
    22         response.setIsInUserSpace(false);
     22        response.setIsPrivate(false);
    2323        return registry.publish(desc, spec, principal);
    2424    }
  • ComponentRegistry/trunk/ComponentRegistry/src/main/webapp/index.jsp

    r2534 r5603  
    9090                        "type", "application/x-shockwave-flash",
    9191                        "pluginspage", "http://www.adobe.com/go/getflashplayer",
    92                         "FlashVars", "serviceRootUrl=<%= application.getInitParameter("eu.clarin.cmdi.componentregistry.serviceRootUrl") %>&userName=${pageContext.request.remoteUser}&item=${param.item}&view=${param.view}&browserview=${param.browserview}&space=${param.space}&debug=${flexDebug}"
     92                        "FlashVars", "serviceRootUrl=<%= application.getInitParameter("eu.clarin.cmdi.componentregistry.serviceRootUrl") %>&userName=${pageContext.request.remoteUser}&itemId=${param.itemId}&view=${param.view}&browserview=${param.browserview}&registrySpace=${param.registrySpace}&groupId=${param.groupId}&debug=${flexDebug}"
    9393                           
    9494        );
  • ComponentRegistry/trunk/ComponentRegistry/src/test/java/clarin/cmdi/componentregistry/model/CommentResponseTest.java

    r4138 r5603  
    3535        CommentResponse resp = new CommentResponse();
    3636        resp.setRegistered(false);
    37         resp.setIsInUserSpace(true);
     37        resp.setIsPrivate(true);
    3838        resp.addError("Error 1");
    3939        resp.addError("Error 2, <!-- to be escaped -->");
     
    4242        String expected = "";
    4343        expected += "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n";
    44         expected += "<commentResponse registered=\"false\" isInUserSpace=\"true\" xmlns:ns2=\"http://www.w3.org/1999/xlink\">\n";
     44        expected += "<commentResponse registered=\"false\" isPrivate=\"true\" xmlns:ns2=\"http://www.w3.org/1999/xlink\">\n";
    4545        expected += "    <errors>\n";
    4646        expected += "        <error>Error 1</error>\n";
     
    6464        CommentResponse resp = new CommentResponse();
    6565        resp.setRegistered(true);
    66         resp.setIsInUserSpace(false);
     66        resp.setIsPrivate(false);
    6767        resp.setComment(getComment());
    6868        ByteArrayOutputStream out = new ByteArrayOutputStream();
     
    7070        String expected = "";
    7171        expected += "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n";
    72         expected += "<commentResponse registered=\"true\" isInUserSpace=\"false\" xmlns:ns2=\"http://www.w3.org/1999/xlink\">\n";
     72        expected += "<commentResponse registered=\"true\" isPrivate=\"false\" xmlns:ns2=\"http://www.w3.org/1999/xlink\">\n";
    7373        expected += "    <errors/>\n";
    7474        expected += "    <comment>\n";
  • ComponentRegistry/trunk/ComponentRegistry/src/test/java/clarin/cmdi/componentregistry/model/RegisterResponseTest.java

    r4139 r5603  
    2828                resp.setRegistered(false);
    2929                resp.setIsProfile(true);
    30                 resp.setIsInUserSpace(true);
     30                resp.setIsPrivate(true);
    3131                resp.addError("Error 1");
    3232                resp.addError("Error 2, <!-- to be escaped -->");
     
    3535                String expected = "";
    3636                expected += "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n";
    37                 expected += "<registerResponse isProfile=\"true\" registered=\"false\" isInUserSpace=\"true\" xmlns:ns2=\"http://www.w3.org/1999/xlink\">\n";
     37                expected += "<registerResponse isProfile=\"true\" registered=\"false\" isPrivate=\"true\" xmlns:ns2=\"http://www.w3.org/1999/xlink\">\n";
    3838                expected += "    <errors>\n";
    3939                expected += "        <error>Error 1</error>\n";
     
    5454                resp.setRegistered(true);
    5555                resp.setIsProfile(true);
    56                 resp.setIsInUserSpace(false);
     56                resp.setIsPrivate(false);
    5757                resp.setDescription(getProfileDescription());
    5858                ByteArrayOutputStream out = new ByteArrayOutputStream();
     
    6060                String expected = "";
    6161                expected += "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n";
    62                 expected += "<registerResponse isProfile=\"true\" registered=\"true\" isInUserSpace=\"false\" xmlns:ns2=\"http://www.w3.org/1999/xlink\">\n";
     62                expected += "<registerResponse isProfile=\"true\" registered=\"true\" isPrivate=\"false\" xmlns:ns2=\"http://www.w3.org/1999/xlink\">\n";
    6363                expected += "    <errors/>\n";
    6464                expected += "    <description xsi:type=\"profileDescription\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n";
     
    8787                resp.setRegistered(true);
    8888                resp.setIsProfile(false);
    89                 resp.setIsInUserSpace(true);
     89                resp.setIsPrivate(true);
    9090                resp.setDescription(getComponentDescription());
    9191                ByteArrayOutputStream out = new ByteArrayOutputStream();
     
    9393                String expected = "";
    9494                expected += "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n";
    95                 expected += "<registerResponse isProfile=\"false\" registered=\"true\" isInUserSpace=\"true\" xmlns:ns2=\"http://www.w3.org/1999/xlink\">\n";
     95                expected += "<registerResponse isProfile=\"false\" registered=\"true\" isPrivate=\"true\" xmlns:ns2=\"http://www.w3.org/1999/xlink\">\n";
    9696                expected += "    <errors/>\n";
    9797                expected += "    <description xsi:type=\"componentDescription\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n";
  • ComponentRegistry/trunk/ComponentRegistry/src/test/java/clarin/cmdi/componentregistry/rest/ComponentRegistryRestServiceTest.java

    r5563 r5603  
    861861                RegisterResponse.class, form);
    862862        assertTrue(response.isProfile());
    863         assertTrue(response.isInUserSpace());
     863        assertTrue(response.isPrivate());
    864864        ProfileDescription profileDesc = (ProfileDescription) response
    865865                .getDescription();
     
    993993                form);
    994994        assertTrue(response.isProfile());
    995         assertTrue(response.isInUserSpace());
     995        assertTrue(response.isPrivate());
    996996        ProfileDescription profileDesc = (ProfileDescription) response
    997997                .getDescription();
     
    11511151        assertTrue(response.isRegistered());
    11521152        assertFalse(response.isProfile());
    1153         assertTrue(response.isInUserSpace());
     1153        assertTrue(response.isPrivate());
    11541154        ComponentDescription desc = (ComponentDescription) response
    11551155                .getDescription();
     
    12831283        assertTrue(response.isRegistered());
    12841284        assertFalse(response.isProfile());
    1285         assertTrue(response.isInUserSpace());
     1285        assertTrue(response.isPrivate());
    12861286        ComponentDescription desc = (ComponentDescription) response
    12871287                .getDescription();
     
    13091309        assertTrue(response.isRegistered());
    13101310        assertFalse(response.isProfile());
    1311         assertTrue(response.isInUserSpace());
     1311        assertTrue(response.isPrivate());
    13121312        desc = (ComponentDescription) response.getDescription();
    13131313        assertNotNull(desc);
     
    13451345        assertTrue(response.isRegistered());
    13461346        assertTrue(response.isProfile());
    1347         assertTrue(response.isInUserSpace());
     1347        assertTrue(response.isPrivate());
    13481348        ProfileDescription desc = (ProfileDescription) response
    13491349                .getDescription();
     
    13721372        assertTrue(response.isRegistered());
    13731373        assertTrue(response.isProfile());
    1374         assertTrue(response.isInUserSpace());
     1374        assertTrue(response.isPrivate());
    13751375        desc = (ProfileDescription) response.getDescription();
    13761376        assertNotNull(desc);
     
    14341434        assertTrue(response.isRegistered());
    14351435        assertFalse(response.isProfile());
    1436         assertTrue(response.isInUserSpace());
     1436        assertTrue(response.isPrivate());
    14371437        ComponentDescription desc = (ComponentDescription) response
    14381438                .getDescription();
     
    14691469                .post(CommentResponse.class, form);
    14701470        assertTrue(response.isRegistered());
    1471         assertFalse(response.isInUserSpace());
     1471        assertFalse(response.isPrivate());
    14721472        Comment comment = response.getComment();
    14731473        assertNotNull(comment);
  • ComponentRegistry/trunk/ComponentRegistry/src/test/java/clarin/cmdi/componentregistry/rest/RestGroupServiceTest.java

    r5568 r5603  
    860860        assertTrue(response.isRegistered());
    861861        assertFalse(response.isProfile());
    862         assertTrue(response.isInUserSpace());
     862        assertTrue(response.isPrivate());
    863863        ComponentDescription desc = (ComponentDescription) response.getDescription();
    864864        assertNotNull(desc);
     
    877877        assertTrue(response.isRegistered());
    878878        assertFalse(response.isProfile());
    879         assertTrue(response.isInUserSpace());
     879        assertTrue(response.isPrivate());
    880880        desc = (ComponentDescription) response.getDescription();
    881881        assertNotNull(desc);
     
    903903        assertTrue(response.isRegistered());
    904904        assertTrue(response.isProfile());
    905         assertTrue(response.isInUserSpace());
     905        assertTrue(response.isPrivate());
    906906        ProfileDescription pdesc = (ProfileDescription) response.getDescription();
    907907        assertNotNull(pdesc);
     
    920920        assertTrue(response.isRegistered());
    921921        assertTrue(response.isProfile());
    922         assertTrue(response.isInUserSpace());
     922        assertTrue(response.isPrivate());
    923923        pdesc = (ProfileDescription) response.getDescription();
    924924        assertNotNull(pdesc);
     
    954954                .type(MediaType.MULTIPART_FORM_DATA).post(
    955955                RegisterResponse.class, form);
    956         assertFalse(response.isInUserSpace());
     956        assertFalse(response.isPrivate());
    957957        assertTrue(response.isProfile());
    958958        assertEquals(ProfileDescription.PROFILE_PREFIX+"profile-1", response.getDescription().getId());
     
    979979                .type(MediaType.MULTIPART_FORM_DATA).post(
    980980                RegisterResponse.class, form);
    981         assertFalse(response.isInUserSpace());
     981        assertFalse(response.isPrivate());
    982982        assertTrue(response.isProfile());
    983983        assertEquals(ProfileDescription.PROFILE_PREFIX+"Bprofile-1", response.getDescription().getId());
     
    10141014                .type(MediaType.MULTIPART_FORM_DATA).post(
    10151015                RegisterResponse.class, form);
    1016         assertFalse(response.isInUserSpace());
     1016        assertFalse(response.isPrivate());
    10171017        assertFalse(response.isProfile());
    10181018        assertEquals(ComponentDescription.COMPONENT_PREFIX+"component-1", response.getDescription().getId());
     
    10401040                .type(MediaType.MULTIPART_FORM_DATA).post(
    10411041                RegisterResponse.class, form);
    1042         assertFalse(response.isInUserSpace());
     1042        assertFalse(response.isPrivate());
    10431043        assertFalse(response.isProfile());
    10441044        assertEquals(ComponentDescription.COMPONENT_PREFIX+"Bcomponent-1", response.getDescription().getId());
     
    12371237                .post(CommentResponse.class, form);
    12381238        assertTrue(response.isRegistered());
    1239         assertTrue(response.isInUserSpace());
     1239        assertTrue(response.isPrivate());
    12401240        Comment comment = response.getComment();
    12411241        assertNotNull(comment);
     
    12591259                .post(CommentResponse.class, form);
    12601260        assertTrue(response.isRegistered());
    1261         assertTrue(response.isInUserSpace());
     1261        assertTrue(response.isPrivate());
    12621262        comment = response.getComment();
    12631263        assertNotNull(comment);
Note: See TracChangeset for help on using the changeset viewer.