2005/9/7, Martin Koci <[EMAIL PROTECTED]>: > See org.apache.portals.graffito.store.ContentStore#getCmsObject(String > path). It returns org.apache.portals.graffito.model.core.CmsObject.
See the implementation in org.apache.portals.graffito.store.impl.ojb.GraffitoOJBStore. It used the ClassName to build the query. > think it means: I want an object stored in repository. I know that > object is repository managed. I know path but not type. Maybe this > situation is equivalent to: /someDirectory/someFileWithoutExtension. I > can use 'file' on unix and it tells me kind of content. In Java I can > use if (returnedObject instanceof Document). > I see only 2 solutions : * Add an extra property : jcrmapping:classname (as you suggest). In this case, node which doesn't contain this property cannot be mapped. Data migration is required if a user want to use this framework. * or use the class as method parameters. Interface support will minimize this issue. it will be possible to do something like this : Suppose that we have a ancestor interface : CmsObject and 2 descendants : Folder and Document. it will possible to make query and retrieve object based on this interface : For example : CmsObject cmsobject = pm.getObject(CmsObject.class, "/test/..."); Collection cmsObjects = pm.retrieveCollection(CmsObject.class, criteria); Collection cmsObjects = pm.retrieveCollection(Document.class, criteria); The first one can returns any kind of CmsObject based object (Folder, Document, Images, ...) The second method call will return all objects based on the CmsObject interface and matching to a criteria. The last one will return only Document based objects (Binary, Word, HTML, ...)
