void refresh(ItemData item) throws InvalidItemStateException, RepositoryException
{
if (!isModified(item) && itemsPool.contains(item.getIdentifier()))
{
// if not modified but was pooled, load data from persistent storage
ItemData persisted = transactionableManager.getItemData(item.getIdentifier());
if (persisted == null)
{
// ...try by path
NodeData parent = (NodeData)transactionableManager.getItemData(item.getParentIdentifier());
if (parent != null)
{
QPathEntry[] path = item.getQPath().getEntries();
persisted =
transactionableManager.getItemData(parent, path[path.length - 1], ItemType.getItemType(item));
} // else, the item has an invalid state, will be throwed on save
}
if (persisted != null)
{
// the item
itemsPool.reload(item.getIdentifier(), persisted);
// the childs is acquired in the session.
for (ItemImpl pooled : itemsPool.getDescendats(persisted.getQPath()))
{
persisted = transactionableManager.getItemData(pooled.getInternalIdentifier());
if (persisted == null)
{
// ...try by path