...
Code...
In case the Syncope 2.0 deployment is based on Maven project, It is strongly advised to generate a new Maven project for 2.1 and to re-apply all the customizations and extensions made.
Warning |
---|
title | Upgrading to Syncope 2.1.0? |
---|
|
There is an issue with Syncope 2.1.0 (fixed for later releases), which requires to manually modify the sources of the generated Maven project. The following lines must be removed from console/pom.xml in order to avoid build errors: <!-- TEST -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency> |
Default implementations
This change is primarily due to the introduction of default methods on interfaces.
All local classes extending default implementations such as DefaultPropagationActions, DefaultPullActions, DefaultPushActions, ... must be changed to implement the related interfaces, e.g. PropagationActions, PullActions, PushActions, ...
Pull correlation rules
For each custom JAVA PullCorrelationRule add a configuration class in package org.apache.syncope.common.lib.policy
in common module of the project. For example, if you have a custom pull correlation rule class TestPullRule
create a configuration class TestPullRuleConf
like this:
Code Block |
---|
language | java |
---|
title | pull_correlatio0n_rule_conf |
---|
|
package org.apache.syncope.common.lib.policy;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@XmlRootElement(name = "testPullRuleConf")
@XmlType
public class TestPullRuleConf extends AbstractCorrelationRuleConf implements PullCorrelationRuleConf {
private static final long serialVersionUID = 429126085793346273L;
} |
Then reference the latter class from your correlation rule code with the specific annotation like this:
Code Block |
---|
language | java |
---|
title | pull_correlation_rule |
---|
|
package org.apache.syncope.core.persistence.jpa.dao;
...
@PullCorrelationRuleConfClass(TestPullRuleConf.class)
public class TestPullRule implements PullCorrelationRule {
@Override
public SearchCond getSearchCond(SyncDelta syncDelta, Provision provision) {
// your custom pull search condition
}
} |
Optional
Various methods now return Optional, rather than nullable values as before; for example:
Code Block |
---|
language | java |
---|
title | Syncope 2.0 |
---|
|
userTO.getPlainAttr("email").getUniqueValue() |
now becomes
Code Block |
---|
language | java |
---|
title | Syncope 2.1 |
---|
|
userTO.getPlainAttr("email").get().getUniqueValue() |
Check the Javadocs to find out which methods are now returning Optional.
Configuration
Security
Ensure to copy the following values from Syncope 2.0's security.properties
into Syncope 2.1's:
- secretKey
- anonymousKey
- jwsKey
Moreover, when the Java EE container running Syncope Core is down, remove all existing Access Tokens:
Code Block |
---|
|
DELETE FROM AccessToken; |
Remove also all templates assigned to Realms and/or Pull tasks
Code Block |
---|
|
DELETE FROM ANYTEMPLATEPULLTASK;
DELETE FROM ANYTEMPLATEREALM; |
Note: if you want tamplates back you should re-create them once the procedure has finished successfully.
Workflow
Note |
---|
The procedure outlined here is only required if Syncope 2.0 was configured to use the Activiti user workflow adapter. |
The changes below will allow the new Flowable user workflow adapter to deal with the Activiti workflow definition from Syncope 2.0; more details are available in the Flowable website.
Once set, any update to the workflow definition will be automatically migrated to the new Flowable format.
Additional Maven dependencies
Add to core/pom.xml
the following dependencies:
Code Block |
---|
|
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable5-compatibility</artifactId>
<version>${flowable.version}</version>
</dependency>
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable5-spring</artifactId>
<version>${flowable.version}</version>
</dependency>
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable5-spring-compatibility</artifactId>
<version>${flowable.version}</version>
</dependency> |
right after
Code Block |
---|
|
<dependency>
<groupId>org.apache.syncope.core</groupId>
<artifactId>syncope-core-workflow-flowable</artifactId>
<version>${syncope.version}</version>
</dependency> |
Flowable configuration adjustments
In core/src/main/webapp/WEB-INF/web.xml
, replace
Code Block |
---|
classpath*:/workflow*Context.xml |
with
Code Block |
---|
classpath*:/workflowContext.xml
classpath:/workflowFlowableContext.xml |
then download workflowFlowableContext.xml, save it under core/src/main/resources
and add
Code Block |
---|
|
<bean id="flowable5CompabilityFactory" class="org.activiti.compatibility.spring.SpringFlowable5CompatibilityHandlerFactory"/> |
right before </beans>
and
Code Block |
---|
|
<property name="flowable5CompatibilityEnabled" value="true" />
<property name="flowable5CompatibilityHandlerFactory" ref="flowable5CompabilityFactory"/> |
right after </property>
.
Logging tuning
Add the following to core/src/main/resources/log4j2.xml
:
Code Block |
---|
|
<asyncLogger name="org.activiti" additivity="false" level="ERROR">
<appender-ref ref="mainFile"/>
<appender-ref ref="main"/>
</asyncLogger> |
Internal Storage
The steps to upgrade the internal storage to Syncope 2.1.0 are outlined in the Reference Guide.
Warning |
---|
title | Upgrading to Syncope 2.1.0? |
---|
|
There is an issue with Syncope 2.1.0 (fixed for later releases), which requires to add some additional few SQL statements to the ones generated by the upgrade tool: UPDATE SyncopeUser SET mustChangePassword=0 WHERE mustChangePassword IS NULL; UPDATE VirSchema SET readonly=0 WHERE readonly IS NULL; UPDATE ExternalResource SET overrideCapabilities=0 WHERE overrideCapabilities IS NULL; UPDATE Task SET active=0 WHERE active IS NULL;
Do not forget to restart the Java EE container where Syncope Core is deployed, after executing the SQL statements above. |