manifoldcf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karl Wright <daddy...@gmail.com>
Subject Re: File System MCF API Service
Date Mon, 19 Aug 2013 12:39:38 GMT
Hi Mohammet,

Try this:

        Configuration documentSpecification = new Configuration();
        addAttributeNode(documentSpecification, "chromedmode", "mode",
"none");
        addAttributeNode(documentSpecification, "feedtimeout", "value",
"60");
        ConfigurationNode startpoint = new ConfigurationNode("startpoint");
        startPoint.setAttribute("path", "this is path");
        ConfigurationNode include = new ConfigurationNode("include");
        include.setAttribute("type","file");
        include.setAttribute("match","*");
        startPoint.addChild(0, "include", include);

documentSpecification.addChild(documentSpecification.getChildCount(),startPoint);

The shortcut methods available are helpful, but they are not
all-inclusive.  There may also be other help methods that are more
appropriate and do what I have here, but I don't remember right now what
they are...
Karl




On Mon, Aug 19, 2013 at 7:52 AM, Muhammed Olgun <mh.olgun@gmail.com> wrote:

>
>
> I've done this before and the problem was that I couldn't add "type"
> attribute to "include" as a child attribute. I added type attribute as a
> simple value node and my output
>
> <document_specification><chromedmode mode="none"/><feedtimeout value="60"/>
> <startpoint path="this is path"/>
> <include>
> <type>file</type>
> <match>*</match>
> </include>
> </document_specification>
>
> My code,
>         Configuration documentSpecification = new Configuration();
>         Configuration include = new Configuration();
>         addAttributeNode(documentSpecification, "chromedmode", "mode",
> "none");
>         addAttributeNode(documentSpecification, "feedtimeout", "value",
> "60");
>         addAttributeNode(documentSpecification, "startpoint", "path",
> "this is path");
>         addSimpleValueNode(include, "type", "file");
>         addSimpleValueNode(include, "match", "*");
>         addChildHierarchy(documentSpecification, "include", include);
>
> I've also tried this,
>
>         Configuration documentSpecification = new Configuration();
>         Configuration include = new Configuration();
>         addAttributeNode(documentSpecification, "chromedmode", "mode",
> "none");
>         addAttributeNode(documentSpecification, "feedtimeout", "value",
> "60");
>         addAttributeNode(documentSpecification, "startpoint", "path",
> "this is path");
>         addAttributeNode(include, "include", "type", "file");
>         addAttributeNode(include, "include", "match", "*");
>         addChildHierarchy(documentSpecification, "include", include);
>
> and my output was,
>
> <document_specification>
> <chromedmode mode="none"/>
> <feedtimeout value="60"/>
> <startpoint path="this is path"/>
> <include>
> <include type="file"/>
> <include match="*"/>
> </include>
> </document_specification>
>
> include is child of include.
>
>
>
>
> 2013/8/19 Karl Wright <daddywri@gmail.com>
>
>> Hi Muhammet,
>>
>> The "include" and "exclude" nodes are actual nodes, not attributes.  So
>> there can be more than one of each.  You add them as children, not as
>> attributes.  So you do not use "addAttributeNode", but rather create new
>> nodes and add them as children.
>>
>> If you use the "toXML" method to dump it as XML, it will become much
>> clearer exactly what is going on.
>>
>> Thanks!
>> Karl
>>
>>
>>
>> On Mon, Aug 19, 2013 at 7:28 AM, Muhammed Olgun <mh.olgun@gmail.com>wrote:
>>
>>> Hi Karl,
>>>
>>> Of course, here is my createFileSystemJob method
>>>
>>> public String createFileSystemJob(String description,
>>>             String repositoryConnectionName,
>>>             String outputConnectionName,
>>>             int priority,
>>>             Long expirationInterval,
>>>             Long rescanInterval,
>>>             Long reseedInterval,
>>>              Configuration outputSpecification)
>>>             throws IOException, ManifoldCFException {
>>>         Configuration documentSpecification = new Configuration();
>>>         Configuration startPoint = new Configuration();
>>>         addAttributeNode(documentSpecification, "chromedmode", "mode",
>>> "none");
>>>         addAttributeNode(documentSpecification, "feedtimeout", "value",
>>> "60");
>>>         addAttributeNode(documentSpecification, "startpoint", "path",
>>> "this is path");
>>>         addAttributeNode(documentSpecification, "startpoint", "include",
>>> "this is include");
>>>
>>>         return createContinuousJob(description,
>>>                 repositoryConnectionName, outputConnectionName,
>>>                 priority, expirationInterval, rescanInterval,
>>> reseedInterval,
>>>                 documentSpecification, outputSpecification);
>>>     }
>>>
>>> and my document_specification
>>> JSON "document_specification":{"chromedmode":{"_attribute_mode":"none"},"feedtimeout":{"_attribute_value":"60"},"startpoint":[{"_attribute_path":"this
>>> is path"},{"_attribute_include":"this is include"}]}}
>>>
>>> bu my JSON should be
>>>
>>>
>>> {"startpoint":[{"_attribute_path":"c:\path_to_files","include":[{"_attribute_type":"file","_attribute_match":"*.txt"},{"_attribute_type":"file","_attribute_match":"*.doc"\,"_attribute_type":"directory","_attribute_match":"*"],"exclude":["*.mov"]]}
>>>
>>> For instance there is no attribute tag on include and how to add the
>>> type attribute to the include attribute with addAttributeNode method?
>>>
>>>
>>> 2013/8/19 Karl Wright <daddywri@gmail.com>
>>>
>>>> Hi Muhammet,
>>>>
>>>> I haven't looked at the book example for a while.  Can you please
>>>> include some code which demonstrates what you tried?  Otherwise it's not
>>>> clear where the issue would be.
>>>>
>>>> Thanks!
>>>> Karl
>>>>
>>>>
>>>>
>>>> On Mon, Aug 19, 2013 at 4:28 AM, Muhammed Olgun <mh.olgun@gmail.com>wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> I'm working on file system operations with MCF API. I studied Programmatic
>>>>> Operations<http://manifoldcf.apache.org/release/trunk/en_US/programmatic-operation.html#File+system+connector>page
and MCF's RSSMCFAPISupport class according to ManifoldCF book on
>>>>> chapter 3 and I wrote a class which extends GenericMCFAPISupport.
>>>>>
>>>>> I created the file system job but I couldn't add include and exclude
>>>>> attributes. The problem is that I couldn't create a JSON which is mentioned
>>>>> on Programmatic Operations<http://manifoldcf.apache.org/release/trunk/en_US/programmatic-operation.html#File+system+connector>
page
>>>>> with provided methods like addAttributeNode or addParameterNode. Is there
>>>>> any way to create File System Job JSON with these methods or can I make
>>>>> request with my own JSON on MCF API Service? If yes, how can make my
own
>>>>> request on MCF API Service?
>>>>>
>>>>> Best Regards.
>>>>> Muhammet
>>>>>
>>>>
>>>>
>>>
>>
>

Mime
View raw message