Apache Camel RSS Feed Processor skips with feeds of same pubdate - rss

I have a camel setup to read feeds, I use splitEntries=true and I use available org.apache.camel.component.rss.RssEndpoint , but it skips the feeds with same timestamp. Does anybody know what is happening?

Finally found the solution for it, need to customize the FeedPollingConsumer class which internally uses the UpdatedDateFilter, and remove the
lastUpdate.after(updated) || lastUpdate.equals(updated)
And Remove the lastUpdate.equals(updated) , to process the same pubDate timestamp feeds. UpdatedDateFilter is not extensible , too so checkout implementing your own from the FeedFilter interface.
Thanks. Let me know if you have any better solution.

Related

How to get pronounce of the word in Google translate api?

In google translate website, if we translate it shows translation and also pronounce of the word.
But when I use the Google translate rest API, it only return the translation, I need pronounce of the word same as website.
My Rest API
https://translation.googleapis.com/language/translate/v2?key=myApiKey&q=%D8%A7%D9%84%D8%A8%D8%B3%D8%AA%D8%A7%D9%86&source=ar&target=en
I may miss something, is any extra parameters there to retrieve these extra information?
Translating a word from the alphabet of one language to another(get the pronuntiation), is named transliteration and it is not supported by Cloud Translate API yet.
However, there is a feature request filed for the same. You can vote for this feature by clicking "+1" and "STAR" mark to recieve updates on it.
I was also looking for the same answer.
I haven't found a way to get Pronuntiation with the Google Translate API yet.
However, I found a way to get it through the Python library.
You can use the Python googletrans library.
The code is as follows.
You must use googletrans library 3.1.0a0 to avoid errors.
# pip install googletrans==3.1.0a0
from googletrans import Translator
translator = Translator()
SENTENSE = "안녕하세요. 반갑습니다."
LANGUAGE_CODE = translator.detect(SENTENSE).lang
k = translator.translate(SENTENSE, dest=LANGUAGE_CODE)
print(k)
print(k.text)
print(k.pronunciation)
Output:
Translated(src=ko, dest=ko, text=안녕하세요. 반갑습니다., pronunciation=annyeonghaseyo. bangabseubnida., extra_data="{'translat...")
안녕하세요. 반갑습니다.
annyeonghaseyo. bangabseubnida.

GSA Wildcard search and suggestion not working together

I'm using GSA 7.2 version which supports wildcard search but as soon as I enable it then spelling suggestions stop appearing. Please take a look below URL and suggest what should be done so that I start getting it.
http:// {host-name}/search?start=0&num=1000&site=xyzTest&output=xml&client=frontend&filter=0&getfields=&q=sken
In the above query, search term is "sken", GSA suggestion tag should appear and provide suggestion for "skin" but it is not happening.
Is spelling suggestion enabled in your frontend?
If not enable it by setting 1 to the show_spelling variable in the xslt.
i.e: <xsl:variable name="show_spelling">1</xsl:variable>
From the GSA Documentation:
When using daterange or inmeta queries, spelling suggestions are not returned.
To view spelling suggestions, use the requiredfields parameter instead of inmeta

Open direct links to AX-objects or datasets from external application

Is there a way to open a specified document, eg "production order 123" or form, eg "purchase orders" in Ax2012 from an external application directly?
In detail, I'm looking for something similiar like AXPath, but this doesn't work with versions greater then 2009.
Is there any ( maybe included ) way to achieve this?
There is! It's using AX's drilldown functionality which uses AxHLink.exe to handle dynamics:// URLs, which are passed to the Classes\SysStartupCmd function. You could also create some custom code there if you wanted to launch the AX client executable directly.
My question I asked some while back should have a great deal of useful information in it here:
What handles dynamics:// URLs?
Some more can be found: http://technet.microsoft.com/en-us/library/aa834337.aspx
EDIT:
It sounds like you are confused or the posts weren't clear enough. I think you have 3 basic options.
Dynamics:// URLs are handled by AxHLink.exe and they only seem to handle drilldown, viewalert, and viewalertrule. So if you want to use Dynamics:// URLs, you will need to hi-jack those somehow. There is a pastbin from Jan in that other stack post.
Create a custom URI handler and event poller (lot of work) see http://axcoder.blogspot.dk/2010/10/how-to-open-form-in-running-ax-from.html
Extend SysStartupCmd and then instead of using Dynamics:// URLs, just call Ax32.exe -startupCmd directly and a parameter can be passed to your custom class.

