|
|
|
@ -254,13 +254,14 @@ public class ItemsManager {
|
|
|
|
|
@Path("{id}/search")
|
|
|
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
|
|
|
public ItemList searchItems(@QueryParam("showHidden") Boolean showHidden, @QueryParam("exclude") List<String> excludes, @QueryParam("onlyType") String nodeType,@QueryParam("name") String name ){
|
|
|
|
|
InnerMethodName.instance.set("listById");
|
|
|
|
|
InnerMethodName.instance.set("search");
|
|
|
|
|
Session ses = null;
|
|
|
|
|
List<? extends Item> toReturn = null;
|
|
|
|
|
try{
|
|
|
|
|
ses = repository.getRepository().login(CredentialHandler.getAdminCredentials(context));
|
|
|
|
|
authChecker.checkReadAuthorizationControl(ses, id);
|
|
|
|
|
toReturn = Utils.serachByNameOnFolder(ses, ses.getNodeByIdentifier(id), excludes, null, showHidden==null?false:showHidden, nodeType!=null ? ClassHandler.instance().get(nodeType) : null, name);
|
|
|
|
|
log.debug("search retrieved {} elements",toReturn.size());
|
|
|
|
|
}catch (ItemNotFoundException e) {
|
|
|
|
|
log.error("id {} not found",id,e);
|
|
|
|
|
GXOutboundErrorResponse.throwException(new IdNotFoundException(id, e), Status.NOT_FOUND);
|
|
|
|
|