Cross API dependencies exposed in interfaces
Description
Activity
Matthew Buckett January 28, 2010 at 8:30 AM
With the kernel this isn't a problem for most Sakai developers and is very unlikely get fixed for 2.5.x
Matthew Buckett May 12, 2008 at 7:56 AM
In my example I was writing my pom.xml file and then generating the eclipse files with "mvn eclipse:eclipse"
The project in question had a dependency on sakai-site-api but when I try and use SiteService.getSites() I get an error similar to:
/home/buckett/sakai/hierarchy/sakai-hierarchy-neighbourhood/src/java/org/sakaiproject/portal/HierarchyNeighbourhoodImpl.java:[29,7] cannot access org.sakaiproject.javax.PagingPosition
class file for org.sakaiproject.javax.PagingPosition not found
public class HierarchyNeighbourhoodImpl implements SiteNeighbourhoodService
which is because PagingPosition is in sakai-util-api.
I wasn't suggesting that APIs shouldn't depend on each other.
As I see it the bug is that although maven has transitive dependencies the correct APIs aren't being propogated to the project using the sakai-site-api.
Stephen Marquard May 12, 2008 at 7:36 AM
Is this an Eclipse/build difficulty, or are you suggesting that site should not expose classes from authz/entity in its API ?
There are cases elsewhere in the code where it's assumed for example that the site groups implementation uses authz (e.g. passing a list of site group references to an authz API call).
Matthew Buckett May 12, 2008 at 5:45 AM
You also need sakai-util-api.
In Eclipse it allows you to use the site API without having sakai-util-api but you can't use methods that require the util API (SiteService.getSites()).
If a make a maven project dependent on org.sakaiproject:sakai-site-api then I also need to add org.sakaiproject:sakai-entity-api and org.sakaiproject:sakai-authz-api to the project. This is because sakai-site-api exposes classes from these two other APIs through its interfaces.