Remove dependency to OSGi user admin from API
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / acr / directory / HierarchyUnitContent.java
index 1e4aad77328a7805df4732e51935eafc71e5a047..e4c637f20b8fd2fca0cdccaf0f295e3594d2f8e0 100644 (file)
@@ -10,13 +10,12 @@ import javax.xml.namespace.QName;
 
 import org.argeo.api.acr.Content;
 import org.argeo.api.acr.ContentName;
-import org.argeo.api.acr.CrName;
 import org.argeo.api.acr.DName;
 import org.argeo.api.acr.spi.ProvidedSession;
-import org.argeo.osgi.useradmin.UserDirectory;
-import org.argeo.util.directory.Directory;
-import org.argeo.util.directory.HierarchyUnit;
-import org.osgi.service.useradmin.Role;
+import org.argeo.api.cms.directory.CmsDirectory;
+import org.argeo.api.cms.directory.CmsRole;
+import org.argeo.api.cms.directory.HierarchyUnit;
+import org.argeo.api.cms.directory.UserDirectory;
 
 class HierarchyUnitContent extends AbstractDirectoryContent {
        private HierarchyUnit hierarchyUnit;
@@ -46,7 +45,7 @@ class HierarchyUnitContent extends AbstractDirectoryContent {
        @Override
        public Content getParent() {
                HierarchyUnit parentHu = hierarchyUnit.getParent();
-               if (parentHu instanceof Directory) {
+               if (parentHu instanceof CmsDirectory) {
                        return new DirectoryContent(getSession(), provider, hierarchyUnit.getDirectory());
                }
                return new HierarchyUnitContent(getSession(), provider, parentHu);
@@ -58,7 +57,7 @@ class HierarchyUnitContent extends AbstractDirectoryContent {
                for (HierarchyUnit hu : hierarchyUnit.getDirectHierarchyUnits(false))
                        lst.add(new HierarchyUnitContent(getSession(), provider, hu));
 
-               for (Role role : ((UserDirectory) hierarchyUnit.getDirectory()).getHierarchyUnitRoles(hierarchyUnit, null,
+               for (CmsRole role : ((UserDirectory) hierarchyUnit.getDirectory()).getHierarchyUnitRoles(hierarchyUnit, null,
                                false))
                        lst.add(new RoleContent(getSession(), provider, this, role));
                return lst.iterator();