Merged V3.2 to HEAD

15171: Merged V3.1 to V3.2
        14215: Fixed ETHREEOH-1314 - WCM - content publisher cannot submit existing folder that has modified properties


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16852 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2009-10-13 10:46:28 +00:00
parent cc86399e68
commit d78e0152e2
3 changed files with 21 additions and 12 deletions

View File

@@ -578,7 +578,7 @@ public class AssetServiceImplTest extends AbstractWCMServiceImplTest
assertEquals("file description", props.get(ContentModel.PROP_DESCRIPTION)); assertEquals("file description", props.get(ContentModel.PROP_DESCRIPTION));
/* TODO - pending ETHREEOH-1314 - fails for content contributor / content publisher during submit if updating folder properties /* TODO - pending ETHREEOH-1314 - fails for content contributor / content publisher during submit if updating folder properties
*/
// update folder properties - eg. title and description // update folder properties - eg. title and description
newProps = new HashMap<QName, Serializable>(2); newProps = new HashMap<QName, Serializable>(2);
@@ -589,7 +589,8 @@ public class AssetServiceImplTest extends AbstractWCMServiceImplTest
props = assetService.getAssetProperties(existingFolder1Asset); props = assetService.getAssetProperties(existingFolder1Asset);
assertEquals("folder title", props.get(ContentModel.PROP_TITLE)); assertEquals("folder title", props.get(ContentModel.PROP_TITLE));
assertEquals("folder description", props.get(ContentModel.PROP_DESCRIPTION)); assertEquals("folder description", props.get(ContentModel.PROP_DESCRIPTION));
*/
} }
else else
{ {

View File

@@ -162,7 +162,7 @@ public class SandboxServiceImpl implements SandboxService
{ {
ParameterCheck.mandatoryString("wpStoreId", wpStoreId); ParameterCheck.mandatoryString("wpStoreId", wpStoreId);
String currentUserName = AuthenticationUtil.getRunAsUser(); String currentUserName = AuthenticationUtil.getFullyAuthenticatedUser();
SandboxInfo sbInfo = null; SandboxInfo sbInfo = null;
if (! wpService.isWebUser(wpStoreId, currentUserName)) if (! wpService.isWebUser(wpStoreId, currentUserName))
@@ -246,7 +246,7 @@ public class SandboxServiceImpl implements SandboxService
{ {
ParameterCheck.mandatoryString("wpStoreId", wpStoreId); ParameterCheck.mandatoryString("wpStoreId", wpStoreId);
String currentUser = AuthenticationUtil.getRunAsUser(); String currentUser = AuthenticationUtil.getFullyAuthenticatedUser();
List<SandboxInfo> sbInfos = null; List<SandboxInfo> sbInfos = null;
@@ -326,7 +326,7 @@ public class SandboxServiceImpl implements SandboxService
if (! WCMUtil.isStagingStore(sbStoreId)) if (! WCMUtil.isStagingStore(sbStoreId))
{ {
String currentUser = AuthenticationUtil.getRunAsUser(); String currentUser = AuthenticationUtil.getFullyAuthenticatedUser();
if (! ((WCMUtil.getUserName(sbStoreId).equals(currentUser)) || (wpService.isContentManager(wpStoreId, currentUser)))) if (! ((WCMUtil.getUserName(sbStoreId).equals(currentUser)) || (wpService.isContentManager(wpStoreId, currentUser))))
{ {
@@ -344,7 +344,7 @@ public class SandboxServiceImpl implements SandboxService
{ {
ParameterCheck.mandatoryString("wpStoreId", wpStoreId); ParameterCheck.mandatoryString("wpStoreId", wpStoreId);
String currentUserName = AuthenticationUtil.getRunAsUser(); String currentUserName = AuthenticationUtil.getFullyAuthenticatedUser();
return getSandbox(WCMUtil.buildUserMainStoreName(WCMUtil.buildStagingStoreName(wpStoreId), currentUserName)); return getSandbox(WCMUtil.buildUserMainStoreName(WCMUtil.buildStagingStoreName(wpStoreId), currentUserName));
} }
@@ -378,7 +378,7 @@ public class SandboxServiceImpl implements SandboxService
String wpStoreId = WCMUtil.getWebProjectStoreId(sbStoreId); String wpStoreId = WCMUtil.getWebProjectStoreId(sbStoreId);
String currentUserName = AuthenticationUtil.getRunAsUser(); String currentUserName = AuthenticationUtil.getFullyAuthenticatedUser();
if (sbStoreId.equals(WCMUtil.buildUserMainStoreName(wpStoreId, currentUserName))) if (sbStoreId.equals(WCMUtil.buildUserMainStoreName(wpStoreId, currentUserName)))
{ {
// author may delete their own sandbox // author may delete their own sandbox
@@ -725,7 +725,7 @@ public class SandboxServiceImpl implements SandboxService
// mysite--workflow-9161f640-b020-11db-8015-130bf9b5b652 // mysite--workflow-9161f640-b020-11db-8015-130bf9b5b652
String workflowMainStoreName = sandboxInfo.getMainStoreName(); String workflowMainStoreName = sandboxInfo.getMainStoreName();
List<AVMDifference> diffs = new ArrayList<AVMDifference>(srcPaths.size()); final List<AVMDifference> diffs = new ArrayList<AVMDifference>(srcPaths.size());
// get diff list - also process expiration dates, if any, and set virt svr update path // get diff list - also process expiration dates, if any, and set virt svr update path
@@ -766,7 +766,15 @@ public class SandboxServiceImpl implements SandboxService
} }
// write changes to layer so files are marked as modified // write changes to layer so files are marked as modified
AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<Object>()
{
public Object doWork() throws Exception
{
avmSyncService.update(diffs, null, false, false, false, false, null, null); avmSyncService.update(diffs, null, false, false, false, false, null, null);
return null;
}
}, AuthenticationUtil.getSystemUserName());
return new Pair<SandboxInfo, String>(sandboxInfo, virtUpdatePath); return new Pair<SandboxInfo, String>(sandboxInfo, virtUpdatePath);
} }

View File

@@ -284,7 +284,7 @@ public class WebProjectServiceImpl extends WCMUtil implements WebProjectService
// TODO: Currently auto-creates author sandbox for creator of web project (eg. an admin or a DM contributor to web projects root space) // TODO: Currently auto-creates author sandbox for creator of web project (eg. an admin or a DM contributor to web projects root space)
// NOTE: JSF client does not yet allow explicit creation of author sandboxes // NOTE: JSF client does not yet allow explicit creation of author sandboxes
inviteWebUser(wpNodeRef, AuthenticationUtil.getRunAsUser(), WCMUtil.ROLE_CONTENT_MANAGER, true); inviteWebUser(wpNodeRef, AuthenticationUtil.getFullyAuthenticatedUser(), WCMUtil.ROLE_CONTENT_MANAGER, true);
// Bind the post-commit transaction listener with data required for virtualization server notification // Bind the post-commit transaction listener with data required for virtualization server notification
CreateWebProjectTransactionListener tl = new CreateWebProjectTransactionListener(wpStoreId); CreateWebProjectTransactionListener tl = new CreateWebProjectTransactionListener(wpStoreId);
@@ -764,7 +764,7 @@ public class WebProjectServiceImpl extends WCMUtil implements WebProjectService
*/ */
public boolean isContentManager(String storeName) public boolean isContentManager(String storeName)
{ {
return isContentManager(storeName, AuthenticationUtil.getRunAsUser()); return isContentManager(storeName, AuthenticationUtil.getFullyAuthenticatedUser());
} }
/* (non-Javadoc) /* (non-Javadoc)
@@ -780,7 +780,7 @@ public class WebProjectServiceImpl extends WCMUtil implements WebProjectService
*/ */
public boolean isContentManager(NodeRef wpNodeRef) public boolean isContentManager(NodeRef wpNodeRef)
{ {
return isContentManager(wpNodeRef, AuthenticationUtil.getRunAsUser()); return isContentManager(wpNodeRef, AuthenticationUtil.getFullyAuthenticatedUser());
} }
/* (non-Javadoc) /* (non-Javadoc)