How to add NEW Document Source in DCS?

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

How to add NEW Document Source in DCS?

savannah_beckett
Hi,
  I want to my own web service as a new document source to DCS.   Can someone point me to the right files to modify to add my new document source?  
Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: How to add NEW Document Source in DCS?

Stanislaw Osinski
Administrator
>   I want to my own web service as a new document source to DCS.   Can
> someone point me to the right files to modify to add my new document source?

Hi,

The manual does not contain specific instructions yet, but the process
is very similar to adding a source to the webapp:

http://download.carrot2.org/head/manual/#section.advanced-topics.customizing-applications.adding-source-to-webapp

If you've written your own DocumentSource implementation (see here for
an example: http://fisheye3.atlassian.com/browse/carrot2/trunk/applications/carrot2-examples/src/org/carrot2/examples/source/ExampleDocumentSource.java?r=trunk)
and it doesn't have any extra parameters, follow step 2 from the above
procedure with two changes:

* edit suite-dcs.xml instead of suite-webapp.xml
* don't include the attribute-sets-resource attribute in the <source> element.

If your DocumentSource has extra parameters you'd like to pass in the
DCS configuration, please take a look at:

http://download.carrot2.org/head/manual/#section.advanced-topics.customizing-applications.customizing-lingo-for-webapp

The process would be very similar for the DCS.

Cheers,

S.

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Carrot2-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/carrot2-developers
Reply | Threaded
Open this post in threaded view
|

Re: How to add NEW Document Source in DCS?

savannah_beckett
Thanks, the examples help a lot.  Now I understand how it works.

There is a mistake in the documentsource implementation in fisheye at line 21.  It should be QUERY, not RESULTS in attribute key.  

 19       @Processing
20    @Input
21    @Attribute(key = AttributeNames.RESULTS)
22    public String query;


Stanislaw Osinski wrote
>   I want to my own web service as a new document source to DCS.   Can
> someone point me to the right files to modify to add my new document source?

Hi,

The manual does not contain specific instructions yet, but the process
is very similar to adding a source to the webapp:

http://download.carrot2.org/head/manual/#section.advanced-topics.customizing-applications.adding-source-to-webapp

If you've written your own DocumentSource implementation (see here for
an example: http://fisheye3.atlassian.com/browse/carrot2/trunk/applications/carrot2-examples/src/org/carrot2/examples/source/ExampleDocumentSource.java?r=trunk)
and it doesn't have any extra parameters, follow step 2 from the above
procedure with two changes:

* edit suite-dcs.xml instead of suite-webapp.xml
* don't include the attribute-sets-resource attribute in the <source> element.

If your DocumentSource has extra parameters you'd like to pass in the
DCS configuration, please take a look at:

http://download.carrot2.org/head/manual/#section.advanced-topics.customizing-applications.customizing-lingo-for-webapp

The process would be very similar for the DCS.

Cheers,

S.

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Carrot2-developers mailing list
Carrot2-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/carrot2-developers
Reply | Threaded
Open this post in threaded view
|

Re: How to add NEW Document Source in DCS?

Stanislaw Osinski
Administrator
There is a mistake in the documentsource implementation in fisheye at line
21.  It should be QUERY, not RESULTS in attribute key.

 19          @Processing
20          @Input
21          @Attribute(key = AttributeNames.RESULTS)
22          public String query;

Good catch, thanks!

S.

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Carrot2-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/carrot2-developers
Reply | Threaded
Open this post in threaded view
|

Re: How to add NEW Document Source in DCS?

savannah_beckett
In reply to this post by Stanislaw Osinski
I looked at the javadoc of org.carrot2.core.attribute.AttributeNames, and the results is type of string.  So why it is type of integer in this example in fisheye?  Is this code for older version of carrot2?
Thanks.

 24       @Processing
25    @Input
26    @Attribute(key = AttributeNames.RESULTS)
27    @IntRange(min = 1, max = 1000)
28    public int results = 20;

Stanislaw Osinski wrote
>   I want to my own web service as a new document source to DCS.   Can
> someone point me to the right files to modify to add my new document source?

Hi,

The manual does not contain specific instructions yet, but the process
is very similar to adding a source to the webapp:

http://download.carrot2.org/head/manual/#section.advanced-topics.customizing-applications.adding-source-to-webapp

If you've written your own DocumentSource implementation (see here for
an example: http://fisheye3.atlassian.com/browse/carrot2/trunk/applications/carrot2-examples/src/org/carrot2/examples/source/ExampleDocumentSource.java?r=trunk)
and it doesn't have any extra parameters, follow step 2 from the above
procedure with two changes:

* edit suite-dcs.xml instead of suite-webapp.xml
* don't include the attribute-sets-resource attribute in the <source> element.

If your DocumentSource has extra parameters you'd like to pass in the
DCS configuration, please take a look at:

