| 1 | A class that allows hierarchical access to the data inside a datasource, if the datasource supports hierachical access. Most desktop datasources, like Outlook, Lotus Notes, Files, EmailFolders, etc. have very strong hierarchical access. DFKI frameworks often have to extract this hierarchical data from the datasource directly to extract the implicit semantics. |
| 2 | |
| 3 | Therefore, this Interface is a parallel add-on for convenience, independent from ApertureDataCrawler. Whereas ApertureDataCrawler is only for incremental crawling, the ApertureHierachicalAccess is for one-time crawling when someone (the user ?) wants to see the hierarchy inside. |
| 4 | It must be noted, that IF a DataSource supports ApertureHierachicalAccess, then the extracted Data that is stored in some database has also to have the hierarchical structure visible somehow. So all data that build the Hierarchy expressed in ApertureHierachicalAccess should also be returned by ApertureDataCrawler. |
| 5 | |
| 6 | {{{ |
| 7 | |
| 8 | /** |
| 9 | * convenience access to the data inside a DataSource. |
| 10 | * Not all DataSources will support HierachicalAccess, if a DataSource does, this class |
| 11 | * provides the user a way to see the structure inside the DataSource without having to |
| 12 | * crawl it completely. A preview to the extracted data can be given using the HierachicalAccess |
| 13 | * or the hierachical structure can be extracted without having to extract all data. |
| 14 | */ |
| 15 | public interface HierachicalAccess { |
| 16 | |
| 17 | /** |
| 18 | * Returns the DataSource on which this HierachicalAccess works. |
| 19 | */ |
| 20 | public DataSource getDataSource(); |
| 21 | |
| 22 | /** |
| 23 | * get the uri of the root folder of this datasource. This is the first folder to crawl, |
| 24 | * its subfolders can be retrieved using getSubFolders and then incrementally. |
| 25 | */ |
| 26 | public String getRootFolder(); |
| 27 | |
| 28 | /** |
| 29 | * get the detailed data of one object, |
| 30 | * this is costly. |
| 31 | * If the DataObject is a file, then the InputStream of the file is not converted to |
| 32 | * metadata yet, use the Extractors assigned to the mime-type. |
| 33 | * Internally, this uses a suitable DataAccessor to access the DataObject from inside |
| 34 | * the datasource. |
| 35 | */ |
| 36 | public DataObject getDataObject(String uri); |
| 37 | |
| 38 | /** |
| 39 | * List sub-folders of this folder. Iterator contains folder uris as Strings. |
| 40 | * this may also return the uris of objects, if the objects can contain sub-objects. |
| 41 | * (IMAP-attachments)-but this is bad as detection of sub-objects of emails is costly. |
| 42 | * the first call of this method would be with the getRootUri() |
| 43 | */ |
| 44 | public Iterator listSubFolders(String uri); |
| 45 | |
| 46 | /** |
| 47 | * List objects inside the passed folder, Iterator contains uris of objects as Strings. |
| 48 | * To get the metadata and data of the object, use getDataObject with the returned uri. |
| 49 | */ |
| 50 | public Iterator listSubObjects(String uri); |
| 51 | |
| 52 | } |
| 53 | |
| 54 | }}} |