Merged V2.1 to HEAD

6846: used ] instead of } in ${ldap.synchronisation.userIdAttributeName]
   6856: Fixed 2 NPEs, one reported by MIT and one found by Jan (WCM-835)
   6859: Truncate an existing file when uploading via FTP. WCM-836.
   6869: Removed temporary files and folders from deploy-installer project
   6870: Updated ignore property
   6875: Fix for AWC-1605
   6878: Fix for AWC-1587
   6880: Fix for French language pack - locked_user message
   6883: Fix for AWC-1565
   6884: Relax trhe permissions required to get the parent links from a child node
   6891: Fix for AR-1781 and AR-1782 (requires CHK-1451)
   6892: Fixed AR-1777: Node status not updated for addition and removal of secondary associations (affects index tracking)
   6893: Sample for replicating content store sample
   6896: Added JVM shutdown check into inner loop to get faster breakout in the event of shutdown.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6899 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-10-02 16:10:58 +00:00
parent 19d195c423
commit 575c51a697
10 changed files with 49 additions and 83 deletions

View File

@@ -73,7 +73,7 @@
--> -->
<property name="userIdAttributeName"> <property name="userIdAttributeName">
<value>${ldap.synchronisation.userIdAttributeName]</value> <value>${ldap.synchronisation.userIdAttributeName}</value>
</property> </property>
<!-- Services --> <!-- Services -->

View File

@@ -7,80 +7,34 @@
If you include this file, please ensure that you review the sample If you include this file, please ensure that you review the sample
beans contained here. beans contained here.
--> -->
<bean id="backupContentStore" <bean id="localDriveContentStore" class="org.alfresco.repo.content.filestore.FileContentStore">
class="org.alfresco.repo.content.filestore.FileContentStore">
<constructor-arg> <constructor-arg>
<value>${dir.contentstore}/../backups/alfresco</value> <value>/var/alfresco/content-store</value>
</constructor-arg> </constructor-arg>
</bean> </bean>
<bean id="networkContentStore" class="org.alfresco.repo.content.filestore.FileContentStore">
<bean id="contentStoreReplicator" <constructor-arg>
class="org.alfresco.repo.content.replication.ContentStoreReplicator" <value>/share/alfresco/content-store</value>
depends-on="fileContentStore, backupContentStore" > </constructor-arg>
<!-- content source -->
<property name="sourceStore">
<ref bean="fileContentStore" />
</property>
<!-- content target -->
<property name="targetStore">
<ref bean="backupContentStore" />
</property>
</bean> </bean>
<bean id="fileContentStore" class="org.alfresco.repo.content.replication.ReplicatingContentStore" >
<bean id="contentStoreBackupTrigger" class="org.alfresco.util.CronTriggerBean">
<property name="jobDetail">
<bean class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass">
<value>org.alfresco.repo.content.replication.ContentStoreReplicator$ContentStoreReplicatorJob</value>
</property>
<property name="jobDataAsMap">
<map>
<entry key="contentStoreReplicator">
<ref bean="contentStoreReplicator" />
</entry>
</map>
</property>
</bean>
</property>
<property name="scheduler">
<ref bean="schedulerFactory" />
</property>
<!-- trigger at 3am each day -->
<property name="cronExpression">
<value>0 0 03 * * ?</value>
</property>
</bean>
<bean id="replicatingContentStore"
class="org.alfresco.repo.content.replication.ReplicatingContentStore" >
<!-- the preferred store for reads and writes -->
<property name="primaryStore"> <property name="primaryStore">
<ref bean="fileContentStore" /> <ref bean="localDriveContentStore" />
</property> </property>
<!-- example of possible secondary store configuration -->
<property name="secondaryStores"> <property name="secondaryStores">
<list> <list>
<ref bean="archiveStoreA" /> <ref bean="networkContentStore" />
<ref bean="archiveStoreB" />
</list> </list>
</property> </property>
<!-- enable content missing from the primary store to be pulled in from the secondary stores -->
<property name="inbound"> <property name="inbound">
<value>false</value> <value>true</value>
</property> </property>
<!-- enable replication from the primary to the secondary stores -->
<property name="outbound"> <property name="outbound">
<value>false</value> <value>true</value>
</property> </property>
<!-- this is required if outbound replication is active, otherwise not -->
<property name="retryingTransactionHelper"> <property name="retryingTransactionHelper">
<ref bean="retryingTransactionHelper"/> <ref bean="retryingTransactionHelper"/>
</property> </property>
<!-- set this to force outbound replication to be asynchronous -->
<property name="outboundThreadPoolExecutor">
<ref bean="threadPoolExecutor" />
</property>
</bean> </bean>
</beans> </beans>

