Changeset 5551
- Timestamp:
- 08/12/14 16:29:07 (10 years ago)
- Location:
- ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/impl/database/ComponentRegistryFactoryDbImpl.java
r5549 r5551 82 82 } 83 83 ComponentRegistryDbImpl cr = componentRegistryBeanFactory.getNewComponentRegistry();// default public registry 84 cr.setRegistrySpace(RegistrySpace. PRIVATE);84 cr.setRegistrySpace(RegistrySpace.GROUP); 85 85 cr.setRegistryOwner(owner); 86 86 cr.setGroupId(groupId); -
ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/rest/ComponentRegistryRestService.java
r5550 r5551 163 163 } 164 164 165 private boolean checkRegistrySpaceString(String registrySpace) { 166 return (registrySpace.equalsIgnoreCase("group") || registrySpace.equalsIgnoreCase("private") || registrySpace.equalsIgnoreCase("published")); 167 } 168 165 169 @Override 166 170 @GET … … 173 177 throws ComponentRegistryException, IOException { 174 178 long start = System.currentTimeMillis(); 179 180 if (!checkRegistrySpaceString(registrySpace)) { 181 response.sendError(Status.NOT_FOUND.getStatusCode(), "illegal registry space"); 182 return new ArrayList<ComponentDescription>(); 183 } 175 184 176 185 try { … … 205 214 206 215 long start = System.currentTimeMillis(); 216 217 if (!checkRegistrySpaceString(registrySpace)) { 218 response.sendError(Status.NOT_FOUND.getStatusCode(), "illegal registry space"); 219 return new ArrayList<ProfileDescription>(); 220 } 207 221 try { 208 222 ComponentRegistry cr = this.initialiseRegistry(registrySpace, groupId); … … 349 363 return createDownloadResponse(result, fileName); 350 364 } else { 351 return Response.status(Status.NOT_FOUND).entity("Usupported raw type " +rawType).build();365 return Response.status(Status.NOT_FOUND).entity("Usupported raw type " + rawType).build(); 352 366 } 353 367 354 368 355 369 } catch (UserUnauthorizedException e2) { … … 758 772 try { 759 773 ComponentRegistry br = this.getBaseRegistry(); 760 ComponentDescription desc = br.getComponentDescriptionAccessControlled(componentId);774 ComponentDescription desc = br.getComponentDescriptionAccessControlled(componentId); 761 775 if (desc != null) { 762 776 if (desc.isPublic()) { … … 931 945 return Response.serverError().status(Status.FORBIDDEN) 932 946 .entity("" + e.getMessage()).build(); 933 } 934 catch (ComponentRegistryException e) { 935 LOG.info("Could not find comment "+commentId+ " for "+profileId); 947 } catch (ComponentRegistryException e) { 948 LOG.info("Could not find comment " + commentId + " for " + profileId); 936 949 return Response.serverError().status(Status.INTERNAL_SERVER_ERROR) 937 950 .build(); 938 } 939 catch (IOException e) { 951 } catch (IOException e) { 940 952 LOG.error("Comment with id: " + commentId + " deletion failed.", e); 941 953 return Response.serverError().status(Status.INTERNAL_SERVER_ERROR) … … 985 997 return Response.serverError().status(Status.FORBIDDEN) 986 998 .entity("" + e.getMessage()).build(); 987 } catch (ComponentRegistryException e) { 988 LOG.info("Could not retrieve component " +componentId+" for the component "+componentId);999 } catch (ComponentRegistryException e) { 1000 LOG.info("Could not retrieve component " + componentId + " for the component " + componentId); 989 1001 return Response.serverError().status(Status.INTERNAL_SERVER_ERROR) 990 1002 .build(); … … 1066 1078 }; 1067 1079 } else { 1068 return Response.status(Status.NOT_FOUND).entity("Unsupported raw type " +rawType).build();1080 return Response.status(Status.NOT_FOUND).entity("Unsupported raw type " + rawType).build(); 1069 1081 } 1070 1082 return createDownloadResponse(result, fileName);
Note: See TracChangeset
for help on using the changeset viewer.