http://download.carrot2.org/head/manual/#section.advanced-topics.customizing-applications.customizing-lingo-for-webapp

The process would be very similar for the DCS.

Cheers,

S.

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Carrot2-developers mailing list
Carrot2-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/carrot2-developers
Reply | Threaded
Open this post in threaded view
|

Re: How to add NEW Document Source in DCS?

Stanislaw Osinski
Administrator
I looked at the javadoc of org.carrot2.core.attribute.AttributeNames, and the
results is type of string.  So why it is type of integer in this example in
fisheye?  Is this code for older version of carrot2?

AttributeNames.RESULTS is just a constant for the "results to fetch" attribute key, all attribute keys are strings. The type of the attribute is defined by the type of field that implements the attribute. Notice, for example that AttributeNames.DOCUMENTS is also a string, while the field is of type List<Document>.

Cheers,

S.


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Carrot2-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/carrot2-developers
Reply | Threaded
Open this post in threaded view
|

Re: How to add NEW Document Source in DCS?

savannah_beckett
I decide to use the carrot2 api instead of dcs.  Can I still create document source if I am using the api?  or do I just use the example in ClusteringDocumentList.java without creating new document source if I am using api?
Thanks.

Stanislaw Osinski wrote
>
> I looked at the javadoc of org.carrot2.core.attribute.AttributeNames, and
> the
> results is type of string.  So why it is type of integer in this example in
> fisheye?  Is this code for older version of carrot2?


AttributeNames.RESULTS is just a constant for the "results to fetch"
attribute key, all attribute keys are strings. The type of the attribute is
defined by the type of field that implements the attribute. Notice, for
example that AttributeNames.DOCUMENTS is also a string, while the field is
of type List<Document>.

Cheers,

S.

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Carrot2-developers mailing list
Carrot2-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/carrot2-developers
Reply | Threaded
Open this post in threaded view
|

Re: How to add NEW Document Source in DCS?

savannah_beckett
In reply to this post by Stanislaw Osinski
I cannot figure out how to deal with custom attributes in my document source.  I am not doing dcs anymore.  I look at the api files, and there is no SavingAttributeToXml class as mentioned in the manual.  Now, my code won't even compile because it doesn't recognize any of the custom attributes that I added in my code.

Stanislaw Osinski wrote
>
> I looked at the javadoc of org.carrot2.core.attribute.AttributeNames, and
> the
> results is type of string.  So why it is type of integer in this example in
> fisheye?  Is this code for older version of carrot2?


AttributeNames.RESULTS is just a constant for the "results to fetch"
attribute key, all attribute keys are strings. The type of the attribute is
defined by the type of field that implements the attribute. Notice, for
example that AttributeNames.DOCUMENTS is also a string, while the field is
of type List<Document>.

Cheers,

S.

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Carrot2-developers mailing list
Carrot2-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/carrot2-developers
Reply | Threaded
Open this post in threaded view
|

Re: How to add NEW Document Source in DCS?

Stanislaw Osinski
Administrator
In reply to this post by savannah_beckett
I decide to use the carrot2 api instead of dcs.  Can I still create document
source if I am using the api?  or do I just use the example in
ClusteringDocumentList.java without creating new document source if I am
using api?

You can do both, depending on which way is easier for you. You can either use just the clustering mode with documents passed directly in a list like in ClusteringDocumentList or you could create your specific document source like in ExampleDocumentSource. Notice that the 3.0 stable release may not contain all the examples as some of the were added after the release. Please use the latest development release (http://download.carrot2.org/head/carrot2-java-api-3.1-dev.zip) or the upcoming 3.0.1 release (http://download.carrot2.org/stable/carrot2-java-api-3.0.1.zip).

Cheers,

S.

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Carrot2-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/carrot2-developers
Reply | Threaded
Open this post in threaded view
|

Re: How to add NEW Document Source in DCS?

Stanislaw Osinski
Administrator
In reply to this post by savannah_beckett
I cannot figure out how to deal with custom attributes in my document source.
I am not doing dcs anymore.  I look at the api files, and there is no
SavingAttributeToXml class as mentioned in the manual.  Now, my code won't
even compile because it doesn't recognize any of the custom attributes that
I added in my code.

That's strange... If you download the 3.0.1 version (http://download.carrot2.org/stable/carrot2-java-api-3.0.1.zip) and import it to Eclipse (http://download.carrot2.org/head/manual/#section.integration.seting-up-c2-project-in-eclipse) -- do the examples compile? If so, the ExampleDocumentSource should get you all you need to get started with your custom document source. In fact, if you're using only the Java API, you don't need to bother with any XML files, just use a simple code like in the main method of ExampleDocumentSource to call clustering.

Cheers,

S.


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Carrot2-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/carrot2-developers