GraphSearch Plugin Migration from PoolParty 7.0 or Higher to PoolParty 8.0
GraphSearch Plugin Migration from PoolParty 7.0 or Higher to PoolParty 8.0
This section introduces how to update a GraphSearch PoolParty 7.0 or higher plugin to GraphSearch PoolParty 8.0 plugin.
PoolParty 8.0 is a major release and contains architectural changes. This time it affects the GraphSearch plugin backend API. Plugins developed for GraphSearch 7.0 or higher will no longer work with GraphSearch 8.0 and need to be rebuilt with new dependencies after some minor code changes.
1. Code migration for the access to repository connection
If the plugin accesses to the storage backend of the search data via RDF4J repository connection, this migration step is necessary.
The entrypoint method of the plugin is
public List<ProposalResult> getRecommendedDocuments(DocumentRecommendationRequest documentRecommendationRequest, SearchSpaceProvider searchSpaceProvider)
The connection details to the underlying data source is passed in by argument searchSpaceProvider.
Prior to PoolParty 8.0, this class has the following fields:
private Repository repository; private List<String> contexts;
Since PoolParty 8.0, this class has the following fields:
private T searchServerDatabase; private List<String> contexts; private String local; private List<String> thesaurusFacetIds;
Particularly, Generic Typed searchServerDatabase
is introduced to replace repository
and also encapsulate other type of storage backends. In the case of a search space configured on top of an RDF repository, the object needs to be casted to type Repository
before accessing to the connection object:
before 8.0: searchSpaceProvider.getRepository().getConnection() since 8.0:((Repository)searchSpaceProvider.getSearchServerDatabase()).getConnection()
2. Rebuild the plugin with new dependencies
The following architectural changes are introduced in PoolParty 8.0:
Java from 8 to 11
RDF4J from 2 to 3
Spring from 4 to 5
Dependency hierarchy is also reworked. For example, the dependency to Spring Context is moved out from GraphSearch API artifact, which is a dependency for plugins.
Accordingly, the plugin needs to be rebuilt with updated dependencies. The following configuration is a snippet of the updated project configuration in the form of Maven POM. You need to add to the POM configuration of the plugin project.
<dependencies> <dependency> <groupId>biz.poolparty.graphsearch</groupId> <artifactId>poolparty-graphsearch-api</artifactId> <version>8.0.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>5.1.15.RELEASE</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.eclipse.rdf4j</groupId> <artifactId>rdf4j-client</artifactId> <type>pom</type> <version>3.2.3</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.7.25</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.7.6</version> <scope>provided</scope> </dependency> </dependencies> <build> <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.0</version> <configuration> <release>11</release> </configuration> </plugin> </plugins> </pluginManagement> </build> <repositories> <repository> <id>poolparty</id> <name>PoolParty Development</name> <url>https://mvn.poolparty.biz/repository/maven-releases/</url> <snapshots> <updatePolicy>always</updatePolicy> </snapshots> </repository> </repositories>
Finally, the plugin can be built again with Maven via
mvn clean package
Note
PoolParty 8.0 uses Java 11. Make sure the plugin is built with JDK 11.