display repository name rather than id

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1301526 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-03-16 14:02:51 +00:00
parent 684505391a
commit 2348ff4e62
2 changed files with 11 additions and 2 deletions

View File

@ -30,6 +30,7 @@ import org.apache.archiva.rest.api.model.BrowseResultEntry;
import org.apache.archiva.rest.api.model.VersionsList;
import org.apache.archiva.rest.api.services.ArchivaRestServiceException;
import org.apache.archiva.rest.api.services.BrowseService;
import org.apache.archiva.security.ArchivaSecurityException;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
@ -354,7 +355,15 @@ public class DefaultBrowseService
public List<ManagedRepository> getUserRepositories()
throws ArchivaRestServiceException
{
return userRepositories.getAccessibleRepositories( )
try
{
return userRepositories.getAccessibleRepositories( getPrincipal() );
}
catch ( ArchivaSecurityException e )
{
throw new ArchivaRestServiceException( "repositories.read.observable.error",
Response.Status.INTERNAL_SERVER_ERROR.getStatusCode() );
}
}
//---------------------------

View File

@ -383,7 +383,7 @@
<script id="selected_repository_tmpl" type="text/html">
<select id="repository">
{{each(i,repository) repositories}}
<option value="${repository}">${repository}</option>
<option value="${repository.id}">${repository.name}</option>
{{/each}}
</select>
</script>