How do I query for comments in Orchard?

I am trying to build a "Latest Comments" widget for Orchard CMS.
I know I could directly query the SQL, but is there an API I can use in Orchard to get the latest comments on the whole blog (and which blog post each comment belongs to, etc)? I've been looking at IContentManager::Query, but I'm not exactly clear how I can use this to get the information I want.
Check out the CommentsService in the Orchard.Comments module. Orchard.Comments.Services.CommentsService. It's really close to what you need. Since the service returns the query, you could just tack on some additional sorting like this...
var query = commentsService.GetCommentsForCommentedContent(blogId);
var comments = query.OrderByDescending(c => c.CommentDateUtc).Slice(10);
Something like that.

How do I add taxonomy terms using Drupal Migrate

I'm using the migrate module to copy data from several sources to a new drupal installation. So far, I'm able to replicate a lot of what I need from the examples provided with the module. I'm currently stuck on adding terms or taxonomy to newly created nodes. The example shows:
// These are related terms, which by default will be looked up by name
$this->addFieldMapping('migrate_example_beer_styles', 'terms')
->separator(',');
I've tracked down the migrate_example_beer_styles destination mapping and it seems to be the machine name for that taxonomy.
I've tried imitating this behavior with every variation of what my machine_name should be, but the terms never seem to get associated:
By id:
// where source breed_id is '1,100' - it finds mapped values accordingly
$this->addFieldMapping('breeds', 'breed_id')
->sourceMigration('BreedMigration')
->separator(',')
And, by name:
// where source breeds is 'Dogs,German Shepherd'
$this->addFieldMapping('breeds', 'breeds')
->separator(',');
Am I wrong assuming the destination mapping is the machine name for a taxonomy?
This version of the migrate module was released recently, I haven't found any other helpful examples on the web.
This question still seems to be getting some views, so I thought I'd add what else I've discovered. While the accepted answer works, you are able to map Vocabs on ID:
$this->addFieldMapping('Exact Case Sensitive Vocab Name', 'source_field_name')
->sourceMigration('ExactSourceClassName')
->arguments(array('source_type' => 'tid'))
->separator(',');
->separator(',') used for passing a delimited string of source ids. Obviously, leave that off if you're mapping an array of values.
I'm currently working with migrate module myself, and I agree that the documentation is somewhat wanting at this point. :)
The 'machine name' of a vocabulary is listed in the Vocabulary table, in the field 'module'. Try using that value. Do note that you need to feed the text into the mapping, not the ids.
This is my first post on stackoverflow, so I apologize in advance if this isn't the accepted way to submit more information concerning this issue...
I've been stumbling around with the Migrate module for the past few days and was looking for a way to do this in Drupal 7. I had a comma-delimited list of taxonomy ids within an XML field that I wanted to use, but every example I found was retrieving from an external class, or from a database source.
Anyway, through trial and error, I found that you can use a field within the migrate class, rather than reference an external term migration class.
$this->addFieldMapping('field_article_type', 'category_id')
->arguments(array('source_type' => 'tid'))
->xpath('/article/category_id')
->separator(',');
Check out the taxonomy csv import module at http://drupal.org/project/taxonomy_csv.
It was easy to use and did what it was supposed to and more.
I ended up only using the migrate module for importin gNodes and used this module for the taxonomy. It was a pleasure to use.

Resources