mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Smarten up deployment to filesystem.
- Deploying to a filesystem implicitly snapshots the source store. This allows shortcutting the tree comparison for directories, because guids on directories act as a deep modification indicator if deployments are always from snapshots. Doh! - I'll do this for alfresco -> alfresco deployment too. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5635 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -952,11 +952,21 @@
|
|||||||
<property name="mappedNames">
|
<property name="mappedNames">
|
||||||
<list>
|
<list>
|
||||||
<value>deployDifference</value>
|
<value>deployDifference</value>
|
||||||
<value>deployDifferenceFS</value>
|
|
||||||
</list>
|
</list>
|
||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
|
<bean id="deploymentServiceWriteTxnAdvisor" class="org.springframework.aop.support.NameMatchMethodPointcutAdvisor">
|
||||||
|
<property name="advice">
|
||||||
|
<ref bean="retryingWriteTxnAdvice"/>
|
||||||
|
</property>
|
||||||
|
<property name="mappedNames">
|
||||||
|
<list>
|
||||||
|
<value>deployDifferenceFS</value>
|
||||||
|
</list>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
|
||||||
<bean id="DeploymentService" class="org.springframework.aop.framework.ProxyFactoryBean">
|
<bean id="DeploymentService" class="org.springframework.aop.framework.ProxyFactoryBean">
|
||||||
<property name="proxyInterfaces">
|
<property name="proxyInterfaces">
|
||||||
<list>
|
<list>
|
||||||
@@ -968,6 +978,7 @@
|
|||||||
</property>
|
</property>
|
||||||
<property name="interceptorNames">
|
<property name="interceptorNames">
|
||||||
<list>
|
<list>
|
||||||
|
<value>deploymentServiceWriteTxnAdvisor</value>
|
||||||
<value>deploymentServiceReadTxnAdvisor</value>
|
<value>deploymentServiceReadTxnAdvisor</value>
|
||||||
</list>
|
</list>
|
||||||
</property>
|
</property>
|
||||||
|
@@ -233,7 +233,6 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
|||||||
}
|
}
|
||||||
parent.putChild(parentName[1], newChild);
|
parent.putChild(parentName[1], newChild);
|
||||||
}
|
}
|
||||||
// AVMDAOs.Instance().fVersionLayeredNodeEntryDAO.delete(lastVersion);
|
|
||||||
// Clear out the new nodes.
|
// Clear out the new nodes.
|
||||||
List<AVMNode> newInRep = AVMDAOs.Instance().fAVMNodeDAO.getNewInStore(this);
|
List<AVMNode> newInRep = AVMDAOs.Instance().fAVMNodeDAO.getNewInStore(this);
|
||||||
List<AVMNode> layeredNodes = new ArrayList<AVMNode>();
|
List<AVMNode> layeredNodes = new ArrayList<AVMNode>();
|
||||||
@@ -950,7 +949,7 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return fName.equals(((AVMStore)obj).getName());
|
return fID == ((AVMStore)obj).getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -960,7 +959,7 @@ public class AVMStoreImpl implements AVMStore, Serializable
|
|||||||
@Override
|
@Override
|
||||||
public int hashCode()
|
public int hashCode()
|
||||||
{
|
{
|
||||||
return fName.hashCode();
|
return (int)fID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -125,17 +125,19 @@
|
|||||||
<id column="id" type="long">
|
<id column="id" type="long">
|
||||||
<generator class="native"></generator>
|
<generator class="native"></generator>
|
||||||
</id>
|
</id>
|
||||||
<property name="versionID" type="int" not-null="true"
|
<natural-id>
|
||||||
column="version_id" index="idx_avm_vr_version">
|
<property name="versionID" type="int" not-null="true"
|
||||||
</property>
|
column="version_id" index="idx_avm_vr_version">
|
||||||
|
</property>
|
||||||
|
<many-to-one name="avmStore" column="avm_store_id"
|
||||||
|
class="AVMStoreImpl" not-null="true" foreign-key="fk_avm_vr_store">
|
||||||
|
</many-to-one>
|
||||||
|
</natural-id>
|
||||||
<property name="createDate" type="long" not-null="true" column="create_date">
|
<property name="createDate" type="long" not-null="true" column="create_date">
|
||||||
</property>
|
</property>
|
||||||
<property name="creator" type="string" column="creator"
|
<property name="creator" type="string" column="creator"
|
||||||
not-null="true">
|
not-null="true">
|
||||||
</property>
|
</property>
|
||||||
<many-to-one name="avmStore" column="avm_store_id"
|
|
||||||
class="AVMStoreImpl" not-null="true" foreign-key="fk_avm_vr_store">
|
|
||||||
</many-to-one>
|
|
||||||
<many-to-one name="root" class="DirectoryNodeImpl"
|
<many-to-one name="root" class="DirectoryNodeImpl"
|
||||||
column="root_id" not-null="true" foreign-key="fk_avm_vr_root">
|
column="root_id" not-null="true" foreign-key="fk_avm_vr_root">
|
||||||
</many-to-one>
|
</many-to-one>
|
||||||
|
@@ -608,8 +608,13 @@ public class DeploymentServiceImpl implements DeploymentService
|
|||||||
callback.eventOccurred(event);
|
callback.eventOccurred(event);
|
||||||
}
|
}
|
||||||
report.add(event);
|
report.add(event);
|
||||||
|
String storeName = srcPath.substring(0, srcPath.indexOf(':'));
|
||||||
|
System.out.println(storeName);
|
||||||
|
if (version < 0)
|
||||||
|
{
|
||||||
|
version = fAVMService.createSnapshot(storeName, null, null);
|
||||||
|
}
|
||||||
String ticket = service.begin(target, userName, password);
|
String ticket = service.begin(target, userName, password);
|
||||||
|
|
||||||
deployDirectoryPush(service, ticket, report, callback, version, srcPath, "/");
|
deployDirectoryPush(service, ticket, report, callback, version, srcPath, "/");
|
||||||
service.commit(ticket);
|
service.commit(ticket);
|
||||||
event = new DeploymentEvent(DeploymentEvent.Type.END,
|
event = new DeploymentEvent(DeploymentEvent.Type.END,
|
||||||
@@ -683,8 +688,7 @@ public class DeploymentServiceImpl implements DeploymentService
|
|||||||
}
|
}
|
||||||
if (diff == 0)
|
if (diff == 0)
|
||||||
{
|
{
|
||||||
if (src.isFile() && dst.getType() == FileType.FILE &&
|
if (src.getGuid().equals(dst.getGUID()))
|
||||||
src.getGuid().equals(dst.getGUID()))
|
|
||||||
{
|
{
|
||||||
src = null;
|
src = null;
|
||||||
dst = null;
|
dst = null;
|
||||||
@@ -701,6 +705,10 @@ public class DeploymentServiceImpl implements DeploymentService
|
|||||||
// Source is a directory.
|
// Source is a directory.
|
||||||
if (dst.getType() == FileType.DIR)
|
if (dst.getType() == FileType.DIR)
|
||||||
{
|
{
|
||||||
|
if (!dstPath.equals("/"))
|
||||||
|
{
|
||||||
|
service.setGuid(ticket, dstPath, src.getGuid());
|
||||||
|
}
|
||||||
deployDirectoryPush(service, ticket, report, callback, version, src.getPath(), dstPath + '/' + dst.getName());
|
deployDirectoryPush(service, ticket, report, callback, version, src.getPath(), dstPath + '/' + dst.getName());
|
||||||
src = null;
|
src = null;
|
||||||
dst = null;
|
dst = null;
|
||||||
|
Reference in New Issue
Block a user