Merged V4.0-BUG-FIX to HEAD

34321: Make CIFS virtual circuit per session limit configurable, return correct status code when virtual circuit limit is reached.
   Required by Terminal Server clients as they can use a single session for all connections. ALF-13156
   34322: Services part of fix for ALF-13057 Nodes marked with rma:ghosted aspect (or other configurable aspects/types) should not be renditioned.
   34323: Added configuration property for CIFS virtual circuits per session, required by Terminal Server clients. ALF-13156.
   34332: Fix for ALF-8405
   34336: Merged BRANCHES/V4.0 to BRANCHES/DEV/V4.0-BUG-FIX:
      34335: Fixing a failing test as part of ALF-13057
   34338: NodeDAO: re-parent "lost & found" orphan child nodes (see ALF-12358 & ALF-13066 / SYS-301)
   - test fix (follow-on to r34279)
   34341: NodeDAO: re-parent "lost & found" orphan child nodes (see ALF-12358 & ALF-13066 / SYS-301)
   - ano test fix (once more with feeling)
   34351: Merged V4.0 to V4.0-BUG-FIX
      34335: (RECORD ONLY) Fixing a failing test as part of ALF-13057
      34350: Merged V3.4 to V4.0
         34327: ALF-13030 ALF-13041 Transformer Server needs filename and to make its transformer preferred over OpenOffice and JOD
            Relates to ALF-10976 and ALF-10412 set of changes
            - TransformerOptions.sourceNodeRef now populated
            - Set average transformer time via global properties
            - TransformerDebug of active transformers added
         34331: ALF-13030 ALF-13041 Transformer Server needs filename and to make its transformer preferred over OpenOffice and JOD
            Relates to ALF-10976 and ALF-10412 set of changes
            - Fix test failures
         34346: ALF-13030 ALF-13041 Transformer Server needs filename and to make its transformer preferred over OpenOffice and JOD
            Relates to ALF-10976 and ALF-10412 set of changes
            - sourceNodeRef was not available to the first child transformer of a ComplexContentTransformer
   34358: Merged V4.0 to V4.0-BUG-FIX (RECORD ONLY)
      34324: Merged BRANCHES/DEV/V4.0-BUG-FIX to BRANCHES/V4.0:
         34322: Services part of fix for ALF-13057 Nodes marked with rma:ghosted aspect (or other configurable aspects/types) should not be renditioned.
   34360: Merged V3.4-BUG-FIX to V4.0-BUG-FIX (RECORD ONLY)
      34349: Merged V3.4 to V3.4-BUG-FIX
         34327: ALF-13030 ALF-13041 Transformer Server needs filename and to make its transformer preferred over OpenOffice and JOD
            Relates to ALF-10976 and ALF-10412 set of changes
            - TransformerOptions.sourceNodeRef now populated
            - Set average transformer time via global properties
            - TransformerDebug of active transformers added
         34331: ALF-13030 ALF-13041 Transformer Server needs filename and to make its transformer preferred over OpenOffice and JOD
            Relates to ALF-10976 and ALF-10412 set of changes
            - Fix test failures
         34346: ALF-13030 ALF-13041 Transformer Server needs filename and to make its transformer preferred over OpenOffice and JOD
            Relates to ALF-10976 and ALF-10412 set of changes
            - sourceNodeRef was not available to the first child transformer of a ComplexContentTransformer
         34348: Merged PATCHES/V3.4.7 to V3.4
            34347: ALF-12949: Merged V4.0-BUG-FIX to PATCHES/V3.4.7
               33959: Merged BRANCHES/DEV/V3.4-BUG-FIX to BRANCHES/DEV/V4.0-BUG-FIX
                  33950: Fix for ALF-12787:
                         - Surf Memory usage optimizations and improvements to ModelObject and derived classes.
                         - Reduced avg memory usage for a ModelObject in the Surf persister cache from 4.0K to 1.5K.
                         - Related refactoring to support removal of in-memory XML DOM previously used to maintain ModelObject state. Now XML DOM only created as needed for set() operations and thrown away.
                         - Improvements to Surf Persister cache strategy to support MRU style concurrent cache, now uses a LinkedConcurrentHashMap to provide a concurrent cache that also has a configurable maximum capacity
                         - Added various improved spring config for persister caches and default sizes.
               Merged BRANCHES/DEV/V3.4-BUG-FIX to BRANCHES/DEV/V4.0-BUG-FIX
                  33956: Latest SpringSurf libs: Fixed issue with overly aggressive caching of missing page View objects.
               34108: Merged BRANCHES/DEV/V3.4-BUG-FIX to BRANCHES/DEV/V4.0-BUG-FIX
                  34107: Added missing jar lib to wcmquickstart and webeditor dependencies
   34363: Merged V4.0 to V4.0-BUG-FIX
      34362: Merged V3.4 to V4.0 (RECORD ONLY)
         34282: ALF-13059: Windows 7 specific: It's impossible to add documents to DWS
         - Fix by Alex Malinovsky
         34348: Merged PATCHES/V3.4.7 to V3.4
            34347: ALF-12949: Merged V4.0-BUG-FIX to PATCHES/V3.4.7
               33959: Merged BRANCHES/DEV/V3.4-BUG-FIX to BRANCHES/DEV/V4.0-BUG-FIX
                  33950: Fix for ALF-12787:
                         - Surf Memory usage optimizations and improvements to ModelObject and derived classes.
                         - Reduced avg memory usage for a ModelObject in the Surf persister cache from 4.0K to 1.5K.
                         - Related refactoring to support removal of in-memory XML DOM previously used to maintain ModelObject state. Now XML DOM only created as needed for set() operations and thrown away.
                         - Improvements to Surf Persister cache strategy to support MRU style concurrent cache, now uses a LinkedConcurrentHashMap to provide a concurrent cache that also has a configurable maximum capacity
                         - Added various improved spring config for persister caches and default sizes.
               Merged BRANCHES/DEV/V3.4-BUG-FIX to BRANCHES/DEV/V4.0-BUG-FIX
                  33956: Latest SpringSurf libs: Fixed issue with overly aggressive caching of missing page View objects.
               34108: Merged BRANCHES/DEV/V3.4-BUG-FIX to BRANCHES/DEV/V4.0-BUG-FIX
                  34107: Added missing jar lib to wcmquickstart and webeditor dependencies


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@34364 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Dave Ward
2012-03-02 15:00:35 +00:00
parent 57eef7ee93
commit 840440764b
34 changed files with 850 additions and 107 deletions