View File

@@ -349,10 +349,10 @@
org.alfresco.service.cmr.repository.NodeService.setProperties=ACL_NODE.0.sys:base.WriteProperties org.alfresco.service.cmr.repository.NodeService.setProperties=ACL_NODE.0.sys:base.WriteProperties
org.alfresco.service.cmr.repository.NodeService.setProperty=ACL_NODE.0.sys:base.WriteProperties org.alfresco.service.cmr.repository.NodeService.setProperty=ACL_NODE.0.sys:base.WriteProperties
org.alfresco.service.cmr.repository.NodeService.removeProperty=ACL_NODE.0.sys:base.WriteProperties org.alfresco.service.cmr.repository.NodeService.removeProperty=ACL_NODE.0.sys:base.WriteProperties
org.alfresco.service.cmr.repository.NodeService.getParentAssocs=ACL_NODE.0.sys:base.ReadProperties,AFTER_ACL_PARENT.sys:base.ReadProperties org.alfresco.service.cmr.repository.NodeService.getParentAssocs=ACL_NODE.0.sys:base.ReadProperties
org.alfresco.service.cmr.repository.NodeService.getChildAssocs=ACL_NODE.0.sys:base.ReadChildren,AFTER_ACL_NODE.sys:base.ReadProperties org.alfresco.service.cmr.repository.NodeService.getChildAssocs=ACL_NODE.0.sys:base.ReadChildren,AFTER_ACL_NODE.sys:base.ReadProperties
org.alfresco.service.cmr.repository.NodeService.getChildByName=ACL_NODE.0.sys:base.ReadChildren,AFTER_ACL_NODE.sys:base.ReadProperties org.alfresco.service.cmr.repository.NodeService.getChildByName=ACL_NODE.0.sys:base.ReadChildren,AFTER_ACL_NODE.sys:base.ReadProperties
org.alfresco.service.cmr.repository.NodeService.getPrimaryParent=ACL_NODE.0.sys:base.ReadProperties,AFTER_ACL_PARENT.sys:base.ReadProperties org.alfresco.service.cmr.repository.NodeService.getPrimaryParent=ACL_NODE.0.sys:base.ReadProperties
org.alfresco.service.cmr.repository.NodeService.createAssociation=ROLE_AUTHENTICATED org.alfresco.service.cmr.repository.NodeService.createAssociation=ROLE_AUTHENTICATED
org.alfresco.service.cmr.repository.NodeService.removeAssociation=ROLE_AUTHENTICATED org.alfresco.service.cmr.repository.NodeService.removeAssociation=ROLE_AUTHENTICATED
org.alfresco.service.cmr.repository.NodeService.getTargetAssocs=ROLE_AUTHENTICATED org.alfresco.service.cmr.repository.NodeService.getTargetAssocs=ROLE_AUTHENTICATED

View File

@@ -2339,6 +2339,10 @@ public class FTPSrvSession extends SrvSession implements Runnable
// Overwrite the existing file // Overwrite the existing file
netFile = disk.openFile(this, tree, params); netFile = disk.openFile(this, tree, params);
// Truncate the existing file
netFile.truncateFile( 0L);
} }
else else
{ {

View File

@@ -704,7 +704,8 @@ public class ScriptNode implements Serializable, Scopeable
{ {
if (displayPath == null) if (displayPath == null)
{ {
displayPath = this.nodeService.getPath(this.nodeRef).toDisplayPath(this.nodeService); displayPath = this.nodeService.getPath(this.nodeRef).toDisplayPath(
this.nodeService, this.services.getPermissionService());
} }
return displayPath; return displayPath;

View File

@@ -832,6 +832,9 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
// Invoke policy behaviours // Invoke policy behaviours
invokeOnCreateChildAssociation(assocRef, false); invokeOnCreateChildAssociation(assocRef, false);
// update the node status
nodeDaoService.recordChangeId(childNodeRef);
return assoc.getChildAssocRef(); return assoc.getChildAssocRef();
} }
@@ -872,6 +875,12 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
{ {
deleteNode(primaryAssocRef.getChildRef()); deleteNode(primaryAssocRef.getChildRef());
} }
else
{
// The cascade delete will update the node status, but just a plain assoc deletion will not
// Update the node status
nodeDaoService.recordChangeId(childRef);
}
// done // done
} }
@@ -888,6 +897,8 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
if (deleted) if (deleted)
{ {
invokeOnDeleteChildAssociation(childAssocRef); invokeOnDeleteChildAssociation(childAssocRef);
// Update the node status
nodeDaoService.recordChangeId(childNode.getNodeRef());
} }
// Done // Done
return deleted; return deleted;
@@ -914,6 +925,8 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
// Delete the secondary association // Delete the secondary association
nodeDaoService.deleteChildAssoc(assoc, false); nodeDaoService.deleteChildAssoc(assoc, false);
invokeOnDeleteChildAssociation(childAssocRef); invokeOnDeleteChildAssociation(childAssocRef);
// Update the node status
nodeDaoService.recordChangeId(childNode.getNodeRef());
// Done // Done
return true; return true;
} }

