Added support to limit module execution to a specific range of repository versions.

e.g. the PHP SDK module has the following:
   module.repo.version.min=2.0
   module.repo.version.max=2.1
This limits it to being installed on 2.0 or 2.1 versions of Alfresco.
Roy can change this, if required.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5532 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-04-24 01:14:42 +00:00
parent 5fed27a6d9
commit c1a69f0f3f
10 changed files with 113 additions and 8 deletions

View File

@@ -42,6 +42,9 @@ import org.alfresco.util.VersionNumber;
*
* @author Roy Wetherall
*/
/**
* @author Derek Hulley
*/
public class ModuleDetailsImpl implements ModuleDetails
{
private String id;
@@ -114,6 +117,13 @@ public class ModuleDetailsImpl implements ModuleDetails
{
throw new AlfrescoRuntimeException("The following module properties need to be defined: " + missingProperties);
}
if (repoVersionMax.compareTo(repoVersionMin) < 0)
{
throw new AlfrescoRuntimeException("The max repo version must be greater than the min repo version:\n" +
" ID: " + id + "\n" +
" Min repo version: " + repoVersionMin + "\n" +
" Max repo version: " + repoVersionMax);
}
// Set other defaults
installState = ModuleInstallState.INSTALLED;
@@ -195,11 +205,21 @@ public class ModuleDetailsImpl implements ModuleDetails
return repoVersionMin;
}
public void setRepoVersionMin(VersionNumber repoVersionMin)
{
this.repoVersionMin = repoVersionMin;
}
public VersionNumber getRepoVersionMax()
{
return repoVersionMax;
}
public void setRepoVersionMax(VersionNumber repoVersionMax)
{
this.repoVersionMax = repoVersionMax;
}
public Date getInstallDate()
{
return installDate;