View File

@@ -37,6 +37,7 @@ import org.alfresco.service.cmr.rendition.CompositeRenditionDefinition;
import org.alfresco.service.cmr.rendition.RenderCallback;
import org.alfresco.service.cmr.rendition.RenderingEngineDefinition;
import org.alfresco.service.cmr.rendition.RenditionDefinition;
import org.alfresco.service.cmr.rendition.RenditionPreventedException;
import org.alfresco.service.cmr.rendition.RenditionService;
import org.alfresco.service.cmr.rendition.RenditionServiceException;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
@@ -67,6 +68,11 @@ public class RenditionServiceImpl implements RenditionService, RenditionDefiniti
private RenditionDefinitionPersisterImpl renditionDefinitionPersister;
/**
* @since 4.0.1
*/
private RenditionPreventionRegistry renditionPreventionRegistry;
/**
* Injects the RenditionDefinitionPersister bean.
* @param renditionDefinitionPersister
@@ -76,6 +82,14 @@ public class RenditionServiceImpl implements RenditionService, RenditionDefiniti
this.renditionDefinitionPersister = renditionDefinitionPersister;
}
/**
* @since 4.0.1
*/
public void setRenditionPreventionRegistry(RenditionPreventionRegistry registry)
{
this.renditionPreventionRegistry = registry;
}
/**
* Injects the ServiceRegistry bean.
* @param serviceRegistry
@@ -180,6 +194,8 @@ public class RenditionServiceImpl implements RenditionService, RenditionDefiniti
*/
public ChildAssociationRef render(NodeRef sourceNode, RenditionDefinition definition)
{
checkSourceNodeForPreventionClass(sourceNode);
ChildAssociationRef result = executeRenditionAction(sourceNode, definition, false);
if (log.isDebugEnabled())
@@ -193,6 +209,8 @@ public class RenditionServiceImpl implements RenditionService, RenditionDefiniti
public void render(NodeRef sourceNode, RenditionDefinition definition,
RenderCallback callback)
{
checkSourceNodeForPreventionClass(sourceNode);
// The asynchronous render can't return a ChildAssociationRef as it is created
// asynchronously after this method returns.
definition.setCallback(callback);
@@ -208,6 +226,8 @@ public class RenditionServiceImpl implements RenditionService, RenditionDefiniti
*/
public ChildAssociationRef render(NodeRef sourceNode, final QName renditionDefinitionQName)
{
checkSourceNodeForPreventionClass(sourceNode);
RenditionDefinition rendDefn = AuthenticationUtil.runAs(
new AuthenticationUtil.RunAsWork<RenditionDefinition>()
{
@@ -231,6 +251,8 @@ public class RenditionServiceImpl implements RenditionService, RenditionDefiniti
*/
public void render(NodeRef sourceNode, final QName renditionDefinitionQName, RenderCallback callback)
{
checkSourceNodeForPreventionClass(sourceNode);
RenditionDefinition rendDefn = AuthenticationUtil.runAs(
new AuthenticationUtil.RunAsWork<RenditionDefinition>()
{
@@ -247,8 +269,41 @@ public class RenditionServiceImpl implements RenditionService, RenditionDefiniti
this.render(sourceNode, rendDefn, callback);
}
/**
* This method checks whether the specified source node is of a content class which has been registered for rendition prevention.
*
* @param sourceNode the node to check.
* @throws RenditionPreventedException if the source node is configured for rendition prevention.
* @since 4.0.1
* @see RenditionPreventionRegistry
*/
private void checkSourceNodeForPreventionClass(NodeRef sourceNode)
{
// A node's content class is its type and all its aspects.
// We'll not check the source node for null and leave that to the rendering action.
if (sourceNode != null && nodeService.exists(sourceNode))
{
Set<QName> nodeContentClasses = nodeService.getAspects(sourceNode);
nodeContentClasses.add(nodeService.getType(sourceNode));
for (QName contentClass : nodeContentClasses)
{
if (renditionPreventionRegistry.isContentClassRegistered(contentClass))
{
StringBuilder msg = new StringBuilder();
msg.append("Node ").append(sourceNode)
.append(" cannot be renditioned as it is of class ").append(contentClass);
if (log.isDebugEnabled())
{
log.debug(msg.toString());
}
throw new RenditionPreventedException(msg.toString());
}
}
}
}
/**
* This method delegates the execution of the specified RenditionDefinition
* to the {@link ActionService action service}.