This commit is contained in:
Lucio Lelii 2018-06-26 08:51:34 +00:00
parent 4af9f3bf64
commit 4209d0d5a7
3 changed files with 6 additions and 4 deletions

View File

@ -37,7 +37,7 @@ public class ItemManagerPlugin extends AbstractPlugin<WebTarget, ItemManagerClie
Node node =result.getNode();
Node child=node.getFirstChild();
String address = child.getTextContent();
GcubeService service = GcubeService.service().withName(Constants.MANAGER_QNAME).andPath("item");
GcubeService service = GcubeService.service().withName(Constants.MANAGER_QNAME).andPath("items");
return TargetFactory.stubFor(service).at(address);
}

View File

@ -34,7 +34,7 @@ public class Items {
String afi = null;
try (InputStream is = new FileInputStream(new File("/home/lucio/Downloads/rockandroll.jpeg"))){
afi = shc.getWSRoot().uploadFile(is, "tes-image.jpeg", "descr").get().getId();
shc.getWSRoot().uploadFile(is, "tes-image.jpeg", "descr");
System.out.println(afi);
} catch (Exception e) {

View File

@ -23,6 +23,7 @@ import org.gcube.common.storagehub.model.expressions.date.Before;
import org.gcube.common.storagehub.model.expressions.logical.And;
import org.gcube.common.storagehub.model.expressions.logical.ISDescendant;
import org.gcube.common.storagehub.model.expressions.text.Contains;
import org.gcube.common.storagehub.model.expressions.text.Like;
import org.gcube.common.storagehub.model.items.AbstractFileItem;
import org.gcube.common.storagehub.model.items.Item;
import org.gcube.common.storagehub.model.query.Queries;
@ -176,9 +177,10 @@ public class TestCall {
WorkspaceManagerClient wsclient = AbstractPlugin.workspace().build();
//String path = wsclient.getVreFolder("hl:accounting").getPath();
//System.out.println("path is "+path);
query.setExpression(new ISDescendant(Paths.getPath("/Home/massimiliano.assante/Workspace/MySpecialFolders/gcube-devNext-NextNext/")));
query.setExpression(new And(new ISDescendant(Paths.getPath("/Home/massimiliano.assante/Workspace/MySpecialFolders/gcube-devNext-NextNext/")),
new Like(GenericSearchableItem.get().title,"title")));
query.setLimit(10);
query.setOrder(new OrderField(GenericSearchableItem.get().lastModification,MODE.DESC));
query.setOrder(new OrderField(GenericSearchableItem.get().title));
List<? extends Item> items = wsclient.search(query, "hl:accounting", "jcr:content");
for (Item item: items) {
System.out.println(item.getName()+" "+item.getLastModificationTime().getTimeInMillis());