Merged BRANCHES/V2.2 to BRANCHES/V2.3:

97444: RM-1586 Restricted the custom metadata property names to alphanumeric and a few special characters
   97026: RM-1660 Fixed NPE exception on schema upgrade Also fixed transaction type for the capabilities schema update.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.3@97447 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alexandru Balan
2015-02-19 08:59:00 +00:00
3 changed files with 62 additions and 28 deletions

View File

@@ -59,6 +59,12 @@ public abstract class AbstractModulePatch implements ModulePatch, BeanNameAware
/** module patch target module schema number */ /** module patch target module schema number */
private int targetSchema; private int targetSchema;
/** if it should use a read only transaction */
private boolean txnReadOnly = true;
/** if it should use a new transaction */
private boolean txnRequiresNew = false;
/** /**
* Initiialisation method * Initiialisation method
*/ */
@@ -67,6 +73,16 @@ public abstract class AbstractModulePatch implements ModulePatch, BeanNameAware
modulePatchExecuter.register(this); modulePatchExecuter.register(this);
} }
protected void setTxnReadOnly(boolean txnReadOnly)
{
this.txnReadOnly = txnReadOnly;
}
protected void setTxnRequiresNew(boolean txnRequiresNew)
{
this.txnRequiresNew = txnRequiresNew;
}
/** /**
* @param modulePatchExecuter module patch executer * @param modulePatchExecuter module patch executer
*/ */
@@ -216,8 +232,8 @@ public abstract class AbstractModulePatch implements ModulePatch, BeanNameAware
// do patch in transaction // do patch in transaction
transactionService.getRetryingTransactionHelper().doInTransaction( transactionService.getRetryingTransactionHelper().doInTransaction(
new ApplyCallback(), new ApplyCallback(),
true, txnReadOnly,
false); txnRequiresNew);
if (LOGGER.isInfoEnabled()) if (LOGGER.isInfoEnabled())
{ {

View File

@@ -128,5 +128,13 @@ public abstract class CapabilityPatch extends AbstractModulePatch
} }
} }
@Override
public void apply()
{
setTxnReadOnly(false);
setTxnRequiresNew(true);
super.apply();
}
protected abstract void applyCapabilityPatch(NodeRef filePlan); protected abstract void applyCapabilityPatch(NodeRef filePlan);
} }

View File

@@ -126,6 +126,8 @@ public class RMv2FilePlanNodeRefPatch extends ModulePatchComponent
NodeRef filePlan = filePlanService.getFilePlan(filePlanComponentNodeRef); NodeRef filePlan = filePlanService.getFilePlan(filePlanComponentNodeRef);
if(filePlan != null)
{
// set the file plan node reference // set the file plan node reference
if (nodeService.getProperty(filePlanComponentNodeRef, PROP_ROOT_NODEREF) == null) if (nodeService.getProperty(filePlanComponentNodeRef, PROP_ROOT_NODEREF) == null)
{ {
@@ -158,6 +160,14 @@ public class RMv2FilePlanNodeRefPatch extends ModulePatchComponent
} }
} }
} }
else
{
if (LOGGER.isWarnEnabled())
{
LOGGER.warn(" ... node " + filePlanComponent.toString() + " was skiped, beacuse there was no associated file plan.");
}
}
}
} }
} }
} }