Fix for working copy checked out via CIFS is not accessible until FileStateReaper expires file state. ALF-962.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19783 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gary Spencer
2010-04-09 08:41:54 +00:00
parent 252533c313
commit 56f6c38b22

View File

@@ -1,20 +1,21 @@
/*
* Copyright (C) 2005-2010 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>. */
* Copyright (C) 2005-2010 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.filesys.repo.desk;
import java.io.Serializable;
@@ -25,13 +26,15 @@ import org.alfresco.filesys.alfresco.DesktopAction;
import org.alfresco.filesys.alfresco.DesktopParams;
import org.alfresco.filesys.alfresco.DesktopResponse;
import org.alfresco.filesys.alfresco.DesktopTarget;
import org.alfresco.filesys.state.FileState;
import org.alfresco.filesys.state.FileStateTable;
import org.alfresco.jlan.server.filesys.FileName;
import org.alfresco.jlan.server.filesys.FileStatus;
import org.alfresco.jlan.server.filesys.NotifyChange;
import org.alfresco.model.ContentModel;
import org.alfresco.service.cmr.coci.CheckOutCheckInService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.transaction.TransactionService;
/**
* Check In/Out Desktop Action Class
@@ -102,7 +105,7 @@ public class CheckInOutDesktopAction extends DesktopAction {
{
try
{
// Check in the file, pass an empty version properties so that veriosnable nodes create a new version
// Check in the file, pass an empty version properties so that versionable nodes create a new version
Map<String, Serializable> versionProperties = new HashMap<String, Serializable>();
getCheckInOutService().checkin( target.getNode(), versionProperties, null, false);
@@ -174,14 +177,26 @@ public class CheckInOutDesktopAction extends DesktopAction {
response.setStatus(StsSuccess, "Checked out working copy " + workingCopyName);
// Build the relative path to the checked out file
String fileName = FileName.buildPath( params.getFolder().getFullName(), null, workingCopyName, FileName.DOS_SEPERATOR);
// Update cached state for the working copy to indicate the file exists
FileStateTable stateTable = getContext().getStateTable();
if ( stateTable != null) {
// Update any cached state for the working copy file
FileState fstate = stateTable.findFileState( fileName);
if ( fstate != null)
fstate.setFileStatus( FileStatus.FileExists);
}
// Check if there are any file/directory change notify requests active
if ( getContext().hasChangeHandler()) {
// Build the relative path to the checked in file
String fileName = FileName.buildPath( params.getFolder().getFullName(), null, workingCopyName, FileName.DOS_SEPERATOR);
// Queue a file added change notification
getContext().getChangeHandler().notifyFileChanged(NotifyChange.ActionAdded, fileName);