Merged V3.0 to HEAD

12003: ETHREEOH-535: User with Editor role can't edit content
   12016: ETHREEOH-864
   12018: Fixed NullPointerException during NFS mount. JLAN-51.
   12019: Fixed problems in mounting the Alfresco filesystems with NFS. ETHREEOH-913.
   12020: Use a default RPC authenticator if not specified in the xml configuration. JLAN-51.
   12021: Fixed typo in Portmapper server class name that is loader dynamically. JLAN-52.
   12025: MT - fix export/import tenant (ensure tenant admin ops run in tx)
   12026: Site service now returns information about the site managers. First part of fix for ETHREEOH-547
   12027: Fix for ETHREEOH-664 and ETHREEOH-789. RSS feed issues and authentication errors when trying to retrieve user details via feed service endpoint.
   12029: Fix for some wiki page links being highlighted as "missing page" when they're not
   12030: ETHREEOH-916 - Unable to "Publish Internally" a newly created blog post
   12031: Added logging to thumbnail service to help diagnose ETHREEOH-910 should it occur again
   12032: Removed out of date comment on mysql driver
   12034: Suppress freemarker.runtime ERROR log messages. These may correspond to exceptions that get handled by Alfresco's retrying transaction handler (e.g. optimistic locking failures) and are only passed on and logged if the retry threshold is exceeded.
   12037: Fix for ETHREEOH-901: Radio buttons using a enumeration can not be selected in internet explorer and selecting an option in a drop down menu causes a script error in Internet Explorer
   12038: Merged 2.2 to 3.0
      12017: Integrated ETWOTWO-926: Inline callouts should be able to reference a web script maintained in the Data Dictionary
   12042: Build fix
   12043: Fix for ETHREEOH-472 & ETHREEOH-473: File picker restrictions (folder and search) do not work.
   12065: New class Alfresco.service.Preferences that makes it easy to add and remove user preferences.
   12069: Fix for ETHREEOH-926. Fixed bug webscript matching code when url element containing a dot is followed by further url elements.
   12071: Added support to Alfresco.service.Preferences so it can handle hirerchial properties, ie "org.alfresco.share.sites.favourites"
   12074: Fix for ETHREEOH-896: XML Form layout is incorrect on Firefox 3
   12075: Fix for ETHREEOH-917 - help text for Create Site changed as requested.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@12497 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2008-12-18 15:49:55 +00:00
parent 6b3d327f64
commit 9f42bfac4c
9 changed files with 571 additions and 385 deletions

View File

@@ -36,7 +36,7 @@
#db.url=jdbc:derby:/srv/alfresco/alf_data/derby_data/alfresco;create=true #db.url=jdbc:derby:/srv/alfresco/alf_data/derby_data/alfresco;create=true
# #
# MySQL connection (This is default and requires mysql-connector-java-5.0.3-bin.jar, which ships with the Alfresco server) # MySQL connection
# #
#db.driver=org.gjt.mm.mysql.Driver #db.driver=org.gjt.mm.mysql.Driver
#db.url=jdbc:mysql://localhost/alfresco #db.url=jdbc:mysql://localhost/alfresco

View File

@@ -644,7 +644,7 @@
<property name="afterInvocationManager"><ref local="afterInvocationManager"/></property> <property name="afterInvocationManager"><ref local="afterInvocationManager"/></property>
<property name="objectDefinitionSource"> <property name="objectDefinitionSource">
<value> <value>
org.alfresco.service.cmr.coci.CheckOutCheckInService.checkout=ACL_NODE.0.cm:lockable.CheckOut,ACL_NODE.1.sys:base.CreateChildren org.alfresco.service.cmr.coci.CheckOutCheckInService.checkout=ACL_NODE.0.cm:lockable.CheckOut
org.alfresco.service.cmr.coci.CheckOutCheckInService.checkin=ACL_NODE.0.cm:lockable.CheckIn org.alfresco.service.cmr.coci.CheckOutCheckInService.checkin=ACL_NODE.0.cm:lockable.CheckIn
org.alfresco.service.cmr.coci.CheckOutCheckInService.cancelCheckout=ACL_NODE.0.cm:lockable.CancelCheckOut org.alfresco.service.cmr.coci.CheckOutCheckInService.cancelCheckout=ACL_NODE.0.cm:lockable.CancelCheckOut
org.alfresco.service.cmr.coci.CheckOutCheckInService.getWorkingCopy=ACL_NODE.0.sys:base.Read org.alfresco.service.cmr.coci.CheckOutCheckInService.getWorkingCopy=ACL_NODE.0.sys:base.Read

