Changeset 12932
- Timestamp:
- 03/02/09 16:02:44 (3 years ago)
- Location:
- trunk/Jav_BDP_FS/com/scenari/m/bdp/item/fs
- Files:
-
- 3 edited
-
HContentAccessFs.java (modified) (6 diffs)
-
XItemCache.java (modified) (8 diffs)
-
XItemCacheData.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Jav_BDP_FS/com/scenari/m/bdp/item/fs/HContentAccessFs.java
r12843 r12932 50 50 import java.util.List; 51 51 52 import com.scenari.m.bdp.context.ContextBdp; 52 53 import com.scenari.m.bdp.item.IHItemDef; 53 54 import com.scenari.m.bdp.item.fs.TransfCacheMgr.CacheDef; … … 70 71 import com.scenari.src.feature.paths.SrcFeaturePaths; 71 72 import com.scenari.src.feature.random.SrcFeatureRandom; 72 import com.scenari.src.feature.refresh.SrcFeatureRefresh;73 73 import com.scenari.src.feature.rights.SrcFeatureRights; 74 74 import com.scenari.src.fs.mini.FsMiniFactory; … … 158 158 if (vItem == null) { return null; } 159 159 ISrcNode vItemSrc = vItem.getSource(); 160 // vItem.hRefresh();161 160 if (pTransforms == null) { 162 161 ISrcNode vSource; … … 431 430 432 431 if (vSource != vItemSource) { 433 //Si on a modifié une ressource dans l'item, on force un re freshde l'item.434 SrcFeatureRefresh.refresh(vItemSource);432 //Si on a modifié une ressource dans l'item, on force un recalcul de l'item. 433 vItem.reloadAfterUpdate(ContextBdp.getThreadClient()); 435 434 } 436 435 } … … 472 471 public final int hDeleteRes(IHItemDef pItemDef, String pFormat, String pUriRes, IHTransaction pTransaction) throws Exception { 473 472 XItemCache vItem = xGetItemCache(pItemDef); 474 // vItem.hRefresh();475 473 if (vItem == null) { return 0; } 476 474 ISrcNode vItemSrc = vItem.getSource(); … … 483 481 int vResult = vContent.removeSrc() ? 1 : 0; 484 482 if (vItemSrc != vContent) { 485 //Si on a modifié une ressource dans l'item, on force un re freshde l'item.486 SrcFeatureRefresh.refresh(vItemSrc);483 //Si on a modifié une ressource dans l'item, on force un recalcul de l'item. 484 vItem.reloadAfterUpdate(ContextBdp.getThreadClient()); 487 485 } 488 486 return vResult; -
trunk/Jav_BDP_FS/com/scenari/m/bdp/item/fs/XItemCache.java
r12844 r12932 79 79 public class XItemCache { 80 80 81 public static long sElapseBetweenRefresh = 1500; 82 81 83 /** 82 84 * AttrLink. … … 648 650 public void hRefresh() throws Exception { 649 651 XItemCacheData vDatas = getDatas(); 652 if (vDatas.fLastRefresh > 0 && vDatas.fLastRefresh >= System.currentTimeMillis() - sElapseBetweenRefresh) { 653 //Dernier refresh très récent, pas d'écriture entre temps, on passe. 654 //System.out.print('.'); 655 return; 656 } 650 657 ISrcNode vSrc = vDatas.getWspSrcNodeItem().getSubSrcNode(); 651 658 if (fStatusItem == IHItem.STATUS_UNKNOWN) { 652 xLoadItemFromSource(f StatusItem != IHItem.STATUS_UNKNOWN, vSrc, vSrc.getLastModifWithChildren());659 xLoadItemFromSource(false, vSrc, vSrc.getLastModifWithChildren(), IContextBdp.CLIENTID_NONE); 653 660 } else { 654 661 SrcFeatureRefresh.refresh(vSrc); 655 662 long vLastUpdt = vSrc.getLastModifWithChildren(); 656 663 if (vLastUpdt != fMemLastModif) { 657 xLoadItemFromSource(fStatusItem != IHItem.STATUS_UNKNOWN, vSrc, vLastUpdt); 658 } 659 } 664 xLoadItemFromSource(true, vSrc, vLastUpdt, IContextBdp.CLIENTID_NONE); 665 } 666 } 667 vDatas.fLastRefresh = System.currentTimeMillis(); 668 } 669 670 /** 671 * Rafraichit cet item si la source a été modifiée (cas des itesm multi-flux). 672 */ 673 public void reloadAfterUpdate(int pClientId) throws Exception { 674 XItemCacheData vDatas = getDatas(); 675 ISrcNode vSrc = vDatas.getWspSrcNodeItem().getSubSrcNode(); 676 SrcFeatureRefresh.refresh(vSrc); 677 long vLastUpdt = vSrc.getLastModifWithChildren(); 678 xLoadItemFromSource(true, vSrc, vLastUpdt, pClientId); 679 vDatas.fLastRefresh = System.currentTimeMillis(); 660 680 } 661 681 … … 823 843 public void hCommit() throws Exception { 824 844 XItemCacheData vItemData = getDatas(); 845 vItemData.fLastRefresh = System.currentTimeMillis(); 825 846 fMemLastModif = vItemData.getWspSrcNodeItem().getSubSrcNode().getLastModifWithChildren(); 826 847 } … … 916 937 if (vSrc == null) return; 917 938 long vLastModif = vSrc.getLastModifWithChildren(); 918 xLoadItemFromSource(pFireEventUpdated, vSrc, vLastModif); 939 xLoadItemFromSource(pFireEventUpdated, vSrc, vLastModif, IContextBdp.CLIENTID_NONE); 940 vDatas.fLastRefresh = System.currentTimeMillis(); 919 941 } 920 942 … … 926 948 * (et pas une découverte ou un chargement initial). 927 949 */ 928 protected void xLoadItemFromSource(boolean pFireEventUpdated, ISrcNode pSrc, long pLastModif ) throws Exception {950 protected void xLoadItemFromSource(boolean pFireEventUpdated, ISrcNode pSrc, long pLastModif, int pClientId) throws Exception { 929 951 boolean vFireEventUpdated = pFireEventUpdated || fWsp.fFireDiscoveredItems; 930 952 int vStatus = pSrc.getContentStatus(); … … 932 954 if (vStatus <= ISrcNode.STATUS_NONE) { 933 955 //L'item est supprimé 934 hRemove(vFireEventUpdated, IContextBdp.CLIENTID_NONE);956 hRemove(vFireEventUpdated, pClientId); 935 957 if (vStatus == ISrcNode.STATUS_CONFLICT) { 936 958 fStatusItem = IHItemDef.STATUS_CONFLICT; … … 948 970 IHModuleSave vModuleSave = vItemType.hGetModuleSave(); 949 971 IHItem vNewItem = vModuleSave.hFillItem(vCurrent, null, vStream, null); 950 hSaveInCache(vNewItem, vFireEventUpdated, IContextBdp.CLIENTID_NONE);972 hSaveInCache(vNewItem, vFireEventUpdated, pClientId); 951 973 } else { 952 974 fStatusItem = IHItem.STATUS_ERRORS; 953 if (vFireEventUpdated) fWsp.xFireEventItemRemoved(this, null, IContextBdp.CLIENTID_NONE);975 if (vFireEventUpdated) fWsp.xFireEventItemRemoved(this, null, pClientId); 954 976 xValidPointers(vFireEventUpdated); 955 977 } … … 957 979 HLogMgr.hPublishException(e, "Echec au traitement d'un item : " + hGetSpace() + "/" + hGetCode(), IHLogMessage.TYPE_WARNING); 958 980 fStatusItem = IHItem.STATUS_ERRORS; 959 if (vFireEventUpdated) fWsp.xFireEventItemRemoved(this, null, IContextBdp.CLIENTID_NONE);981 if (vFireEventUpdated) fWsp.xFireEventItemRemoved(this, null, pClientId); 960 982 xValidPointers(vFireEventUpdated); 961 983 } finally { -
trunk/Jav_BDP_FS/com/scenari/m/bdp/item/fs/XItemCacheData.java
r12705 r12932 69 69 /** Dom en cache. */ 70 70 protected Document fDom = null; 71 72 protected long fLastRefresh = -1L; 71 73 72 74 public XItemCacheData(XItemCache pItemCache, ISrcNode pSource) {
Note: See TracChangeset
for help on using the changeset viewer.