X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;ds=sidebyside;f=org.argeo.cms%2Fsrc%2Forg%2Fargeo%2Fcms%2Facr%2Fdirectory%2FDirectoryContent.java;h=6e39280cee86a12bbb4d1dfa85f51ddedb8c392a;hb=f5c293792ad697475d29073069c05063d7218c0b;hp=992f0b41b2eedd87b06baf5ef6fac20c22ce83e2;hpb=54df376a9c2dd458a82eaa09bfbb718fe699dd0d;p=lgpl%2Fargeo-commons.git
diff --git a/org.argeo.cms/src/org/argeo/cms/acr/directory/DirectoryContent.java b/org.argeo.cms/src/org/argeo/cms/acr/directory/DirectoryContent.java
index 992f0b41b..6e39280ce 100644
--- a/org.argeo.cms/src/org/argeo/cms/acr/directory/DirectoryContent.java
+++ b/org.argeo.cms/src/org/argeo/cms/acr/directory/DirectoryContent.java
@@ -10,13 +10,13 @@ import javax.xml.namespace.QName;
import org.argeo.api.acr.Content;
import org.argeo.api.acr.ContentName;
import org.argeo.api.acr.spi.ProvidedSession;
-import org.argeo.api.cms.directory.Directory;
+import org.argeo.api.cms.directory.CmsDirectory;
import org.argeo.api.cms.directory.HierarchyUnit;
class DirectoryContent extends AbstractDirectoryContent {
- private Directory directory;
+ private CmsDirectory directory;
- public DirectoryContent(ProvidedSession session, DirectoryContentProvider provider, Directory directory) {
+ public DirectoryContent(ProvidedSession session, DirectoryContentProvider provider, CmsDirectory directory) {
super(session, provider);
this.directory = directory;
}
@@ -45,4 +45,14 @@ class DirectoryContent extends AbstractDirectoryContent {
return provider.getRootContent(getSession());
}
+ @SuppressWarnings("unchecked")
+ @Override
+ public A adapt(Class clss) {
+ if (clss.equals(HierarchyUnit.class))
+ return (A) directory;
+ if (clss.equals(CmsDirectory.class))
+ return (A) directory;
+ return super.adapt(clss);
+ }
+
}