- Timestamp:
- 03/14/10 09:12:55 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Jav_Wsp/src/com/scenari/m/bdp/item/fs/HWorkspaceFs.java
r14725 r15098 555 555 fFireDiscoveredItems = vOld; 556 556 } 557 break; 558 559 case space: 560 case wsp: 561 //not implemented 562 assert (false); 557 563 } 558 564 } … … 641 647 vResult = new XItemCache(this, vSrcNode); 642 648 fItemsByUri.put(pUri, vResult); 643 String vId = SrcFeatureIds.getSrcId(vSrcNode);644 if (vId != null) {645 fItemsById.put(vId, vResult);646 }647 649 vResult.refresh(true); 648 650 } … … 657 659 * L'itemCache a été rafraichit. 658 660 * 659 * Retourne null si l' uri n'est pas une uri d'item.661 * Retourne null si l'id n'existe pas. 660 662 */ 661 663 protected XItemCache xGetItemCacheById(String pSrcId, boolean pRefresh) throws Exception { … … 665 667 ISrcNode vSrcNode = SrcFeatureIds.findNodeById(fSubSrcNode, pSrcId); 666 668 if (vSrcNode != null) { 667 vResult = new XItemCache(this, vSrcNode); 668 fItemsByUri.put(vSrcNode.getSrcUri(), vResult); 669 //Mutualisation des strings, on reprend la String de l'id de la source. 670 String vId = SrcFeatureIds.getSrcId(vSrcNode); 671 if (vId != null) { 672 fItemsById.put(vId, vResult); 673 } 674 } 675 } 676 if (pRefresh && vResult != null) vResult.refresh(true); 669 String vSrcId = SrcFeatureIds.getSrcId(vSrcNode); 670 if (vSrcId != null && vSrcId.equals(pSrcId)) { 671 vResult = new XItemCache(this, vSrcNode); 672 fItemsByUri.put(vSrcNode.getSrcUri(), vResult); 673 if (!pRefresh) vResult.setId(vSrcNode); 674 } else if (vSrcId != null) { 675 //pSrcId était un alias vers le "bon id". 676 return xGetItemCacheById(vSrcId, pRefresh); 677 } 678 } 679 } 680 if (pRefresh && vResult != null) { 681 String vId = vResult.fId; 682 vResult.refresh(true); 683 if (vId != null && (vResult.fId == null || !vResult.fId.equals(vId))) { 684 //L'id a été modifié au refresh... 685 return xGetItemCacheById(pSrcId, pRefresh); 686 } 687 } 677 688 return vResult; 678 689 } … … 691 702 vResult = new XItemCache(this, pSubSrcNode); 692 703 fItemsByUri.put(pSubSrcNode.getSrcUri(), vResult); 693 String vId = SrcFeatureIds.getSrcId(pSubSrcNode);694 if (vId != null) {695 fItemsById.put(vId, vResult);696 }697 704 } 698 705 vResult.refresh(true); … … 713 720 vResult = new XItemCache(this, vSrcNode); 714 721 fItemsByUri.put(pUri, vResult); 715 String vId = SrcFeatureIds.getSrcId(vSrcNode); 716 if (vId != null) { 717 fItemsById.put(vId, vResult); 718 } 722 if (!pRefresh) vResult.setId(vSrcNode); 719 723 } 720 724 if (pRefresh) vResult.refresh(true); … … 728 732 assert Thread.holdsLock(this); 729 733 fItemsByUri.remove(pItemCache.fUri); 730 XItemCacheData vDatas = pItemCache.getDatasIfExist(); 731 if (vDatas != null) { 732 ISrcNode vSrcNode = vDatas.getWspSrcNodeItem(); 733 try { 734 String vId = SrcFeatureIds.getSrcId(vSrcNode); 735 if (vId != null) { 736 fItemsById.remove(vId); 737 } 738 } catch (Exception e) { 739 LogMgr.publishException(e); 740 } 734 if (pItemCache.fId != null) { 735 fItemsById.remove(pItemCache.fId); 741 736 } 742 737 }
Note: See TracChangeset
for help on using the changeset viewer.