Hello,
I'm trying to incorporate a Twitter crawler written in Java for the
CUbRIK project into SMILA. So far I have created a pipelet called
"org.eclipse.smila.integration.TwitterPipelet" that contains the
class
"org.eclipse.smila.integration.TwitterPipelet.myTwitterPipelet". I
have also created a pipeline called "TwitterPipeline.bpel" according
to the instructions given here.
At this point I am trying to make my pipelet taking only one input,
the query that is given from the user as a string, in order to start
the crawler. I tried several things but although I get no error from
the compiler, when I go to HTTP REST API to my pipelet, I get this:
{
"class": "org.eclipse.smila.integration.TwitterPipelet",
- "parameters": [
- { "name": "TwitterQuery",
"type":
"string"
} ],
"description": "Find the image
urls from tweets that are relevant to the query",
- "errors": ["Pipelet class could not be loaded."]
}
I have added to the bpel the following:
<extensionActivity>
<proc:invokePipelet name="invokeTwitterPipelet">
<proc:pipelet
class="org.eclipse.smila.integration.TwitterPipelet.myTwitterPipelet"
/>
<proc:variables input="request" />
<proc:configuration>
<rec:Val
key="TwitterQuery">TweetQ</rec:Val>
</proc:configuration>
</proc:invokePipelet>
</extensionActivity>
and my pipelet looks like this:
public class myTwitterPipelet implements Pipelet
{
private static final String TWITTER_QUERY =
"TwitterQuery";
private AnyMap _config;
public void configure(final AnyMap config) throws
ProcessingException
{ _config = config; }
public String[] process(final Blackboard blackboard, final
String[] recordIds) throws ProcessingException
{
//Read the input query:
final ParameterAccessor paramAccessor = new
ParameterAccessor(blackboard, _config);
paramAccessor.setCurrentRecord(recordIds[0]);
final String QueryStr =
paramAccessor.getParameter(TWITTER_QUERY, null);
//...
}
return null;
}
It is not clear to me whether I have to declare the query input and
where exactly, (i)to the configure function of my pipelet, (ii)the
bpel pipeline, and/or (iii)the json file. Is this the reason why I
get this error?
Thank you in advance
Stavroula Manolopoulou
|