View File

@@ -1069,7 +1069,7 @@ public class HibernateNodeDaoServiceImpl extends HibernateDaoSupport implements
if (parentAssoc == null) if (parentAssoc == null)
{ {
// The cache is out of date, so just repopulate it // The cache is out of date, so just repopulate it
parentAssoc = null; parentAssocs = null;
break; break;
} }
else else

View File

@@ -100,6 +100,11 @@ public class IndexRemoteTransactionTracker extends AbstractReindexComponent
long txnId = txn.getId(); long txnId = txn.getId();
reindexTransaction(txnId); reindexTransaction(txnId);
currentTxnId = txnId; currentTxnId = txnId;
// break out if the VM is shutting down
if (isShuttingDown())
{
break;
}
} }
} }
} }

View File

@@ -35,7 +35,6 @@ import java.util.Set;
import org.alfresco.model.ApplicationModel; import org.alfresco.model.ApplicationModel;
import org.alfresco.model.ContentModel; import org.alfresco.model.ContentModel;
import org.alfresco.repo.content.MimetypeMap; import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.security.permissions.AccessDeniedException;
import org.alfresco.service.ServiceRegistry; import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.dictionary.DictionaryService; import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.ChildAssociationRef;
@@ -259,14 +258,8 @@ public abstract class BaseContentNode implements TemplateContent
{ {
if (displayPath == null) if (displayPath == null)
{ {
try displayPath = this.services.getNodeService().getPath(getNodeRef()).toDisplayPath(
{ services.getNodeService(), services.getPermissionService());
displayPath = this.services.getNodeService().getPath(getNodeRef()).toDisplayPath(this.services.getNodeService());
}
catch (AccessDeniedException err)
{
displayPath = "";
}
} }
return displayPath; return displayPath;

View File

@@ -30,6 +30,8 @@ import java.util.LinkedList;
import org.alfresco.model.ContentModel; import org.alfresco.model.ContentModel;
import org.alfresco.repo.security.permissions.AccessDeniedException; import org.alfresco.repo.security.permissions.AccessDeniedException;
import org.alfresco.service.cmr.security.AccessStatus;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.namespace.NamespacePrefixResolver; import org.alfresco.service.namespace.NamespacePrefixResolver;
import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.QName;
import org.alfresco.util.ISO9075; import org.alfresco.util.ISO9075;
@@ -193,7 +195,7 @@ public final class Path implements Iterable<Path.Element>, Serializable
* *
* @return human readable form of the Path excluding the final element * @return human readable form of the Path excluding the final element
*/ */
public String toDisplayPath(NodeService nodeService) public String toDisplayPath(NodeService nodeService, PermissionService permissionService)
{ {
StringBuilder buf = new StringBuilder(64); StringBuilder buf = new StringBuilder(64);
@@ -207,22 +209,16 @@ public final class Path implements Iterable<Path.Element>, Serializable
if (elementRef.getParentRef() != null) if (elementRef.getParentRef() != null)
{ {
Serializable nameProp = null; Serializable nameProp = null;
try if (permissionService.hasPermission(
elementRef.getChildRef(), PermissionService.READ) == AccessStatus.ALLOWED)
{ {
nameProp = nodeService.getProperty(elementRef.getChildRef(), ContentModel.PROP_NAME); nameProp = nodeService.getProperty(elementRef.getChildRef(), ContentModel.PROP_NAME);
} // use the name property if we are allowed access to it
catch (AccessDeniedException err)
{
// unable to access this property on the path - so we cannot display it's name
}
if (nameProp != null)
{
// use the name property if we find it
elementString = nameProp.toString(); elementString = nameProp.toString();
} }
else else
{ {
// revert to using QName if not found // revert to using QName if not
elementString = elementRef.getQName().getLocalName(); elementString = elementRef.getQName().getLocalName();
} }
} }