mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Feature/acs 3555 add custom embedded workflow license code (#1432)
* ACS-3555 Add license code for custom embedded workflow * ACS-3555 remove unused import * ACS-3560 Discovery API for custom embedded workflow license * ACS-3560 fix compilation error * use default method * restore discovery api
This commit is contained in:
@@ -284,7 +284,8 @@ public class RepositoryInfo
|
|||||||
.setMaxDocs(licenseDescriptor.getMaxDocs())
|
.setMaxDocs(licenseDescriptor.getMaxDocs())
|
||||||
.setMaxUsers(licenseDescriptor.getMaxUsers())
|
.setMaxUsers(licenseDescriptor.getMaxUsers())
|
||||||
.setClusterEnabled(licenseDescriptor.isClusterEnabled())
|
.setClusterEnabled(licenseDescriptor.isClusterEnabled())
|
||||||
.setCryptodocEnabled(licenseDescriptor.isCryptodocEnabled());
|
.setCryptodocEnabled(licenseDescriptor.isCryptodocEnabled())
|
||||||
|
.setCustomEmbeddedWorkflowEnabled(licenseDescriptor.isCustomEmbeddedWorkflowEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getIssuedAt()
|
public Date getIssuedAt()
|
||||||
@@ -343,6 +344,7 @@ public class RepositoryInfo
|
|||||||
private Long maxDocs;
|
private Long maxDocs;
|
||||||
private boolean isClusterEnabled;
|
private boolean isClusterEnabled;
|
||||||
private boolean isCryptodocEnabled;
|
private boolean isCryptodocEnabled;
|
||||||
|
private boolean isCustomEmbeddedWorkflowEnabled;
|
||||||
|
|
||||||
public LicenseEntitlement()
|
public LicenseEntitlement()
|
||||||
{
|
{
|
||||||
@@ -392,6 +394,17 @@ public class RepositoryInfo
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean getIsCustomEmbeddedWorkflowEnabled()
|
||||||
|
{
|
||||||
|
return isCustomEmbeddedWorkflowEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LicenseEntitlement setCustomEmbeddedWorkflowEnabled(boolean customEmbeddedWorkflowEnabled)
|
||||||
|
{
|
||||||
|
isCustomEmbeddedWorkflowEnabled = customEmbeddedWorkflowEnabled;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
@@ -400,6 +413,7 @@ public class RepositoryInfo
|
|||||||
.append(", maxDocs=").append(maxDocs)
|
.append(", maxDocs=").append(maxDocs)
|
||||||
.append(", isClusterEnabled=").append(isClusterEnabled)
|
.append(", isClusterEnabled=").append(isClusterEnabled)
|
||||||
.append(", isCryptodocEnabled=").append(isCryptodocEnabled)
|
.append(", isCryptodocEnabled=").append(isCryptodocEnabled)
|
||||||
|
.append(", isCustomEmbeddedWorkflowEnabled=").append(isCustomEmbeddedWorkflowEnabled)
|
||||||
.append(']');
|
.append(']');
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
* #%L
|
* #%L
|
||||||
* Alfresco Remote API
|
* Alfresco Remote API
|
||||||
* %%
|
* %%
|
||||||
* Copyright (C) 2005 - 2021 Alfresco Software Limited
|
* Copyright (C) 2005 - 2022 Alfresco Software Limited
|
||||||
* %%
|
* %%
|
||||||
* This file is part of the Alfresco software.
|
* This file is part of the Alfresco software.
|
||||||
* If the software was purchased under a paid Alfresco license, the terms of
|
* If the software was purchased under a paid Alfresco license, the terms of
|
||||||
@@ -177,6 +177,7 @@ public class DiscoveryApiTest extends AbstractSingleNetworkSiteTest
|
|||||||
assertEquals(1000L, entitlements.getMaxDocs().longValue());
|
assertEquals(1000L, entitlements.getMaxDocs().longValue());
|
||||||
assertTrue(entitlements.getIsClusterEnabled());
|
assertTrue(entitlements.getIsClusterEnabled());
|
||||||
assertFalse(entitlements.getIsCryptodocEnabled());
|
assertFalse(entitlements.getIsCryptodocEnabled());
|
||||||
|
assertFalse(entitlements.getIsCustomEmbeddedWorkflowEnabled());
|
||||||
|
|
||||||
// Check status
|
// Check status
|
||||||
StatusInfo statusInfo = repositoryInfo.getStatus();
|
StatusInfo statusInfo = repositoryInfo.getStatus();
|
||||||
@@ -297,11 +298,13 @@ public class DiscoveryApiTest extends AbstractSingleNetworkSiteTest
|
|||||||
assertEquals(1000L, entitlements.getMaxDocs().longValue());
|
assertEquals(1000L, entitlements.getMaxDocs().longValue());
|
||||||
assertTrue(entitlements.getIsClusterEnabled());
|
assertTrue(entitlements.getIsClusterEnabled());
|
||||||
assertFalse(entitlements.getIsCryptodocEnabled());
|
assertFalse(entitlements.getIsCryptodocEnabled());
|
||||||
|
assertFalse(entitlements.getIsCustomEmbeddedWorkflowEnabled());
|
||||||
|
|
||||||
// Override entitlements
|
// Override entitlements
|
||||||
when(licenseDescriptorMock.getMaxDocs()).thenReturn(null);
|
when(licenseDescriptorMock.getMaxDocs()).thenReturn(null);
|
||||||
when(licenseDescriptorMock.isClusterEnabled()).thenReturn(false);
|
when(licenseDescriptorMock.isClusterEnabled()).thenReturn(false);
|
||||||
when(licenseDescriptorMock.isCryptodocEnabled()).thenReturn(true);
|
when(licenseDescriptorMock.isCryptodocEnabled()).thenReturn(true);
|
||||||
|
when(licenseDescriptorMock.isCustomEmbeddedWorkflowEnabled()).thenReturn(true);
|
||||||
|
|
||||||
response = get("discovery", null, 200);
|
response = get("discovery", null, 200);
|
||||||
|
|
||||||
@@ -319,6 +322,7 @@ public class DiscoveryApiTest extends AbstractSingleNetworkSiteTest
|
|||||||
assertNull(entitlements.getMaxDocs());
|
assertNull(entitlements.getMaxDocs());
|
||||||
assertFalse(entitlements.getIsClusterEnabled());
|
assertFalse(entitlements.getIsClusterEnabled());
|
||||||
assertTrue(entitlements.getIsCryptodocEnabled());
|
assertTrue(entitlements.getIsCryptodocEnabled());
|
||||||
|
assertTrue(entitlements.getIsCustomEmbeddedWorkflowEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@@ -140,6 +140,16 @@ public interface LicenseDescriptor
|
|||||||
*/
|
*/
|
||||||
boolean isCryptodocEnabled();
|
boolean isCryptodocEnabled();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Does this license allow custom embedded workflows?
|
||||||
|
*
|
||||||
|
* @return <code>true</code> if the license allows custom embedded workflows
|
||||||
|
*/
|
||||||
|
default boolean isCustomEmbeddedWorkflowEnabled()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ATS Transformation Server Expiry Date
|
* ATS Transformation Server Expiry Date
|
||||||
* @return the ATS Transformation Server Expiry Date or <code>null</code>
|
* @return the ATS Transformation Server Expiry Date or <code>null</code>
|
||||||
|
Reference in New Issue
Block a user