View File

@@ -255,7 +255,7 @@ public class AlfrescoRpcAuthenticator implements RpcAuthenticator {
{ {
// Start a transaction // Start a transaction
UserTransaction tx = m_alfrescoConfig.getTransactionService().getUserTransaction( true); UserTransaction tx = m_alfrescoConfig.getTransactionService().getUserTransaction( false);
try try
{ {

View File

@@ -31,6 +31,7 @@ import java.util.Map;
import org.alfresco.error.AlfrescoRuntimeException; import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.i18n.I18NUtil; import org.alfresco.i18n.I18NUtil;
import org.alfresco.model.ContentModel; import org.alfresco.model.ContentModel;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.version.VersionableAspect; import org.alfresco.repo.version.VersionableAspect;
import org.alfresco.service.cmr.coci.CheckOutCheckInService; import org.alfresco.service.cmr.coci.CheckOutCheckInService;
import org.alfresco.service.cmr.coci.CheckOutCheckInServiceException; import org.alfresco.service.cmr.coci.CheckOutCheckInServiceException;
@@ -194,9 +195,9 @@ public class CheckOutCheckInServiceImpl implements CheckOutCheckInService
* @see org.alfresco.service.cmr.coci.CheckOutCheckInService#checkout(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.namespace.QName, org.alfresco.service.namespace.QName) * @see org.alfresco.service.cmr.coci.CheckOutCheckInService#checkout(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.namespace.QName, org.alfresco.service.namespace.QName)
*/ */
public NodeRef checkout( public NodeRef checkout(
NodeRef nodeRef, final NodeRef nodeRef,
NodeRef destinationParentNodeRef, final NodeRef destinationParentNodeRef,
QName destinationAssocTypeQName, final QName destinationAssocTypeQName,
QName destinationAssocQName) QName destinationAssocQName)
{ {
LockType lockType = this.lockService.getLockType(nodeRef); LockType lockType = this.lockService.getLockType(nodeRef);
@@ -242,12 +243,19 @@ public class CheckOutCheckInServiceImpl implements CheckOutCheckInService
} }
// Make the working copy // Make the working copy
destinationAssocQName = QName.createQName(destinationAssocQName.getNamespaceURI(), QName.createValidLocalName(copyName)); final QName copyQName = QName.createQName(destinationAssocQName.getNamespaceURI(), QName.createValidLocalName(copyName));
NodeRef workingCopy = this.copyService.copy( NodeRef workingCopy = AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<NodeRef>()
nodeRef, {
destinationParentNodeRef, public NodeRef doWork() throws Exception
destinationAssocTypeQName, {
destinationAssocQName); NodeRef workingCopy = copyService.copy(
nodeRef,
destinationParentNodeRef,
destinationAssocTypeQName,
copyQName);
return workingCopy;
}
}, AuthenticationUtil.getSystemUserName());
// Update the working copy name // Update the working copy name
this.nodeService.setProperty(workingCopy, ContentModel.PROP_NAME, copyName); this.nodeService.setProperty(workingCopy, ContentModel.PROP_NAME, copyName);

View File

@@ -74,7 +74,7 @@ public interface SiteService
/** /**
* List the memebers of the site. * List the memebers of the site.
* <p> * <p>
* Name and role filters are optional and if not specified all the memebers of the site are returned. * Name and role filters are optional and if not specified all the members of the site are returned.
* *
* @param shortName site short name * @param shortName site short name
* @param nameFilter name filter * @param nameFilter name filter

File diff suppressed because it is too large Load Diff

View File

@@ -374,6 +374,20 @@ public class SiteServiceImplTest extends BaseAlfrescoSpringTest
assertTrue(members.containsKey(USER_THREE)); assertTrue(members.containsKey(USER_THREE));
assertEquals(SiteModel.SITE_COLLABORATOR, members.get(USER_THREE)); assertEquals(SiteModel.SITE_COLLABORATOR, members.get(USER_THREE));
// Get only the site managers
members = this.siteService.listMembers("testMembership", null, SiteModel.SITE_MANAGER);
assertNotNull(members);
assertEquals(1, members.size());
assertTrue(members.containsKey(USER_ONE));
assertEquals(SiteModel.SITE_MANAGER, members.get(USER_ONE));
// Get only user two
members = this.siteService.listMembers("testMembership", USER_TWO, null);
assertNotNull(members);
assertEquals(1, members.size());
assertTrue(members.containsKey(USER_TWO));
assertEquals(SiteModel.SITE_CONSUMER, members.get(USER_TWO));
// Change the membership of user two // Change the membership of user two
this.siteService.setMembership("testMembership", USER_TWO, SiteModel.SITE_COLLABORATOR); this.siteService.setMembership("testMembership", USER_TWO, SiteModel.SITE_COLLABORATOR);

View File

@@ -84,7 +84,14 @@ public class TenantInterpreter extends BaseInterpreter
try try
{ {
AuthenticationUtil.setSystemUserAsCurrentUser(); AuthenticationUtil.setSystemUserAsCurrentUser();
return executeCommand(line); RetryingTransactionCallback<String> txnWork = new RetryingTransactionCallback<String>()
{
public String execute() throws Exception
{
return executeCommand(line);
}
};
return transactionService.getRetryingTransactionHelper().doInTransaction(txnWork);
} }
finally finally
{ {
@@ -321,20 +328,13 @@ public class TenantInterpreter extends BaseInterpreter
final String tenantAdminUsername = tenantService.getDomainUser(TenantService.ADMIN_BASENAME, tenantDomain); final String tenantAdminUsername = tenantService.getDomainUser(TenantService.ADMIN_BASENAME, tenantDomain);
AuthenticationUtil.runAs(new RunAsWork<Object>() AuthenticationUtil.runAs(new RunAsWork<Object>()
{ {
public Object doWork() throws Exception public Object doWork() throws Exception
{ {
RetryingTransactionCallback<Object> txnWork = new RetryingTransactionCallback<Object>() authenticationService.setAuthentication(tenantAdminUsername, newPassword.toCharArray());
{ return null;
public Object execute() throws Exception }
{ }, tenantAdminUsername);
authenticationService.setAuthentication(tenantAdminUsername, newPassword.toCharArray());
return null;
}
};
return transactionService.getRetryingTransactionHelper().doInTransaction(txnWork);
}
}, tenantAdminUsername);
} }
else else

View File

@@ -49,17 +49,21 @@ import org.alfresco.service.namespace.QName;
import org.alfresco.service.namespace.RegexQNamePattern; import org.alfresco.service.namespace.RegexQNamePattern;
import org.alfresco.util.GUID; import org.alfresco.util.GUID;
import org.alfresco.util.ParameterCheck; import org.alfresco.util.ParameterCheck;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/** /**
* @author Roy Wetherall * @author Roy Wetherall
*/ */
public class ThumbnailServiceImpl implements ThumbnailService public class ThumbnailServiceImpl implements ThumbnailService
{ {
/** Logger */
private static Log logger = LogFactory.getLog(ThumbnailServiceImpl.class);
/** Error messages */ /** Error messages */
private static final String ERR_NO_CREATE = "Thumbnail could not be created as required transformation is not supported from {0} to {1}"; private static final String ERR_NO_CREATE = "Thumbnail could not be created as required transformation is not supported from {0} to {1}";
private static final String ERR_DUPLICATE_NAME = "Thumbnail could not be created because of a duplicate name"; private static final String ERR_DUPLICATE_NAME = "Thumbnail could not be created because of a duplicate name";
private static final String ERR_NO_PARENT = "Thumbnail has no parent so update cannot take place."; private static final String ERR_NO_PARENT = "Thumbnail has no parent so update cannot take place.";
private static final String ERR_TOO_PARENT = "Thumbnail has more than one source content node. This is invalid so update cannot take place.";
/** Node service */ /** Node service */
private NodeService nodeService; private NodeService nodeService;
@@ -140,11 +144,21 @@ public class ThumbnailServiceImpl implements ThumbnailService
ParameterCheck.mandatoryString( "mimetype", mimetype); ParameterCheck.mandatoryString( "mimetype", mimetype);
ParameterCheck.mandatory("transformationOptions", transformationOptions); ParameterCheck.mandatory("transformationOptions", transformationOptions);
if (logger.isDebugEnabled() == true)
{
logger.debug("Creating thumbnail (node=" + node.toString() + "; contentProperty=" + contentProperty.toString() + "; mimetype=" + mimetype);
}
NodeRef thumbnail = null; NodeRef thumbnail = null;
// Check for duplicate names // Check for duplicate names
if (thumbnailName != null && getThumbnailByName(node, contentProperty, thumbnailName) != null) if (thumbnailName != null && getThumbnailByName(node, contentProperty, thumbnailName) != null)
{ {
if (logger.isDebugEnabled() == true)
{
logger.debug("Creating thumbnail: There is already a thumbnail with the name '" + thumbnail + "' (node=" + node.toString() + "; contentProperty=" + contentProperty.toString() + "; mimetype=" + mimetype);
}
// We can't continue because there is already an thumnail with the given name for that content property // We can't continue because there is already an thumnail with the given name for that content property
throw new ThumbnailException(ERR_DUPLICATE_NAME); throw new ThumbnailException(ERR_DUPLICATE_NAME);
} }
@@ -209,6 +223,11 @@ public class ThumbnailServiceImpl implements ThumbnailService
// Catch the failure to create the thumbnail // Catch the failure to create the thumbnail
if (this.contentService.isTransformable(reader, writer, transformationOptions) == false) if (this.contentService.isTransformable(reader, writer, transformationOptions) == false)
{ {
if (logger.isDebugEnabled() == true)
{
logger.debug("Creating thumbnail: There is no transformer to generate the thumbnail required (node=" + node.toString() + "; contentProperty=" + contentProperty.toString() + "; mimetype=" + mimetype + ")");
}
// Throw exception indicating that the thumbnail could not be created // Throw exception indicating that the thumbnail could not be created
throw new ThumbnailException(MessageFormat.format(ERR_NO_CREATE, reader.getMimetype(), writer.getMimetype())); throw new ThumbnailException(MessageFormat.format(ERR_NO_CREATE, reader.getMimetype(), writer.getMimetype()));
} }
@@ -239,6 +258,11 @@ public class ThumbnailServiceImpl implements ThumbnailService
*/ */
public void updateThumbnail(NodeRef thumbnail, TransformationOptions transformationOptions) public void updateThumbnail(NodeRef thumbnail, TransformationOptions transformationOptions)
{ {
if (logger.isDebugEnabled() == true)
{
logger.debug("Updating thumbnail (thumbnail=" + thumbnail.toString() + ")");
}
// First check that we are dealing with a thumbnail // First check that we are dealing with a thumbnail
if (ContentModel.TYPE_THUMBNAIL.equals(this.nodeService.getType(thumbnail)) == true) if (ContentModel.TYPE_THUMBNAIL.equals(this.nodeService.getType(thumbnail)) == true)
{ {
@@ -247,16 +271,13 @@ public class ThumbnailServiceImpl implements ThumbnailService
List<ChildAssociationRef> parents = this.nodeService.getParentAssocs(thumbnail, ContentModel.ASSOC_THUMBNAILS, RegexQNamePattern.MATCH_ALL); List<ChildAssociationRef> parents = this.nodeService.getParentAssocs(thumbnail, ContentModel.ASSOC_THUMBNAILS, RegexQNamePattern.MATCH_ALL);
if (parents.size() == 0) if (parents.size() == 0)
{ {
if (logger.isDebugEnabled() == true)
{
logger.debug("Updating thumbnail: The thumbnails parent cannot be found (thumbnail=" + thumbnail.toString() + ")");
}
throw new ThumbnailException(ERR_NO_PARENT); throw new ThumbnailException(ERR_NO_PARENT);
} }
// TODO
// When a node with thumbnails is checked in the assoc's get doubled up. This means we get more than one parent.
// As a work around simply take the first parent retrieved
//
//else if (parents.size() != 1)
//{
// throw new ThumbnailException(ERR_TOO_PARENT);
//}
else else
{ {
node = parents.get(0).getParentRef(); node = parents.get(0).getParentRef();
@@ -278,6 +299,11 @@ public class ThumbnailServiceImpl implements ThumbnailService
// Catch the failure to create the thumbnail // Catch the failure to create the thumbnail
if (this.contentService.isTransformable(reader, writer, transformationOptions) == false) if (this.contentService.isTransformable(reader, writer, transformationOptions) == false)
{ {
if (logger.isDebugEnabled() == true)
{
logger.debug("Updating thumbnail: there is not transformer to update the thumbnail with (thumbnail=" + thumbnail.toString() + ")");
}
// Throw exception indicating that the thumbnail could not be created // Throw exception indicating that the thumbnail could not be created
throw new ThumbnailException(MessageFormat.format(ERR_NO_CREATE, reader.getMimetype(), writer.getMimetype())); throw new ThumbnailException(MessageFormat.format(ERR_NO_CREATE, reader.getMimetype(), writer.getMimetype()));
} }
@@ -287,7 +313,13 @@ public class ThumbnailServiceImpl implements ThumbnailService
this.contentService.transform(reader, writer, transformationOptions); this.contentService.transform(reader, writer, transformationOptions);
} }
} }
// TODO else should we throw an exception? else
{
if (logger.isDebugEnabled() == true)
{
logger.debug("Updating thumbnail: cannot update a thumbnail node that isn't the correct thumbnail type (thumbnail=" + thumbnail.toString() + ")");
}
}
} }
/** /**
@@ -304,6 +336,11 @@ public class ThumbnailServiceImpl implements ThumbnailService
// If retrieval performance becomes an issue then this code can be replaced // If retrieval performance becomes an issue then this code can be replaced
// //
if (logger.isDebugEnabled() == true)
{
logger.debug("Getting thumbnail by name (nodeRef=" + node.toString() + "; contentProperty=" + contentProperty.toString() + "; thumbnailName=" + thumbnailName + ")");
}
// Check that the node has the thumbnailed aspect applied // Check that the node has the thumbnailed aspect applied
if (nodeService.hasAspect(node, ContentModel.ASPECT_THUMBNAILED) == true) if (nodeService.hasAspect(node, ContentModel.ASPECT_THUMBNAILED) == true)
{ {
@@ -339,6 +376,11 @@ public class ThumbnailServiceImpl implements ThumbnailService
// If retrieval performance becomes an issue then this code can be replaced // If retrieval performance becomes an issue then this code can be replaced
// //
if (logger.isDebugEnabled() == true)
{
logger.debug("Getting thumbnails (nodeRef=" + node.toString() + "; contentProperty=" + contentProperty.toString() + "; mimetype=" + mimetype + ")");
}
// Check that the node has the thumbnailed aspect applied // Check that the node has the thumbnailed aspect applied
if (nodeService.hasAspect(node, ContentModel.ASPECT_THUMBNAILED) == true) if (nodeService.hasAspect(node, ContentModel.ASPECT_THUMBNAILED) == true)
{ {