accounting on serach method fixed
This commit is contained in:
parent
4ebc3ce222
commit
df1956c08d
|
@ -4,10 +4,7 @@
|
||||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||||
<dependent-module archiveName="authorization-control-library-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/authorization-control-library/authorization-control-library">
|
<dependent-module archiveName="storagehub-model-1.0.6.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/storagehub-model/storagehub-model">
|
||||||
<dependency-type>uses</dependency-type>
|
|
||||||
</dependent-module>
|
|
||||||
<dependent-module archiveName="storagehub-model-1.0.6-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/storagehub-model/storagehub-model">
|
|
||||||
<dependency-type>uses</dependency-type>
|
<dependency-type>uses</dependency-type>
|
||||||
</dependent-module>
|
</dependent-module>
|
||||||
<property name="context-root" value="storagehub"/>
|
<property name="context-root" value="storagehub"/>
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package org.gcube.data.access.storagehub;
|
package org.gcube.data.access.storagehub;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.ws.rs.ext.Provider;
|
||||||
|
|
||||||
import org.apache.jackrabbit.api.JackrabbitRepository;
|
import org.apache.jackrabbit.api.JackrabbitRepository;
|
||||||
import org.gcube.data.access.storagehub.services.GroupManager;
|
|
||||||
import org.gcube.data.access.storagehub.services.RepositoryInitializer;
|
import org.gcube.data.access.storagehub.services.RepositoryInitializer;
|
||||||
import org.glassfish.jersey.server.monitoring.ApplicationEvent;
|
import org.glassfish.jersey.server.monitoring.ApplicationEvent;
|
||||||
import org.glassfish.jersey.server.monitoring.ApplicationEventListener;
|
import org.glassfish.jersey.server.monitoring.ApplicationEventListener;
|
||||||
|
@ -12,6 +12,7 @@ import org.glassfish.jersey.server.monitoring.RequestEventListener;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
@Provider
|
||||||
public class MyApplicationListener implements ApplicationEventListener {
|
public class MyApplicationListener implements ApplicationEventListener {
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(MyApplicationListener.class);
|
private static final Logger log = LoggerFactory.getLogger(MyApplicationListener.class);
|
||||||
|
@ -21,6 +22,7 @@ public class MyApplicationListener implements ApplicationEventListener {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEvent(ApplicationEvent event) {
|
public void onEvent(ApplicationEvent event) {
|
||||||
|
log.info("StorageHub - event called");
|
||||||
switch (event.getType()) {
|
switch (event.getType()) {
|
||||||
case DESTROY_FINISHED:
|
case DESTROY_FINISHED:
|
||||||
log.info("Destroying application storageHub");
|
log.info("Destroying application storageHub");
|
||||||
|
|
|
@ -254,13 +254,14 @@ public class ItemsManager {
|
||||||
@Path("{id}/search")
|
@Path("{id}/search")
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
public ItemList searchItems(@QueryParam("showHidden") Boolean showHidden, @QueryParam("exclude") List<String> excludes, @QueryParam("onlyType") String nodeType,@QueryParam("name") String name ){
|
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;
|
Session ses = null;
|
||||||
List<? extends Item> toReturn = null;
|
List<? extends Item> toReturn = null;
|
||||||
try{
|
try{
|
||||||
ses = repository.getRepository().login(CredentialHandler.getAdminCredentials(context));
|
ses = repository.getRepository().login(CredentialHandler.getAdminCredentials(context));
|
||||||
authChecker.checkReadAuthorizationControl(ses, id);
|
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);
|
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) {
|
}catch (ItemNotFoundException e) {
|
||||||
log.error("id {} not found",id,e);
|
log.error("id {} not found",id,e);
|
||||||
GXOutboundErrorResponse.throwException(new IdNotFoundException(id, e), Status.NOT_FOUND);
|
GXOutboundErrorResponse.throwException(new IdNotFoundException(id, e), Status.NOT_FOUND);
|
||||||
|
|
|
@ -25,7 +25,7 @@ The projects leading to this software have received funding from a series of
|
||||||
Version
|
Version
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
|
|
||||||
1.0.9 (2020-01-22)
|
1.0.9 (2020-01-24)
|
||||||
|
|
||||||
Please see the file named "changelog.xml" in this directory for the release notes.
|
Please see the file named "changelog.xml" in this directory for the release notes.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue