Changeset 5603
- Timestamp:
- 08/22/14 18:23:26 (10 years ago)
- 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 21 21 @XmlAccessorType(XmlAccessType.FIELD) 22 22 @XmlSeeAlso({RegisterResponse.class, CommentResponse.class}) 23 @XmlType(propOrder = {"registered","is InUserSpace","errors"})23 @XmlType(propOrder = {"registered","isPrivate","errors"}) 24 24 public class ComponentRegistryResponse { 25 25 … … 28 28 29 29 @XmlAttribute(required = true) 30 private Boolean is InUserSpace;30 private Boolean isPrivate; 31 31 32 32 @XmlElementWrapper(name = "errors", required = false) … … 58 58 } 59 59 60 public void setIs InUserSpace(Boolean isInUserSpace) {61 this.is InUserSpace = isInUserSpace;60 public void setIsPrivate(Boolean isPrivate) { 61 this.isPrivate = isPrivate; 62 62 } 63 63 64 public Boolean is InUserSpace() {65 return is InUserSpace;64 public Boolean isPrivate() { 65 return isPrivate; 66 66 } 67 67 } -
ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/rest/ComponentRegistryRestService.java
r5567 r5603 1306 1306 RegisterResponse response = new RegisterResponse(); 1307 1307 //obsolete. Make it setstatus 1308 response.setIs InUserSpace(!desc.isPublic());1308 response.setIsPrivate(!desc.isPublic()); 1309 1309 this.validate(response, descriptionValidator, validator); 1310 1310 if (response.getErrors().isEmpty()) { … … 1391 1391 CommentResponse responseLocal = new CommentResponse(); 1392 1392 1393 responseLocal.setIs InUserSpace(!description.isPublic());1393 responseLocal.setIsPrivate(!description.isPublic()); 1394 1394 this.validateComment(responseLocal, validator); 1395 1395 if (responseLocal.getErrors().isEmpty()) { -
ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/rest/PublishAction.java
r5549 r5603 20 20 @Override 21 21 public int execute(BaseDescription desc, CMDComponentSpec spec, RegisterResponse response, ComponentRegistry registry) throws UserUnauthorizedException, ItemNotFoundException{ 22 response.setIs InUserSpace(false);22 response.setIsPrivate(false); 23 23 return registry.publish(desc, spec, principal); 24 24 } -
ComponentRegistry/trunk/ComponentRegistry/src/main/webapp/index.jsp
r2534 r5603 90 90 "type", "application/x-shockwave-flash", 91 91 "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}®istrySpace=${param.registrySpace}&groupId=${param.groupId}&debug=${flexDebug}" 93 93 94 94 ); -
ComponentRegistry/trunk/ComponentRegistry/src/test/java/clarin/cmdi/componentregistry/model/CommentResponseTest.java
r4138 r5603 35 35 CommentResponse resp = new CommentResponse(); 36 36 resp.setRegistered(false); 37 resp.setIs InUserSpace(true);37 resp.setIsPrivate(true); 38 38 resp.addError("Error 1"); 39 39 resp.addError("Error 2, <!-- to be escaped -->"); … … 42 42 String expected = ""; 43 43 expected += "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"; 44 expected += "<commentResponse registered=\"false\" is InUserSpace=\"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"; 45 45 expected += " <errors>\n"; 46 46 expected += " <error>Error 1</error>\n"; … … 64 64 CommentResponse resp = new CommentResponse(); 65 65 resp.setRegistered(true); 66 resp.setIs InUserSpace(false);66 resp.setIsPrivate(false); 67 67 resp.setComment(getComment()); 68 68 ByteArrayOutputStream out = new ByteArrayOutputStream(); … … 70 70 String expected = ""; 71 71 expected += "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"; 72 expected += "<commentResponse registered=\"true\" is InUserSpace=\"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"; 73 73 expected += " <errors/>\n"; 74 74 expected += " <comment>\n"; -
ComponentRegistry/trunk/ComponentRegistry/src/test/java/clarin/cmdi/componentregistry/model/RegisterResponseTest.java
r4139 r5603 28 28 resp.setRegistered(false); 29 29 resp.setIsProfile(true); 30 resp.setIs InUserSpace(true);30 resp.setIsPrivate(true); 31 31 resp.addError("Error 1"); 32 32 resp.addError("Error 2, <!-- to be escaped -->"); … … 35 35 String expected = ""; 36 36 expected += "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"; 37 expected += "<registerResponse isProfile=\"true\" registered=\"false\" is InUserSpace=\"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"; 38 38 expected += " <errors>\n"; 39 39 expected += " <error>Error 1</error>\n"; … … 54 54 resp.setRegistered(true); 55 55 resp.setIsProfile(true); 56 resp.setIs InUserSpace(false);56 resp.setIsPrivate(false); 57 57 resp.setDescription(getProfileDescription()); 58 58 ByteArrayOutputStream out = new ByteArrayOutputStream(); … … 60 60 String expected = ""; 61 61 expected += "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"; 62 expected += "<registerResponse isProfile=\"true\" registered=\"true\" is InUserSpace=\"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"; 63 63 expected += " <errors/>\n"; 64 64 expected += " <description xsi:type=\"profileDescription\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n"; … … 87 87 resp.setRegistered(true); 88 88 resp.setIsProfile(false); 89 resp.setIs InUserSpace(true);89 resp.setIsPrivate(true); 90 90 resp.setDescription(getComponentDescription()); 91 91 ByteArrayOutputStream out = new ByteArrayOutputStream(); … … 93 93 String expected = ""; 94 94 expected += "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"; 95 expected += "<registerResponse isProfile=\"false\" registered=\"true\" is InUserSpace=\"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"; 96 96 expected += " <errors/>\n"; 97 97 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 861 861 RegisterResponse.class, form); 862 862 assertTrue(response.isProfile()); 863 assertTrue(response.is InUserSpace());863 assertTrue(response.isPrivate()); 864 864 ProfileDescription profileDesc = (ProfileDescription) response 865 865 .getDescription(); … … 993 993 form); 994 994 assertTrue(response.isProfile()); 995 assertTrue(response.is InUserSpace());995 assertTrue(response.isPrivate()); 996 996 ProfileDescription profileDesc = (ProfileDescription) response 997 997 .getDescription(); … … 1151 1151 assertTrue(response.isRegistered()); 1152 1152 assertFalse(response.isProfile()); 1153 assertTrue(response.is InUserSpace());1153 assertTrue(response.isPrivate()); 1154 1154 ComponentDescription desc = (ComponentDescription) response 1155 1155 .getDescription(); … … 1283 1283 assertTrue(response.isRegistered()); 1284 1284 assertFalse(response.isProfile()); 1285 assertTrue(response.is InUserSpace());1285 assertTrue(response.isPrivate()); 1286 1286 ComponentDescription desc = (ComponentDescription) response 1287 1287 .getDescription(); … … 1309 1309 assertTrue(response.isRegistered()); 1310 1310 assertFalse(response.isProfile()); 1311 assertTrue(response.is InUserSpace());1311 assertTrue(response.isPrivate()); 1312 1312 desc = (ComponentDescription) response.getDescription(); 1313 1313 assertNotNull(desc); … … 1345 1345 assertTrue(response.isRegistered()); 1346 1346 assertTrue(response.isProfile()); 1347 assertTrue(response.is InUserSpace());1347 assertTrue(response.isPrivate()); 1348 1348 ProfileDescription desc = (ProfileDescription) response 1349 1349 .getDescription(); … … 1372 1372 assertTrue(response.isRegistered()); 1373 1373 assertTrue(response.isProfile()); 1374 assertTrue(response.is InUserSpace());1374 assertTrue(response.isPrivate()); 1375 1375 desc = (ProfileDescription) response.getDescription(); 1376 1376 assertNotNull(desc); … … 1434 1434 assertTrue(response.isRegistered()); 1435 1435 assertFalse(response.isProfile()); 1436 assertTrue(response.is InUserSpace());1436 assertTrue(response.isPrivate()); 1437 1437 ComponentDescription desc = (ComponentDescription) response 1438 1438 .getDescription(); … … 1469 1469 .post(CommentResponse.class, form); 1470 1470 assertTrue(response.isRegistered()); 1471 assertFalse(response.is InUserSpace());1471 assertFalse(response.isPrivate()); 1472 1472 Comment comment = response.getComment(); 1473 1473 assertNotNull(comment); -
ComponentRegistry/trunk/ComponentRegistry/src/test/java/clarin/cmdi/componentregistry/rest/RestGroupServiceTest.java
r5568 r5603 860 860 assertTrue(response.isRegistered()); 861 861 assertFalse(response.isProfile()); 862 assertTrue(response.is InUserSpace());862 assertTrue(response.isPrivate()); 863 863 ComponentDescription desc = (ComponentDescription) response.getDescription(); 864 864 assertNotNull(desc); … … 877 877 assertTrue(response.isRegistered()); 878 878 assertFalse(response.isProfile()); 879 assertTrue(response.is InUserSpace());879 assertTrue(response.isPrivate()); 880 880 desc = (ComponentDescription) response.getDescription(); 881 881 assertNotNull(desc); … … 903 903 assertTrue(response.isRegistered()); 904 904 assertTrue(response.isProfile()); 905 assertTrue(response.is InUserSpace());905 assertTrue(response.isPrivate()); 906 906 ProfileDescription pdesc = (ProfileDescription) response.getDescription(); 907 907 assertNotNull(pdesc); … … 920 920 assertTrue(response.isRegistered()); 921 921 assertTrue(response.isProfile()); 922 assertTrue(response.is InUserSpace());922 assertTrue(response.isPrivate()); 923 923 pdesc = (ProfileDescription) response.getDescription(); 924 924 assertNotNull(pdesc); … … 954 954 .type(MediaType.MULTIPART_FORM_DATA).post( 955 955 RegisterResponse.class, form); 956 assertFalse(response.is InUserSpace());956 assertFalse(response.isPrivate()); 957 957 assertTrue(response.isProfile()); 958 958 assertEquals(ProfileDescription.PROFILE_PREFIX+"profile-1", response.getDescription().getId()); … … 979 979 .type(MediaType.MULTIPART_FORM_DATA).post( 980 980 RegisterResponse.class, form); 981 assertFalse(response.is InUserSpace());981 assertFalse(response.isPrivate()); 982 982 assertTrue(response.isProfile()); 983 983 assertEquals(ProfileDescription.PROFILE_PREFIX+"Bprofile-1", response.getDescription().getId()); … … 1014 1014 .type(MediaType.MULTIPART_FORM_DATA).post( 1015 1015 RegisterResponse.class, form); 1016 assertFalse(response.is InUserSpace());1016 assertFalse(response.isPrivate()); 1017 1017 assertFalse(response.isProfile()); 1018 1018 assertEquals(ComponentDescription.COMPONENT_PREFIX+"component-1", response.getDescription().getId()); … … 1040 1040 .type(MediaType.MULTIPART_FORM_DATA).post( 1041 1041 RegisterResponse.class, form); 1042 assertFalse(response.is InUserSpace());1042 assertFalse(response.isPrivate()); 1043 1043 assertFalse(response.isProfile()); 1044 1044 assertEquals(ComponentDescription.COMPONENT_PREFIX+"Bcomponent-1", response.getDescription().getId()); … … 1237 1237 .post(CommentResponse.class, form); 1238 1238 assertTrue(response.isRegistered()); 1239 assertTrue(response.is InUserSpace());1239 assertTrue(response.isPrivate()); 1240 1240 Comment comment = response.getComment(); 1241 1241 assertNotNull(comment); … … 1259 1259 .post(CommentResponse.class, form); 1260 1260 assertTrue(response.isRegistered()); 1261 assertTrue(response.is InUserSpace());1261 assertTrue(response.isPrivate()); 1262 1262 comment = response.getComment(); 1263 1263 assertNotNull(comment);
Note: See TracChangeset
for help on using the changeset viewer.