mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V2.2 to HEAD
11106: Leniency in AVM CAL upgrade to avoid customer upgrade issues ACT-4500 11129: ETWOTWO-460 Service Port for alfresco runtime 11144: Proper clean-up of deleted node's properties and aspects 11146: Modifications to enable 'alternatives' when running patches 11153: Fixed masked NPE when checking 'alternative' patches 11154: Some neat reporting when a patch doesn't execute as a result of an alternative patch having run 11161: ETWOTWO-91 11163: ETWOTWO-733: CheckOutCheckInService.getWorkingCopy(NodeRef) returns nodes ... 11165: Merged V2.1 to V2.2 10983: Close stream for audit config 11192: ETWOTWO-169 - Editing FSR Deployment Receiver causes password to be lost 11210: Merge of refactored AVM Filesystem storeCreated Processing from 2.1 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@11227 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -43,6 +43,7 @@ import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.repo.admin.patch.Patch;
|
||||
import org.alfresco.repo.admin.patch.impl.SchemaUpgradeScriptPatch;
|
||||
import org.alfresco.repo.content.filestore.FileContentWriter;
|
||||
import org.alfresco.repo.domain.PropertyValue;
|
||||
@@ -697,11 +698,24 @@ public class SchemaBootstrap extends AbstractLifecycleBean
|
||||
}
|
||||
// Retrieve the first installed schema number
|
||||
int installedSchema = getInstalledSchemaNumber(connection);
|
||||
|
||||
|
||||
nextPatch:
|
||||
for (SchemaUpgradeScriptPatch patch : scriptPatches)
|
||||
{
|
||||
final String patchId = patch.getId();
|
||||
final String scriptUrl = patch.getScriptUrl();
|
||||
|
||||
// Check if any of the alternative patches were executed
|
||||
List<Patch> alternatives = patch.getAlternatives();
|
||||
for (Patch alternativePatch : alternatives)
|
||||
{
|
||||
String alternativePatchId = alternativePatch.getId();
|
||||
boolean alternativeSucceeded = didPatchSucceed(connection, alternativePatchId);
|
||||
if (alternativeSucceeded)
|
||||
{
|
||||
continue nextPatch;
|
||||
}
|
||||
}
|
||||
|
||||
// check if the script was successfully executed
|
||||
boolean wasSuccessfullyApplied = didPatchSucceed(connection, patchId);
|
||||
@@ -830,17 +844,17 @@ public class SchemaBootstrap extends AbstractLifecycleBean
|
||||
StringBuilder sb = new StringBuilder(1024);
|
||||
while(true)
|
||||
{
|
||||
String sql = reader.readLine();
|
||||
String sqlOriginal = reader.readLine();
|
||||
line++;
|
||||
|
||||
if (sql == null)
|
||||
if (sqlOriginal == null)
|
||||
{
|
||||
// nothing left in the file
|
||||
break;
|
||||
}
|
||||
|
||||
// trim it
|
||||
sql = sql.trim();
|
||||
String sql = sqlOriginal.trim();
|
||||
if (sql.length() == 0 ||
|
||||
sql.startsWith( "--" ) ||
|
||||
sql.startsWith( "//" ) ||
|
||||
@@ -879,8 +893,19 @@ public class SchemaBootstrap extends AbstractLifecycleBean
|
||||
// Just take it at face value and probably fail.
|
||||
}
|
||||
}
|
||||
// Add newline
|
||||
if (sb.length() > 0)
|
||||
{
|
||||
sb.append("\n");
|
||||
}
|
||||
// Add leading whitespace for formatting
|
||||
int whitespaceCount = sqlOriginal.indexOf(sql);
|
||||
for (int i = 0; i < whitespaceCount; i++)
|
||||
{
|
||||
sb.append(" ");
|
||||
}
|
||||
// append to the statement being built up
|
||||
sb.append(" ").append(sql);
|
||||
sb.append(sql);
|
||||
// execute, if required
|
||||
if (execute)
|
||||
{
|
||||
@@ -918,7 +943,7 @@ public class SchemaBootstrap extends AbstractLifecycleBean
|
||||
}
|
||||
stmt.execute(sql);
|
||||
// Record the statement
|
||||
executedStatements.append(sql).append(";\n");
|
||||
executedStatements.append(sql).append(";\n\n");
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
|
Reference in New Issue
Block a user