+ public void updateNodeChildren(final RestResource resource){
+
+ if(resource instanceof RestResourceWrapper){
+ boolean updated=false;
+ if(((RestResourceWrapper)resource).getResource().getFolders().size()==0){
+ if(model.getMymap().get(((RestResourceWrapper)resource).getResource().getParentURI())!=null){
+ model.getMymap().get(((RestResourceWrapper)resource).getResource().getParentURI()).refresh(null);
+ updated=true;
+ }
+ if(model.getOthersmap().get(((RestResourceWrapper)resource).getResource().getParentURI())!=null){
+ model.getOthersmap().get(((RestResourceWrapper)resource).getResource().getParentURI()).refresh(null);
+ updated=true;
+ }
+ if(model.getSharedmap().get(((RestResourceWrapper)resource).getResource().getParentURI())!=null){
+ model.getSharedmap().get(((RestResourceWrapper)resource).getResource().getParentURI()).refresh(null);
+ updated=true;
+ }
+ if(updated){
+ if(utils.doesSharedNodeContainsResourceIn1stLevel(resource.getUri())){
+ updateMySharedNode();
+ }
+ return;
+ }
+ }
+ }
+
+ utils.refreshNodeContainingResource(resource);
+ if(utils.doesSharedNodeContainsResourceIn1stLevel(resource.getUri())){
+ updateMySharedNode();
+ }
+
+ }
+ public void updateNodeChildrenForRemove(final String resource){
+ GWT.log("********************************");
+ GWT.log("[UPDATENODECHILDREN]"+resource);
+ GWT.log("********************************");
+ boolean updated=false;
+ TreeNode node=null;
+ if(tree.getRootTreeNode().isChildOpen(0)){
+ node = utils.getNodeContainingResource2(tree.getRootTreeNode().setChildOpen(0,true), resource);
+ }
+ GWT.log("CHECK NODE1:"+node+" "+resource);
+ if(node==null)
+ if(tree.getRootTreeNode().isChildOpen(2)){
+ GWT.log("CHECK NODE2:"+node);
+ node = utils.getNodeContainingResource2(tree.getRootTreeNode().setChildOpen(2,true), resource);
+ }
+ if(node==null)
+ if(tree.getRootTreeNode().isChildOpen(3)){
+ GWT.log("CHECK NODE3:"+node);
+ node = utils.getNodeContainingResource2(tree.getRootTreeNode().setChildOpen(3,true), resource);
+ }
+
+ if(node != null && node.getValue() instanceof RestResourceWrapper){
+ GWT.log("*********************"+((RestResourceWrapper) node.getValue()).getResource().getFolders().size());
+ if(((RestResourceWrapper) node.getValue()).getResource().getFolders().size()==1||((RestResourceWrapper) node.getValue()).getResource().getFolders().size()==0)
+ updateNodeChildren(((RestResourceWrapper) node.getValue()).getResource().getParentURI());
+ else
+ updateNodeChildren(((RestResource) node.getValue()).getUri());
+ return;
+ /*GWT.log("INSIDE:"+node);
+ RestResourceWrapper rw = (RestResourceWrapper) node.getValue();
+ //if(rw.getResource().getFolders().size()==0){
+ if(model.getMymap().get(rw.getResource().getUri())!=null){
+ model.getMymap().get(rw.getResource().getUri()).refresh(null);
+ updated=true;
+ }
+ if(model.getOthersmap().get(rw.getResource().getUri())!=null){
+ model.getOthersmap().get(rw.getResource().getUri()).refresh(null);
+ updated=true;
+ }
+ if(model.getSharedmap().get(rw.getResource().getUri())!=null){
+ model.getSharedmap().get(rw.getResource().getUri()).refresh(null);
+ updated=true;
+ }
+ if(updated){
+ if(doesSharedNodeContainsResourceIn1stLevel(resource)){
+ updateMySharedNode();
+ }
+ return;
+ }
+ }
+ //}*/
+
+ }
+ updateNodeChildren(resource);
+ }
+ public void updateNodeChildren(final String resource){
+
+
+ GWT.log("REFRESH THE OTHER WAY");
+ utils.refreshNodeContainingResource(resource);
+ if(utils.doesSharedNodeContainsResourceIn1stLevel(resource)){
+ updateMySharedNode();
+ }
+ }
+