...
For the GenericFile type find the <metExtractors>
key. It's specifying some extractors to use for server side metadata extraction, namely: CoreMetExtractor, MimeTypeExtractor, FinalFileLocationExtractor. For more details about metadata and extractors see the following page: http://oodt.apache.org/components/maven/metadata/user/basic.html
If you're feeling curious, check out the other xml files in the /usr/local/oodt/cas-filemgr/policy
subdirectories to get a better feel for how we define product types and elements. For a discussion of best practices w.r.t File Manager Policy, the reader is referred to Everything you want to know about File Manager Policy
...
The first command line argument is --url
. This is the location of the filemgr xml-rpc data transfer interface. Looking at the filemgr logs (specifically cas_filemgr0.log), we see an INFO statement telling us that local data transfer is enable on http://localhost:9000. This is the url that we need to specify.
...
We see that we need to set some command line arguments to get anything useful out of the query tool. Try the next command:
$ ./query_tool --url http://localhost:9000
--sql -query 'SELECT * FROM GenericFile'
...
--productName
: The name you want for your ingested product--productStructure
: Flat file or directory (i.e. hierarchical). Yes... we can ingest whole directories as one product--productTypeName
: A product type (as per product-types.xml)--metadataFile
: The client side metadata file--refs
: The product location
There's also an optional argument {{\ Wiki Markup -
\-clientTransfer
}}, however, we're going to leave this and use the default local transfer.
{{\[
\-
\-clientTransfer
--dataTransfer
<java
class
name
of
data
transfer
factory>
\]
}}
Here is the complete command:
$ ./filemgr-client --url http://localhost:9000
--operation --ingestProduct --productName blah.txt --productStructure Flat --productTypeName GenericFile --metadataFile file:///tmp/blah.txt.met
--refs file:///tmp/blah.txt
The output should look like:
Sep 16, 2011 2:09:42 PM org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient <init>
...
...
ingestProduct: Result: c2fbf4b9-e05c-11e0-9022-77a707615e7f
...
To complete the process, lets see if we can retrieve the metadata. Run the query command again:
$ cd /usr/local/oodt/cas-filemgr/bin
$ ./query_tool --url http://localhost:9000
--sql -query 'SELECT * FROM GenericFile'
...
Now you can also check out some of the other 12 --operation
possibilities for filemgr-client. For instance:
$ ./filemgr-client --url http://localhost:9000
--operation --hasProduct --productName blah.txt
Or:
$ ./filemgr-client --url http://localhost:9000
--operation --getFirstPage --productTypeName GenericFile
...
Cameron Goodale has written some useful command line tools aliases that are worth mentioning before we continue. See the following two web pages: https://issues.apache.org/jira/browse/OODT-306
BASH and TCSH shell tools for File Manager
...